mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
committed by
Nino Righi
parent
1d4c900d3a
commit
89b3d9aa60
@@ -5,10 +5,11 @@ export * from './entity-cotnainer';
|
||||
export * from './entity-status';
|
||||
export * from './gender';
|
||||
export * from './list-response-args';
|
||||
export * from './order-type';
|
||||
export * from './order-type-feature';
|
||||
export * from './payer-type';
|
||||
export * from './price-value';
|
||||
export * from './price';
|
||||
export * from './product';
|
||||
export * from './response-args';
|
||||
export * from './return-value';
|
||||
export * from './vat-type';
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
export const OrderType = {
|
||||
InStore: 'Rücklage',
|
||||
Pickup: 'Abholung',
|
||||
Delivery: 'Versand',
|
||||
DigitalShipping: 'DIG-Versand',
|
||||
B2BShipping: 'B2B-Versand',
|
||||
Download: 'Download',
|
||||
} as const;
|
||||
|
||||
export type OrderType = (typeof OrderType)[keyof typeof OrderType];
|
||||
export const OrderTypeFeature = {
|
||||
InStore: 'Rücklage',
|
||||
Pickup: 'Abholung',
|
||||
Delivery: 'Versand',
|
||||
DigitalShipping: 'DIG-Versand',
|
||||
B2BShipping: 'B2B-Versand',
|
||||
Download: 'Download',
|
||||
} as const;
|
||||
|
||||
export type OrderTypeFeature =
|
||||
(typeof OrderTypeFeature)[keyof typeof OrderTypeFeature];
|
||||
5
libs/common/data-access/src/lib/models/product.ts
Normal file
5
libs/common/data-access/src/lib/models/product.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { ProductDTO as CatProductDTO } from '@generated/swagger/cat-search-api';
|
||||
import { ProductDTO as CheckoutProductDTO } from '@generated/swagger/checkout-api';
|
||||
import { ProductDTO as OmsProductDTO } from '@generated/swagger/oms-api';
|
||||
|
||||
export type Product = CatProductDTO | CheckoutProductDTO | OmsProductDTO;
|
||||
@@ -1,12 +1,10 @@
|
||||
import z from 'zod';
|
||||
|
||||
export const AddressSchema = z
|
||||
.object({
|
||||
street: z.string().describe('Street name').optional(),
|
||||
streetNumber: z.string().describe('Street number').optional(),
|
||||
zipCode: z.string().describe('Postal code').optional(),
|
||||
city: z.string().describe('City name').optional(),
|
||||
country: z.string().describe('Country').optional(),
|
||||
additionalInfo: z.string().describe('Additional information').optional(),
|
||||
})
|
||||
.optional();
|
||||
export const AddressSchema = z.object({
|
||||
street: z.string().describe('Street name').optional(),
|
||||
streetNumber: z.string().describe('Street number').optional(),
|
||||
zipCode: z.string().describe('Postal code').optional(),
|
||||
city: z.string().describe('City name').optional(),
|
||||
country: z.string().describe('Country').optional(),
|
||||
additionalInfo: z.string().describe('Additional information').optional(),
|
||||
});
|
||||
|
||||
@@ -7,11 +7,15 @@ import { OrganisationSchema } from './organisation.schema';
|
||||
|
||||
export const AddresseeWithReferenceSchema = EntityReferenceSchema.extend({
|
||||
address: AddressSchema.describe('Address').optional(),
|
||||
communicationDetails: CommunicationDetailsSchema.describe('Communication details').optional(),
|
||||
communicationDetails: CommunicationDetailsSchema.describe(
|
||||
'Communication details',
|
||||
).optional(),
|
||||
firstName: z.string().describe('First name').optional(),
|
||||
lastName: z.string().describe('Last name').optional(),
|
||||
gender: GenderSchema.describe('Gender').optional(),
|
||||
locale: z.string().describe('Locale').optional(),
|
||||
organisation: OrganisationSchema.describe('Organisation information').optional(),
|
||||
organisation: OrganisationSchema.describe(
|
||||
'Organisation information',
|
||||
).optional(),
|
||||
title: z.string().describe('Title').optional(),
|
||||
});
|
||||
|
||||
@@ -4,4 +4,6 @@ import { EntityStatus } from '../models';
|
||||
/**
|
||||
* EntityStatus is a bitwise enum with values: 0 | 1 | 2 | 4 | 8
|
||||
*/
|
||||
export const EntityStatusSchema = z.nativeEnum(EntityStatus).describe('Entity status');
|
||||
export const EntityStatusSchema = z
|
||||
.nativeEnum(EntityStatus)
|
||||
.describe('Entity status');
|
||||
|
||||
@@ -13,6 +13,7 @@ export * from './gender.schema';
|
||||
export * from './key-value.schema';
|
||||
export * from './label.schema';
|
||||
export * from './notification-channel.schema';
|
||||
export * from './order-type.schema';
|
||||
export * from './organisation-names.schema';
|
||||
export * from './organisation.schema';
|
||||
export * from './payment-type.schema';
|
||||
|
||||
14
libs/common/data-access/src/lib/schemas/order-type.schema.ts
Normal file
14
libs/common/data-access/src/lib/schemas/order-type.schema.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const OrderType = {
|
||||
NotSet: 0,
|
||||
Branch: 1,
|
||||
Mail: 2,
|
||||
Download: 4,
|
||||
BranchAndDownload: 5, // Branch | Download
|
||||
MailAndDownload: 6, // Mail | Download
|
||||
} as const;
|
||||
|
||||
export const OrderTypeSchema = z.nativeEnum(OrderType).describe('Order type');
|
||||
|
||||
export type OrderType = z.infer<typeof OrderTypeSchema>;
|
||||
Reference in New Issue
Block a user