feat: consolidar desenvolvimentos do portal InvestMoz
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { createOperationKey } from '@/lib/operation-key';
|
||||
import { useForm } from '@inertiajs/react';
|
||||
import { card, input, button } from '@/pages/investment/shared';
|
||||
import DeskPaymentDocumentForm from './desk-payment-document-form';
|
||||
|
||||
export type DeskDocument = {
|
||||
id: string;
|
||||
@@ -10,6 +11,12 @@ export type DeskDocument = {
|
||||
malware_scan_status: string;
|
||||
category: string;
|
||||
source_reference: string;
|
||||
request_id?: string | null;
|
||||
media_type?: string | null;
|
||||
size_bytes?: number | null;
|
||||
version_no?: number | null;
|
||||
stage?: string | null;
|
||||
valid_until?: string | null;
|
||||
};
|
||||
export function DocumentReview({
|
||||
caseId,
|
||||
@@ -163,6 +170,14 @@ export type DeskPayment = {
|
||||
verified_by: number | null;
|
||||
reason: string | null;
|
||||
version: number;
|
||||
document_evidence?: {
|
||||
link_id: string;
|
||||
file_name: string;
|
||||
document_version: number;
|
||||
source_reference: string;
|
||||
sha256: string;
|
||||
valid_until: string | null;
|
||||
} | null;
|
||||
};
|
||||
export function RequestOperations({
|
||||
requestId,
|
||||
@@ -182,7 +197,7 @@ export function RequestOperations({
|
||||
amount: '',
|
||||
currency: 'MZN',
|
||||
source_reference: '',
|
||||
document_id: '',
|
||||
document_link_id: '',
|
||||
consent: false,
|
||||
});
|
||||
const review = useForm({
|
||||
@@ -221,10 +236,35 @@ export function RequestOperations({
|
||||
: 'Declarado — por conferir'}
|
||||
</p>
|
||||
<p>Fonte do valor: {p.source_reference}</p>
|
||||
{p.document_evidence ? (
|
||||
<p>
|
||||
Comprovativo: {p.document_evidence.file_name} ·
|
||||
versão {p.document_evidence.document_version} ·
|
||||
referência documental:{' '}
|
||||
{p.document_evidence.source_reference}
|
||||
{p.document_evidence.valid_until
|
||||
? ` · validade declarada ${p.document_evidence.valid_until}`
|
||||
: ''}
|
||||
</p>
|
||||
) : (
|
||||
<p>
|
||||
{p.document_id
|
||||
? 'Comprovativo associado em registo anterior; metadados da associação não capturados à época.'
|
||||
: 'Comprovativo ainda não associado.'}
|
||||
</p>
|
||||
)}
|
||||
<p>
|
||||
Responsável pela conferência:{' '}
|
||||
{p.verified_by ?? 'Ainda sem conferência'} · {p.reason}
|
||||
</p>
|
||||
{owner &&
|
||||
['pending', 'internal_issue'].includes(p.status) && (
|
||||
<DeskPaymentDocumentForm
|
||||
requestId={requestId}
|
||||
payment={p}
|
||||
documents={documents}
|
||||
/>
|
||||
)}
|
||||
</article>
|
||||
))}
|
||||
{owner && (
|
||||
@@ -240,6 +280,10 @@ export function RequestOperations({
|
||||
<h3 className="font-bold">
|
||||
Registar referência e comprovativo
|
||||
</h3>
|
||||
<p>
|
||||
Se esta referência já está registada acima, junte ou
|
||||
corrija o comprovativo nesse registo.
|
||||
</p>
|
||||
<label>
|
||||
Referência fornecida
|
||||
<input
|
||||
@@ -297,17 +341,22 @@ export function RequestOperations({
|
||||
Comprovativo associado ao mesmo dossier
|
||||
<select
|
||||
className={input}
|
||||
value={payment.data.document_id}
|
||||
value={payment.data.document_link_id}
|
||||
onChange={(e) =>
|
||||
payment.setData('document_id', e.target.value)
|
||||
payment.setData(
|
||||
'document_link_id',
|
||||
e.target.value,
|
||||
)
|
||||
}
|
||||
>
|
||||
<option value="">
|
||||
Pendente — registar referência agora
|
||||
</option>
|
||||
{documents.map((d) => (
|
||||
<option key={d.id} value={d.document_id}>
|
||||
{d.file_name}
|
||||
<option key={d.id} value={d.id}>
|
||||
{d.file_name} · versão{' '}
|
||||
{d.version_no ?? 'por confirmar'} ·{' '}
|
||||
{d.source_reference}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user