Add extras and options CRUD, add sidebar, add kanban board, udpate packages
This commit is contained in:
@ -6,14 +6,20 @@ const optionField = z.object({
|
||||
optionId: z.string(),
|
||||
price: z.number().optional(),
|
||||
pricePercent: z.number().optional(),
|
||||
priceRange: z.string().regex(rangePattern, "Format must be like '10–80'").optional(),
|
||||
priceRange: z
|
||||
.string()
|
||||
.regex(rangePattern, "Format must be like '10–80'")
|
||||
.optional(),
|
||||
});
|
||||
|
||||
const extraField = z.object({
|
||||
extraId: z.string(),
|
||||
price: z.number().optional(),
|
||||
pricePercent: z.number().optional(),
|
||||
priceRange: z.string().regex(rangePattern, "Format must be like '10–80'").optional(),
|
||||
priceRange: z
|
||||
.string()
|
||||
.regex(rangePattern, "Format must be like '10–80'")
|
||||
.optional(),
|
||||
});
|
||||
|
||||
const customInputsField = z.object({
|
||||
@ -29,6 +35,20 @@ export const commissionTypeSchema = z.object({
|
||||
options: z.array(optionField).optional(),
|
||||
extras: z.array(extraField).optional(),
|
||||
customInputs: z.array(customInputsField).optional(),
|
||||
})
|
||||
});
|
||||
|
||||
export type commissionTypeSchema = z.infer<typeof commissionTypeSchema>
|
||||
export type commissionTypeSchema = z.infer<typeof commissionTypeSchema>;
|
||||
|
||||
export const commissionOptionSchema = z.object({
|
||||
name: z.string().min(1, "Name is required"),
|
||||
description: z.string().optional(),
|
||||
});
|
||||
|
||||
export type CommissionOptionValues = z.infer<typeof commissionOptionSchema>;
|
||||
|
||||
export const commissionExtraSchema = z.object({
|
||||
name: z.string().min(1, "Name is required"),
|
||||
description: z.string().optional(),
|
||||
});
|
||||
|
||||
export type CommissionExtraValues = z.infer<typeof commissionExtraSchema>;
|
||||
|
||||
Reference in New Issue
Block a user