import { Exclude, Expose } from 'class-transformer'; import { IsMongoId, IsNotEmpty, IsString } from 'class-validator'; import { ObjectID } from 'typeorm'; import { IVendorOrder } from '../interface'; export class VendorOrderModel implements IVendorOrder { @Exclude() readonly _id: string | any; @Expose({ groups: ['read', 'write'] }) @IsNotEmpty({ always: true }) @IsMongoId({ always: true }) vendorId: ObjectID; @Expose({ groups: ['read', 'write'] }) @IsNotEmpty({ always: true }) @IsString({ always: true }) orderId: string; @Expose({ groups: ['read', 'write'] }) @IsNotEmpty({ always: true }) @IsString({ always: true }) providerOrderId: string; /** * If true, the order has been sent to the pos system. * Otherwise it was not sent. */ @Expose({ groups: ['read', 'write'] }) @IsNotEmpty({ always: true }) @IsString({ always: true }) isLiveMode: boolean; }