57 lines
1.6 KiB
TypeScript
57 lines
1.6 KiB
TypeScript
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;
|
||
}
|