Skip to content

Commit

Permalink
fix(cb2-13455): ensure certificate number is present (#1559)
Browse files Browse the repository at this point in the history
  • Loading branch information
pbardy2000 authored Aug 23, 2024
1 parent b8ab7fd commit d7375c5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/app/store/test-records/reducers/test-records.reducer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { TEST_TYPES_GROUP1_SPEC_TEST, TEST_TYPES_GROUP5_SPEC_TEST } from '@forms/models/testTypeId.enum';
import {
TEST_TYPES_GROUP1_SPEC_TEST,
TEST_TYPES_GROUP5_SPEC_TEST,
TEST_TYPES_GROUP9_10_CENTRAL_DOCS,
} from '@forms/models/testTypeId.enum';
// eslint-disable-next-line import/no-cycle
import { FormNode } from '@forms/services/dynamic-form.types';
import { DeficiencyCategoryEnum, TestResultDefect } from '@models/test-results/test-result-defect.model';
Expand Down Expand Up @@ -199,6 +203,11 @@ function cleanTestResultPayload(testResult: TestResultModel | undefined) {
testType.secondaryCertificateNumber = '000000';
}

// When abandoning a first test ensure certificate number is sent up
if (isAbandon && TEST_TYPES_GROUP9_10_CENTRAL_DOCS.includes(testType.testTypeId)) {
testType.certificateNumber = '';
}

return testType;
});

Expand Down

0 comments on commit d7375c5

Please sign in to comment.