fix(c4): 异常处理 handle_status 枚举统一为 handling
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
ba7f2397d7
commit
00c258dda5
@ -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: '处理结果' })
|
||||
|
||||
@ -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 },
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user