feat(api): default helcim customer circle to community when omitted

Lets the join form omit circle from the signup payload (circle picker
moves to a post-signup prompt per docs/specs/join-form-redesign.md).
Mongoose Member.circle is required with no default, so the Zod
default fills it in before reaching the model.
This commit is contained in:
Jennie Robinson Faber 2026-05-23 18:49:55 +01:00
parent 5d4321612f
commit c85b2ae3d9

View file

@ -61,7 +61,7 @@ export const helcimCreatePlanSchema = z.object({
export const helcimCustomerSchema = z.object({ export const helcimCustomerSchema = z.object({
name: z.string().min(1).max(200), name: z.string().min(1).max(200),
email: z.string().trim().toLowerCase().email(), email: z.string().trim().toLowerCase().email(),
circle: z.enum(['community', 'founder', 'practitioner']).optional(), circle: z.enum(['community', 'founder', 'practitioner']).optional().default('community'),
contributionAmount: z.number().int().min(0).optional(), contributionAmount: z.number().int().min(0).optional(),
agreedToGuidelines: z.literal(true) agreedToGuidelines: z.literal(true)
}) })