2026-09-19 21:54:21 +03:30
|
|
|
import {
|
2026-09-20 11:24:14 +03:30
|
|
|
IsArray,
|
2026-09-19 21:54:21 +03:30
|
|
|
IsBoolean,
|
|
|
|
|
IsEmail,
|
|
|
|
|
IsIn,
|
2026-09-20 11:24:14 +03:30
|
|
|
IsInt,
|
2026-09-19 21:54:21 +03:30
|
|
|
IsOptional,
|
|
|
|
|
IsString,
|
|
|
|
|
MaxLength,
|
2026-09-20 11:24:14 +03:30
|
|
|
Min,
|
2026-09-19 21:54:21 +03:30
|
|
|
MinLength,
|
|
|
|
|
ValidateIf,
|
|
|
|
|
} from 'class-validator';
|
|
|
|
|
import { USER_ROLES, type UserRole } from '@mento/shared';
|
|
|
|
|
|
|
|
|
|
export class PlatformLoginDto {
|
2026-09-19 22:42:51 +03:30
|
|
|
@IsString()
|
|
|
|
|
@MinLength(8)
|
|
|
|
|
@MaxLength(40)
|
|
|
|
|
mobile!: string;
|
2026-09-19 21:54:21 +03:30
|
|
|
|
|
|
|
|
@IsString()
|
|
|
|
|
@MinLength(6)
|
|
|
|
|
password!: string;
|
|
|
|
|
}
|
|
|
|
|
|
2026-09-19 22:42:51 +03:30
|
|
|
export class CreatePlatformAdminDto {
|
|
|
|
|
@IsString()
|
|
|
|
|
@MinLength(2)
|
|
|
|
|
@MaxLength(120)
|
|
|
|
|
fullName!: string;
|
|
|
|
|
|
|
|
|
|
@IsString()
|
|
|
|
|
@MinLength(8)
|
|
|
|
|
@MaxLength(40)
|
|
|
|
|
mobile!: string;
|
|
|
|
|
|
|
|
|
|
@IsString()
|
|
|
|
|
@MinLength(8)
|
|
|
|
|
@MaxLength(120)
|
|
|
|
|
password!: string;
|
|
|
|
|
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsEmail()
|
|
|
|
|
email?: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class ResetPlatformAdminPasswordDto {
|
|
|
|
|
@IsString()
|
|
|
|
|
@MinLength(8)
|
|
|
|
|
@MaxLength(120)
|
|
|
|
|
password!: string;
|
|
|
|
|
}
|
|
|
|
|
|
2026-09-19 21:54:21 +03:30
|
|
|
export class UpdatePlatformStatusDto {
|
|
|
|
|
@IsBoolean()
|
|
|
|
|
isActive!: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class CreatePlatformOrganizationDto {
|
|
|
|
|
@IsString()
|
|
|
|
|
@MinLength(2)
|
|
|
|
|
@MaxLength(120)
|
|
|
|
|
name!: string;
|
|
|
|
|
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsString()
|
|
|
|
|
@MaxLength(64)
|
|
|
|
|
businessField?: string;
|
|
|
|
|
|
|
|
|
|
@IsString()
|
|
|
|
|
@MinLength(2)
|
|
|
|
|
@MaxLength(120)
|
|
|
|
|
ownerFullName!: string;
|
|
|
|
|
|
|
|
|
|
@IsEmail()
|
|
|
|
|
ownerEmail!: string;
|
|
|
|
|
|
|
|
|
|
@IsString()
|
|
|
|
|
@MinLength(8)
|
|
|
|
|
@MaxLength(120)
|
|
|
|
|
ownerPassword!: string;
|
|
|
|
|
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsString()
|
|
|
|
|
@MaxLength(40)
|
|
|
|
|
ownerMobile?: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class UpdatePlatformOrganizationDto {
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsString()
|
|
|
|
|
@MinLength(2)
|
|
|
|
|
@MaxLength(120)
|
|
|
|
|
name?: string;
|
|
|
|
|
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsString()
|
|
|
|
|
@MinLength(2)
|
|
|
|
|
@MaxLength(64)
|
|
|
|
|
slug?: string;
|
|
|
|
|
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@ValidateIf((_, v) => v !== null && v !== undefined)
|
|
|
|
|
@IsString()
|
|
|
|
|
@MaxLength(64)
|
|
|
|
|
businessField?: string | null;
|
|
|
|
|
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsBoolean()
|
|
|
|
|
isActive?: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class UpdatePlatformMembershipRoleDto {
|
|
|
|
|
@IsIn(USER_ROLES)
|
|
|
|
|
role!: UserRole;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class ResetPlatformUserPasswordDto {
|
|
|
|
|
@IsString()
|
|
|
|
|
@MinLength(8)
|
|
|
|
|
@MaxLength(120)
|
|
|
|
|
password!: string;
|
|
|
|
|
}
|
2026-09-20 11:24:14 +03:30
|
|
|
|
|
|
|
|
export class ApplyBillingPlanDto {
|
|
|
|
|
@IsIn(['trial', 'monthly', 'quarterly', 'semiannual', 'yearly', 'custom'])
|
|
|
|
|
planCode!: 'trial' | 'monthly' | 'quarterly' | 'semiannual' | 'yearly' | 'custom';
|
|
|
|
|
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsInt()
|
|
|
|
|
@Min(1)
|
|
|
|
|
maxOrganizations?: number;
|
|
|
|
|
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsString()
|
|
|
|
|
expiresAt?: string;
|
|
|
|
|
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsString()
|
|
|
|
|
@MaxLength(500)
|
|
|
|
|
notes?: string | null;
|
|
|
|
|
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsIn(['active', 'expired', 'suspended'])
|
|
|
|
|
status?: 'active' | 'expired' | 'suspended';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class UpdateOrgModulesDto {
|
|
|
|
|
@IsArray()
|
|
|
|
|
@IsString({ each: true })
|
|
|
|
|
enabledModules!: string[];
|
|
|
|
|
}
|