92 lines
1.4 KiB
TypeScript
92 lines
1.4 KiB
TypeScript
import {
|
|||
|
|
IsBoolean,
|
||
|
|
IsEmail,
|
||
|
|
IsIn,
|
||
|
|
IsOptional,
|
||
|
|
IsString,
|
||
|
|
MaxLength,
|
||
|
|
MinLength,
|
||
|
|
ValidateIf,
|
||
|
|
} from 'class-validator';
|
||
|
|
import { USER_ROLES, type UserRole } from '@mento/shared';
|
||
|
|
|
||
|
|
export class PlatformLoginDto {
|
||
|
|
@IsEmail()
|
||
|
|
email!: string;
|
||
|
|
|
||
|
|
@IsString()
|
||
|
|
@MinLength(6)
|
||
|
|
password!: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
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;
|
||
|
|
}
|