import { registerEnumType, ObjectType, Field, InputType, Int } from 'type-graphql'; import { PaymentStatusEnum } from './components.payments'; import { AvailableTranslation } from '@src/__components/components'; /* ███████╗███╗ ██╗██╗ ██╗███╗ ███╗ ██╔════╝████╗ ██║██║ ██║████╗ ████║ █████╗ ██╔██╗ ██║██║ ██║██╔████╔██║ ██╔══╝ ██║╚██╗██║██║ ██║██║╚██╔╝██║ ███████╗██║ ╚████║╚██████╔╝██║ ╚═╝ ██║ ╚══════╝╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ */ export enum OrderTypeEnum { online = 'online', withShipping = 'withShipping', } registerEnumType(OrderTypeEnum, { name: 'OrderType', }); export enum OrderStatusEnum { draft = 'draft', processing = 'processing', shipped = 'shipped', completed = 'completed', canceled = 'canceled', refund = 'refund', } registerEnumType(OrderStatusEnum, { name: 'OrderStatusEnum', }); export enum OrderBusinessStatusEnum { processing = 'processing', shipped = 'shipped', completed = 'completed', canceled = 'canceled', refund = 'refund', } registerEnumType(OrderBusinessStatusEnum, { name: 'OrderBusinessStatusEnum', }); /* ██████╗ ██████╗ ███╗ ███╗██████╗ ██████╗ ███╗ ██╗███████╗███╗ ██╗████████╗███████╗ ██╔════╝██╔═══██╗████╗ ████║██╔══██╗██╔═══██╗████╗ ██║██╔════╝████╗ ██║╚══██╔══╝██╔════╝ ██║ ██║ ██║██╔████╔██║██████╔╝██║ ██║██╔██╗ ██║█████╗ ██╔██╗ ██║ ██║ ███████╗ ██║ ██║ ██║██║╚██╔╝██║██╔═══╝ ██║ ██║██║╚██╗██║██╔══╝ ██║╚██╗██║ ██║ ╚════██║ ╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ╚██████╔╝██║ ╚████║███████╗██║ ╚████║ ██║ ███████║ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚══════╝ */ @ObjectType() @InputType('LocaleInfoInput') export class LocaleInfo { @Field({ nullable: true }) countryCode?: string; @Field(() => AvailableTranslation, { nullable: true }) locale?: AvailableTranslation; } @ObjectType() export class OrderInfoComponent { @Field() _id: string; @Field(() => OrderStatusEnum) orderStatus: OrderStatusEnum; @Field(() => PaymentStatusEnum) paymentStatus: PaymentStatusEnum; } @ObjectType() @InputType('AddOnInput') export class AddOnComponent { @Field() addOnId: string; @Field() quantity: number; }