Skip to main content

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

StepInputsControlPersisted as
Trabalhador visadoNome · Email · Departamentotext · email · textcases.employee_name · employee_email · employee_department
Descrição sumária dos factosDescrição sumária dos factostextarea (min 160px)cases.description
Datas relevantesData de conhecimento dos factos · Data dos factos (se conhecida) · Data da suspeita3× date pickercases.knowledge_date · facts_date · suspicion_date
Fonte do conhecimentoFonte do conhecimentotextareacases.knowledge_source
Intervenientes identificadosNome + Tipo (Testemunha · Denunciante · Outro), repeatable add/remove listtext + selectcases.intervenientes — jsonb {nome, tipo}[]
Instrutor nomeadoInstrutorselect, filtered to roles instructor_internal, instructor_external, case_manager, hr_admincases.instructor_id
Tipo de aberturaCom Inquérito Prévio / Abertura direta de PD formalradio groupcases.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

DeliverableInputsGenerated content
Participação Disciplinarcreation mode (auto · company Word template · upload) → editable content → ValidarRegisto 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 InstrutoridemDecisão de instaurar (arts. 329.º e ss. CT), fundamento, nomeação do instrutor, aceitação do instrutor
Termo de Abertura do Processo DisciplinaridemNº 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 validated or closed,
  • 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 itemDriven by
Identificação do trabalhadoremployee_name
Descrição factual dos factosdescription
Datas relevantesknowledge_date or facts_date
Fonte do conhecimentoknowledge_source
Intervenientes identificadosintervenientes.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.