diff --git a/src/app/public/supplemental-info/[token]/page.tsx b/src/app/public/supplemental-info/[token]/page.tsx index 3dc19f6d..2f477dcb 100644 --- a/src/app/public/supplemental-info/[token]/page.tsx +++ b/src/app/public/supplemental-info/[token]/page.tsx @@ -157,26 +157,17 @@ export default function SupplementalInfoPage({ params }: PageProps) { ); } - if (data?.token.consumed) { - return ( - -
- -

Thanks — we already have your details

-

- This form was already submitted. Your sales contact will be in touch shortly. -

-
-
- ); - } + // Tokens are now reusable until expiry — the consumed flag is kept + // so the form can show a soft "you've submitted this before" banner + // (and prefill the entered values) without locking the recipient out + // of updating their details. if (submitted) { return (
-

Thanks — got it

+

Thanks, got it

Your details have been sent to the team. Watch your inbox for your EOI document shortly.

@@ -194,6 +185,12 @@ export default function SupplementalInfoPage({ params }: PageProps) { We've pre-filled what we have on file. Please review, correct anything that's wrong, and add what's missing.

+ {data?.token.consumed ? ( +
+ You've submitted this form before. Feel free to update any details. Changes + overwrite the previous submission. +
+ ) : null}
diff --git a/src/lib/services/supplemental-forms.service.ts b/src/lib/services/supplemental-forms.service.ts index 4e0e7e50..84bcb9bb 100644 --- a/src/lib/services/supplemental-forms.service.ts +++ b/src/lib/services/supplemental-forms.service.ts @@ -8,7 +8,7 @@ * updates, consume token. All inside one transaction. */ -import { and, eq, isNull } from 'drizzle-orm'; +import { and, eq } from 'drizzle-orm'; import crypto from 'node:crypto'; import { db } from '@/lib/db'; @@ -193,14 +193,16 @@ export async function applySubmission(token: string, input: SubmissionInput): Pr } await db.transaction(async (tx) => { + // Reusable-until-expiry: the link stays valid for repeat + // submissions until it expires. `consumedAt` is still stamped on + // first submit so the rep / loader can show "last submitted at + //