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) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
c8c60358c7
commit
18d5e22ad4
@@ -0,0 +1,18 @@
|
||||
import { z } from 'zod'
|
||||
import { DUES_LINK_PLATFORMS, isSafeDuesUrl } from '../dues-payments-logic'
|
||||
|
||||
// One external pay-here URL per platform. url must be absolute https (no
|
||||
// http downgrade, no javascript:/data: scheme) since it is rendered as a
|
||||
// member-clickable anchor. instructions is an optional memo hint (e.g. "put
|
||||
// your member name in the note") to help the treasurer reconcile later.
|
||||
export const duesPaymentMethodSchema = z.object({
|
||||
platform: z.enum(DUES_LINK_PLATFORMS as unknown as [string, ...string[]]),
|
||||
url: z
|
||||
.string()
|
||||
.trim()
|
||||
.max(500)
|
||||
.refine(isSafeDuesUrl, 'Enter an absolute https:// URL'),
|
||||
instructions: z.string().trim().max(300).optional().nullable(),
|
||||
is_active: z.boolean().optional().default(true),
|
||||
sort_order: z.number().int().min(0).max(999).optional().default(0),
|
||||
})
|
||||
Reference in New Issue
Block a user