251119:1700 Backend Phase 1

This commit is contained in:
admin
2025-11-19 16:58:44 +07:00
parent 2b36e5554b
commit 4c961aa4ee
42 changed files with 1701 additions and 45 deletions
@@ -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;
}
@@ -0,0 +1,4 @@
import { PartialType } from '@nestjs/mapped-types';
import { CreateUserDto } from './create-user.dto.js';
export class UpdateUserDto extends PartialType(CreateUserDto) {}