251119:1700 Backend Phase 1
This commit is contained in:
44
backend/src/modules/user/dto/create-user.dto.ts
Normal file
44
backend/src/modules/user/dto/create-user.dto.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import {
|
||||
IsString,
|
||||
IsEmail,
|
||||
IsNotEmpty,
|
||||
MinLength,
|
||||
IsOptional,
|
||||
IsBoolean,
|
||||
IsInt,
|
||||
} from 'class-validator';
|
||||
|
||||
export class CreateUserDto {
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
username!: string;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@MinLength(6, { message: 'Password must be at least 6 characters' })
|
||||
password!: string;
|
||||
|
||||
@IsEmail()
|
||||
@IsNotEmpty()
|
||||
email!: string;
|
||||
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
firstName?: string;
|
||||
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
lastName?: string;
|
||||
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
lineId?: string;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
primaryOrganizationId?: number; // รับเป็น ID ของ Organization
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
isActive?: boolean;
|
||||
}
|
||||
Reference in New Issue
Block a user