fix(c4): 异常处理 handle_status 枚举统一为 handling

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
liuyun 2026-10-15 01:51:38 +08:00
parent ba7f2397d7
commit 00c258dda5
2 changed files with 5 additions and 5 deletions

View File

@ -43,10 +43,10 @@ export class BatchPassDto {
/** 异常处理入参:质控员更新 handle_status/handle_result。 */ /** 异常处理入参:质控员更新 handle_status/handle_result。 */
export class HandleAbnormalDto { export class HandleAbnormalDto {
@ApiProperty({ description: '处理状态', enum: ['handled', 'closed'] }) @ApiProperty({ description: '处理状态', enum: ['handling', 'closed'] })
@IsString() @IsString()
@IsNotEmpty() @IsNotEmpty()
@IsIn(['handled', 'closed']) @IsIn(['handling', 'closed'])
handleStatus!: string; handleStatus!: string;
@ApiPropertyOptional({ description: '处理结果' }) @ApiPropertyOptional({ description: '处理结果' })

View File

@ -653,7 +653,7 @@ describe('QcService.handleAbnormal', () => {
it('abnormal 不存在 → ABNORMAL_NOT_FOUND', async () => { it('abnormal 不存在 → ABNORMAL_NOT_FOUND', async () => {
const { service, recordAbnormalUpdate } = makeService(); const { service, recordAbnormalUpdate } = makeService();
await expect( await expect(
runWithRequestContext(ctx, () => service.handleAbnormal('missing', { handleStatus: 'handled' })), runWithRequestContext(ctx, () => service.handleAbnormal('missing', { handleStatus: 'handling' })),
).rejects.toMatchObject({ response: { code: ErrorCodes.ABNORMAL_NOT_FOUND } }); ).rejects.toMatchObject({ response: { code: ErrorCodes.ABNORMAL_NOT_FOUND } });
expect(recordAbnormalUpdate).not.toHaveBeenCalled(); expect(recordAbnormalUpdate).not.toHaveBeenCalled();
}); });
@ -679,11 +679,11 @@ describe('QcService.handleAbnormal', () => {
const recordAbnormalUpdate = vi.fn().mockResolvedValue({ id: 'a1' }); const recordAbnormalUpdate = vi.fn().mockResolvedValue({ id: 'a1' });
const { service } = makeService({ recordAbnormalFindUnique, recordAbnormalUpdate }); const { service } = makeService({ recordAbnormalFindUnique, recordAbnormalUpdate });
await runWithRequestContext(ctx, () => service.handleAbnormal('a1', { handleStatus: 'handled' })); await runWithRequestContext(ctx, () => service.handleAbnormal('a1', { handleStatus: 'handling' }));
expect(recordAbnormalUpdate).toHaveBeenCalledWith({ expect(recordAbnormalUpdate).toHaveBeenCalledWith({
where: { id: 'a1' }, where: { id: 'a1' },
data: { handleStatus: 'handled', handleResult: null }, data: { handleStatus: 'handling', handleResult: null },
}); });
}); });
}); });