bugfix: route stickness precedences (transaction in the same intent)
This commit is contained in:
BIN
app/domain/__pycache__/__init__.cpython-313.pyc
Normal file
BIN
app/domain/__pycache__/__init__.cpython-313.pyc
Normal file
Binary file not shown.
BIN
app/domain/contas/__pycache__/__init__.cpython-313.pyc
Normal file
BIN
app/domain/contas/__pycache__/__init__.cpython-313.pyc
Normal file
Binary file not shown.
BIN
app/domain/contas/__pycache__/client.cpython-313.pyc
Normal file
BIN
app/domain/contas/__pycache__/client.cpython-313.pyc
Normal file
Binary file not shown.
BIN
app/domain/contas/__pycache__/contestation_rules.cpython-313.pyc
Normal file
BIN
app/domain/contas/__pycache__/contestation_rules.cpython-313.pyc
Normal file
Binary file not shown.
BIN
app/domain/contas/__pycache__/ic_tags.cpython-313.pyc
Normal file
BIN
app/domain/contas/__pycache__/ic_tags.cpython-313.pyc
Normal file
Binary file not shown.
Binary file not shown.
BIN
app/domain/contas/__pycache__/invoice_context.cpython-313.pyc
Normal file
BIN
app/domain/contas/__pycache__/invoice_context.cpython-313.pyc
Normal file
Binary file not shown.
BIN
app/domain/contas/__pycache__/invoice_models.cpython-313.pyc
Normal file
BIN
app/domain/contas/__pycache__/invoice_models.cpython-313.pyc
Normal file
Binary file not shown.
BIN
app/domain/contas/__pycache__/invoice_resolver.cpython-313.pyc
Normal file
BIN
app/domain/contas/__pycache__/invoice_resolver.cpython-313.pyc
Normal file
Binary file not shown.
BIN
app/domain/contas/__pycache__/item_matcher.cpython-313.pyc
Normal file
BIN
app/domain/contas/__pycache__/item_matcher.cpython-313.pyc
Normal file
Binary file not shown.
BIN
app/domain/contas/__pycache__/pro_rata_rules.cpython-313.pyc
Normal file
BIN
app/domain/contas/__pycache__/pro_rata_rules.cpython-313.pyc
Normal file
Binary file not shown.
BIN
app/domain/contas/__pycache__/protocol_triplets.cpython-313.pyc
Normal file
BIN
app/domain/contas/__pycache__/protocol_triplets.cpython-313.pyc
Normal file
Binary file not shown.
BIN
app/domain/contas/__pycache__/rct_policy.cpython-313.pyc
Normal file
BIN
app/domain/contas/__pycache__/rct_policy.cpython-313.pyc
Normal file
Binary file not shown.
BIN
app/domain/contas/__pycache__/service.cpython-313.pyc
Normal file
BIN
app/domain/contas/__pycache__/service.cpython-313.pyc
Normal file
Binary file not shown.
BIN
app/domain/contas/__pycache__/string_metrics.cpython-313.pyc
Normal file
BIN
app/domain/contas/__pycache__/string_metrics.cpython-313.pyc
Normal file
Binary file not shown.
Binary file not shown.
BIN
app/domain/contas/__pycache__/vas_variation.cpython-313.pyc
Normal file
BIN
app/domain/contas/__pycache__/vas_variation.cpython-313.pyc
Normal file
Binary file not shown.
BIN
app/domain/contas/__pycache__/workflow_actions.cpython-313.pyc
Normal file
BIN
app/domain/contas/__pycache__/workflow_actions.cpython-313.pyc
Normal file
Binary file not shown.
Binary file not shown.
BIN
app/domain/contas/parsers/__pycache__/__init__.cpython-313.pyc
Normal file
BIN
app/domain/contas/parsers/__pycache__/__init__.cpython-313.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -37,6 +37,47 @@ class ContasDomainService:
|
||||
def consultar_faturas(self, *, msisdn: str, **_: Any) -> Any:
|
||||
return self.client.consultar_faturas(msisdn)
|
||||
|
||||
def consultar_plano(self, *, msisdn: str, **args: Any) -> dict[str, Any]:
|
||||
"""Retorna somente os planos presentes na evidência de billing analysis.
|
||||
|
||||
A consulta é deliberadamente determinística: não usa VAS, RAG nem o
|
||||
workflow de invoice_explanation para responder qual é o plano do cliente.
|
||||
"""
|
||||
billing = args.get("billing_analysis")
|
||||
if not isinstance(billing, dict):
|
||||
billing = self.client.billing_analysis(
|
||||
msisdn,
|
||||
invoice_id=args.get("invoice_id"),
|
||||
customer_id=args.get("customer_id"),
|
||||
)
|
||||
|
||||
plans: list[dict[str, Any]] = []
|
||||
for section in billing.get("currentInvoice") or [] if isinstance(billing, dict) else []:
|
||||
if not isinstance(section, dict):
|
||||
continue
|
||||
section_type = str(section.get("type") or "").strip().casefold()
|
||||
section_desc = str(section.get("desc") or "").strip().casefold()
|
||||
if section_type not in {"plano", "planos"} and section_desc not in {"plano", "planos"}:
|
||||
continue
|
||||
for item in section.get("items") or []:
|
||||
if not isinstance(item, dict):
|
||||
continue
|
||||
name = str(item.get("desc") or item.get("name") or "").strip()
|
||||
if not name:
|
||||
continue
|
||||
plans.append({
|
||||
"name": name,
|
||||
"value": item.get("value"),
|
||||
"type": str(item.get("type") or section.get("type") or "plano"),
|
||||
"contestable": item.get("contestable"),
|
||||
})
|
||||
|
||||
return {
|
||||
"plans": plans,
|
||||
"count": len(plans),
|
||||
"source": "billing_analysis.currentInvoice",
|
||||
}
|
||||
|
||||
def invoice_explanation(self, *, msisdn: str, **args: Any) -> dict[str, Any]:
|
||||
# Reuse framework-prefetched evidence when available; the domain never owns
|
||||
# a second cache/session implementation. Explanation itself is produced by
|
||||
|
||||
Reference in New Issue
Block a user