mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
1 commit: Bestellbestätigung drucken 2. commit: Schemas 3. commit: Action/Command handler feat(action-handler, printing, schemas): add handle command service for automated action execution Implement HandleCommandService and facade to execute order actions automatically after reward collection. Add action handler infrastructure with 23 handlers (Accepted, Arrived, Assembled, etc.). Integrate automatic receipt fetching for print commands. Add schema validation for command handling and receipt queries. Update reward confirmation to trigger actions after successful collection. - Add HandleCommandService with command orchestration - Add HandleCommandFacade as public API layer - Create schemas: HandleCommandSchema, FetchReceiptsByOrderItemSubsetIdsSchema - Add helpers: getMainActions, buildItemQuantityMap - Register 23 action handlers in reward confirmation routes - Support PRINT_SHIPPINGNOTE and PRINT_SMALLAMOUNTINVOICE auto-fetching - Update CoreCommandModule for forRoot/forChild patterns - Add comprehensive unit tests for new services and helpers - Apply prettier formatting to command and printing modules Ref: #5394
24 lines
474 B
TypeScript
24 lines
474 B
TypeScript
import { z } from 'zod';
|
|
|
|
/**
|
|
* Gender/Salutation enum
|
|
* Geschlecht/Anrede
|
|
*/
|
|
export const Gender = {
|
|
NotSet: 0,
|
|
Male: 1,
|
|
Female: 2,
|
|
Diverse: 4,
|
|
} as const;
|
|
|
|
const ALL_FLAGS = Object.values(Gender).reduce<number>((a, b) => a | b, 0);
|
|
|
|
export const GenderSchema = z
|
|
.nativeEnum(Gender)
|
|
.refine((val) => (val & ALL_FLAGS) === val, {
|
|
message: 'Invalid gender value',
|
|
})
|
|
.describe('Gender/Salutation');
|
|
|
|
export type Gender = z.infer<typeof GenderSchema>;
|