subscription

This commit is contained in:
2026-07-02 19:54:55 +03:30
parent d79fa12d65
commit d20e5be9c8
29 changed files with 1402 additions and 0 deletions
@@ -0,0 +1,33 @@
import {
IsBoolean,
IsInt,
IsNotEmpty,
IsOptional,
IsString,
Length,
Min,
} from 'class-validator';
export class CreateSmsPackageDto {
@IsString()
@Length(1, 100)
@IsNotEmpty()
name: string;
@IsString()
@Length(1, 50)
@IsNotEmpty()
code: string;
@IsInt()
@Min(1)
smsCount: number;
@IsInt()
@Min(0)
price: number;
@IsOptional()
@IsBoolean()
isActive?: boolean;
}
@@ -0,0 +1,37 @@
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;
}
@@ -0,0 +1,11 @@
import { IsNotEmpty, IsUUID } from 'class-validator';
export class PurchaseSmsPackageDto {
@IsUUID()
@IsNotEmpty()
salonId: string;
@IsUUID()
@IsNotEmpty()
packageId: string;
}
@@ -0,0 +1,11 @@
import { IsNotEmpty, IsUUID } from 'class-validator';
export class PurchaseSubscriptionDto {
@IsUUID()
@IsNotEmpty()
salonId: string;
@IsUUID()
@IsNotEmpty()
planId: string;
}
@@ -0,0 +1,34 @@
import {
IsBoolean,
IsInt,
IsOptional,
IsString,
Length,
Min,
} from 'class-validator';
export class UpdateSmsPackageDto {
@IsOptional()
@IsString()
@Length(1, 100)
name?: string;
@IsOptional()
@IsString()
@Length(1, 50)
code?: string;
@IsOptional()
@IsInt()
@Min(1)
smsCount?: number;
@IsOptional()
@IsInt()
@Min(0)
price?: number;
@IsOptional()
@IsBoolean()
isActive?: boolean;
}
@@ -0,0 +1,39 @@
import {
IsBoolean,
IsInt,
IsOptional,
IsString,
Length,
Min,
} from 'class-validator';
export class UpdateSubscriptionPlanDto {
@IsOptional()
@IsString()
@Length(1, 100)
name?: string;
@IsOptional()
@IsString()
@Length(1, 50)
code?: string;
@IsOptional()
@IsInt()
@Min(1)
durationMonths?: number;
@IsOptional()
@IsInt()
@Min(0)
price?: number;
@IsOptional()
@IsInt()
@Min(0)
freeSmsCount?: number;
@IsOptional()
@IsBoolean()
isActive?: boolean;
}