Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ flowchart LR
- [Catálogo inicial de automações e agentes](docs/automacoes-sugeridas.md)
- [Dados do GLPI para Analytics e ML](docs/glpi-dados-analytics-ml.md)
- [Autonomia com LangGraph em ambiente monitorado](docs/langgraph-autonomia-ambiente-monitorado.md)
- [Evolucao NOC, ITSM e operacao padronizada](docs/evolucao-noc-operacao.md)
- [Portas e conectividade](docs/portas-e-conectividade.md)
- [Roadmap de implantação](docs/roadmap.md)
- [Guia do backend MVP](backend/README.md)
Expand Down
2 changes: 2 additions & 0 deletions backend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ HELPDESK_EVOLUTION_BASE_URL=http://localhost:8080
HELPDESK_EVOLUTION_API_KEY=
HELPDESK_EVOLUTION_INSTANCE_NAME=helpdeskAutomacao
HELPDESK_EVOLUTION_WEBHOOK_SECRET=
# Nao habilite em producao: segredo em query string pode vazar em logs/proxies.
HELPDESK_EVOLUTION_WEBHOOK_ALLOW_QUERY_SECRET=false
# Algumas versões da Evolution entregam o remetente como @lid em vez de telefone.
# Cadastre apenas mapeamentos confirmados: {"LID":"telefone cadastrado no GLPI"}
HELPDESK_EVOLUTION_LID_PHONE_MAP=
Expand Down
31 changes: 30 additions & 1 deletion backend/app/api/routes/helpdesk.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
LLMGenerateResponse,
IdentityLookupResponse,
LLMStatusResponse,
NOCAlertReviewRequest,
NOCAlertReviewResponse,
NOCOperationalReportResponse,
NormalizedWhatsAppMessage,
RuntimeAuditOverviewResponse,
RuntimeAutomationRunnerStatusResponse,
Expand Down Expand Up @@ -142,6 +145,30 @@ async def get_ticket_operations_summary(
return await orchestrator.get_ticket_operations_summary()


@router.get(
"/helpdesk/noc/report",
response_model=NOCOperationalReportResponse,
dependencies=[Depends(require_audit_access), Depends(require_automation_read_access)],
)
async def get_noc_operational_report(
period_label: str = Query(default="periodo atual", min_length=3, max_length=120),
orchestrator: HelpdeskOrchestrator = Depends(get_helpdesk_orchestrator),
) -> NOCOperationalReportResponse:
return await orchestrator.get_noc_operational_report(period_label=period_label)


@router.post(
"/helpdesk/noc/alerts/review",
response_model=NOCAlertReviewResponse,
dependencies=[Depends(require_audit_access)],
)
async def review_noc_alerts(
payload: NOCAlertReviewRequest,
orchestrator: HelpdeskOrchestrator = Depends(get_helpdesk_orchestrator),
) -> NOCAlertReviewResponse:
return await orchestrator.review_noc_alerts(payload)


@router.get(
"/helpdesk/runtime/overview",
response_model=RuntimeOverviewResponse,
Expand Down Expand Up @@ -520,7 +547,9 @@ async def receive_evolution_whatsapp_webhook(
)

raw_body = await request.body()
provided_secret = secret_header or secret_query
provided_secret = secret_header
if provided_secret is None and settings.evolution_webhook_allow_query_secret:
provided_secret = secret_query
if not whatsapp_client.validate_evolution_webhook_secret(provided_secret):
raise HTTPException(
status_code=status.HTTP_403_FORBIDDEN,
Expand Down
Loading