Skip to main content

8 — Relatório Final e Decisão (FINAL_REPORT)

Consolidar a apreciação final do processo, preparar a decisão disciplinar e formalizar a sua emissão/notificação.

Source: src/components/workflow/RelatorioDecisaoPhaseView.tsx, RelatorioDecisaoFieldDrawer.tsx, EmissionNotificationDrawer.tsx.

The largest phase view in the PoC (~44 KB) and the only one with two field blocks, two deliverables and an approval step.

1. Consolidação final do processo — 6 steps

12-row textareas. Four of the six are pre-filled from Fase de Prova; the operator is expected to revise rather than retype.

StepPre-filled from Fase de ProvaWhat it asks for
Factos confirmadosyesFactos provados após toda a instrução do processo
Factos controvertidosyesFactos que permanecem controvertidos ou com prova insuficiente
Prova relevanteyesSíntese da prova relevante produzida ao longo do processo
Diligências realizadasnoResumo das diligências instrutórias das várias fases
Resposta do arguido consideradanoSíntese da resposta e dos elementos considerados
Timeline probatória consolidadayesCronologia consolidada dos factos e atos

Diligências realizadas is asked as free prose even though every diligência is a structured case_inquiry_actions row with its own deliverable — see diligências. The system knows the answer and asks the human to retype it.

2. Deliverable — Relatório Final

Creation mode (auto · company Word template · upload) → editable content → Validar. The auto template is generated from the six consolidation fields.

3. Decisão Final — 5 steps

StepInputsControlOptions
Tipo de decisãooutcomeselectArquivado · Advertência · Suspensão · Despedimento · Outro
Fundamentaçãoreasoningtextarea
Proporcionalidadeproportionalitytextarea
Referência à provaevidence_referencetextarea
Consequência aplicadaconsequencetextarea

Stored in case_phase_deliverables.metadata.decision_data. The outcome is copied onto cases.outcome only at the very end, when the case is closed.

The five options here are lowercase Portuguese strings (arquivado, advertencia, …) while OUTCOME_LABELS in workflow-config.ts uses uppercase English keys (ARCHIVED, WARNING, SUSPENSION, TERMINATION, OTHER) for the same five concepts. Two vocabularies, one meaning — see outcomes and proposal and string vocabulary contracts.

Note also that Proporcionalidade — the assessment an unfair-dismissal claim turns on — is a free-text box with no scaffolding: no prior sanctions, no seniority, no comparator cases.

4. Deliverable — Decisão Final

Same drawer, generated from the case, the consolidation fields and the decision fields together.

5. Aprovação da decisão

InputControlOptions
Decisortextfree text
Estado da aprovaçãoselectPor submeter · Submetida · Aprovada · Devolvida para alterações
Data submissãodate
Data aprovaçãodate
Observaçõestextarea

Decisor is a free-text name, not a reference to a user. Meanwhile GATE_REQUIRED_TRANSITIONS declares that the FINAL_REPORT->CLOSED transition needs a decision_approval gate approved by someone holding the decider role. The two never meet: the gate reads case_gates, this block writes jsonb metadata. Typing a name here satisfies the visible UI; the role check lives elsewhere and is client-side anyway. See also roles are global, not scoped.

6. Emissão / Notificação da decisão

The same seven inputs as the Nota de Culpa's emission — Método de envio*, Data de envio*, Comprovativo(s) de envio, Estado da receção, Data de receção / confirmação, Comprovativo de receção, Observações. Full list in Nota de Culpa.

Gate

FINAL_REPORT -> CLOSED is the PoC's only gated transition: decision_approval, required role decider. Closing the case is what enables the dossier export.

But this view does not go through that transition. Its closeCaseMutation writes cases.status = "CLOSED" and cases.outcome directly, then inserts the workflow_transitions row and the case_closed audit event itself — bypassing useWorkflow.transition and therefore the gate it was written to enforce. The one transition in the whole PoC that has a gate is also the one the UI performs around it. See non-atomic transitions and workflow rules can be ignored.