feat: add Zod validation schemas for all domain routes
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
26
src/schemas/bank-accounts.schema.ts
Normal file
26
src/schemas/bank-accounts.schema.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const CreateBankAccountSchema = z.object({
|
||||
account_name: z.string().nullish(),
|
||||
bank_name: z.string().nullish(),
|
||||
account_number: z.string().nullish(),
|
||||
iban: z.string().nullish(),
|
||||
bic: z.string().nullish(),
|
||||
currency: z.string().optional().default('CZK'),
|
||||
is_default: z.any().optional().default(false),
|
||||
position: z.union([z.number(), z.string()]).transform(v => Number(v)).optional().default(0),
|
||||
});
|
||||
|
||||
export const UpdateBankAccountSchema = z.object({
|
||||
account_name: z.string().nullish(),
|
||||
bank_name: z.string().nullish(),
|
||||
account_number: z.string().nullish(),
|
||||
iban: z.string().nullish(),
|
||||
bic: z.string().nullish(),
|
||||
currency: z.string().optional(),
|
||||
is_default: z.any().optional(),
|
||||
position: z.union([z.number(), z.string()]).transform(v => Number(v)).optional(),
|
||||
});
|
||||
|
||||
export type CreateBankAccountInput = z.infer<typeof CreateBankAccountSchema>;
|
||||
export type UpdateBankAccountInput = z.infer<typeof UpdateBankAccountSchema>;
|
||||
Reference in New Issue
Block a user