- Remove validation wrapper functions from common/validation.ts (use Zod schemas directly) - Delete duplicate CheckoutItem/CheckoutTotals/CheckoutCart/OrderCreateResponse from orders/contract.ts - Delete empty orders/checkout.ts - Remove unused MIGRATION_STEPS/MIGRATION_TRANSFER_ITEMS UI constants from auth/forms.ts - Standardize checkout/contract.ts to not re-export schema types - Fix customer/providers/index.ts to not re-export contract types through providers barrel
26 lines
664 B
TypeScript
26 lines
664 B
TypeScript
/**
|
|
* Common Domain - Validation Utilities
|
|
*
|
|
* Generic validation schemas used across all domains.
|
|
* These are pure schemas with no infrastructure dependencies.
|
|
*/
|
|
|
|
import { z } from "zod";
|
|
|
|
/**
|
|
* UUID validation schema (v4)
|
|
*/
|
|
export const uuidSchema = z.string().uuid();
|
|
|
|
/**
|
|
* Required non-empty string schema (trimmed)
|
|
* Use for any string that must have a value
|
|
*/
|
|
export const requiredStringSchema = z.string().min(1, "This field is required").trim();
|
|
|
|
/**
|
|
* Customer number / account number schema
|
|
* Generic schema for customer/account identifiers
|
|
*/
|
|
export const customerNumberSchema = z.string().min(1, "Customer number is required").trim();
|