Add lookup tables, payment methods, tax exemptions, and processor link APIs
Replace unit_status and item_condition pgEnums with company-scoped lookup tables that support custom values. Add account_payment_method table, tax_exemption table with approve/revoke workflow, and CRUD routes for processor links. Validate inventory unit status/condition against lookup tables at service layer.
This commit is contained in:
@@ -26,8 +26,23 @@ export type SupplierCreateInput = z.infer<typeof SupplierCreateSchema>
|
||||
export const SupplierUpdateSchema = SupplierCreateSchema.partial()
|
||||
export type SupplierUpdateInput = z.infer<typeof SupplierUpdateSchema>
|
||||
|
||||
export const ItemCondition = z.enum(['new', 'excellent', 'good', 'fair', 'poor'])
|
||||
export const UnitStatus = z.enum(['available', 'sold', 'rented', 'in_repair', 'retired'])
|
||||
// System slugs — used for code-level business logic references.
|
||||
// Actual valid values are stored in lookup tables and are company-configurable.
|
||||
export const SystemItemCondition = z.enum(['new', 'excellent', 'good', 'fair', 'poor'])
|
||||
export const SystemUnitStatus = z.enum([
|
||||
'available',
|
||||
'sold',
|
||||
'rented',
|
||||
'on_trial',
|
||||
'in_repair',
|
||||
'layaway',
|
||||
'lost',
|
||||
'retired',
|
||||
])
|
||||
|
||||
// API validation accepts any string slug (validated against lookup table at service layer)
|
||||
export const ItemCondition = z.string().min(1).max(100)
|
||||
export const UnitStatus = z.string().min(1).max(100)
|
||||
|
||||
export const ProductCreateSchema = z.object({
|
||||
sku: z.string().max(100).optional(),
|
||||
|
||||
Reference in New Issue
Block a user