refactor: comentarii strict functionale, fara referinte PRD/stories
Curatare globala a comentariilor si docstring-urilor (app, tools, teste, scripturi): eliminate referintele la PRD-uri, US-xxx, task-uri istorice si review-uri; pastrata doar informatia functionala, formulata scurt. Regula adaugata in CLAUDE.md (sectiunea Stil). Fara modificari de cod sau comportament. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"""Teste mapare op ROAAUTO -> cod RAR: fuzzy, rezolvare pura, flux on-demand.
|
||||
|
||||
Contract hibrid (decis 2026-06-15): item de prestatie cu cod_prestatie (RAR direct)
|
||||
SAU cod_op_service+denumire (mapat de gateway). Op nemapata -> needs_mapping, apare
|
||||
Contract hibrid: item de prestatie cu cod_prestatie (RAR direct) SAU
|
||||
cod_op_service+denumire (mapat de gateway). Op nemapata -> needs_mapping, apare
|
||||
in editor; la salvarea maparii submission-ul se re-rezolva automat.
|
||||
"""
|
||||
|
||||
@@ -109,7 +109,7 @@ def test_resolve_fara_valid_codes_e_backcompat():
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------- #
|
||||
# US-002: reguli text (substring) dupa maparea exacta #
|
||||
# reguli text (substring) dupa maparea exacta #
|
||||
# --------------------------------------------------------------------------- #
|
||||
|
||||
def test_regula_text_contains_rezolva():
|
||||
@@ -313,7 +313,7 @@ def test_on_unmapped_error_respinge_fara_enqueue(client):
|
||||
assert res["status"] == "error"
|
||||
assert res["submission_id"] is None
|
||||
assert res["erori"] and res["erori"][0]["cod"] == "COD_NEMAPAT"
|
||||
# PRD 5.7: raspuns onest si pe ramura respinsa — nemapate + motiv populate (aditiv).
|
||||
# raspuns onest si pe ramura respinsa — nemapate + motiv populate (aditiv).
|
||||
assert res["nemapate"] and res["nemapate"][0]["cod_op_service"] == _COD_INTERN
|
||||
assert res["motiv"]
|
||||
# Nu s-a creat nimic in coada.
|
||||
@@ -348,7 +348,7 @@ def test_valideaza_error_mode(client):
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------- #
|
||||
# US-003: 3 niveluri in classify_prezentare (needs_mapping) #
|
||||
# 3 niveluri in classify_prezentare (needs_mapping) #
|
||||
# --------------------------------------------------------------------------- #
|
||||
|
||||
def test_unmapped_are_3niveluri(client):
|
||||
@@ -381,9 +381,9 @@ def test_unmapped_are_3niveluri(client):
|
||||
|
||||
|
||||
def test_auto_send_oprit_3niveluri_noul_comportament(client):
|
||||
"""Mapare cu auto_send=0 -> queued (auto_send ignorat dupa US-001).
|
||||
"""Mapare cu auto_send=0 -> queued (auto_send ignorat).
|
||||
|
||||
Dupa US-001: classify_prezentare nu mai produce ramura AUTO_SEND_OPRIT.
|
||||
classify_prezentare nu mai produce ramura AUTO_SEND_OPRIT.
|
||||
O operatie cu cod rezolvat (indiferent de auto_send) -> queued direct.
|
||||
"""
|
||||
import json
|
||||
@@ -400,12 +400,12 @@ def test_auto_send_oprit_3niveluri_noul_comportament(client):
|
||||
mapping_meta = {"OP_REVIEW": {"cod_prestatie": "OE-1", "auto_send": False}}
|
||||
res = classify_prezentare(content, mapping, mapping_meta)
|
||||
assert res["status"] == "queued", (
|
||||
f"dupa US-001 auto_send=0 -> queued (nu needs_mapping), got {res['status']}"
|
||||
f"auto_send=0 -> queued (nu needs_mapping), got {res['status']}"
|
||||
)
|
||||
|
||||
|
||||
def test_needs_data_pass_through(client):
|
||||
"""VIN invalid -> needs_data; rar_error = array cu erori care au cod/problema/fix (US-002)."""
|
||||
"""VIN invalid -> needs_data; rar_error = array cu erori care au cod/problema/fix."""
|
||||
import json
|
||||
from app.mapping import classify_prezentare
|
||||
|
||||
@@ -423,7 +423,7 @@ def test_needs_data_pass_through(client):
|
||||
erori = json.loads(res["rar_error"])
|
||||
assert isinstance(erori, list)
|
||||
assert len(erori) >= 1
|
||||
# Fiecare eroare are cele 3 niveluri (pass-through US-002)
|
||||
# Fiecare eroare are cele 3 niveluri (pass-through)
|
||||
for e in erori:
|
||||
assert "cod" in e, f"lipseste 'cod' in {e}"
|
||||
assert "problema" in e, f"lipseste 'problema' in {e}"
|
||||
@@ -431,7 +431,7 @@ def test_needs_data_pass_through(client):
|
||||
|
||||
|
||||
# =========================================================================== #
|
||||
# US-001: Scoate hold auto_send din mapare — teste RED (inainte de implementare)
|
||||
# Scoate hold auto_send din mapare #
|
||||
# =========================================================================== #
|
||||
|
||||
@pytest.fixture()
|
||||
@@ -453,7 +453,7 @@ def db_conn(monkeypatch, tmp_path):
|
||||
def test_operatie_mapata_intra_in_queued_indiferent_de_autosend():
|
||||
"""classify_prezentare cu mapare auto_send=0 -> queued (nu needs_mapping).
|
||||
|
||||
Dupa US-001: has_no_auto_send nu mai blocheaza; un cod rezolvat e direct queued.
|
||||
has_no_auto_send nu mai blocheaza; un cod rezolvat e direct queued.
|
||||
"""
|
||||
from app.mapping import classify_prezentare
|
||||
content = {
|
||||
@@ -475,7 +475,7 @@ def test_operatie_mapata_intra_in_queued_indiferent_de_autosend():
|
||||
def test_regula_text_rezolvata_nu_mai_tine_randul():
|
||||
"""Regula text cu auto_send=0 rezolva codul -> queued (nu needs_mapping held).
|
||||
|
||||
Dupa US-001: regula_fara_autosend nu se mai seteaza; codul rezolvat = queued direct.
|
||||
regula_fara_autosend nu se mai seteaza; codul rezolvat = queued direct.
|
||||
"""
|
||||
from app.mapping import classify_prezentare
|
||||
content = {
|
||||
@@ -494,16 +494,16 @@ def test_regula_text_rezolvata_nu_mai_tine_randul():
|
||||
|
||||
|
||||
def test_fara_stare_needs_mapping_pe_auto_send_oprit():
|
||||
"""has_no_auto_send intotdeauna False dupa US-001; nu mai produce AUTO_SEND_OPRIT."""
|
||||
"""has_no_auto_send intotdeauna False; nu mai produce AUTO_SEND_OPRIT."""
|
||||
from app.mapping import has_no_auto_send
|
||||
mapping_meta_false = {"OP_REVIEW": {"cod_prestatie": "OE-1", "auto_send": False}}
|
||||
resolved = [{"cod_op_service": "OP_REVIEW", "cod_prestatie": "OE-1"}]
|
||||
assert has_no_auto_send(resolved, mapping_meta_false) is False, (
|
||||
"has_no_auto_send trebuie sa intoarca mereu False dupa US-001"
|
||||
"has_no_auto_send trebuie sa intoarca mereu False"
|
||||
)
|
||||
resolved_cu_flag = [{"cod_op_service": "X", "cod_prestatie": "OE-1", "regula_fara_autosend": True}]
|
||||
assert has_no_auto_send(resolved_cu_flag, {}) is False, (
|
||||
"has_no_auto_send ignora regula_fara_autosend dupa US-001"
|
||||
"has_no_auto_send ignora regula_fara_autosend"
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user