From 19e602fd62d6af13f61178755fd48d1530552457 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Sun, 28 Jun 2026 10:04:11 +0400 Subject: [PATCH] =?UTF-8?q?feat:=20=D1=81=D0=BE=D1=80=D1=82=D0=B8=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=BA=D0=B0=20=D0=B4=D0=BE=D0=BF=D0=BD=D0=B8=D0=BA?= =?UTF-8?q?=D0=BE=D0=B2=20=D0=BF=D0=BE=20doc=5Fdate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/services/process.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/deploy/services/process.py b/deploy/services/process.py index 52e3f0d..872f7e1 100644 --- a/deploy/services/process.py +++ b/deploy/services/process.py @@ -17,6 +17,9 @@ def run_pipeline(contract_id, order_ids, sse_send, build_prompt_fn): order_list = [x.strip() for x in order_ids.split(",") if x.strip()] order_map = {oid: i for i, oid in enumerate(order_list)} supps.sort(key=lambda s: order_map.get(s["id"], 999999)) + else: + # Sort by doc_date (from classification), fallback to created_at + supps.sort(key=lambda s: (s.get("doc_date") or "9999-99-99", s.get("created_at", ""))) if not supps: sse_send({"type": "error", "message": "Нет распарсенных файлов"})