Add member identifiers table for ID documents (DL, passport, school ID)
member_identifier table with type, value, issuing authority, expiry, front/back image storage (base64 in Postgres), primary flag. CRUD endpoints under /members/:memberId/identifiers. Zod schemas with constrained type enum.
This commit is contained in:
@@ -48,6 +48,29 @@ export const AccountSearchSchema = z.object({
|
||||
q: z.string().min(1).max(255),
|
||||
})
|
||||
|
||||
// --- Member Identifier ---
|
||||
|
||||
export const IdentifierType = z.enum(['drivers_license', 'passport', 'school_id'])
|
||||
export type IdentifierType = z.infer<typeof IdentifierType>
|
||||
|
||||
export const MemberIdentifierCreateSchema = z.object({
|
||||
memberId: z.string().uuid(),
|
||||
type: IdentifierType,
|
||||
label: z.string().max(100).optional(),
|
||||
value: z.string().min(1).max(255),
|
||||
issuingAuthority: z.string().max(255).optional(),
|
||||
issuedDate: z.string().date().optional(),
|
||||
expiresAt: z.string().date().optional(),
|
||||
imageFrontUrl: z.string().max(500).optional(),
|
||||
imageBackUrl: z.string().max(500).optional(),
|
||||
notes: z.string().optional(),
|
||||
isPrimary: z.boolean().default(false),
|
||||
})
|
||||
export type MemberIdentifierCreateInput = z.infer<typeof MemberIdentifierCreateSchema>
|
||||
|
||||
export const MemberIdentifierUpdateSchema = MemberIdentifierCreateSchema.omit({ memberId: true }).partial()
|
||||
export type MemberIdentifierUpdateInput = z.infer<typeof MemberIdentifierUpdateSchema>
|
||||
|
||||
// --- Account Processor Link ---
|
||||
|
||||
export const ProcessorLinkCreateSchema = z.object({
|
||||
|
||||
@@ -13,6 +13,8 @@ export {
|
||||
MemberCreateSchema,
|
||||
MemberUpdateSchema,
|
||||
AccountSearchSchema,
|
||||
MemberIdentifierCreateSchema,
|
||||
MemberIdentifierUpdateSchema,
|
||||
ProcessorLinkCreateSchema,
|
||||
ProcessorLinkUpdateSchema,
|
||||
PaymentMethodCreateSchema,
|
||||
@@ -27,6 +29,8 @@ export type {
|
||||
AccountUpdateInput,
|
||||
MemberCreateInput,
|
||||
MemberUpdateInput,
|
||||
MemberIdentifierCreateInput,
|
||||
MemberIdentifierUpdateInput,
|
||||
ProcessorLinkCreateInput,
|
||||
ProcessorLinkUpdateInput,
|
||||
PaymentMethodCreateInput,
|
||||
|
||||
Reference in New Issue
Block a user