ec-nest/src/qc/dto.ts
liuyun 00c258dda5 fix(c4): 异常处理 handle_status 枚举统一为 handling
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-10-15 01:51:38 +08:00

57 lines
1.6 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { ArrayMaxSize, IsArray, IsIn, IsNotEmpty, IsOptional, IsString } from 'class-validator';
import { ChangePlanDto } from '../plan/dto.js';
/** 退回质控入参(qc_note 必填)。 */
export class ReturnQcDto {
@ApiProperty({ description: '退回原因(必填)' })
@IsString()
@IsNotEmpty()
qcNote!: string;
}
/** 补正入参:只写更正说明 + 生成 recheck,不改原记录证据字段。 */
export class CorrectDto {
@ApiProperty({ description: '留痕记录 ID' })
@IsString()
@IsNotEmpty()
recordId!: string;
@ApiProperty({ description: '补正说明' })
@IsString()
@IsNotEmpty()
correctionNote!: string;
}
/** 异常联动改计划入参:复用 plan.change 字段 + abnormalId。 */
export class ExceptionLinkDto extends ChangePlanDto {
@ApiProperty({ description: '异常上报 ID(ho_record_abnormal.id)' })
@IsString()
@IsNotEmpty()
abnormalId!: string;
}
/** 批量放行入参:待放行的留痕 ID 列表。 */
export class BatchPassDto {
@ApiProperty({ description: '待批量放行的留痕 ID 列表', type: [String] })
@IsArray()
@IsString({ each: true })
@IsNotEmpty()
@ArrayMaxSize(100)
recordIds!: string[];
}
/** 异常处理入参:质控员更新 handle_status/handle_result。 */
export class HandleAbnormalDto {
@ApiProperty({ description: '处理状态', enum: ['handling', 'closed'] })
@IsString()
@IsNotEmpty()
@IsIn(['handling', 'closed'])
handleStatus!: string;
@ApiPropertyOptional({ description: '处理结果' })
@IsOptional()
@IsString()
handleResult?: string;
}