2026-09-19 21:54:21 +03:30
|
|
|
import {
|
|
|
|
|
IsBoolean,
|
|
|
|
|
IsEmail,
|
|
|
|
|
IsIn,
|
|
|
|
|
IsOptional,
|
|
|
|
|
IsString,
|
|
|
|
|
MaxLength,
|
|
|
|
|
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;
|
|
|
|
|
}
|