@@ -0,0 +1,852 @@
|
||||
import { Head, Link, useForm, usePage } from '@inertiajs/react';
|
||||
import {
|
||||
PageTitle,
|
||||
Panel,
|
||||
FormErrors,
|
||||
controlClass,
|
||||
} from '@/components/procurement';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { PeopleClarifications } from '@/components/people-clarifications';
|
||||
import type { ClarificationData } from '@/components/people-clarifications';
|
||||
import { EvidenceBrief } from '@/components/evidence-brief';
|
||||
import type { EvidenceBriefData } from '@/components/evidence-brief';
|
||||
import { AiPreparationPreview } from '@/components/ai-preparation-preview';
|
||||
import type { AiPreparation } from '@/components/ai-preparation-preview';
|
||||
import { PeopleRegistryChoice } from '@/components/people-registry-choice';
|
||||
import type { RegistryChoice } from '@/components/people-registry-choice';
|
||||
|
||||
type Process = {
|
||||
id: number;
|
||||
title: string;
|
||||
purpose: string;
|
||||
kind: string;
|
||||
status: string;
|
||||
version: number;
|
||||
closes_on: string;
|
||||
rules: {
|
||||
submission_form?: {
|
||||
id: number;
|
||||
version: number;
|
||||
definition: {
|
||||
available: boolean;
|
||||
fields: { key: string; label: string; required: boolean }[];
|
||||
documents: { key: string; label: string; required: boolean }[];
|
||||
};
|
||||
};
|
||||
minimum_reviews: number;
|
||||
criteria: { label: string; weight: number }[];
|
||||
annex?: {
|
||||
version: number;
|
||||
template: string;
|
||||
fields: Record<string, string | null>;
|
||||
requirements: {
|
||||
description: string;
|
||||
classification: string;
|
||||
verification: string;
|
||||
equivalences?: string | null;
|
||||
}[];
|
||||
};
|
||||
};
|
||||
selection: null | {
|
||||
rows: Candidate[];
|
||||
reason: string;
|
||||
outcome?: string;
|
||||
decision_reason?: string;
|
||||
};
|
||||
selected_application_id: number | null;
|
||||
contract: null | {
|
||||
reference: string;
|
||||
starts_on: string;
|
||||
terms: string;
|
||||
status: string;
|
||||
};
|
||||
};
|
||||
type Candidate = {
|
||||
electronic_source?: {
|
||||
submission_id: number;
|
||||
reference: string;
|
||||
profile_version: number;
|
||||
};
|
||||
registry_source?: { id: number; reference: string; version: number };
|
||||
id: number;
|
||||
name: string;
|
||||
reference: string;
|
||||
summary: string;
|
||||
received_on: string;
|
||||
evaluation_count: number;
|
||||
score_minor: number | null;
|
||||
reviews: {
|
||||
id: number;
|
||||
reviewed_by: number;
|
||||
reason: string;
|
||||
created_at: string;
|
||||
answers: {
|
||||
score: string;
|
||||
evidence: string;
|
||||
evidence_type?: string;
|
||||
clarification?: string | null;
|
||||
}[];
|
||||
}[];
|
||||
};
|
||||
const states: Record<string, string> = {
|
||||
draft: 'Abertura por conferir',
|
||||
open: 'Recepção de candidaturas',
|
||||
assessment: 'Avaliação',
|
||||
selection_review: 'Selecção por conferir',
|
||||
selected: 'Selecção aprovada',
|
||||
contract_draft: 'Minuta contratual preparada',
|
||||
};
|
||||
const commands: Record<string, string> = {
|
||||
open: 'Conferir e abrir',
|
||||
apply: 'Registar candidatura',
|
||||
close: 'Encerrar recepção e iniciar avaliação',
|
||||
evaluate: 'Registar avaliação',
|
||||
select: 'Propor selecção',
|
||||
confirm: 'Conferir selecção',
|
||||
contract: 'Preparar minuta contratual',
|
||||
};
|
||||
|
||||
function Action({
|
||||
process: p,
|
||||
candidates,
|
||||
command,
|
||||
registry,
|
||||
}: {
|
||||
process: Process;
|
||||
candidates: Candidate[];
|
||||
command: string;
|
||||
registry?: RegistryChoice;
|
||||
}) {
|
||||
const requestedApplication =
|
||||
new URL(usePage().url, 'http://local').searchParams.get(
|
||||
'candidatura',
|
||||
) ?? '';
|
||||
const form = useForm({
|
||||
version: p.version,
|
||||
operation_key: crypto.randomUUID(),
|
||||
reason: '',
|
||||
no_conflict: false,
|
||||
name: '',
|
||||
person_id: '',
|
||||
person_version: '',
|
||||
save_person: !!registry?.ready && registry.canCreate,
|
||||
person_reference: '',
|
||||
reference: '',
|
||||
summary: '',
|
||||
received_on: '',
|
||||
application_id: candidates.some(
|
||||
(candidate) => String(candidate.id) === requestedApplication,
|
||||
)
|
||||
? requestedApplication
|
||||
: '',
|
||||
outcome: 'approved',
|
||||
starts_on: '',
|
||||
terms: '',
|
||||
answers: p.rules.criteria.map(() => ({
|
||||
score: '',
|
||||
evidence: '',
|
||||
evidence_type: '',
|
||||
clarification: '',
|
||||
})),
|
||||
});
|
||||
const candidateChoice = ['evaluate', 'select'].includes(command);
|
||||
return (
|
||||
<Panel title={commands[command]}>
|
||||
<form
|
||||
className="space-y-4"
|
||||
onSubmit={(e) => {
|
||||
e.preventDefault();
|
||||
form.post(`/pessoas/${p.id}/${command}`, {
|
||||
preserveState: 'errors',
|
||||
preserveScroll: true,
|
||||
});
|
||||
}}
|
||||
>
|
||||
<FormErrors errors={form.errors} />
|
||||
{command === 'apply' && (
|
||||
<>
|
||||
{registry?.ready && (
|
||||
<PeopleRegistryChoice
|
||||
processId={p.id}
|
||||
data={registry}
|
||||
selected={form.data.person_id}
|
||||
choose={(person) => {
|
||||
form.setData((data) => ({
|
||||
...data,
|
||||
person_id: person
|
||||
? String(person.id)
|
||||
: '',
|
||||
person_version: person
|
||||
? String(person.version)
|
||||
: '',
|
||||
name: person?.name ?? '',
|
||||
summary: person?.profile_summary ?? '',
|
||||
}));
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<label className="block">
|
||||
Nome da pessoa
|
||||
<input
|
||||
className={controlClass}
|
||||
required
|
||||
minLength={3}
|
||||
maxLength={200}
|
||||
value={form.data.name}
|
||||
readOnly={!!form.data.person_id}
|
||||
onChange={(e) =>
|
||||
form.setData('name', e.target.value)
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
{registry?.ready &&
|
||||
registry.canCreate &&
|
||||
!form.data.person_id && (
|
||||
<>
|
||||
<label className="flex items-center gap-2">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={form.data.save_person}
|
||||
onChange={(event) =>
|
||||
form.setData(
|
||||
'save_person',
|
||||
event.target.checked,
|
||||
)
|
||||
}
|
||||
/>
|
||||
Guardar também no meu cadastro para
|
||||
reutilizar
|
||||
</label>
|
||||
{form.data.save_person && (
|
||||
<label className="block">
|
||||
Referência do cadastro (opcional)
|
||||
<input
|
||||
className={controlClass}
|
||||
maxLength={120}
|
||||
value={
|
||||
form.data.person_reference
|
||||
}
|
||||
onChange={(event) =>
|
||||
form.setData(
|
||||
'person_reference',
|
||||
event.target.value,
|
||||
)
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
<label className="block">
|
||||
Referência documental da candidatura
|
||||
<input
|
||||
className={controlClass}
|
||||
required
|
||||
maxLength={200}
|
||||
value={form.data.reference}
|
||||
onChange={(e) =>
|
||||
form.setData('reference', e.target.value)
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
<label className="block">
|
||||
Recebida em
|
||||
<input
|
||||
className={controlClass}
|
||||
type="date"
|
||||
required
|
||||
value={form.data.received_on}
|
||||
onChange={(e) =>
|
||||
form.setData('received_on', e.target.value)
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
<label className="block">
|
||||
Resumo profissional pertinente
|
||||
<textarea
|
||||
className={controlClass}
|
||||
required
|
||||
minLength={10}
|
||||
maxLength={5000}
|
||||
value={form.data.summary}
|
||||
onChange={(e) =>
|
||||
form.setData('summary', e.target.value)
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
</>
|
||||
)}
|
||||
{candidateChoice && (
|
||||
<label className="block">
|
||||
Candidatura
|
||||
<select
|
||||
className={controlClass}
|
||||
required
|
||||
value={form.data.application_id}
|
||||
onChange={(e) =>
|
||||
form.setData('application_id', e.target.value)
|
||||
}
|
||||
>
|
||||
<option value="">Seleccione</option>
|
||||
{candidates.map((c) => (
|
||||
<option key={c.id} value={c.id}>
|
||||
{c.name} · {c.reference}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
)}
|
||||
{command === 'evaluate' &&
|
||||
p.rules.criteria.map((criterion, index) => (
|
||||
<fieldset
|
||||
key={index}
|
||||
className="space-y-3 rounded-lg border p-4"
|
||||
>
|
||||
<legend>
|
||||
{criterion.label} · {criterion.weight}%
|
||||
</legend>
|
||||
<label className="block">
|
||||
Pontuação (0 a 10)
|
||||
<input
|
||||
className={controlClass}
|
||||
type="number"
|
||||
min="0"
|
||||
max="10"
|
||||
step="0.01"
|
||||
required
|
||||
value={form.data.answers[index].score}
|
||||
onChange={(e) =>
|
||||
form.setData(
|
||||
'answers',
|
||||
form.data.answers.map((a, i) =>
|
||||
i === index
|
||||
? {
|
||||
...a,
|
||||
score: e.target.value,
|
||||
}
|
||||
: a,
|
||||
),
|
||||
)
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
<label className="block">
|
||||
Evidência e fundamento
|
||||
<textarea
|
||||
className={controlClass}
|
||||
required
|
||||
minLength={10}
|
||||
maxLength={2000}
|
||||
value={form.data.answers[index].evidence}
|
||||
onChange={(e) =>
|
||||
form.setData(
|
||||
'answers',
|
||||
form.data.answers.map((a, i) =>
|
||||
i === index
|
||||
? {
|
||||
...a,
|
||||
evidence:
|
||||
e.target.value,
|
||||
}
|
||||
: a,
|
||||
),
|
||||
)
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
<label className="block">
|
||||
Tipo de evidência
|
||||
<select
|
||||
className={controlClass}
|
||||
required
|
||||
value={
|
||||
form.data.answers[index].evidence_type
|
||||
}
|
||||
onChange={(e) =>
|
||||
form.setData(
|
||||
'answers',
|
||||
form.data.answers.map((a, i) =>
|
||||
i === index
|
||||
? {
|
||||
...a,
|
||||
evidence_type:
|
||||
e.target.value,
|
||||
}
|
||||
: a,
|
||||
),
|
||||
)
|
||||
}
|
||||
>
|
||||
<option value="">Seleccione</option>
|
||||
<option value="reported">
|
||||
Relatada pela pessoa candidata
|
||||
</option>
|
||||
<option value="observed">
|
||||
Observada na entrevista ou exercício
|
||||
</option>
|
||||
<option value="verified">
|
||||
Comprovada por fonte verificável
|
||||
</option>
|
||||
</select>
|
||||
</label>
|
||||
<label className="block">
|
||||
Esclarecimentos necessários
|
||||
<textarea
|
||||
className={controlClass}
|
||||
maxLength={2000}
|
||||
value={
|
||||
form.data.answers[index].clarification
|
||||
}
|
||||
onChange={(e) =>
|
||||
form.setData(
|
||||
'answers',
|
||||
form.data.answers.map((a, i) =>
|
||||
i === index
|
||||
? {
|
||||
...a,
|
||||
clarification:
|
||||
e.target.value,
|
||||
}
|
||||
: a,
|
||||
),
|
||||
)
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
</fieldset>
|
||||
))}
|
||||
{command === 'confirm' && (
|
||||
<label className="block">
|
||||
Decisão
|
||||
<select
|
||||
className={controlClass}
|
||||
value={form.data.outcome}
|
||||
onChange={(e) =>
|
||||
form.setData('outcome', e.target.value)
|
||||
}
|
||||
>
|
||||
<option value="approved">Aprovar selecção</option>
|
||||
<option value="returned">
|
||||
Devolver para análise
|
||||
</option>
|
||||
</select>
|
||||
</label>
|
||||
)}
|
||||
{command === 'contract' && (
|
||||
<>
|
||||
<p className="text-sm">
|
||||
Preparação interna de minuta. Não comprova
|
||||
assinatura, admissão efectiva nem prestação de
|
||||
serviço.
|
||||
</p>
|
||||
<label className="block">
|
||||
Referência da minuta
|
||||
<input
|
||||
className={controlClass}
|
||||
required
|
||||
maxLength={200}
|
||||
value={form.data.reference}
|
||||
onChange={(e) =>
|
||||
form.setData('reference', e.target.value)
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
<label className="block">
|
||||
Início proposto
|
||||
<input
|
||||
className={controlClass}
|
||||
type="date"
|
||||
required
|
||||
value={form.data.starts_on}
|
||||
onChange={(e) =>
|
||||
form.setData('starts_on', e.target.value)
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
<label className="block">
|
||||
Condições propostas
|
||||
<textarea
|
||||
className={controlClass}
|
||||
required
|
||||
minLength={20}
|
||||
maxLength={10000}
|
||||
value={form.data.terms}
|
||||
onChange={(e) =>
|
||||
form.setData('terms', e.target.value)
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
</>
|
||||
)}
|
||||
<label className="block">
|
||||
Fundamento{' '}
|
||||
{command === 'select'
|
||||
? '(inclua a justificação de eventual empate)'
|
||||
: ''}
|
||||
<textarea
|
||||
className={controlClass}
|
||||
required
|
||||
minLength={10}
|
||||
maxLength={5000}
|
||||
value={form.data.reason}
|
||||
onChange={(e) => form.setData('reason', e.target.value)}
|
||||
/>
|
||||
</label>
|
||||
{['open', 'evaluate', 'select', 'confirm', 'contract'].includes(
|
||||
command,
|
||||
) && (
|
||||
<label className="flex gap-3">
|
||||
<input
|
||||
type="checkbox"
|
||||
required
|
||||
checked={form.data.no_conflict}
|
||||
onChange={(e) =>
|
||||
form.setData('no_conflict', e.target.checked)
|
||||
}
|
||||
/>
|
||||
Declaro não ter conflito de interesses neste processo e
|
||||
nesta intervenção.
|
||||
</label>
|
||||
)}
|
||||
<Button disabled={form.processing}>{commands[command]}</Button>
|
||||
</form>
|
||||
</Panel>
|
||||
);
|
||||
}
|
||||
|
||||
export default function PeopleShow({
|
||||
process: p,
|
||||
candidates,
|
||||
canPrepare,
|
||||
canViewElectronicSources = false,
|
||||
canReview,
|
||||
canApprove = false,
|
||||
canContract = false,
|
||||
canManage = false,
|
||||
formFields = {},
|
||||
clarifications,
|
||||
brief,
|
||||
aiPreparation,
|
||||
registry,
|
||||
history,
|
||||
}: {
|
||||
process: Process;
|
||||
candidates: Candidate[];
|
||||
canPrepare: boolean;
|
||||
canViewElectronicSources?: boolean;
|
||||
canReview: boolean;
|
||||
canApprove?: boolean;
|
||||
canContract?: boolean;
|
||||
canManage?: boolean;
|
||||
formFields?: Record<string, string>;
|
||||
clarifications?: ClarificationData;
|
||||
brief?: EvidenceBriefData | null;
|
||||
aiPreparation?: AiPreparation;
|
||||
registry?: RegistryChoice;
|
||||
history: {
|
||||
id: number;
|
||||
action: string;
|
||||
user_id: number;
|
||||
created_at: string;
|
||||
}[];
|
||||
}) {
|
||||
const actions = [
|
||||
...(canReview && p.status === 'draft' ? ['open'] : []),
|
||||
...(canPrepare && p.status === 'open' ? ['apply', 'close'] : []),
|
||||
...(canReview && p.status === 'assessment' ? ['evaluate'] : []),
|
||||
...(canPrepare && p.status === 'assessment' ? ['select'] : []),
|
||||
...(canApprove && p.status === 'selection_review' ? ['confirm'] : []),
|
||||
...(canContract && p.status === 'selected' ? ['contract'] : []),
|
||||
];
|
||||
const rows =
|
||||
p.selection &&
|
||||
['selection_review', 'selected', 'contract_draft'].includes(p.status)
|
||||
? p.selection.rows
|
||||
: candidates;
|
||||
return (
|
||||
<>
|
||||
<Head title={p.title} />
|
||||
<div className="mx-auto max-w-6xl space-y-6 p-5 lg:p-8">
|
||||
<PageTitle
|
||||
eyebrow={
|
||||
p.kind === 'service'
|
||||
? 'Prestador individual'
|
||||
: 'Recrutamento de trabalhador'
|
||||
}
|
||||
title={p.title}
|
||||
description={`${states[p.status] ?? p.status} · PES-${p.id}`}
|
||||
action={
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={() => window.print()}
|
||||
>
|
||||
Imprimir relatório
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
<Link className="underline" href="/pessoas">
|
||||
Voltar a Pessoas e contratações
|
||||
</Link>
|
||||
{(canPrepare || canViewElectronicSources) && (
|
||||
<Link
|
||||
className="block underline"
|
||||
href={`/pessoas/${p.id}/recebidas`}
|
||||
>
|
||||
Publicação e candidaturas electrónicas recebidas
|
||||
</Link>
|
||||
)}
|
||||
{canManage && (
|
||||
<Link
|
||||
className="underline print:hidden"
|
||||
href={`/pessoas/${p.id}/acessos`}
|
||||
>
|
||||
Organizar equipa e permissões deste processo
|
||||
</Link>
|
||||
)}
|
||||
{p.rules.submission_form && (
|
||||
<Panel
|
||||
title={`Formulário de candidatura — versão ${p.rules.submission_form.version}`}
|
||||
>
|
||||
<p>
|
||||
Definição preservada na preparação deste processo.
|
||||
Portal externo em desenvolvimento.
|
||||
</p>
|
||||
<p>
|
||||
{p.rules.submission_form.definition.available
|
||||
? 'Modalidade prevista para recepção.'
|
||||
: 'Modalidade indisponível para novas submissões externas.'}
|
||||
</p>
|
||||
<ul>
|
||||
{p.rules.submission_form.definition.fields.map(
|
||||
(field) => (
|
||||
<li key={field.key}>
|
||||
{field.label} ·{' '}
|
||||
{field.required
|
||||
? 'Obrigatório'
|
||||
: 'Opcional'}
|
||||
</li>
|
||||
),
|
||||
)}
|
||||
{p.rules.submission_form.definition.documents.map(
|
||||
(document) => (
|
||||
<li key={document.key}>
|
||||
{document.label} ·{' '}
|
||||
{document.required
|
||||
? 'Obrigatório'
|
||||
: 'Opcional'}
|
||||
</li>
|
||||
),
|
||||
)}
|
||||
</ul>
|
||||
</Panel>
|
||||
)}
|
||||
{p.rules.annex && (
|
||||
<Panel
|
||||
title={`Anexo ${p.rules.annex.template} — versão ${p.rules.annex.version}`}
|
||||
>
|
||||
<dl className="space-y-3">
|
||||
{Object.entries(p.rules.annex.fields)
|
||||
.filter(([, value]) => value)
|
||||
.map(([key, value]) => (
|
||||
<div key={key}>
|
||||
<dt className="font-medium">
|
||||
{formFields[key] ?? key}
|
||||
</dt>
|
||||
<dd className="whitespace-pre-wrap">
|
||||
{value}
|
||||
</dd>
|
||||
</div>
|
||||
))}
|
||||
</dl>
|
||||
<h3 className="mt-5 font-semibold">
|
||||
Requisitos e verificação
|
||||
</h3>
|
||||
{p.rules.annex.requirements.map((r, index) => (
|
||||
<section
|
||||
key={index}
|
||||
className="mt-3 rounded border p-3"
|
||||
>
|
||||
<strong>
|
||||
{r.classification === 'mandatory'
|
||||
? 'Obrigatório'
|
||||
: 'Desejável'}{' '}
|
||||
· {r.description}
|
||||
</strong>
|
||||
<p>Verificação: {r.verification}</p>
|
||||
{r.equivalences && (
|
||||
<p>
|
||||
Equivalências e adaptações:{' '}
|
||||
{r.equivalences}
|
||||
</p>
|
||||
)}
|
||||
</section>
|
||||
))}
|
||||
</Panel>
|
||||
)}
|
||||
{brief && <EvidenceBrief data={brief} />}
|
||||
{aiPreparation && <AiPreparationPreview data={aiPreparation} />}
|
||||
<Panel
|
||||
id="people-report-scope"
|
||||
title="Âmbito e critérios preservados"
|
||||
>
|
||||
<p className="whitespace-pre-wrap">{p.purpose}</p>
|
||||
<p className="my-3">
|
||||
Candidaturas até {p.closes_on} ·{' '}
|
||||
{p.rules.minimum_reviews} avaliador(es) independente(s)
|
||||
por pessoa.
|
||||
</p>
|
||||
<ul className="list-disc pl-5">
|
||||
{p.rules.criteria.map((c, i) => (
|
||||
<li key={i}>
|
||||
{c.label} · {c.weight}%
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</Panel>
|
||||
<Panel
|
||||
id="people-report-candidates"
|
||||
title="Candidaturas e avaliação"
|
||||
description="Pontuações pela média das avaliações elegíveis. Empates exigem escolha fundamentada, sem selecção automática."
|
||||
>
|
||||
<div className="space-y-4">
|
||||
{rows.map((c) => (
|
||||
<section
|
||||
className="rounded-lg border p-4"
|
||||
key={c.id}
|
||||
>
|
||||
{c.registry_source && (
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Cadastro {c.registry_source.reference} ·
|
||||
versão utilizada{' '}
|
||||
{c.registry_source.version}
|
||||
</p>
|
||||
)}
|
||||
{c.electronic_source && (
|
||||
<p className="text-sm">
|
||||
Submissão electrónica{' '}
|
||||
{c.electronic_source.reference} · perfil
|
||||
v{c.electronic_source.profile_version}
|
||||
{canViewElectronicSources && (
|
||||
<Link
|
||||
className="ml-2 underline"
|
||||
href={`/pessoas/${p.id}/recebidas?submission=${c.electronic_source.submission_id}`}
|
||||
>
|
||||
Consultar dados enviados
|
||||
</Link>
|
||||
)}
|
||||
</p>
|
||||
)}
|
||||
<strong>
|
||||
{c.name} · {c.reference}
|
||||
</strong>
|
||||
<p>
|
||||
Recebida em {c.received_on} ·{' '}
|
||||
{c.evaluation_count} avaliação(ões) ·{' '}
|
||||
{c.score_minor === null
|
||||
? 'Por concluir'
|
||||
: `${(c.score_minor / 100).toFixed(2)} / 10`}
|
||||
{c.id === p.selected_application_id
|
||||
? p.status === 'selection_review'
|
||||
? ' · Candidatura proposta'
|
||||
: ' · Pessoa seleccionada'
|
||||
: ''}
|
||||
</p>
|
||||
<p className="text-sm whitespace-pre-wrap">
|
||||
{c.summary}
|
||||
</p>
|
||||
{c.reviews.map((r) => (
|
||||
<details key={r.id} className="mt-3">
|
||||
<summary>
|
||||
Avaliação #{r.id} · pessoa #
|
||||
{r.reviewed_by} · {r.created_at}
|
||||
</summary>
|
||||
<p>{r.reason}</p>
|
||||
{r.answers.map((a, i) => (
|
||||
<p key={i}>
|
||||
{p.rules.criteria[i]?.label}:{' '}
|
||||
{a.score}/10 · {a.evidence}
|
||||
<span className="block">
|
||||
Evidência:{' '}
|
||||
{{
|
||||
reported: 'relatada',
|
||||
observed: 'observada',
|
||||
verified: 'comprovada',
|
||||
}[a.evidence_type ?? ''] ??
|
||||
'não classificada no registo inicial'}
|
||||
{a.clarification
|
||||
? ` · Esclarecimento registado na avaliação: ${a.clarification}`
|
||||
: ''}
|
||||
</span>
|
||||
</p>
|
||||
))}
|
||||
</details>
|
||||
))}
|
||||
</section>
|
||||
))}
|
||||
{!rows.length && <p>Sem candidaturas registadas.</p>}
|
||||
</div>
|
||||
</Panel>
|
||||
{p.selection && (
|
||||
<Panel
|
||||
id="people-report-selection"
|
||||
title="Fundamento da selecção"
|
||||
>
|
||||
<p className="whitespace-pre-wrap">
|
||||
{p.selection.reason}
|
||||
</p>
|
||||
{p.selection.decision_reason && (
|
||||
<p className="mt-3 whitespace-pre-wrap">
|
||||
Conferência: {p.selection.decision_reason}
|
||||
</p>
|
||||
)}
|
||||
</Panel>
|
||||
)}
|
||||
{p.contract && (
|
||||
<Panel
|
||||
id="people-report-contract"
|
||||
title="Minuta contratual — preparação interna"
|
||||
>
|
||||
<p>
|
||||
{p.contract.reference} · início proposto{' '}
|
||||
{p.contract.starts_on}
|
||||
</p>
|
||||
<p className="whitespace-pre-wrap">
|
||||
{p.contract.terms}
|
||||
</p>
|
||||
<p className="mt-3 text-sm">
|
||||
Não comprova assinatura ou contratação concluída.
|
||||
</p>
|
||||
</Panel>
|
||||
)}
|
||||
<PeopleClarifications processId={p.id} data={clarifications} />
|
||||
<div className="space-y-6 print:hidden">
|
||||
{actions.map((command) => (
|
||||
<div
|
||||
id={`people-${command}`}
|
||||
className="scroll-mt-24"
|
||||
key={`${command}-${p.version}`}
|
||||
>
|
||||
<Action
|
||||
key={`${command}-${p.version}`}
|
||||
registry={registry}
|
||||
process={p}
|
||||
candidates={candidates}
|
||||
command={command}
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<Panel title="Histórico">
|
||||
<ol className="space-y-2 text-sm">
|
||||
{history.map((h) => (
|
||||
<li key={h.id}>
|
||||
{h.created_at} · {h.action} · pessoa #
|
||||
{h.user_id}
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
</Panel>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user