1 — Abertura (INTAKE)
Formalizar a abertura do procedimento e consolidar os elementos mínimos necessários para o seu desenvolvimento.
Source: src/components/workflow/AperturaPhaseView.tsx, AperturaFieldDrawer.tsx.
This is the only phase whose fields all land in real cases columns.
Informação base necessária — 7 steps
| Step | Inputs | Control | Persisted as |
|---|---|---|---|
| Trabalhador visado | Nome · Email · Departamento | text · email · text | cases.employee_name · employee_email · employee_department |
| Descrição sumária dos factos | Descrição sumária dos factos | textarea (min 160px) | cases.description |
| Datas relevantes | Data de conhecimento dos factos · Data dos factos (se conhecida) · Data da suspeita | 3× date picker | cases.knowledge_date · facts_date · suspicion_date |
| Fonte do conhecimento | Fonte do conhecimento | textarea | cases.knowledge_source |
| Intervenientes identificados | Nome + Tipo (Testemunha · Denunciante · Outro), repeatable add/remove list | text + select | cases.intervenientes — jsonb {nome, tipo}[] |
| Instrutor nomeado | Instrutor | select, filtered to roles instructor_internal, instructor_external, case_manager, hr_admin | cases.instructor_id |
| Tipo de abertura | Com Inquérito Prévio / Abertura direta de PD formal | radio group | cases.has_preliminary_inquiry (bool) + cases.opening_type |
Tipo de abertura is reported as Preenchido unconditionally — the field is a boolean with a
default, so it can never be "missing". It counts toward the 7/7 without the operator touching it.
Deliverables formais — 3 documents
| Deliverable | Inputs | Generated content |
|---|---|---|
| Participação Disciplinar | creation mode (auto · company Word template · upload) → editable content → Validar | Registo formal da denúncia/queixa: participante, modo de receção (Escrita / Oral reduzida a auto / Denúncia anónima / Outra), data dos factos, factos relatados, intervenientes, anexos |
| Despacho Inicial e Nomeação de Instrutor | idem | Decisão de instaurar (arts. 329.º e ss. CT), fundamento, nomeação do instrutor, aceitação do instrutor |
| Termo de Abertura do Processo Disciplinar | idem | Nº de processo (internal_code), arguido, data, factos sumários, instrutor designado, assinatura |
All three templates are hardcoded Portuguese strings in AperturaPhaseView.tsx
(generateParticipacao, generateDespachoInicial, generateTermoAbertura). The instructor's
name is left as a literal [NOME DO INSTRUTOR] placeholder in two of them even though
instructor_id is a field of this same phase.
Gate
phaseComplete requires all three at once:
- all 7 base fields truthy,
- all 3 deliverables at
validatedorclosed, - the engine checklist fully
approved.
The next phase branches on has_preliminary_inquiry: Inquérito Prévio when true, Nota de
Culpa when false. See conditional branching.
The checklist coupling
A useEffect in this view matches the phase's checklist item labels by regex and flips them to
approved / draft to follow the field state — the "sincronizam automaticamente com os campos
acima" line in the UI. Only 5 of the seeded items are mapped:
| Checklist item | Driven by |
|---|---|
| Identificação do trabalhador | employee_name |
| Descrição factual dos factos | description |
| Datas relevantes | knowledge_date or facts_date |
| Fonte do conhecimento | knowledge_source |
| Intervenientes identificados | intervenientes.length > 0 |
DEFAULT_CHECKLISTS.INTAKE seeds 8 items. The other three — Participação Disciplinar
registada, Despacho Inicial e Nomeação de Instrutor, Termo de Abertura do Processo
Disciplinar — became the deliverables above and have no matching field, so the sync never
touches them. On a freshly seeded case the gate therefore needs three items ticked by hand, or
bulk-approved as a side effect of validating a document.
This makes it a fourth writer to checklist item state, on top of the three catalogued in checklist auto-approve.
Related
- Diligências catalogue — not used in this phase, but the next one uses it
- Caducidade — 30 days —
knowledge_dateis the anchor - Legal time vs click time