import { Exclude, Expose } from 'class-transformer'; import { IsArray, IsDate, IsEnum, IsNotEmpty } from 'class-validator'; import { IVendorToken, VendorProviderEnum, VendorTokenInfoType } from '../interface'; export class VendorTokenModel implements IVendorToken { @Exclude() readonly _id: string | any; @Expose({ groups: ['read', 'write'] }) @IsNotEmpty({ always: true }) @IsEnum(VendorProviderEnum, { always: true }) provider: VendorProviderEnum; @Exclude() @IsNotEmpty({ always: true }) @IsArray({ always: true }) info: VendorTokenInfoType; @Expose({ groups: ['read'] }) @IsDate() readonly createdAt: Date; @Expose({ groups: ['read'] }) @IsDate() readonly updatedAt: Date; }