feat(ux): import compact + preview format Trimiteri + navigatie + scoatere auto_send (5.11)
8 stories TDD (echipa Sonnet, lead orchestreaza). US-001 scoate hold-ul auto_send din mapare (has_no_auto_send->False, simbol pastrat; cod rezolvat->queued). US-002 scoate bifa auto_send din UI. US-003 preview pas 3 in format .tabel-trimiteri (STARI_PREVIEW + nota_umana_preview, fara repr Python; view-model prez). US-004 filtre layout/stil ca referinta + buton Custom. US-005 navigatie Trimiteri/Mapari sub contoare pe toate paginile. US-006 import <details> nativ colapsabil. US-007 post-commit reveal (OOB _coada/_status + HX-Trigger). US-008 auto-refresh dupa actiuni (nudge eliminat). VERIFY context curat PASS (8/8). /code-review high: 3 buguri reparate (tab nav la self-refresh, pill Custom valori stale, nota_umana_preview precedenta needs_mapping). 934 passed, 1 skipped. Backend trimitere + schema NEATINSE. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -221,7 +221,7 @@ def _resolve_row_for_preview(
|
||||
errors = validate_prezentare(mapped)
|
||||
|
||||
if all_flags:
|
||||
# needs_review: chiar daca validarea trece, flagurile blocheaza auto-send
|
||||
# needs_review: validarea a trecut, dar flagurile (date ambigue, formule) cer confirmare manuala
|
||||
return {
|
||||
"resolved_status": "needs_review",
|
||||
"resolved": mapped,
|
||||
@@ -229,14 +229,7 @@ def _resolve_row_for_preview(
|
||||
"flags": all_flags,
|
||||
}
|
||||
|
||||
# auto_send gate
|
||||
if has_no_auto_send(resolved, mapping_meta):
|
||||
return {
|
||||
"resolved_status": "needs_mapping",
|
||||
"resolved": mapped,
|
||||
"errors": [{"auto_send": "cod mapat cu auto_send=0; review manual inainte de trimitere"}],
|
||||
"flags": all_flags,
|
||||
}
|
||||
# US-001 (PRD 5.11): ramura auto_send eliminata din preview.
|
||||
|
||||
if errors:
|
||||
return {
|
||||
|
||||
@@ -87,8 +87,10 @@ def _erori_nemapate(unmapped: list[dict]) -> list[dict]:
|
||||
def _motiv_clasificare(cl: dict) -> str | None:
|
||||
"""Rezumat uman pe o linie pentru un rezultat de clasificare.
|
||||
|
||||
None cand status='queued'. Acopera toate ramurile de blocaj: erori de continut
|
||||
(needs_data), coduri nemapate (needs_mapping) si auto_send oprit (needs_mapping).
|
||||
None cand status='queued'. Acopera ramurile de blocaj: erori de continut
|
||||
(needs_data) si coduri fara mapare RAR (needs_mapping).
|
||||
Dupa US-001: needs_mapping apare EXCLUSIV cand unmapped e non-gol
|
||||
(ramura auto_send_oprit era inaccesibila si a fost eliminata).
|
||||
"""
|
||||
if cl["status"] == "queued":
|
||||
return None
|
||||
@@ -99,8 +101,6 @@ def _motiv_clasificare(cl: dict) -> str | None:
|
||||
if cl["unmapped"]:
|
||||
coduri = ", ".join((u.get("cod_op_service") or "") for u in cl["unmapped"])
|
||||
return f"Coduri fara mapare RAR: {coduri}"
|
||||
if cl["status"] == "needs_mapping":
|
||||
return "Cod cu trimitere automata oprita; confirmare manuala inainte de trimitere."
|
||||
return None
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ def create_prezentari(
|
||||
conn = get_connection()
|
||||
results: list[SubmissionResult] = []
|
||||
try:
|
||||
# load_mapping_meta include auto_send per op (gate pentru coduri noi).
|
||||
# load_mapping_meta incarca maparea op->cod RAR; dupa US-001, auto_send nu mai tine randuri.
|
||||
mapping_meta = load_mapping_meta(conn, acct)
|
||||
mapping = {op: meta["cod_prestatie"] for op, meta in mapping_meta.items()}
|
||||
# Validare cod_prestatie fata de nomenclator + modul la cod necunoscut/nemapat.
|
||||
@@ -230,7 +230,7 @@ def create_prezentari(
|
||||
continue
|
||||
|
||||
# Helper pur partajat cu dry-run: reproduce EXACT clasificarea
|
||||
# (canonicalize + mapare op->cod + validare + auto_send gate).
|
||||
# (canonicalize + mapare op->cod + validare; auto_send gate eliminat dupa US-001).
|
||||
cl = _classify_modal(content, mapping, mapping_meta, valid_codes, error_mode, text_rules)
|
||||
if cl["blocked_error"]:
|
||||
# on_unmapped_error=True: respinge fara enqueue (cod necunoscut/nemapat).
|
||||
|
||||
Reference in New Issue
Block a user