Files
CRM_Montzar/apps/api/src/integrations/woocommerce/dto.ts
T

74 lines
1.1 KiB
TypeScript

import {
IsBoolean,
IsOptional,
IsString,
MaxLength,
MinLength,
} from 'class-validator';
export class CreateWooConnectionDto {
@IsString()
@MinLength(2)
@MaxLength(80)
label!: string;
@IsString()
@MinLength(8)
@MaxLength(300)
storeUrl!: string;
@IsString()
@MinLength(8)
@MaxLength(200)
consumerKey!: string;
@IsString()
@MinLength(8)
@MaxLength(200)
consumerSecret!: string;
@IsOptional()
@IsString()
@MaxLength(200)
webhookSecret?: string;
@IsOptional()
@IsBoolean()
enabled?: boolean;
}
export class UpdateWooConnectionDto {
@IsOptional()
@IsString()
@MinLength(2)
@MaxLength(80)
label?: string;
@IsOptional()
@IsString()
@MinLength(8)
@MaxLength(300)
storeUrl?: string;
@IsOptional()
@IsString()
@MinLength(8)
@MaxLength(200)
consumerKey?: string;
@IsOptional()
@IsString()
@MinLength(8)
@MaxLength(200)
consumerSecret?: string;
@IsOptional()
@IsString()
@MaxLength(200)
webhookSecret?: string | null;
@IsOptional()
@IsBoolean()
enabled?: boolean;
}