diff --git a/src/qc/dto.ts b/src/qc/dto.ts index b587f89..151f49c 100644 --- a/src/qc/dto.ts +++ b/src/qc/dto.ts @@ -43,10 +43,10 @@ export class BatchPassDto { /** 异常处理入参:质控员更新 handle_status/handle_result。 */ export class HandleAbnormalDto { - @ApiProperty({ description: '处理状态', enum: ['handled', 'closed'] }) + @ApiProperty({ description: '处理状态', enum: ['handling', 'closed'] }) @IsString() @IsNotEmpty() - @IsIn(['handled', 'closed']) + @IsIn(['handling', 'closed']) handleStatus!: string; @ApiPropertyOptional({ description: '处理结果' }) diff --git a/src/qc/qc.service.spec.ts b/src/qc/qc.service.spec.ts index 829c5f5..b2cbb10 100644 --- a/src/qc/qc.service.spec.ts +++ b/src/qc/qc.service.spec.ts @@ -653,7 +653,7 @@ describe('QcService.handleAbnormal', () => { it('abnormal 不存在 → ABNORMAL_NOT_FOUND', async () => { const { service, recordAbnormalUpdate } = makeService(); await expect( - runWithRequestContext(ctx, () => service.handleAbnormal('missing', { handleStatus: 'handled' })), + runWithRequestContext(ctx, () => service.handleAbnormal('missing', { handleStatus: 'handling' })), ).rejects.toMatchObject({ response: { code: ErrorCodes.ABNORMAL_NOT_FOUND } }); expect(recordAbnormalUpdate).not.toHaveBeenCalled(); }); @@ -679,11 +679,11 @@ describe('QcService.handleAbnormal', () => { const recordAbnormalUpdate = vi.fn().mockResolvedValue({ id: 'a1' }); const { service } = makeService({ recordAbnormalFindUnique, recordAbnormalUpdate }); - await runWithRequestContext(ctx, () => service.handleAbnormal('a1', { handleStatus: 'handled' })); + await runWithRequestContext(ctx, () => service.handleAbnormal('a1', { handleStatus: 'handling' })); expect(recordAbnormalUpdate).toHaveBeenCalledWith({ where: { id: 'a1' }, - data: { handleStatus: 'handled', handleResult: null }, + data: { handleStatus: 'handling', handleResult: null }, }); }); });