v1.0.171: ▶ Сравнить группу via SSE + classify timer/progress
This commit is contained in:
@@ -108,6 +108,7 @@ def apply_groups(batch_id, groups_data):
|
||||
Возвращает {ok, created: количество созданных supplements}.
|
||||
"""
|
||||
created = 0
|
||||
contract_ids = []
|
||||
for g in groups_data:
|
||||
contract_number = g.get("contract_number", "")
|
||||
if contract_number == "__unresolved__":
|
||||
@@ -118,6 +119,7 @@ def apply_groups(batch_id, groups_data):
|
||||
# Create contract
|
||||
c = db_contracts.insert(contract_number, counterparty)
|
||||
contract_id = c["id"]
|
||||
contract_ids.append(contract_id)
|
||||
|
||||
# Create supplements in order
|
||||
for i, d in enumerate(docs):
|
||||
@@ -126,4 +128,4 @@ def apply_groups(batch_id, groups_data):
|
||||
db_supplements.insert(contract_id, doc_id, supp_type)
|
||||
created += 1
|
||||
|
||||
return {"ok": True, "created": created}
|
||||
return {"ok": True, "created": created, "contract_ids": contract_ids}
|
||||
|
||||
Reference in New Issue
Block a user