feat(5.8): reguli mapare pe text (substring/cont) + UX tabel trimiteri (detaliu inline, fara scroll, cod RAR)

Reguli text per cont (operation_text_rules), resolve_prestatii cu param aditiv
text_rules + precedenta stricta, threadat pe toate cele 6 callsite-uri + valid_codes
+ seam classify_prezentare. UI Mapari: sectiune reguli + preview pre-salvare + overlap
+ telemetrie text_rule_hit. UX tabel: cod_rar sub operatie, pill eticheta scurta, fara
scroll orizontal (scopat .tabel-trimiteri + carduri <768px), detaliu inline expandabil
(a11y + pauza poll). code-review: reparat regula auto_send=0 care trimitea automat la RAR
in loc sa tina randul pentru review. 814 passed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-06-24 12:47:37 +00:00
parent c80c79462c
commit 51dc504f1d
28 changed files with 3023 additions and 61 deletions

View File

@@ -35,6 +35,17 @@ def _clean_odometru(value: Any) -> str:
return s
def _clean_cod_rar(value: Any) -> str:
"""Cod RAR afisat curat: uppercase + strip '.0' defensiv (coercion Excel 'OE-2.0' -> 'OE-2').
Codurile RAR nu au zecimale, dar fii defensiv ca la odometru.
"""
s = _clean_str(value)
if s.endswith(".0"):
s = s[:-2]
return s.upper() if s else ""
def _vin_scurt(vin: str) -> str:
"""Forma trunchiata a VIN-ului pentru tabel (integral ramane in detaliu).
@@ -101,6 +112,9 @@ def prezentare_din_payload(payload: str | dict | None) -> dict[str, str]:
denumire = _clean_str(item.get("denumire"))
operatie = denumire or cod
# cod_rar: exclusiv din cod_prestatie (NU fallback la cod_op_service); uppercase + strip ".0"
cod_rar = _clean_cod_rar(item.get("cod_prestatie"))
return {
"vehicul_nr": nr or EMPTY,
"vin": vin or EMPTY,
@@ -109,4 +123,5 @@ def prezentare_din_payload(payload: str | dict | None) -> dict[str, str]:
"data_prestatie": data_prest or EMPTY,
"odometru": odo or EMPTY,
"cod": cod or EMPTY,
"cod_rar": cod_rar or EMPTY,
}