Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion app/schemas/customer.schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ const createCustomerBody = z.object({
custAddress1: z.string().max(255).optional(),
custAddress2: z.string().max(255).optional(),
custCity: z.string().max(255).optional(),
custState: z.string().max(255).optional(),
// custState matches the DB column: varchar(2) — US state codes
// ("NE", "CA", etc.) and Canadian province codes ("AB", "BC").
// Without this length constraint, anything ≤ 255 chars passed zod
// and surfaced as a 500 at the postgres INSERT layer ("value too
// long for type character varying(2)") instead of a clean 400.
custState: z.string().length(2).optional(),
custZip: z.string().max(32).optional(),
custPhone: z.string().max(64).optional(),
custEmail: z.string().email().max(255).optional(),
Expand Down