feat(validation): rename contributionTier → contributionAmount in Zod schemas
This commit is contained in:
parent
55af652263
commit
e4dade18b9
3 changed files with 49 additions and 35 deletions
|
|
@ -9,7 +9,7 @@ export const memberCreateSchema = z.object({
|
|||
email: z.string().trim().toLowerCase().email(),
|
||||
name: z.string().min(1).max(200),
|
||||
circle: z.enum(['community', 'founder', 'practitioner']),
|
||||
contributionTier: z.enum(['0', '5', '15', '30', '50'])
|
||||
contributionAmount: z.number().int().min(0)
|
||||
})
|
||||
|
||||
export const memberProfileUpdateSchema = z.object({
|
||||
|
|
@ -57,7 +57,7 @@ export const helcimCustomerSchema = z.object({
|
|||
name: z.string().min(1).max(200),
|
||||
email: z.string().trim().toLowerCase().email(),
|
||||
circle: z.enum(['community', 'founder', 'practitioner']).optional(),
|
||||
contributionTier: z.enum(['0', '5', '15', '30', '50']).optional(),
|
||||
contributionAmount: z.number().int().min(0).optional(),
|
||||
agreedToGuidelines: z.literal(true)
|
||||
})
|
||||
|
||||
|
|
@ -73,7 +73,7 @@ export const helcimInitializePaymentSchema = z.object({
|
|||
|
||||
export const helcimSubscriptionSchema = z.object({
|
||||
customerId: z.union([z.string().min(1), z.number()]),
|
||||
contributionTier: z.enum(['0', '5', '15', '30', '50']),
|
||||
contributionAmount: z.number().int().min(0),
|
||||
customerCode: z.union([z.string().min(1).max(200), z.number()]).transform(String),
|
||||
cardToken: z.string().max(500).optional().nullable(),
|
||||
cadence: z.enum(['monthly', 'annual']).default('monthly')
|
||||
|
|
@ -140,7 +140,7 @@ export const eventPaymentSchema = z.object({
|
|||
// --- Member schemas ---
|
||||
|
||||
export const updateContributionSchema = z.object({
|
||||
contributionTier: z.enum(['0', '5', '15', '30', '50']),
|
||||
contributionAmount: z.number().int().min(0),
|
||||
cadence: z.enum(['monthly', 'annual']).default('monthly')
|
||||
})
|
||||
|
||||
|
|
@ -294,14 +294,14 @@ export const adminMemberCreateSchema = z.object({
|
|||
name: z.string().min(1).max(200),
|
||||
email: z.string().trim().toLowerCase().email(),
|
||||
circle: z.enum(['community', 'founder', 'practitioner']),
|
||||
contributionTier: z.enum(['0', '5', '15', '30', '50'])
|
||||
contributionAmount: z.number().int().min(0)
|
||||
})
|
||||
|
||||
export const adminMemberUpdateSchema = z.object({
|
||||
name: z.string().min(1).max(200),
|
||||
email: z.string().trim().toLowerCase().email(),
|
||||
circle: z.enum(['community', 'founder', 'practitioner']),
|
||||
contributionTier: z.enum(['0', '5', '15', '30', '50']),
|
||||
contributionAmount: z.number().int().min(0),
|
||||
status: z.enum(['pending_payment', 'active', 'suspended', 'cancelled'])
|
||||
})
|
||||
|
||||
|
|
@ -314,7 +314,7 @@ export const bulkMemberImportSchema = z.object({
|
|||
name: z.string().min(1).max(200),
|
||||
email: z.string().trim().toLowerCase().email(),
|
||||
circle: z.enum(['community', 'founder', 'practitioner']),
|
||||
contributionTier: z.enum(['0', '5', '15', '30', '50'])
|
||||
contributionAmount: z.number().int().min(0)
|
||||
})).min(1).max(100)
|
||||
})
|
||||
|
||||
|
|
@ -351,7 +351,7 @@ export const inviteAcceptSchema = z.object({
|
|||
location: z.string().max(200).optional(),
|
||||
circle: z.enum(['community', 'founder', 'practitioner']),
|
||||
motivation: z.string().max(5000).optional(),
|
||||
contributionTier: z.enum(['0', '5', '15', '30', '50']),
|
||||
contributionAmount: z.number().int().min(0),
|
||||
agreedToGuidelines: z.literal(true),
|
||||
token: z.string().min(1)
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue