refactor(validations): split lib/validations.ts into a barrel'd folder (slice 1)
1141-line lib/validations.ts → lib/validations/<feature>.ts + primitives.ts + an index.ts barrel. '@/lib/validations' now resolves to the barrel, so all 40 importers are untouched. Every one of the 143 exports is preserved verbatim (verified by symbol-diff); schemas moved unchanged. tsc 0, 635 tests green. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
c8c60358c7
commit
18d5e22ad4
@@ -0,0 +1,26 @@
|
||||
import { z } from 'zod'
|
||||
import { emailField, flexibleDateTime } from './primitives'
|
||||
|
||||
const importEmail = emailField('Invalid email')
|
||||
|
||||
export const importMembersSchema = z.array(
|
||||
z.object({
|
||||
display_name: z.string().min(1, 'Name required').max(100),
|
||||
email: importEmail,
|
||||
phone: z.string().max(20).optional().nullable(),
|
||||
tier: z.enum(['plus', 'basic', 'associate']).optional(),
|
||||
joined_at: flexibleDateTime().optional(),
|
||||
last_paid_at: flexibleDateTime().optional(),
|
||||
has_card_access: z.boolean().optional(),
|
||||
}),
|
||||
).max(5000)
|
||||
|
||||
export const importPaymentsCsvSchema = z.array(
|
||||
z.object({
|
||||
platform: z.enum(['paypal', 'zeffy', 'venmo', 'cash']),
|
||||
amount: z.number().finite().positive('Amount must be positive').max(10_000_000),
|
||||
from_identifier: z.string().min(1, 'Payer required').max(200),
|
||||
from_note: z.string().max(500).optional().nullable(),
|
||||
transaction_date: flexibleDateTime().optional(),
|
||||
}),
|
||||
).max(10000)
|
||||
Reference in New Issue
Block a user