Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cb2-13455): ensure certificate number is present #1559

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading