fix(auth): cap insurerIkNumber length before the digit refine

The insurerIkNumber field went straight to the 9-digit regex refine with
no upper bound, unlike its siblings insurerName and fullName which cap at
120 characters. Add a defensive .max(32) before the transform — well
above the 9 digits the value ever holds — so an oversized string is
rejected at the length gate rather than reaching the regex. The refine
already rejects malformed input; this is hardening for consistency with
the surrounding fields.
This commit is contained in:
Marc-André Bombeck committed 2026-06-01 23:43:39 +02:00
1 parent 0ec4a16153
commit 712c5707ee
1 file changed
+1
+1
View File
@@ -65,6 +65,7 @@ export const profileSchema = z.object({
// the iOS client contract). Surfaced on the FHIR `Coverage` payor.
insurerIkNumber: z
.string()
.max(32)
.nullable()
.optional()
.transform((v) => {