38 lines
647 B
TypeScript
38 lines
647 B
TypeScript
import { IsString, IsNotEmpty, IsOptional, IsInt, IsBoolean } from 'class-validator';
|
|
|
|
export class CreateDepartmentDto {
|
|
@IsString() @IsNotEmpty()
|
|
name: string;
|
|
|
|
@IsOptional() @IsInt()
|
|
parentId?: number;
|
|
|
|
@IsOptional() @IsString()
|
|
type?: string;
|
|
|
|
@IsOptional() @IsInt()
|
|
sortOrder?: number;
|
|
}
|
|
|
|
export class UpdateDepartmentDto {
|
|
@IsOptional() @IsString()
|
|
name?: string;
|
|
|
|
@IsOptional() @IsInt()
|
|
parentId?: number;
|
|
|
|
@IsOptional() @IsString()
|
|
type?: string;
|
|
|
|
@IsOptional() @IsInt()
|
|
sortOrder?: number;
|
|
}
|
|
|
|
export class AssignUserDto {
|
|
@IsInt()
|
|
userId: number;
|
|
|
|
@IsOptional() @IsBoolean()
|
|
isDefault?: boolean;
|
|
}
|