Files
ISA-Frontend/libs/checkout/data-access/src/lib/schemas/component-item.schema.ts
Lorenz Hilpert 2b5da00249 feat(checkout): add reward order confirmation feature with schema migrations
- 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
2025-10-21 14:28:52 +02:00

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>;