feat(missao-6): finalizacao descoberta P5-P6, compatibilidade do motor e atualizacao PROJECT_STATE

This commit is contained in:
gti
2026-09-28 16:40:07 -03:00
parent d383332150
commit f5893ac860
5 changed files with 128 additions and 81 deletions
@@ -149,10 +149,16 @@ def test_c3_cest_auto_fill_only_when_single_candidate():
# ---------------- C.4: IPI ----------------
def test_c4_ipi_taxpayer_gate():
"""C.4: valor da TIPI só onde CONTRIBUINTE_IPI aplicar; senão NOT_APPLICABLE."""
# Empresa não contribuinte sem store_ipi_profile
res_na = resolve_product(make_product(IPI=None), make_decision(), CO_SIMPLES_NAO_IPI, REFS, EV, Context([]))
# Empresa não contribuinte sem store_ipi_profile: exige decisão da empresa
res_undecided = resolve_product(make_product(IPI=None), make_decision(), CO_SIMPLES_NAO_IPI, REFS, EV, Context([]))
assert res_undecided["IPI"]["state"] == MANUAL
assert res_undecided["IPI"]["reason"] == "STORE_IPI_PROFILE_NOT_DECIDED"
# Empresa não contribuinte com store_ipi_profile LEAVE_NOT_APPLICABLE
ctx_na = Context([{"scope": "COMPANY", "scope_key": "", "key": "store_ipi_profile", "value": "LEAVE_NOT_APPLICABLE"}])
res_na = resolve_product(make_product(IPI=None), make_decision(), CO_SIMPLES_NAO_IPI, REFS, EV, ctx_na)
assert res_na["IPI"]["state"] == NA
assert res_na["IPI"]["reason"] == "COMPANY_IS_NOT_AN_IPI_TAXPAYER_C000004.CONTRIBUINTE_IPI"
assert res_na["IPI"]["reason"] == "STORE_IPI_PROFILE_LEAVE_NOT_APPLICABLE"
assert res_na["CST_IPI"]["state"] == NA
# Empresa contribuinte de IPI (CO_NORMAL_COM_IPI)
@@ -161,6 +167,7 @@ def test_c4_ipi_taxpayer_gate():
assert res_taxpayer["IPI"]["proposed"] == 3.9
# ---------------- C.6: GTIN Validation ----------------
def test_c6_gtin_validation_algorithm():
"""C.6: Validação de DV GS1 e prefixos válidos/restritos."""