- 新增电工APP独立鉴权中间件与登录注册接口 - 新增定时任务管理模块,支持任务配置、执行日志与手动触发 - 新增运维费定价与电工派单成本价目管理 - 新增电工资质证照管理与到期提醒定时任务 - 完善数据库实体与DTO校验,优化权限控制
52 lines
1.8 KiB
TypeScript
52 lines
1.8 KiB
TypeScript
import { IsNotEmpty, IsOptional, IsString, IsInt, IsNumber, IsIn, Min, Max, MaxLength } from "class-validator";
|
|
|
|
export class DispatchPriceQueryDTO {
|
|
@IsOptional() @IsInt() @Min(1) page?: number = 1;
|
|
|
|
@IsOptional() @IsInt() @Min(1) @Max(200, { message: "分页大小不能超过 200 条" }) pageSize?: number = 10;
|
|
|
|
@IsOptional() @IsString() @MaxLength(64, { message: "关键词最大 64 字符" }) keyword?: string;
|
|
|
|
@IsOptional() @IsString() @MaxLength(32) dispatchType?: string;
|
|
|
|
@IsOptional() @IsIn([1, 2], { message: "计价方式非法" }) priceMode?: number;
|
|
|
|
@IsOptional() @IsIn([0, 1], { message: "状态值非法" }) status?: number;
|
|
}
|
|
|
|
export class DispatchPriceCreateDTO {
|
|
@IsNotEmpty({ message: "派单类型不能为空" })
|
|
@IsString()
|
|
@MaxLength(32)
|
|
dispatchType!: string;
|
|
|
|
@IsNotEmpty({ message: "单价不能为空" })
|
|
@IsNumber({}, { message: "单价必须为数字" })
|
|
unitPrice!: number;
|
|
|
|
@IsOptional() @IsString() @MaxLength(32) priceType?: string;
|
|
|
|
@IsOptional() @IsIn([1, 2], { message: "计价方式非法" }) priceMode?: number;
|
|
|
|
@IsOptional() @IsString() @MaxLength(16) unit?: string;
|
|
|
|
@IsOptional() @IsIn([0, 1], { message: "状态值非法" }) status?: number;
|
|
|
|
@IsOptional() @IsString() @MaxLength(255) remark?: string;
|
|
}
|
|
|
|
export class DispatchPriceUpdateDTO {
|
|
@IsOptional() @IsString() @MaxLength(32) dispatchType?: string;
|
|
|
|
@IsOptional() @IsString() @MaxLength(32) priceType?: string;
|
|
|
|
@IsOptional() @IsIn([1, 2], { message: "计价方式非法" }) priceMode?: number;
|
|
|
|
@IsOptional() @IsNumber({}, { message: "单价必须为数字" }) unitPrice?: number;
|
|
|
|
@IsOptional() @IsString() @MaxLength(16) unit?: string;
|
|
|
|
@IsOptional() @IsIn([0, 1], { message: "状态值非法" }) status?: number;
|
|
|
|
@IsOptional() @IsString() @MaxLength(255) remark?: string;
|
|
} |