130 lines
4.5 KiB
Python
130 lines
4.5 KiB
Python
"""Centralized Portuguese labels for the admin UI.
|
|
|
|
v4.7.3 keeps business rules unchanged, but moves display labels out of the
|
|
route handlers so Operations, Tasks and Opportunities use the same wording.
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
ACTION_LABELS = {
|
|
"SEND_INFO": "Enviar informação",
|
|
"SEND_QUOTE": "Preparar orçamento",
|
|
"SEND_PROFORMA": "Enviar orçamento para pagamento",
|
|
"SEND_INVOICE": "Emitir fatura",
|
|
"CONFIRM_PAYMENT": "Confirmar pagamento",
|
|
"CONFIRM_PAYMENT_AND_PREPARE_SHIPMENT": "Confirmar pagamento",
|
|
"PREPARE_ORDER": "Preparar encomenda",
|
|
"VALIDATE_PHYSICAL_ORDER": "Validar encomenda física",
|
|
"CREATE_SHIPMENT": "Criar envio",
|
|
"REVIEW_MANUALLY": "Rever manualmente",
|
|
"ASSOCIATE_CUSTOMER": "Associar cliente",
|
|
"ASSOCIATE_OPPORTUNITY": "Associar oportunidade",
|
|
"MARK_NO_INTEREST": "Marcar sem interesse",
|
|
"REMOVE_FROM_LIST": "Remover da lista",
|
|
"SUPPORT": "Responder suporte",
|
|
"NO_ACTION": "Sem ação",
|
|
"IGNORE_SPAM": "Ignorar spam",
|
|
"FOLLOW_UP_QUOTE": "Follow-up do orçamento",
|
|
"FOLLOW_UP_PROFORMA": "Follow-up do orçamento para pagamento",
|
|
"FOLLOW_UP_PAYMENT": "Follow-up de pagamento",
|
|
"FOLLOW_UP_CUSTOMER_REVIEW": "Follow-up ao cliente",
|
|
"FOLLOW_UP_GENERIC": "Follow-up",
|
|
"CONFIRM_DELIVERY": "Confirmar receção",
|
|
"RECOVER_OPPORTUNITY": "Recuperar oportunidade",
|
|
"REVIEW_NURTURE": "Rever acompanhamento futuro",
|
|
"REVIEW_RECONSTRUCTED_PROCESS": "Validar processo reconstruído",
|
|
}
|
|
|
|
PRIMARY_ACTION_LABELS = {
|
|
"SEND_INFO": "Preparar resposta",
|
|
"SEND_QUOTE": "Preparar orçamento",
|
|
"SEND_PROFORMA": "Preparar orçamento para pagamento",
|
|
"SEND_INVOICE": "Emitir fatura",
|
|
"CONFIRM_PAYMENT": "Confirmar pagamento",
|
|
"CONFIRM_PAYMENT_AND_PREPARE_SHIPMENT": "Confirmar pagamento",
|
|
"PREPARE_ORDER": "Preparar encomenda",
|
|
"VALIDATE_PHYSICAL_ORDER": "Validar encomenda física",
|
|
"CREATE_SHIPMENT": "Criar envio",
|
|
"REVIEW_MANUALLY": "Rever mensagem",
|
|
"ASSOCIATE_CUSTOMER": "Associar cliente",
|
|
"ASSOCIATE_OPPORTUNITY": "Associar oportunidade",
|
|
"MARK_NO_INTEREST": "Marcar sem interesse",
|
|
"REMOVE_FROM_LIST": "Remover da lista",
|
|
"SUPPORT": "Responder suporte",
|
|
"FOLLOW_UP_QUOTE": "Follow-up do orçamento",
|
|
"FOLLOW_UP_PROFORMA": "Follow-up do orçamento para pagamento",
|
|
"FOLLOW_UP_PAYMENT": "Follow-up de pagamento",
|
|
"FOLLOW_UP_CUSTOMER_REVIEW": "Follow-up ao cliente",
|
|
"FOLLOW_UP_GENERIC": "Follow-up",
|
|
"CONFIRM_DELIVERY": "Confirmar receção",
|
|
"RECOVER_OPPORTUNITY": "Recuperar oportunidade",
|
|
"REVIEW_NURTURE": "Rever acompanhamento futuro",
|
|
"REVIEW_RECONSTRUCTED_PROCESS": "Validar processo reconstruído",
|
|
}
|
|
|
|
QUEUE_LABELS = {
|
|
"vendas": "Vendas",
|
|
"financeiro": "Financeiro",
|
|
"operacoes": "Operações",
|
|
"operações": "Operações",
|
|
"logistica": "Logística",
|
|
"logística": "Logística",
|
|
"rever": "Revisão",
|
|
"revisao": "Revisão",
|
|
"revisão": "Revisão",
|
|
"suporte": "Suporte",
|
|
}
|
|
|
|
STATUS_LABELS = {
|
|
"pending": "Pendente",
|
|
"done": "Concluída",
|
|
"skipped": "Ignorada",
|
|
"failed": "Falhada",
|
|
"blocked": "Bloqueada",
|
|
"processing": "Em processamento",
|
|
"sent": "Enviada",
|
|
"dry_run": "Dry-run",
|
|
"ignored": "Ignorada",
|
|
"cancelled": "Cancelada",
|
|
"created": "Criada",
|
|
"issued": "Emitida",
|
|
"converted": "Convertida",
|
|
}
|
|
|
|
BLOCK_REASON_LABELS = {
|
|
"ambiguous_opportunity": "Associação por confirmar",
|
|
"missing_customer": "Cliente fiscal em falta",
|
|
"missing_product_code": "Produto sem código externo",
|
|
"outbox_failed": "Integração falhada",
|
|
"payment_confirmation": "Confirmação financeira obrigatória",
|
|
}
|
|
|
|
|
|
def normalized_code(value: Any) -> str:
|
|
return str(value or "").strip().upper()
|
|
|
|
|
|
def action_label(code: Any, fallback: str = "Ação") -> str:
|
|
return ACTION_LABELS.get(normalized_code(code), str(code or fallback))
|
|
|
|
|
|
def primary_action_label(code: Any, fallback: str = "Abrir") -> str:
|
|
normalized = normalized_code(code)
|
|
return PRIMARY_ACTION_LABELS.get(normalized) or ACTION_LABELS.get(normalized) or str(code or fallback)
|
|
|
|
|
|
def queue_label(queue: Any) -> str:
|
|
key = str(queue or "").strip().lower()
|
|
return QUEUE_LABELS.get(key, str(queue or "—"))
|
|
|
|
|
|
def status_label(status: Any) -> str:
|
|
key = str(status or "").strip().lower()
|
|
return STATUS_LABELS.get(key, str(status or "—"))
|
|
|
|
|
|
def block_reason_label(reason: Any) -> str:
|
|
key = str(reason or "").strip().lower()
|
|
return BLOCK_REASON_LABELS.get(key, str(reason or "Bloqueio operacional"))
|