The case lifecycle (end to end)
This is the spine of the whole product. A disciplinary case moves through eight operational phases plus transversal states. Everything else — checklists, deadlines, gates, documents, the portal, the dossier — hangs off this journey. Reading it top to bottom is the fastest way to understand the app.
┌─────────────────────────────────────────────┐
suspicion of │ THE CASE FILE │
misconduct ──────────▶│ status • flags • milestone dates • outcome │
└─────────────────────────────────────────────┘
│
(1) INTAKE ─────────────┐ Abertura: register the facts, the employee, the source.
│ │ Flag has_preliminary_inquiry? dismissal_intent?
│ │ Produces: Participação Disciplinar, Despacho Inicial,
│ │ Termo de Abertura + Nomeação de Instrutor
▼ │
(2) PRELIMINARY_INQUIRY │ Inquérito Prévio (optional*): investigate before accusing.
│ *branch │ Diligências (witness hearings, doc collection…) → Relatório
│ │ Instructor proposes: PROCEED_DISCIPLINARY or ARCHIVE.
│ │ ⏱ caducidade: Nota de Culpa within 30 days of IP end.
▼ │
(3) CHARGES_ISSUED ─────┤ Nota de Culpa: the formal written accusation.
│ │ Legal review → sign → deliver to employee → proof of receipt.
▼ │
(4) CONSULTATION_PORTAL │ Consulta do Processo: employee gets portal access to the file.
│ │
▼ │
(5) RESPONSE_WINDOW ────┤ Resposta do Arguido: employee replies / requests diligences.
│ │ ⏱ 10 working days from delivery of the Nota de Culpa.
▼ │
(6) EVIDENCE_PHASE ─────┤ Fase de Prova: run requested + additional diligences.
│ *branch │ Consolidate the factual timeline; verify evidence integrity.
▼ │
(7) BODIES_OPINION ─────┤ Pareceres (only if dismissal_intent AND union/rep involved):
│ conditional │ send draft decision to CT/Sindicato, wait 5 working days.
▼ │
(8) FINAL_REPORT ───────┤ Relatório Final e Decisão: proportionality, reasoning, sanction.
│ │ 🚪 GATE: decision_approval — must be approved by the DECIDER.
▼ │
CLOSED ──────────────┘ outcome ∈ {Arquivado, Advertência, Suspensão, Despedimento, Outro}
→ export the FINAL DOSSIER (immutable snapshot).
transversal at any point: SUSPENDED (pauses, remembers previous_status) · ARCHIVED
The two branch points (where the path forks)
The procedure is not linear — three case flags reshape it:
has_preliminary_inquiry(set at intake): if true, the case must go through phase 2 (Inquérito Prévio); if false, it jumps straight from INTAKE to CHARGES_ISSUED.dismissal_intentANDemployee_rep_or_union_related: if both, phase 7 (BODIES_OPINION — the mandatory CT/Sindicato consultation) is inserted before the final report; otherwise EVIDENCE_PHASE goes straight to FINAL_REPORT.
Full logic in Conditional branching.
What each phase gives the user
Every phase presents the same four affordances, composed differently:
| Affordance | What it is |
|---|---|
| Checklist | Predefined items the phase requires (DEFAULT_CHECKLISTS) — the "have you done X?" list |
| Deadlines | Legally-anchored clocks that start on entry (PHASE_DEADLINES) |
| Deliverables | The formal documents to produce (Nota de Culpa, Relatório, Ata…) |
| Gate | A required approval to leave the phase (only FINAL_REPORT→CLOSED has one) |
A phase view (e.g. AperturaPhaseView, InqueritoPrevioPhaseView) renders these; drawers
handle editing fields and producing documents. See
The workflow engine.
The clocks that run alongside
The journey is really a race against statutory deadlines. The ones the PoC models:
- 30 days — issue the Nota de Culpa after the Inquérito Prévio ends (caducidade)
- 10 working days — the employee's response window
- 5 working days — wait for the CT/Sindicato opinion
- 30 days — internal decision deadline after instruction closes
These are the product's reason to exist — and also its most legally fragile code (uncited figures, holiday-blind math, click-time dates). See Phase deadlines.
The employee's parallel journey
While the internal team works the phases, the arguido experiences a much narrower path: they receive a portal link (token, no login), can view whatever documents the team makes visible, and — during the response window — can submit a written reply and files. Every view/download/submission is logged. See External portal flow.
The endpoint
Reaching CLOSED with an outcome set, the team exports the final dossier — the bundle
that would go to a tribunal. This is the artifact the entire journey exists to produce. See
Dossier generation.
Related
- Personas & roles — who drives each phase
- The workflow engine — how it's implemented
- Domain & legal rules — the statutes behind the clocks