@@ -1,23 +1,197 @@
|
||||
import type { ReactNode } from 'react';
|
||||
|
||||
export default function Blank({ disclaimer }: { disclaimer: string }) {
|
||||
return <main className="mx-auto max-w-4xl space-y-6 p-8 print:max-w-none print:p-0">
|
||||
<div className="flex justify-end print:hidden"><button className="rounded border px-4 py-2" onClick={() => window.print()}>Imprimir / guardar como PDF</button></div>
|
||||
<header className="space-y-2 border-b pb-4"><p>InvestMoz · modelo de preparação · versão land-assistance-v1</p><h1 className="text-2xl font-bold">Formulário de orientação e preparação — Terra e DUAT</h1><p>{disclaimer}</p></header>
|
||||
<p>Preencha apenas o que sabe. Use “Não sei” ou “Por confirmar”. Este modelo imprimível não é um PDF electrónico preenchível nem formulário oficial.</p>
|
||||
<Section title="A. Tipo de apoio"><Lines items={['Terra para investimento', 'Habitação', 'Exploração familiar', 'Reconhecimento ou titulação de área ocupada', 'Regularização cadastral', 'Delimitação ou demarcação', 'Alteração de uso/área', 'Transmissão/herança', 'Acompanhamento de processo', 'Conflito/restrição', 'Outro']} /><Line label="Descrição do pedido" /><Line label="Modalidade invocada, se conhecida" /><Line label="Projecto ou oportunidade no InvestMoz" /></Section>
|
||||
<Section title="B. Requerente"><Lines items={['Pessoa singular', 'Pessoa colectiva', 'Comunidade', 'Outra categoria']} /><Line label="Nome ou denominação" /><Line label="Pessoa de contacto" /><Line label="Email" /><Line label="Telefone" /><Line label="Canal preferido de resposta" /><Line label="País/nacionalidade (se aplicável)" /><Line label="Representante, qualidade e fundamento (se aplicável)" /><Line label="NUIT/identificação (apenas se necessário ao acto concreto)" /></Section>
|
||||
<Section title="C. Localização"><Lines items={['Tenho área identificada', 'Procuro localização', 'Preciso de apoio para localizar']} />{['Província','Distrito/município','Posto administrativo','Localidade/bairro/comunidade','Descrição do local','Área e unidade','Referência cadastral (se existente)','Coordenadas/planta (se disponíveis)'].map((label) => <Line key={label} label={label} />)}</Section>
|
||||
<Section title="D. Finalidade e situação conhecida"><Line label="Uso pretendido e actividade, se aplicável" />{['Ocupantes/utilizações conhecidas? Sim / Não segundo informação disponível / Não sei','Descrição','Construções, benfeitorias, machambas, servidões ou usos comunitários?','Título, autorização ou antecedentes?','Conflito, oposição ou possível sobreposição?','Descrição'].map((label) => <Line key={label} label={label} />)}<p>As respostas são declarações do requerente, não conclusões cadastrais.</p></Section>
|
||||
<Section title="E. Processo existente"><Line label="Número oficial, se já atribuído" /><Line label="Entidade receptora e data apresentada" /><Line label="Estado comunicado pela entidade" /><Line label="Pendências e comprovativo disponível" /></Section>
|
||||
<Section title="F. Plano de exploração, se aplicável"><p>Indique períodos livremente; não existe duração obrigatória presumida por este modelo.</p>{['Actividade e período','Área/unidade','Existente ou planeado','Metas e construções','Investimento previsto'].map((label) => <Line key={label} label={label} />)}</Section>
|
||||
<Section title="G. Consulta comunitária e pareceres"><p>Esta secção serve apenas para preparar/registar informação. Não declarar consulta realizada sem evidência.</p>{['Comunidade/local/data','Participantes e funções','Língua/tradução','Intervenções e divergências','Oposição','Acordos e compromissos','Acta, assinaturas e pareceres recebidos'].map((label) => <Line key={label} label={label} />)}</Section>
|
||||
<Section title="H. Documentos opcionais nesta fase"><Lines items={['Planta/esboço','Título ou antecedente','Plano de exploração','Recibo/comunicação oficial','Acta de consulta','Fotografias','Outros']} /><Line label="Informação complementar" /></Section>
|
||||
<footer className="space-y-2 border-t pt-4"><p>Confirmo que os dados correspondem à informação de que disponho e que identifiquei as dúvidas conhecidas.</p><Line label="Data, nome do requerente/representante e assinatura (só na versão impressa, quando aplicável)"/><p className="font-semibold">{disclaimer}</p></footer>
|
||||
<style>{'@media print { button { display: none } section { break-inside: avoid } }'}</style>
|
||||
</main>;
|
||||
return (
|
||||
<main className="mx-auto max-w-4xl space-y-6 p-8 print:max-w-none print:p-0">
|
||||
<div className="flex justify-end print:hidden">
|
||||
<button
|
||||
className="rounded border px-4 py-2"
|
||||
onClick={() => window.print()}
|
||||
>
|
||||
Imprimir / guardar como PDF
|
||||
</button>
|
||||
</div>
|
||||
<header className="space-y-2 border-b pb-4">
|
||||
<p>
|
||||
InvestMoz · modelo de preparação · versão land-assistance-v1
|
||||
</p>
|
||||
<h1 className="text-2xl font-bold">
|
||||
Formulário de orientação e preparação — Terra e DUAT
|
||||
</h1>
|
||||
<p>{disclaimer}</p>
|
||||
</header>
|
||||
<p>
|
||||
Preencha apenas o que sabe. Use “Não sei” ou “Por confirmar”.
|
||||
Este modelo imprimível não é um PDF electrónico preenchível nem
|
||||
formulário oficial.
|
||||
</p>
|
||||
<Section title="A. Tipo de apoio">
|
||||
<Lines
|
||||
items={[
|
||||
'Terra para investimento',
|
||||
'Habitação',
|
||||
'Exploração familiar',
|
||||
'Reconhecimento ou titulação de área ocupada',
|
||||
'Regularização cadastral',
|
||||
'Delimitação ou demarcação',
|
||||
'Alteração de uso/área',
|
||||
'Transmissão/herança',
|
||||
'Acompanhamento de processo',
|
||||
'Conflito/restrição',
|
||||
'Outro',
|
||||
]}
|
||||
/>
|
||||
<Line label="Descrição do pedido" />
|
||||
<Line label="Modalidade invocada, se conhecida" />
|
||||
<Line label="Projecto ou oportunidade no InvestMoz" />
|
||||
</Section>
|
||||
<Section title="B. Requerente">
|
||||
<Lines
|
||||
items={[
|
||||
'Pessoa singular',
|
||||
'Pessoa colectiva',
|
||||
'Comunidade',
|
||||
'Outra categoria',
|
||||
]}
|
||||
/>
|
||||
<Line label="Nome ou denominação" />
|
||||
<Line label="Pessoa de contacto" />
|
||||
<Line label="Email" />
|
||||
<Line label="Telefone" />
|
||||
<Line label="Canal preferido de resposta" />
|
||||
<Line label="País/nacionalidade (se aplicável)" />
|
||||
<Line label="Representante, qualidade e fundamento (se aplicável)" />
|
||||
<Line label="NUIT/identificação (apenas se necessário ao acto concreto)" />
|
||||
</Section>
|
||||
<Section title="C. Localização">
|
||||
<Lines
|
||||
items={[
|
||||
'Tenho área identificada',
|
||||
'Procuro localização',
|
||||
'Preciso de apoio para localizar',
|
||||
]}
|
||||
/>
|
||||
{[
|
||||
'Província',
|
||||
'Distrito/município',
|
||||
'Posto administrativo',
|
||||
'Localidade/bairro/comunidade',
|
||||
'Descrição do local',
|
||||
'Área e unidade',
|
||||
'Referência cadastral (se existente)',
|
||||
'Coordenadas/planta (se disponíveis)',
|
||||
].map((label) => (
|
||||
<Line key={label} label={label} />
|
||||
))}
|
||||
</Section>
|
||||
<Section title="D. Finalidade e situação conhecida">
|
||||
<Line label="Uso pretendido e actividade, se aplicável" />
|
||||
{[
|
||||
'Ocupantes/utilizações conhecidas? Sim / Não segundo informação disponível / Não sei',
|
||||
'Descrição',
|
||||
'Construções, benfeitorias, machambas, servidões ou usos comunitários?',
|
||||
'Título, autorização ou antecedentes?',
|
||||
'Conflito, oposição ou possível sobreposição?',
|
||||
'Descrição',
|
||||
].map((label) => (
|
||||
<Line key={label} label={label} />
|
||||
))}
|
||||
<p>
|
||||
As respostas são declarações do requerente, não conclusões
|
||||
cadastrais.
|
||||
</p>
|
||||
</Section>
|
||||
<Section title="E. Processo existente">
|
||||
<Line label="Número oficial, se já atribuído" />
|
||||
<Line label="Entidade receptora e data apresentada" />
|
||||
<Line label="Estado comunicado pela entidade" />
|
||||
<Line label="Pendências e comprovativo disponível" />
|
||||
</Section>
|
||||
<Section title="F. Plano de exploração, se aplicável">
|
||||
<p>
|
||||
Indique períodos livremente; não existe duração obrigatória
|
||||
presumida por este modelo.
|
||||
</p>
|
||||
{[
|
||||
'Actividade e período',
|
||||
'Área/unidade',
|
||||
'Existente ou planeado',
|
||||
'Metas e construções',
|
||||
'Investimento previsto',
|
||||
].map((label) => (
|
||||
<Line key={label} label={label} />
|
||||
))}
|
||||
</Section>
|
||||
<Section title="G. Consulta comunitária e pareceres">
|
||||
<p>
|
||||
Esta secção serve apenas para preparar/registar informação.
|
||||
Não declarar consulta realizada sem evidência.
|
||||
</p>
|
||||
{[
|
||||
'Comunidade/local/data',
|
||||
'Participantes e funções',
|
||||
'Língua/tradução',
|
||||
'Intervenções e divergências',
|
||||
'Oposição',
|
||||
'Acordos e compromissos',
|
||||
'Acta, assinaturas e pareceres recebidos',
|
||||
].map((label) => (
|
||||
<Line key={label} label={label} />
|
||||
))}
|
||||
</Section>
|
||||
<Section title="H. Documentos opcionais nesta fase">
|
||||
<Lines
|
||||
items={[
|
||||
'Planta/esboço',
|
||||
'Título ou antecedente',
|
||||
'Plano de exploração',
|
||||
'Recibo/comunicação oficial',
|
||||
'Acta de consulta',
|
||||
'Fotografias',
|
||||
'Outros',
|
||||
]}
|
||||
/>
|
||||
<Line label="Informação complementar" />
|
||||
</Section>
|
||||
<footer className="space-y-2 border-t pt-4">
|
||||
<p>
|
||||
Confirmo que os dados correspondem à informação de que
|
||||
disponho e que identifiquei as dúvidas conhecidas.
|
||||
</p>
|
||||
<Line label="Data, nome do requerente/representante e assinatura (só na versão impressa, quando aplicável)" />
|
||||
<p className="font-semibold">{disclaimer}</p>
|
||||
</footer>
|
||||
<style>
|
||||
{
|
||||
'@media print { button { display: none } section { break-inside: avoid } }'
|
||||
}
|
||||
</style>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
function Section({ title, children }: { title: string; children: ReactNode }) { return <section className="space-y-3 rounded border p-4"><h2 className="text-lg font-bold">{title}</h2>{children}</section>; }
|
||||
function Line({ label }: { label: string }) { return <div className="space-y-1"><span className="text-sm">{label}</span><div className="min-h-8 border-b border-dotted border-slate-500" /></div>; }
|
||||
function Lines({ items }: { items: string[] }) { return <div className="grid gap-2 sm:grid-cols-2">{items.map((item) => <div key={item}>☐ {item}</div>)}</div>; }
|
||||
function Section({ title, children }: { title: string; children: ReactNode }) {
|
||||
return (
|
||||
<section className="space-y-3 rounded border p-4">
|
||||
<h2 className="text-lg font-bold">{title}</h2>
|
||||
{children}
|
||||
</section>
|
||||
);
|
||||
}
|
||||
function Line({ label }: { label: string }) {
|
||||
return (
|
||||
<div className="space-y-1">
|
||||
<span className="text-sm">{label}</span>
|
||||
<div className="min-h-8 border-b border-dotted border-slate-500" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
function Lines({ items }: { items: string[] }) {
|
||||
return (
|
||||
<div className="grid gap-2 sm:grid-cols-2">
|
||||
{items.map((item) => (
|
||||
<div key={item}>☐ {item}</div>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,34 +2,433 @@ import { Link, router, useForm } from '@inertiajs/react';
|
||||
import { useState } from 'react';
|
||||
|
||||
type Props = {
|
||||
case: { id: string; reference: string; version: number; status: string; payload: Record<string, any>; updated_at: string };
|
||||
documents: { id: string; category: string; file_name: string; status: 'active'|'quarantined' }[];
|
||||
events: { action: string; version: number; metadata: Record<string, unknown>; created_at: string }[];
|
||||
case: {
|
||||
id: string;
|
||||
reference: string;
|
||||
version: number;
|
||||
status: string;
|
||||
payload: Record<string, any>;
|
||||
updated_at: string;
|
||||
};
|
||||
documents: {
|
||||
id: string;
|
||||
category: string;
|
||||
file_name: string;
|
||||
status: 'active' | 'quarantined';
|
||||
}[];
|
||||
events: {
|
||||
action: string;
|
||||
version: number;
|
||||
metadata: Record<string, unknown>;
|
||||
created_at: string;
|
||||
}[];
|
||||
disclaimer: string;
|
||||
management: boolean;
|
||||
};
|
||||
const statusLabels: Record<string,string> = { draft:'Rascunho privado', support_requested:'Apoio solicitado ao InvestMoz', internal_review:'Análise interna', waiting_applicant:'A aguardar informação do requerente', referral_prepared:'Encaminhamento preparado (não submetido)', closed:'Encerrado no InvestMoz' };
|
||||
const actionLabels: Record<string,string> = { draft_created:'Rascunho criado', draft_updated:'Rascunho actualizado', support_requested:'Pedido de apoio registado', status_changed:'Estado interno actualizado', attachment_added:'Documento anexado', applicant_update_recorded:'Actualização comunicada pelo requerente' };
|
||||
const categoryLabels: Record<string,string> = { sketch:'Planta/esboço', prior_right:'Antecedente de direito', exploration_plan:'Plano de exploração', official_receipt:'Recibo/comunicação oficial', consultation_minutes:'Acta/minuta', photo:'Fotografia', other:'Outro' };
|
||||
const statusLabels: Record<string, string> = {
|
||||
draft: 'Rascunho privado',
|
||||
support_requested: 'Apoio solicitado ao InvestMoz',
|
||||
internal_review: 'Análise interna',
|
||||
waiting_applicant: 'A aguardar informação do requerente',
|
||||
referral_prepared: 'Encaminhamento preparado (não submetido)',
|
||||
closed: 'Encerrado no InvestMoz',
|
||||
};
|
||||
const actionLabels: Record<string, string> = {
|
||||
draft_created: 'Rascunho criado',
|
||||
draft_updated: 'Rascunho actualizado',
|
||||
support_requested: 'Pedido de apoio registado',
|
||||
status_changed: 'Estado interno actualizado',
|
||||
attachment_added: 'Documento anexado',
|
||||
applicant_update_recorded: 'Actualização comunicada pelo requerente',
|
||||
};
|
||||
const categoryLabels: Record<string, string> = {
|
||||
sketch: 'Planta/esboço',
|
||||
prior_right: 'Antecedente de direito',
|
||||
exploration_plan: 'Plano de exploração',
|
||||
official_receipt: 'Recibo/comunicação oficial',
|
||||
consultation_minutes: 'Acta/minuta',
|
||||
photo: 'Fotografia',
|
||||
other: 'Outro',
|
||||
};
|
||||
|
||||
export default function LandCase({case: record, documents, events, disclaimer, management}:Props) {
|
||||
const [file,setFile]=useState<File|null>(null);
|
||||
const [category,setCategory]=useState('other');
|
||||
const [status,setStatus]=useState('internal_review');
|
||||
const upload=useForm({version:record.version,category,file:null as File|null});
|
||||
const report=useForm({version:record.version,reported_status:'',official_reference:'',receiving_entity:'',reported_at:''});
|
||||
const change=useForm({version:record.version,status:'internal_review',evidence_reference:''});
|
||||
const canEdit=['draft','waiting_applicant'].includes(record.status);
|
||||
const payload=record.payload??{};
|
||||
const supportKinds:Record<string,string>={investment:'Terra para investimento',home:'Habitação',family_exploitation:'Exploração familiar',recognition:'Reconhecimento/titulação',regularization:'Regularização cadastral',delimitation:'Delimitação/demarcação',change_of_use:'Alteração de uso/área',transfer:'Transmissão/herança',existing_process:'Processo existente',conflict_guidance:'Orientação sobre conflito/restrição',other:'Outro'};
|
||||
return <main className="mx-auto max-w-5xl space-y-6 p-6">
|
||||
<header className="space-y-2"><Link href="/investidor/terra-duat" className="underline">Os meus pedidos Terra e DUAT</Link><h1 className="text-3xl font-bold">Acompanhamento {record.reference}</h1><p>Referência interna InvestMoz · versão {record.version} · {statusLabels[record.status]??record.status}</p><p className="rounded border border-amber-400 bg-amber-50 p-3">{disclaimer}</p>{record.status==='referral_prepared'&&<p className="rounded bg-amber-50 p-3">O encaminhamento foi preparado internamente. Não há confirmação de submissão nem de recepção por entidade pública.</p>}</header>
|
||||
{!management&&canEdit&&<Link className="inline-block rounded border px-4 py-2" href={`/investidor/terra-duat/${record.id}/editar`}>Continuar preenchimento</Link>}
|
||||
{!management&&<Link className="ml-3 inline-block rounded border px-4 py-2" href={`/investidor/terra-duat/${record.id}/imprimir`}>Imprimir / guardar cópia preenchida como PDF</Link>}
|
||||
<section className="grid gap-4 rounded border p-4 sm:grid-cols-2"><h2 className="sm:col-span-2 text-xl font-semibold">Resumo informado pelo requerente</h2><p><strong>Tipo:</strong> {supportKinds[payload.support_kind]??'Por indicar'}</p><p><strong>Requerente:</strong> {payload.full_name??'Por indicar'}</p><p><strong>Categoria:</strong> {payload.applicant_category??'Por indicar'}</p><p><strong>Contacto preferido:</strong> {payload.preferred_contact??'Por indicar'}</p><p className="sm:col-span-2"><strong>Descrição:</strong> {payload.request_description??'Por indicar'}</p><p className="sm:col-span-2"><strong>Uso pretendido:</strong> {payload.purpose??'Por indicar'}</p><p className="sm:col-span-2"><strong>Localização declarada:</strong> {(payload.parcels??[]).map((parcel:any)=>parcel.place_description).filter(Boolean).join('; ')||'Por localizar/confirmar'}</p><p className="sm:col-span-2 text-sm">Dados e situação geográfica aqui exibidos são declarações do requerente; não confirmam direitos ou disponibilidade cadastral.</p></section>
|
||||
{!management&&<section className="space-y-3 rounded border p-4"><h2 className="text-xl font-semibold">Comunicar actualização</h2><p className="text-sm">A informação fica identificada como comunicada por si e não é confirmada automaticamente pelo InvestMoz.</p><label className="block space-y-1"><span>Actualização do estado *</span><textarea className="w-full rounded border p-2" value={report.data.reported_status} onChange={e=>report.setData('reported_status',e.target.value)} maxLength={1000}/></label><div className="grid gap-3 sm:grid-cols-3"><label>Referência oficial (se tiver)<input className="mt-1 w-full rounded border p-2" value={report.data.official_reference} onChange={e=>report.setData('official_reference',e.target.value)}/></label><label>Entidade indicada<input className="mt-1 w-full rounded border p-2" value={report.data.receiving_entity} onChange={e=>report.setData('receiving_entity',e.target.value)}/></label><label>Data indicada<input type="date" className="mt-1 w-full rounded border p-2" value={report.data.reported_at} onChange={e=>report.setData('reported_at',e.target.value)}/></label></div><button className="rounded border px-4 py-2" disabled={!report.data.reported_status||report.processing} onClick={()=>router.post(`/investidor/terra-duat/${record.id}/actualizacoes`,report.data,{preserveScroll:true})}>Registar informação comunicada</button></section>}
|
||||
<section className="space-y-3 rounded border p-4"><h2 className="text-xl font-semibold">Documentos anexados</h2>{documents.map((document)=><p key={document.id}>{document.status==='active'?<a className="underline" href={`/investidor/terra-duat/${record.id}/documentos/${document.id}`}>{categoryLabels[document.category]??document.category}: {document.file_name}</a>:<span>{categoryLabels[document.category]??document.category}: {document.file_name} · em quarentena; leitura/descarga bloqueada até verificação</span>}</p>)}{!documents.length&&<p>Nenhum documento anexado. Anexos são opcionais nesta fase.</p>}{!management&&record.status!=='closed'&&<div className="grid gap-3 sm:grid-cols-3"><label>Categoria<select className="mt-1 w-full rounded border p-2" value={category} onChange={e=>setCategory(e.target.value)}>{Object.entries(categoryLabels).map(([key,label])=><option value={key} key={key}>{label}</option>)}</select></label><label className="sm:col-span-2">Ficheiro PDF/JPG/PNG (até 10 MB)<input className="mt-1 w-full rounded border p-2" type="file" accept=".pdf,.jpg,.jpeg,.png" onChange={e=>setFile(e.target.files?.[0]??null)}/></label><button className="rounded border px-4 py-2" disabled={!file||upload.processing} onClick={()=>router.post(`/investidor/terra-duat/${record.id}/documentos`,{version:record.version,category,file},{forceFormData:true,preserveScroll:true})}>Anexar em espaço privado</button></div>}<p className="text-sm">Os ficheiros são reservados; anexar não equivale a verificação, validação cadastral ou parecer oficial. O ambiente não tem antivírus configurado, por isso os uploads ficam em quarentena e não podem ser descarregados até verificação.</p></section>
|
||||
<section className="space-y-3 rounded border p-4"><h2 className="text-xl font-semibold">Histórico no InvestMoz</h2>{events.map((event,index)=><div className="border-l-2 pl-3" key={`${event.version}-${index}`}><p className="font-medium">{actionLabels[event.action]??event.action}</p><p className="text-sm">{new Date(event.created_at).toLocaleString('pt-MZ')} · versão {event.version}</p>{event.action==='applicant_update_recorded'&&<p className="text-xs">Actualização comunicada pelo requerente; não verificada externamente.</p>}{event.action==='status_changed'&&event.metadata?.external_submission_confirmed===false&&<p className="text-xs">Transição de estado interno; submissão oficial não confirmada.</p>}</div>)}</section>
|
||||
{management&&<section className="space-y-3 rounded border border-slate-400 p-4"><h2 className="text-xl font-semibold">Gestão interna</h2><label className="block">Estado interno<select className="mt-1 w-full rounded border p-2" value={change.data.status} onChange={e=>change.setData('status',e.target.value)}><option value="internal_review">Análise interna</option><option value="waiting_applicant">A aguardar requerente</option><option value="referral_prepared">Encaminhamento preparado (não enviado)</option><option value="closed">Encerrado no InvestMoz</option></select></label>{change.data.status==='referral_prepared'&&<label className="block">Referência interna da preparação<input className="mt-1 w-full rounded border p-2" value={change.data.evidence_reference} onChange={e=>change.setData('evidence_reference',e.target.value)}/></label>}<button className="rounded bg-slate-800 px-4 py-2 text-white" disabled={change.processing} onClick={()=>router.patch(`/management/terra-duat/${record.id}/estado`,{...change.data,version:record.version},{preserveScroll:true})}>Actualizar estado interno</button></section>}
|
||||
</main>;
|
||||
export default function LandCase({
|
||||
case: record,
|
||||
documents,
|
||||
events,
|
||||
disclaimer,
|
||||
management,
|
||||
}: Props) {
|
||||
const [file, setFile] = useState<File | null>(null);
|
||||
const [category, setCategory] = useState('other');
|
||||
const [_status, _setStatus] = useState('internal_review');
|
||||
const upload = useForm({
|
||||
version: record.version,
|
||||
category,
|
||||
file: null as File | null,
|
||||
});
|
||||
const report = useForm({
|
||||
version: record.version,
|
||||
reported_status: '',
|
||||
official_reference: '',
|
||||
receiving_entity: '',
|
||||
reported_at: '',
|
||||
});
|
||||
const change = useForm({
|
||||
version: record.version,
|
||||
status: 'internal_review',
|
||||
evidence_reference: '',
|
||||
});
|
||||
const canEdit = ['draft', 'waiting_applicant'].includes(record.status);
|
||||
const payload = record.payload ?? {};
|
||||
const supportKinds: Record<string, string> = {
|
||||
investment: 'Terra para investimento',
|
||||
home: 'Habitação',
|
||||
family_exploitation: 'Exploração familiar',
|
||||
recognition: 'Reconhecimento/titulação',
|
||||
regularization: 'Regularização cadastral',
|
||||
delimitation: 'Delimitação/demarcação',
|
||||
change_of_use: 'Alteração de uso/área',
|
||||
transfer: 'Transmissão/herança',
|
||||
existing_process: 'Processo existente',
|
||||
conflict_guidance: 'Orientação sobre conflito/restrição',
|
||||
other: 'Outro',
|
||||
};
|
||||
return (
|
||||
<main className="mx-auto max-w-5xl space-y-6 p-6">
|
||||
<header className="space-y-2">
|
||||
<Link href="/investidor/terra-duat" className="underline">
|
||||
Os meus pedidos Terra e DUAT
|
||||
</Link>
|
||||
<h1 className="text-3xl font-bold">
|
||||
Acompanhamento {record.reference}
|
||||
</h1>
|
||||
<p>
|
||||
Referência interna InvestMoz · versão {record.version} ·{' '}
|
||||
{statusLabels[record.status] ?? record.status}
|
||||
</p>
|
||||
<p className="rounded border border-amber-400 bg-amber-50 p-3">
|
||||
{disclaimer}
|
||||
</p>
|
||||
{record.status === 'referral_prepared' && (
|
||||
<p className="rounded bg-amber-50 p-3">
|
||||
O encaminhamento foi preparado internamente. Não há
|
||||
confirmação de submissão nem de recepção por entidade
|
||||
pública.
|
||||
</p>
|
||||
)}
|
||||
</header>
|
||||
{!management && canEdit && (
|
||||
<Link
|
||||
className="inline-block rounded border px-4 py-2"
|
||||
href={`/investidor/terra-duat/${record.id}/editar`}
|
||||
>
|
||||
Continuar preenchimento
|
||||
</Link>
|
||||
)}
|
||||
{!management && (
|
||||
<Link
|
||||
className="ml-3 inline-block rounded border px-4 py-2"
|
||||
href={`/investidor/terra-duat/${record.id}/imprimir`}
|
||||
>
|
||||
Imprimir / guardar cópia preenchida como PDF
|
||||
</Link>
|
||||
)}
|
||||
<section className="grid gap-4 rounded border p-4 sm:grid-cols-2">
|
||||
<h2 className="text-xl font-semibold sm:col-span-2">
|
||||
Resumo informado pelo requerente
|
||||
</h2>
|
||||
<p>
|
||||
<strong>Tipo:</strong>{' '}
|
||||
{supportKinds[payload.support_kind] ?? 'Por indicar'}
|
||||
</p>
|
||||
<p>
|
||||
<strong>Requerente:</strong>{' '}
|
||||
{payload.full_name ?? 'Por indicar'}
|
||||
</p>
|
||||
<p>
|
||||
<strong>Categoria:</strong>{' '}
|
||||
{payload.applicant_category ?? 'Por indicar'}
|
||||
</p>
|
||||
<p>
|
||||
<strong>Contacto preferido:</strong>{' '}
|
||||
{payload.preferred_contact ?? 'Por indicar'}
|
||||
</p>
|
||||
<p className="sm:col-span-2">
|
||||
<strong>Descrição:</strong>{' '}
|
||||
{payload.request_description ?? 'Por indicar'}
|
||||
</p>
|
||||
<p className="sm:col-span-2">
|
||||
<strong>Uso pretendido:</strong>{' '}
|
||||
{payload.purpose ?? 'Por indicar'}
|
||||
</p>
|
||||
<p className="sm:col-span-2">
|
||||
<strong>Localização declarada:</strong>{' '}
|
||||
{(payload.parcels ?? [])
|
||||
.map((parcel: any) => parcel.place_description)
|
||||
.filter(Boolean)
|
||||
.join('; ') || 'Por localizar/confirmar'}
|
||||
</p>
|
||||
<p className="text-sm sm:col-span-2">
|
||||
Dados e situação geográfica aqui exibidos são declarações do
|
||||
requerente; não confirmam direitos ou disponibilidade
|
||||
cadastral.
|
||||
</p>
|
||||
</section>
|
||||
{!management && (
|
||||
<section className="space-y-3 rounded border p-4">
|
||||
<h2 className="text-xl font-semibold">
|
||||
Comunicar actualização
|
||||
</h2>
|
||||
<p className="text-sm">
|
||||
A informação fica identificada como comunicada por si e
|
||||
não é confirmada automaticamente pelo InvestMoz.
|
||||
</p>
|
||||
<label className="block space-y-1">
|
||||
<span>Actualização do estado *</span>
|
||||
<textarea
|
||||
className="w-full rounded border p-2"
|
||||
value={report.data.reported_status}
|
||||
onChange={(e) =>
|
||||
report.setData(
|
||||
'reported_status',
|
||||
e.target.value,
|
||||
)
|
||||
}
|
||||
maxLength={1000}
|
||||
/>
|
||||
</label>
|
||||
<div className="grid gap-3 sm:grid-cols-3">
|
||||
<label>
|
||||
Referência oficial (se tiver)
|
||||
<input
|
||||
className="mt-1 w-full rounded border p-2"
|
||||
value={report.data.official_reference}
|
||||
onChange={(e) =>
|
||||
report.setData(
|
||||
'official_reference',
|
||||
e.target.value,
|
||||
)
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
Entidade indicada
|
||||
<input
|
||||
className="mt-1 w-full rounded border p-2"
|
||||
value={report.data.receiving_entity}
|
||||
onChange={(e) =>
|
||||
report.setData(
|
||||
'receiving_entity',
|
||||
e.target.value,
|
||||
)
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
Data indicada
|
||||
<input
|
||||
type="date"
|
||||
className="mt-1 w-full rounded border p-2"
|
||||
value={report.data.reported_at}
|
||||
onChange={(e) =>
|
||||
report.setData(
|
||||
'reported_at',
|
||||
e.target.value,
|
||||
)
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
<button
|
||||
className="rounded border px-4 py-2"
|
||||
disabled={
|
||||
!report.data.reported_status || report.processing
|
||||
}
|
||||
onClick={() =>
|
||||
router.post(
|
||||
`/investidor/terra-duat/${record.id}/actualizacoes`,
|
||||
report.data,
|
||||
{ preserveScroll: true },
|
||||
)
|
||||
}
|
||||
>
|
||||
Registar informação comunicada
|
||||
</button>
|
||||
</section>
|
||||
)}
|
||||
<section className="space-y-3 rounded border p-4">
|
||||
<h2 className="text-xl font-semibold">Documentos anexados</h2>
|
||||
{documents.map((document) => (
|
||||
<p key={document.id}>
|
||||
{document.status === 'active' ? (
|
||||
<a
|
||||
className="underline"
|
||||
href={`/investidor/terra-duat/${record.id}/documentos/${document.id}`}
|
||||
>
|
||||
{categoryLabels[document.category] ??
|
||||
document.category}
|
||||
: {document.file_name}
|
||||
</a>
|
||||
) : (
|
||||
<span>
|
||||
{categoryLabels[document.category] ??
|
||||
document.category}
|
||||
: {document.file_name} · em quarentena;
|
||||
leitura/descarga bloqueada até verificação
|
||||
</span>
|
||||
)}
|
||||
</p>
|
||||
))}
|
||||
{!documents.length && (
|
||||
<p>
|
||||
Nenhum documento anexado. Anexos são opcionais nesta
|
||||
fase.
|
||||
</p>
|
||||
)}
|
||||
{!management && record.status !== 'closed' && (
|
||||
<div className="grid gap-3 sm:grid-cols-3">
|
||||
<label>
|
||||
Categoria
|
||||
<select
|
||||
className="mt-1 w-full rounded border p-2"
|
||||
value={category}
|
||||
onChange={(e) => setCategory(e.target.value)}
|
||||
>
|
||||
{Object.entries(categoryLabels).map(
|
||||
([key, label]) => (
|
||||
<option value={key} key={key}>
|
||||
{label}
|
||||
</option>
|
||||
),
|
||||
)}
|
||||
</select>
|
||||
</label>
|
||||
<label className="sm:col-span-2">
|
||||
Ficheiro PDF/JPG/PNG (até 10 MB)
|
||||
<input
|
||||
className="mt-1 w-full rounded border p-2"
|
||||
type="file"
|
||||
accept=".pdf,.jpg,.jpeg,.png"
|
||||
onChange={(e) =>
|
||||
setFile(e.target.files?.[0] ?? null)
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
<button
|
||||
className="rounded border px-4 py-2"
|
||||
disabled={!file || upload.processing}
|
||||
onClick={() =>
|
||||
router.post(
|
||||
`/investidor/terra-duat/${record.id}/documentos`,
|
||||
{ version: record.version, category, file },
|
||||
{
|
||||
forceFormData: true,
|
||||
preserveScroll: true,
|
||||
},
|
||||
)
|
||||
}
|
||||
>
|
||||
Anexar em espaço privado
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
<p className="text-sm">
|
||||
Os ficheiros são reservados; anexar não equivale a
|
||||
verificação, validação cadastral ou parecer oficial. O
|
||||
ambiente não tem antivírus configurado, por isso os uploads
|
||||
ficam em quarentena e não podem ser descarregados até
|
||||
verificação.
|
||||
</p>
|
||||
</section>
|
||||
<section className="space-y-3 rounded border p-4">
|
||||
<h2 className="text-xl font-semibold">
|
||||
Histórico no InvestMoz
|
||||
</h2>
|
||||
{events.map((event, index) => (
|
||||
<div
|
||||
className="border-l-2 pl-3"
|
||||
key={`${event.version}-${index}`}
|
||||
>
|
||||
<p className="font-medium">
|
||||
{actionLabels[event.action] ?? event.action}
|
||||
</p>
|
||||
<p className="text-sm">
|
||||
{new Date(event.created_at).toLocaleString('pt-MZ')}{' '}
|
||||
· versão {event.version}
|
||||
</p>
|
||||
{event.action === 'applicant_update_recorded' && (
|
||||
<p className="text-xs">
|
||||
Actualização comunicada pelo requerente; não
|
||||
verificada externamente.
|
||||
</p>
|
||||
)}
|
||||
{event.action === 'status_changed' &&
|
||||
event.metadata?.external_submission_confirmed ===
|
||||
false && (
|
||||
<p className="text-xs">
|
||||
Transição de estado interno; submissão
|
||||
oficial não confirmada.
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</section>
|
||||
{management && (
|
||||
<section className="space-y-3 rounded border border-slate-400 p-4">
|
||||
<h2 className="text-xl font-semibold">Gestão interna</h2>
|
||||
<label className="block">
|
||||
Estado interno
|
||||
<select
|
||||
className="mt-1 w-full rounded border p-2"
|
||||
value={change.data.status}
|
||||
onChange={(e) =>
|
||||
change.setData('status', e.target.value)
|
||||
}
|
||||
>
|
||||
<option value="internal_review">
|
||||
Análise interna
|
||||
</option>
|
||||
<option value="waiting_applicant">
|
||||
A aguardar requerente
|
||||
</option>
|
||||
<option value="referral_prepared">
|
||||
Encaminhamento preparado (não enviado)
|
||||
</option>
|
||||
<option value="closed">
|
||||
Encerrado no InvestMoz
|
||||
</option>
|
||||
</select>
|
||||
</label>
|
||||
{change.data.status === 'referral_prepared' && (
|
||||
<label className="block">
|
||||
Referência interna da preparação
|
||||
<input
|
||||
className="mt-1 w-full rounded border p-2"
|
||||
value={change.data.evidence_reference}
|
||||
onChange={(e) =>
|
||||
change.setData(
|
||||
'evidence_reference',
|
||||
e.target.value,
|
||||
)
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
)}
|
||||
<button
|
||||
className="rounded bg-slate-800 px-4 py-2 text-white"
|
||||
disabled={change.processing}
|
||||
onClick={() =>
|
||||
router.patch(
|
||||
`/management/terra-duat/${record.id}/estado`,
|
||||
{ ...change.data, version: record.version },
|
||||
{ preserveScroll: true },
|
||||
)
|
||||
}
|
||||
>
|
||||
Actualizar estado interno
|
||||
</button>
|
||||
</section>
|
||||
)}
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,24 +1,78 @@
|
||||
import { Link } from '@inertiajs/react';
|
||||
|
||||
export default function Guide({ disclaimer }: { disclaimer: string }) {
|
||||
return <main className="mx-auto max-w-5xl space-y-8 p-6 print:p-0">
|
||||
<header className="space-y-3">
|
||||
<p className="text-sm font-semibold uppercase tracking-wide">InvestMoz · orientação informativa</p>
|
||||
<h1 className="text-3xl font-bold">Terra e DUAT</h1>
|
||||
<p>Prepare informação sobre uma área, um pedido ou um processo que já acompanha. Pode indicar dúvidas e dados por confirmar.</p>
|
||||
<p className="rounded border border-amber-400 bg-amber-50 p-4 text-sm">{disclaimer}</p>
|
||||
</header>
|
||||
<section className="grid gap-4 md:grid-cols-3">
|
||||
<article className="rounded border p-4"><h2 className="font-semibold">Preparar informação</h2><p>Identifique a finalidade, o requerente, a localização conhecida e os antecedentes que tiver.</p></article>
|
||||
<article className="rounded border p-4"><h2 className="font-semibold">Organizar documentos</h2><p>Anexos são opcionais nesta fase. A lista não substitui os requisitos confirmados pela entidade competente.</p></article>
|
||||
<article className="rounded border p-4"><h2 className="font-semibold">Acompanhar</h2><p>Guarde uma referência interna e registe separadamente informações comunicadas por si e diligências internas.</p></article>
|
||||
</section>
|
||||
<p className="rounded bg-slate-50 p-4">Não inferimos que uma área está livre, que não existem direitos ou conflitos, nem que um registo ou mapa confirma titularidade. O InvestMoz não atribui DUAT nem substitui a autoridade pública.</p>
|
||||
<nav className="flex flex-wrap gap-4">
|
||||
<Link className="rounded bg-emerald-800 px-4 py-3 text-white" href="/investidor/terra-duat/novo">Preencher no portal</Link>
|
||||
<Link className="rounded border px-4 py-3" href="/terra-duat/formulario-em-branco">Descarregar formulário em branco (imprimir/guardar como PDF)</Link>
|
||||
<Link className="rounded border px-4 py-3" href="/apoio">Solicitar apoio geral</Link>
|
||||
</nav>
|
||||
<details className="rounded border p-4"><summary className="cursor-pointer font-semibold">Estado das fontes e requisitos</summary><p className="mt-3">Os modelos digitalizados estão inventariados como referências reservadas. Conteúdo, actualidade e requisitos legais aguardam OCR, conferência oficial e revisão. Não use esta orientação como checklist oficial.</p></details>
|
||||
</main>;
|
||||
return (
|
||||
<main className="mx-auto max-w-5xl space-y-8 p-6 print:p-0">
|
||||
<header className="space-y-3">
|
||||
<p className="text-sm font-semibold tracking-wide uppercase">
|
||||
InvestMoz · orientação informativa
|
||||
</p>
|
||||
<h1 className="text-3xl font-bold">Terra e DUAT</h1>
|
||||
<p>
|
||||
Prepare informação sobre uma área, um pedido ou um processo
|
||||
que já acompanha. Pode indicar dúvidas e dados por
|
||||
confirmar.
|
||||
</p>
|
||||
<p className="rounded border border-amber-400 bg-amber-50 p-4 text-sm">
|
||||
{disclaimer}
|
||||
</p>
|
||||
</header>
|
||||
<section className="grid gap-4 md:grid-cols-3">
|
||||
<article className="rounded border p-4">
|
||||
<h2 className="font-semibold">Preparar informação</h2>
|
||||
<p>
|
||||
Identifique a finalidade, o requerente, a localização
|
||||
conhecida e os antecedentes que tiver.
|
||||
</p>
|
||||
</article>
|
||||
<article className="rounded border p-4">
|
||||
<h2 className="font-semibold">Organizar documentos</h2>
|
||||
<p>
|
||||
Anexos são opcionais nesta fase. A lista não substitui
|
||||
os requisitos confirmados pela entidade competente.
|
||||
</p>
|
||||
</article>
|
||||
<article className="rounded border p-4">
|
||||
<h2 className="font-semibold">Acompanhar</h2>
|
||||
<p>
|
||||
Guarde uma referência interna e registe separadamente
|
||||
informações comunicadas por si e diligências internas.
|
||||
</p>
|
||||
</article>
|
||||
</section>
|
||||
<p className="rounded bg-slate-50 p-4">
|
||||
Não inferimos que uma área está livre, que não existem direitos
|
||||
ou conflitos, nem que um registo ou mapa confirma titularidade.
|
||||
O InvestMoz não atribui DUAT nem substitui a autoridade pública.
|
||||
</p>
|
||||
<nav className="flex flex-wrap gap-4">
|
||||
<Link
|
||||
className="rounded bg-emerald-800 px-4 py-3 text-white"
|
||||
href="/investidor/terra-duat/novo"
|
||||
>
|
||||
Preencher no portal
|
||||
</Link>
|
||||
<Link
|
||||
className="rounded border px-4 py-3"
|
||||
href="/terra-duat/formulario-em-branco"
|
||||
>
|
||||
Descarregar formulário em branco (imprimir/guardar como PDF)
|
||||
</Link>
|
||||
<Link className="rounded border px-4 py-3" href="/apoio">
|
||||
Solicitar apoio geral
|
||||
</Link>
|
||||
</nav>
|
||||
<details className="rounded border p-4">
|
||||
<summary className="cursor-pointer font-semibold">
|
||||
Estado das fontes e requisitos
|
||||
</summary>
|
||||
<p className="mt-3">
|
||||
Os modelos digitalizados estão inventariados como
|
||||
referências reservadas. Conteúdo, actualidade e requisitos
|
||||
legais aguardam OCR, conferência oficial e revisão. Não use
|
||||
esta orientação como checklist oficial.
|
||||
</p>
|
||||
</details>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,87 @@
|
||||
import { Link } from '@inertiajs/react';
|
||||
type Row={id:string;reference:string;status:string;version:number;applicant:string|null;updated_at:string};
|
||||
const labels:Record<string,string>={draft:'Rascunho',support_requested:'Apoio solicitado',internal_review:'Análise interna',waiting_applicant:'A aguardar requerente',referral_prepared:'Encaminhamento preparado (não enviado)',closed:'Encerrado'};
|
||||
export default function Management({cases}:{cases:{data:Row[];prev_page_url:string|null;next_page_url:string|null}}){return <main className="mx-auto max-w-6xl space-y-6 p-6"><header><h1 className="text-3xl font-bold">Gestão — Terra e DUAT</h1><p>Fila interna. Não representa protocolo com autoridade pública.</p></header><div className="overflow-x-auto"><table className="w-full border-collapse text-left"><thead><tr><th className="border p-2">Referência interna</th><th className="border p-2">Requerente</th><th className="border p-2">Estado InvestMoz</th><th className="border p-2">Versão/actualização</th><th className="border p-2">Acção</th></tr></thead><tbody>{cases.data.map(row=><tr key={row.id}><td className="border p-2">{row.reference}</td><td className="border p-2">{row.applicant??'—'}</td><td className="border p-2">{labels[row.status]??row.status}</td><td className="border p-2">{row.version} · {new Date(row.updated_at).toLocaleString('pt-MZ')}</td><td className="border p-2"><Link className="underline" href={`/management/terra-duat/${row.id}`}>Abrir</Link></td></tr>)}</tbody></table></div>{!cases.data.length&&<p>Sem pedidos registados.</p>}<nav className="flex gap-4">{cases.prev_page_url&&<Link href={cases.prev_page_url}>Anterior</Link>}{cases.next_page_url&&<Link href={cases.next_page_url}>Seguinte</Link>}</nav></main>;}
|
||||
type Row = {
|
||||
id: string;
|
||||
reference: string;
|
||||
status: string;
|
||||
version: number;
|
||||
applicant: string | null;
|
||||
updated_at: string;
|
||||
};
|
||||
const labels: Record<string, string> = {
|
||||
draft: 'Rascunho',
|
||||
support_requested: 'Apoio solicitado',
|
||||
internal_review: 'Análise interna',
|
||||
waiting_applicant: 'A aguardar requerente',
|
||||
referral_prepared: 'Encaminhamento preparado (não enviado)',
|
||||
closed: 'Encerrado',
|
||||
};
|
||||
export default function Management({
|
||||
cases,
|
||||
}: {
|
||||
cases: {
|
||||
data: Row[];
|
||||
prev_page_url: string | null;
|
||||
next_page_url: string | null;
|
||||
};
|
||||
}) {
|
||||
return (
|
||||
<main className="mx-auto max-w-6xl space-y-6 p-6">
|
||||
<header>
|
||||
<h1 className="text-3xl font-bold">Gestão — Terra e DUAT</h1>
|
||||
<p>
|
||||
Fila interna. Não representa protocolo com autoridade
|
||||
pública.
|
||||
</p>
|
||||
</header>
|
||||
<div className="overflow-x-auto">
|
||||
<table className="w-full border-collapse text-left">
|
||||
<thead>
|
||||
<tr>
|
||||
<th className="border p-2">Referência interna</th>
|
||||
<th className="border p-2">Requerente</th>
|
||||
<th className="border p-2">Estado InvestMoz</th>
|
||||
<th className="border p-2">Versão/actualização</th>
|
||||
<th className="border p-2">Acção</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{cases.data.map((row) => (
|
||||
<tr key={row.id}>
|
||||
<td className="border p-2">{row.reference}</td>
|
||||
<td className="border p-2">
|
||||
{row.applicant ?? '—'}
|
||||
</td>
|
||||
<td className="border p-2">
|
||||
{labels[row.status] ?? row.status}
|
||||
</td>
|
||||
<td className="border p-2">
|
||||
{row.version} ·{' '}
|
||||
{new Date(row.updated_at).toLocaleString(
|
||||
'pt-MZ',
|
||||
)}
|
||||
</td>
|
||||
<td className="border p-2">
|
||||
<Link
|
||||
className="underline"
|
||||
href={`/management/terra-duat/${row.id}`}
|
||||
>
|
||||
Abrir
|
||||
</Link>
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{!cases.data.length && <p>Sem pedidos registados.</p>}
|
||||
<nav className="flex gap-4">
|
||||
{cases.prev_page_url && (
|
||||
<Link href={cases.prev_page_url}>Anterior</Link>
|
||||
)}
|
||||
{cases.next_page_url && (
|
||||
<Link href={cases.next_page_url}>Seguinte</Link>
|
||||
)}
|
||||
</nav>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,4 +1,81 @@
|
||||
import { Link } from '@inertiajs/react';
|
||||
type CaseRow={id:string;reference:string;status:string;version:number;updated_at:string};
|
||||
const labels:Record<string,string>={draft:'Rascunho privado',support_requested:'Apoio solicitado ao InvestMoz',internal_review:'Análise interna',waiting_applicant:'A aguardar informação',referral_prepared:'Encaminhamento preparado (não enviado)',closed:'Encerrado no InvestMoz'};
|
||||
export default function Workspace({cases}:{cases:{data:CaseRow[];prev_page_url:string|null;next_page_url:string|null}}){return <main className="mx-auto max-w-5xl space-y-6 p-6"><header><h1 className="text-3xl font-bold">Os meus pedidos — Terra e DUAT</h1><p>As referências e estados são internos do InvestMoz.</p></header><Link className="inline-block rounded bg-emerald-800 px-4 py-3 text-white" href="/terra-duat">Orientação Terra e DUAT</Link> <Link className="ml-2 inline-block rounded border px-4 py-3" href="/investidor/terra-duat/novo">Preparar novo pedido</Link><section className="space-y-3">{cases.data.map((record)=><article key={record.id} className="rounded border p-4"><Link href={`/investidor/terra-duat/${record.id}`} className="font-semibold underline">{record.reference}</Link><p>{labels[record.status]??record.status} · versão {record.version}</p><p className="text-sm">Actualizado {new Date(record.updated_at).toLocaleString('pt-MZ')}</p></article>)}{!cases.data.length&&<p>Ainda não tem rascunhos ou pedidos de apoio.</p>}</section><nav className="flex gap-4">{cases.prev_page_url&&<Link href={cases.prev_page_url}>Anterior</Link>}{cases.next_page_url&&<Link href={cases.next_page_url}>Seguinte</Link>}</nav></main>;}
|
||||
type CaseRow = {
|
||||
id: string;
|
||||
reference: string;
|
||||
status: string;
|
||||
version: number;
|
||||
updated_at: string;
|
||||
};
|
||||
const labels: Record<string, string> = {
|
||||
draft: 'Rascunho privado',
|
||||
support_requested: 'Apoio solicitado ao InvestMoz',
|
||||
internal_review: 'Análise interna',
|
||||
waiting_applicant: 'A aguardar informação',
|
||||
referral_prepared: 'Encaminhamento preparado (não enviado)',
|
||||
closed: 'Encerrado no InvestMoz',
|
||||
};
|
||||
export default function Workspace({
|
||||
cases,
|
||||
}: {
|
||||
cases: {
|
||||
data: CaseRow[];
|
||||
prev_page_url: string | null;
|
||||
next_page_url: string | null;
|
||||
};
|
||||
}) {
|
||||
return (
|
||||
<main className="mx-auto max-w-5xl space-y-6 p-6">
|
||||
<header>
|
||||
<h1 className="text-3xl font-bold">
|
||||
Os meus pedidos — Terra e DUAT
|
||||
</h1>
|
||||
<p>As referências e estados são internos do InvestMoz.</p>
|
||||
</header>
|
||||
<Link
|
||||
className="inline-block rounded bg-emerald-800 px-4 py-3 text-white"
|
||||
href="/terra-duat"
|
||||
>
|
||||
Orientação Terra e DUAT
|
||||
</Link>{' '}
|
||||
<Link
|
||||
className="ml-2 inline-block rounded border px-4 py-3"
|
||||
href="/investidor/terra-duat/novo"
|
||||
>
|
||||
Preparar novo pedido
|
||||
</Link>
|
||||
<section className="space-y-3">
|
||||
{cases.data.map((record) => (
|
||||
<article key={record.id} className="rounded border p-4">
|
||||
<Link
|
||||
href={`/investidor/terra-duat/${record.id}`}
|
||||
className="font-semibold underline"
|
||||
>
|
||||
{record.reference}
|
||||
</Link>
|
||||
<p>
|
||||
{labels[record.status] ?? record.status} · versão{' '}
|
||||
{record.version}
|
||||
</p>
|
||||
<p className="text-sm">
|
||||
Actualizado{' '}
|
||||
{new Date(record.updated_at).toLocaleString(
|
||||
'pt-MZ',
|
||||
)}
|
||||
</p>
|
||||
</article>
|
||||
))}
|
||||
{!cases.data.length && (
|
||||
<p>Ainda não tem rascunhos ou pedidos de apoio.</p>
|
||||
)}
|
||||
</section>
|
||||
<nav className="flex gap-4">
|
||||
{cases.prev_page_url && (
|
||||
<Link href={cases.prev_page_url}>Anterior</Link>
|
||||
)}
|
||||
{cases.next_page_url && (
|
||||
<Link href={cases.next_page_url}>Seguinte</Link>
|
||||
)}
|
||||
</nav>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user