38 lines
473 B
TypeScript
38 lines
473 B
TypeScript
import {
|
|
IsBoolean,
|
|
IsInt,
|
|
IsNotEmpty,
|
|
IsOptional,
|
|
IsString,
|
|
Length,
|
|
Min,
|
|
} from 'class-validator';
|
|
|
|
export class CreateSubscriptionPlanDto {
|
|
@IsString()
|
|
@Length(1, 100)
|
|
@IsNotEmpty()
|
|
name: string;
|
|
|
|
@IsString()
|
|
@Length(1, 50)
|
|
@IsNotEmpty()
|
|
code: string;
|
|
|
|
@IsInt()
|
|
@Min(1)
|
|
durationMonths: number;
|
|
|
|
@IsInt()
|
|
@Min(0)
|
|
price: number;
|
|
|
|
@IsInt()
|
|
@Min(0)
|
|
freeSmsCount: number;
|
|
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
isActive?: boolean;
|
|
}
|