mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
- Add new reward-order-confirmation feature library with components and store - Implement checkout completion orchestrator service for order finalization - Migrate checkout/oms/crm models to Zod schemas for better type safety - Add order creation facade and display order schemas - Update shopping cart facade with order completion flow - Add comprehensive tests for shopping cart facade - Update routing to include order confirmation page
28 lines
1.3 KiB
TypeScript
28 lines
1.3 KiB
TypeScript
import {
|
|
EntityContainerSchema,
|
|
QuantityUnitTypeSchema,
|
|
TouchBaseSchema,
|
|
} from '@isa/common/data-access';
|
|
import { z } from 'zod';
|
|
import { CategorySchema } from './category.schema';
|
|
import { ComponentItemDisplayTypeSchema } from './component-item-display-type.schema';
|
|
|
|
export const ComponentItemSchema = z
|
|
.object({
|
|
name: z.string().describe('Name').optional(),
|
|
description: z.string().describe('Description text').optional(),
|
|
item: EntityContainerSchema(z.lazy(() => z.any())).describe('Item').optional(), // ItemSchema would create circular dependency
|
|
category: EntityContainerSchema(CategorySchema).describe('Category information').optional(),
|
|
required: z.boolean().describe('Whether this is required').optional(),
|
|
quantityMin: z.number().describe('Quantity min').optional(),
|
|
quantityMax: z.number().describe('Quantity max').optional(),
|
|
quantityUnitType: QuantityUnitTypeSchema.describe('QuantityUnit type').optional(),
|
|
unit: z.string().describe('Unit').optional(),
|
|
displayType: ComponentItemDisplayTypeSchema.describe('Display type').optional(),
|
|
start: z.string().describe('Start').optional(),
|
|
stop: z.string().describe('Stop').optional(),
|
|
})
|
|
.extend(TouchBaseSchema.shape);
|
|
|
|
export type ComponentItem = z.infer<typeof ComponentItemSchema>;
|