fix: gate cClassTrib applicability by CRT and date

This commit is contained in:
gti
2026-09-25 17:47:04 -03:00
parent 95605c2ff5
commit 4a12640031
25 changed files with 498 additions and 72 deletions
+14
View File
@@ -690,6 +690,20 @@ def test_panel_shows_rtc_products_summary_and_the_pending_message_only_when_rtc_
for legacy in ("Escopo anterior", "Escopo ampliado"):
assert legacy not in on
_complete_sync(client, agent_id, {
"rtc_enabled": True,
"rtc_supported": True,
"rtc_catalog_valid": True,
"cclasstrib_applicability": {"state": "NOT_APPLICABLE", "basis": "SIMPLES_CCLASSTRIB_NOT_EFFECTIVE"},
"rtc_resolution": {"total": 521, "valid_existing": 0, "ready_to_apply": 0, "insufficient": 521},
})
not_applicable = client.get(f"/agents/{agent_id}").text
assert "cClassTrib: Não utilizado neste cliente" in not_applicable
assert "cClassTrib pendente em 521 produtos" not in not_applicable
rtc_page = client.get(f"/agents/{agent_id}/rtc").text
assert "cClassTrib: Não utilizado neste cliente" in rtc_page
assert "cClassTrib pendente em 521 produtos" not in rtc_page
def test_rtc_control_page_shows_human_labels_and_a_catalog_column_never_raw_enums():
from central.app.panel_presentation import abort_reason_label, audit_outcome_label, candidate_status_label, catalog_state_label, blocker_reason_label, blocker_type_label, rtc_rule_label