mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 04:15:43 +00:00
feat: add poa and poa delegation file to onboarding
This commit is contained in:
@@ -392,11 +392,17 @@ export default function OnboardingWizardDialog({
|
||||
const requiredDocsMissing = requirementDocuments.some(
|
||||
(d) => d.isRequired && !d.uploaded,
|
||||
);
|
||||
// The PoA gets the same treatment: a resumed draft that predates the
|
||||
// delegation-letter requirement (or a forwarder whose PoA is blank) must land
|
||||
// back on the PoA step, where both the details and the letter are entered.
|
||||
const poaIncomplete = requirementsQuery.data?.poa?.complete === false;
|
||||
// Each unmet requirement lowers the ceiling; resume never moves forward.
|
||||
let ceiling = FORM_STEPS.length - 1;
|
||||
if (requiredDocsMissing)
|
||||
ceiling = Math.min(ceiling, FORM_STEPS.indexOf("documents"));
|
||||
if (poaIncomplete) ceiling = Math.min(ceiling, FORM_STEPS.indexOf("poa"));
|
||||
const effectiveResumeStep: FormStep =
|
||||
requiredDocsMissing &&
|
||||
FORM_STEPS.indexOf(resumeFormStep) > FORM_STEPS.indexOf("documents")
|
||||
? "documents"
|
||||
: resumeFormStep;
|
||||
FORM_STEPS[Math.min(Math.max(FORM_STEPS.indexOf(resumeFormStep), 0), ceiling)];
|
||||
|
||||
const formProps = {
|
||||
documentSettingCode: resolvedDocumentSettingCode,
|
||||
|
||||
Reference in New Issue
Block a user