diff --git a/package-lock.json b/package-lock.json index 510e13d32..75373565c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "@angular/router": "^18.2.7", "@azure/msal-angular": "^3.0.24", "@azure/msal-browser": "^3.24.0", - "@dvsa/cvs-type-definitions": "^7.6.2", + "@dvsa/cvs-type-definitions": "^7.8.0", "@ngrx/effects": "^18.0.2", "@ngrx/entity": "^18.0.2", "@ngrx/operators": "^18.1.0", @@ -4489,9 +4489,9 @@ "license": "ISC" }, "node_modules/@dvsa/cvs-type-definitions": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/@dvsa/cvs-type-definitions/-/cvs-type-definitions-7.6.2.tgz", - "integrity": "sha512-Ju0L1cbXfjN9dpwT5JmsVKJnSLaMPA0NqnC2bg858BvKmu5q6NaRZK0Gve3hvIzP6NQYFW6ub3RCuRHDSNUMrA==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@dvsa/cvs-type-definitions/-/cvs-type-definitions-7.8.0.tgz", + "integrity": "sha512-yGuAm6ZeoOjy+3Q+ftsbTyP5fdUYn8RJEP/DSWIhmkY7r+xjJ7eKG9zuNXRJWIyrgfprtiu1Vq91cy6IuDSBcg==", "license": "ISC", "dependencies": { "ajv": "^8.12.0", diff --git a/package.json b/package.json index bf371fed2..9933ccf9b 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "@angular/router": "^18.2.7", "@azure/msal-angular": "^3.0.24", "@azure/msal-browser": "^3.24.0", - "@dvsa/cvs-type-definitions": "^7.6.2", + "@dvsa/cvs-type-definitions": "^7.8.0", "@ngrx/effects": "^18.0.2", "@ngrx/entity": "^18.0.2", "@ngrx/operators": "^18.1.0", diff --git a/src/app/features/tech-record/components/tech-record-summary-changes/tech-record-summary-changes.component.html b/src/app/features/tech-record/components/tech-record-summary-changes/tech-record-summary-changes.component.html index 19eccaa08..22c663f4c 100644 --- a/src/app/features/tech-record/components/tech-record-summary-changes/tech-record-summary-changes.component.html +++ b/src/app/features/tech-record/components/tech-record-summary-changes/tech-record-summary-changes.component.html @@ -5,8 +5,72 @@ - - + + +
+
+
Vehicle identification number (VIN)
+
+ {{ techRecordEdited.vin | defaultNullOrEmpty }} +
+
+
+
TrailerID
+
+ {{ techRecordEdited.trailerId | defaultNullOrEmpty }} +
+
+
+
Vehicle registration mark (VRM)
+
+ {{ techRecordEdited.primaryVrm | defaultNullOrEmpty }} +
+
+
+
Vehicle type
+
+ {{ $any(techRecordEdited.techRecord_vehicleType) | formatVehicleType | defaultNullOrEmpty }} +
+
+
+
Year of manufacture
+
+ {{ techRecordEdited.techRecord_manufactureYear | defaultNullOrEmpty }} +
+
+
+
Make
+
+ {{ techRecordEdited.techRecord_chassisMake | defaultNullOrEmpty }} +
+
+
+
Model
+
+ {{ techRecordEdited.techRecord_chassisModel | defaultNullOrEmpty }} +
+
+
+
Make
+
+ {{ + techRecordEdited.techRecord_vehicleType === 'trl' || techRecordEdited.techRecord_vehicleType === 'hgv' + ? (techRecordEdited.techRecord_make | defaultNullOrEmpty) + : '-' + }} +
+
+
+
Model
+
+ {{ + techRecordEdited.techRecord_vehicleType === 'trl' || techRecordEdited.techRecord_vehicleType === 'hgv' + ? (techRecordEdited.techRecord_model | defaultNullOrEmpty) + : '-' + }} +
+
+
diff --git a/src/app/features/tech-record/components/tech-record-summary-changes/tech-record-summary-changes.component.ts b/src/app/features/tech-record/components/tech-record-summary-changes/tech-record-summary-changes.component.ts index b9693867a..9cee1638a 100644 --- a/src/app/features/tech-record/components/tech-record-summary-changes/tech-record-summary-changes.component.ts +++ b/src/app/features/tech-record/components/tech-record-summary-changes/tech-record-summary-changes.component.ts @@ -9,7 +9,6 @@ import { TechRecordGETPSV, TechRecordGETTRL, } from '@dvsa/cvs-type-definitions/types/v3/tech-record/tech-record-verb-vehicle-type'; -import { VehicleSummary } from '@forms/templates/tech-records/vehicle-summary.template'; import { vehicleTemplateMap } from '@forms/utils/tech-record-constants'; import { Axles, VehicleTypes } from '@models/vehicle-tech-record.model'; import { Actions, ofType } from '@ngrx/effects'; @@ -139,10 +138,6 @@ export class TechRecordSummaryChangesComponent implements OnInit, OnDestroy { : undefined; } - get vehicleSummary(): FormNode { - return VehicleSummary; - } - get deletedAxles(): Axles { if (this.techRecordEdited?.techRecord_vehicleType === 'hgv' && this.techRecordDeletions) { return Object.values((this.techRecordDeletions as Partial).techRecord_axles ?? {}); diff --git a/src/app/features/test-records/amend/views/confirm-cancellation/__tests__/confirm-cancellation.component.spec.ts b/src/app/features/test-records/amend/views/confirm-cancellation/__tests__/confirm-cancellation.component.spec.ts index cd5c84d4a..89380672a 100644 --- a/src/app/features/test-records/amend/views/confirm-cancellation/__tests__/confirm-cancellation.component.spec.ts +++ b/src/app/features/test-records/amend/views/confirm-cancellation/__tests__/confirm-cancellation.component.spec.ts @@ -9,7 +9,7 @@ import { provideMockStore } from '@ngrx/store/testing'; import { TestRecordsService } from '@services/test-records/test-records.service'; import { SharedModule } from '@shared/shared.module'; import { initialAppState } from '@store/index'; -import { ReplaySubject } from 'rxjs'; +import { ReplaySubject, of } from 'rxjs'; import { VehicleHeaderComponent } from '../../../../components/vehicle-header/vehicle-header.component'; import { ConfirmCancellationComponent } from '../confirm-cancellation.component'; @@ -28,6 +28,7 @@ describe('ConfirmCancellationComponent', () => { provide: TestRecordsService, useValue: { cancelTest: () => {}, + isTestTypeGroupEditable$: of(false), }, }, ], diff --git a/src/app/features/test-records/components/vehicle-header/vehicle-header.component.html b/src/app/features/test-records/components/vehicle-header/vehicle-header.component.html index 06099ad2f..2690ce269 100644 --- a/src/app/features/test-records/components/vehicle-header/vehicle-header.component.html +++ b/src/app/features/test-records/components/vehicle-header/vehicle-header.component.html @@ -20,6 +20,12 @@

+ + + +

Vehicle details

@@ -90,6 +96,12 @@

+ + + +
diff --git a/src/app/features/test-records/components/vehicle-header/vehicle-header.component.ts b/src/app/features/test-records/components/vehicle-header/vehicle-header.component.ts index 152d5051d..de49aa743 100644 --- a/src/app/features/test-records/components/vehicle-header/vehicle-header.component.ts +++ b/src/app/features/test-records/components/vehicle-header/vehicle-header.component.ts @@ -1,5 +1,7 @@ -import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; +import { TestRecordsService } from '@/src/app/services/test-records/test-records.service'; +import { ChangeDetectionStrategy, Component, Input, inject } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; +import { RecallsSchema } from '@dvsa/cvs-type-definitions/types/v1/recalls'; import { TechRecordType } from '@dvsa/cvs-type-definitions/types/v3/tech-record/tech-record-vehicle-type'; import { ReferenceDataResourceType } from '@models/reference-data.model'; import { TestResultStatus } from '@models/test-results/test-result-status.enum'; @@ -8,10 +10,9 @@ import { TestType, resultOfTestEnum } from '@models/test-types/test-type.model'; import { TEST_TYPES_GROUP7 } from '@models/testTypeId.enum'; import { V3TechRecordModel, VehicleTypes } from '@models/vehicle-tech-record.model'; import { Store } from '@ngrx/store'; -import { TestTypesService } from '@services/test-types/test-types.service'; import { techRecord } from '@store/technical-records'; import { selectAllTestTypes } from '@store/test-types/test-types.selectors'; -import { Observable } from 'rxjs'; +import { Observable, map } from 'rxjs'; import { TagType, TagTypes } from '../../../../components/tag/tag.component'; @Component({ @@ -26,11 +27,9 @@ export class VehicleHeaderComponent { @Input() testNumber?: string | null; @Input() isReview = false; - constructor( - private testTypesService: TestTypesService, - private store: Store, - private activatedRoute: ActivatedRoute - ) {} + store = inject(Store); + activatedRoute = inject(ActivatedRoute); + testRecordsService = inject(TestRecordsService); get test(): TestType | undefined { return this.testResult?.testTypes?.find((t) => this.testNumber === t.testNumber); @@ -82,6 +81,12 @@ export class VehicleHeaderComponent { return testCode ? `(${testCode})` : ''; } + get recalls(): Observable { + return this.testRecordsService.isTestTypeGroupEditable$.pipe( + map((editable) => (editable ? this.testResult?.recalls : this.activatedRoute.snapshot?.data?.['recalls'])) + ); + } + // eslint-disable-next-line @typescript-eslint/no-shadow getVehicleDescription(techRecord: V3TechRecordModel, vehicleType: VehicleTypes | undefined) { switch (vehicleType) { diff --git a/src/app/features/test-records/create/create-test-records-routing.module.ts b/src/app/features/test-records/create/create-test-records-routing.module.ts index 7dc40c8c7..fab813ebf 100644 --- a/src/app/features/test-records/create/create-test-records-routing.module.ts +++ b/src/app/features/test-records/create/create-test-records-routing.module.ts @@ -1,3 +1,4 @@ +import { recallsResolver } from '@/src/app/resolvers/recalls/recalls.resolver'; import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { DefectSelectComponent } from '@forms/components/defect-select/defect-select.component'; @@ -40,6 +41,7 @@ const routes: Routes = [ defectTaxonomy: defectsTaxonomyResolver, testStations: testStationsResolver, testCode: testCodeResolver, + recalls: recallsResolver, }, data: { title: 'Test details', roles: Roles.TestResultCreateContingency, breadcrumbPreserveQueryParams: true }, canActivate: [RoleGuard], diff --git a/src/app/forms/custom-sections/psv-brakes/psv-brakes.component.ts b/src/app/forms/custom-sections/psv-brakes/psv-brakes.component.ts index c84acd246..a16a08766 100644 --- a/src/app/forms/custom-sections/psv-brakes/psv-brakes.component.ts +++ b/src/app/forms/custom-sections/psv-brakes/psv-brakes.component.ts @@ -101,7 +101,8 @@ export class PsvBrakesComponent implements OnInit, OnChanges, OnDestroy { } get brakeCode(): string { - return `${this.brakeCodePrefix}${this.form.get('techRecord_brakes_brakeCodeOriginal')?.value}`; + const suffix = this.form.get('techRecord_brakes_brakeCodeOriginal')?.value; + return suffix ? `${this.brakeCodePrefix}${suffix}` : '-'; } get brakesForm(): FormGroup { diff --git a/src/app/forms/templates/small-trailer/small-trailer-tech-record.template.ts b/src/app/forms/templates/small-trailer/small-trailer-tech-record.template.ts index a863cb240..417d91cbf 100644 --- a/src/app/forms/templates/small-trailer/small-trailer-tech-record.template.ts +++ b/src/app/forms/templates/small-trailer/small-trailer-tech-record.template.ts @@ -47,7 +47,7 @@ export const SmallTrailerTechRecord: FormNode = { editType: FormNodeEditTypes.SELECT, options: [ { value: 'January', label: 'January' }, - { value: 'February', label: 'Febraury' }, + { value: 'February', label: 'February' }, { value: 'March', label: 'March' }, { value: 'April', label: 'April' }, { value: 'May', label: 'May' }, diff --git a/src/app/forms/templates/tech-records/vehicle-summary.template.ts b/src/app/forms/templates/tech-records/vehicle-summary.template.ts deleted file mode 100644 index 4b5521fa4..000000000 --- a/src/app/forms/templates/tech-records/vehicle-summary.template.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { - FormNode, - FormNodeEditTypes, - FormNodeTypes, - FormNodeViewTypes, -} from '@services/dynamic-forms/dynamic-form.types'; - -export const VehicleSummary: FormNode = { - name: 'vehicleSummary', - label: 'Vehicle Summary', - type: FormNodeTypes.GROUP, - children: [ - { - name: 'vin', - label: 'Vehicle identification number (VIN)', - type: FormNodeTypes.CONTROL, - viewType: FormNodeViewTypes.STRING, - editType: FormNodeEditTypes.TEXT, - }, - { - name: 'primaryVrm', - label: 'Vehicle registration mark (VRM)', - type: FormNodeTypes.CONTROL, - viewType: FormNodeViewTypes.STRING, - editType: FormNodeEditTypes.TEXT, - }, - { - name: 'techRecord_vehicleType', - label: 'Vehicle type', - type: FormNodeTypes.CONTROL, - viewType: FormNodeViewTypes.STRING, - editType: FormNodeEditTypes.TEXT, - }, - { - name: 'techRecord_manufactureYear', - label: 'Year of manufacture', - type: FormNodeTypes.CONTROL, - viewType: FormNodeViewTypes.STRING, - editType: FormNodeEditTypes.TEXT, - }, - { - name: 'techRecord_make', - label: 'Make', - type: FormNodeTypes.CONTROL, - viewType: FormNodeViewTypes.STRING, - editType: FormNodeEditTypes.TEXT, - }, - { - name: 'techRecord_model', - label: 'Model', - type: FormNodeTypes.CONTROL, - viewType: FormNodeViewTypes.STRING, - editType: FormNodeEditTypes.TEXT, - }, - ], -}; diff --git a/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group1.template.ts b/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group1.template.ts index 63d12a2e6..ee320d1de 100644 --- a/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group1.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group1.template.ts @@ -39,6 +39,26 @@ export const ContingencyTestSectionGroup1: FormNode = { editType: FormNodeEditTypes.HIDDEN, validators: [{ name: ValidatorNames.AheadOfDate, args: 'testStartTimestamp' }], }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group12and14.template.ts b/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group12and14.template.ts index 6507e6f84..bc5cefa39 100644 --- a/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group12and14.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group12and14.template.ts @@ -40,6 +40,26 @@ export const ContingencyTestSectionGroup12and14: FormNode = { editType: FormNodeEditTypes.HIDDEN, validators: [{ name: ValidatorNames.AheadOfDate, args: 'testStartTimestamp' }], }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group15and16.template.ts b/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group15and16.template.ts index fd3fdc579..8142e0661 100644 --- a/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group15and16.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group15and16.template.ts @@ -41,6 +41,26 @@ export const ContingencyTestSectionGroup15and16: FormNode = { editType: FormNodeEditTypes.HIDDEN, validators: [{ name: ValidatorNames.AheadOfDate, args: 'testStartTimestamp' }], }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group3And4And8.template.ts b/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group3And4And8.template.ts index 532003f2f..93ec59bbd 100644 --- a/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group3And4And8.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group3And4And8.template.ts @@ -41,6 +41,26 @@ export const ContingencyTestSectionGroup3And4And8: FormNode = { editType: FormNodeEditTypes.HIDDEN, validators: [{ name: ValidatorNames.AheadOfDate, args: 'testStartTimestamp' }], }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group5And13.template.ts b/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group5And13.template.ts index e8b23e76e..5ec7e5a23 100644 --- a/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group5And13.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group5And13.template.ts @@ -41,6 +41,26 @@ export const ContingencyTestSectionGroup5And13: FormNode = { editType: FormNodeEditTypes.HIDDEN, validators: [{ name: ValidatorNames.AheadOfDate, args: 'testStartTimestamp' }], }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group6And11.template.ts b/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group6And11.template.ts index 78eb222db..fdb208232 100644 --- a/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group6And11.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group6And11.template.ts @@ -40,6 +40,26 @@ export const ContingencyTestSectionGroup6And11: FormNode = { editType: FormNodeEditTypes.HIDDEN, validators: [{ name: ValidatorNames.AheadOfDate, args: 'testStartTimestamp' }], }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group7.template.ts b/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group7.template.ts index b5326593a..365a70c19 100644 --- a/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group7.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group7.template.ts @@ -42,6 +42,26 @@ export const ContingencyTestSectionGroup7: FormNode = { editType: FormNodeEditTypes.HIDDEN, validators: [{ name: ValidatorNames.AheadOfDate, args: 'testStartTimestamp' }], }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group8Notifiable.template.ts b/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group8Notifiable.template.ts index 0f5c7f1a7..38ad6dcf1 100644 --- a/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group8Notifiable.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group8Notifiable.template.ts @@ -41,6 +41,26 @@ export const ContingencyTestSectionGroup8Notifiable: FormNode = { editType: FormNodeEditTypes.HIDDEN, validators: [{ name: ValidatorNames.AheadOfDate, args: 'testStartTimestamp' }], }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group9And10.template.ts b/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group9And10.template.ts index e83df76af..6bd66e86a 100644 --- a/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group9And10.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group9And10.template.ts @@ -40,6 +40,26 @@ export const ContingencyTestSectionGroup9And10: FormNode = { editType: FormNodeEditTypes.HIDDEN, validators: [{ name: ValidatorNames.AheadOfDate, args: 'testStartTimestamp' }], }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group9And10CentralDocs.template.ts b/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group9And10CentralDocs.template.ts index 4644012b7..7b068959a 100644 --- a/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group9And10CentralDocs.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-group9And10CentralDocs.template.ts @@ -40,6 +40,26 @@ export const ContingencyTestSectionGroup9And10CentralDocs: FormNode = { editType: FormNodeEditTypes.HIDDEN, validators: [{ name: ValidatorNames.AheadOfDate, args: 'testStartTimestamp' }], }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-specialist-group1.template.ts b/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-specialist-group1.template.ts index 713aa7d45..f8d3823fa 100644 --- a/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-specialist-group1.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-specialist-group1.template.ts @@ -43,6 +43,26 @@ export const ContingencyTestSectionSpecialistGroup1: FormNode = { editType: FormNodeEditTypes.HIDDEN, validators: [{ name: ValidatorNames.AheadOfDate, args: 'testStartTimestamp' }], }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-specialist-group2.template.ts b/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-specialist-group2.template.ts index f4258f14a..25b963ce1 100644 --- a/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-specialist-group2.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-specialist-group2.template.ts @@ -41,6 +41,26 @@ export const ContingencyTestSectionSpecialistGroup2: FormNode = { editType: FormNodeEditTypes.HIDDEN, validators: [{ name: ValidatorNames.AheadOfDate, args: 'testStartTimestamp' }], }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-specialist-group3And4.template.ts b/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-specialist-group3And4.template.ts index 5a9aeb3ac..a6647b545 100644 --- a/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-specialist-group3And4.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-specialist-group3And4.template.ts @@ -41,6 +41,26 @@ export const ContingencyTestSectionSpecialistGroup3And4: FormNode = { editType: FormNodeEditTypes.HIDDEN, validators: [{ name: ValidatorNames.AheadOfDate, args: 'testStartTimestamp' }], }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-specialist-group5.template.ts b/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-specialist-group5.template.ts index e37d76ce5..33d057c64 100644 --- a/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-specialist-group5.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/contingency/contingency-test-section-specialist-group5.template.ts @@ -42,6 +42,26 @@ export const ContingencyTestSectionSpecialistGroup5: FormNode = { editType: FormNodeEditTypes.HIDDEN, validators: [{ name: ValidatorNames.AheadOfDate, args: 'testStartTimestamp' }], }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/contingency/old-contingency-specialist-group1.template.ts b/src/app/forms/templates/test-records/section-templates/test/contingency/old-contingency-specialist-group1.template.ts index d0e4d47a6..3871c90ae 100644 --- a/src/app/forms/templates/test-records/section-templates/test/contingency/old-contingency-specialist-group1.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/contingency/old-contingency-specialist-group1.template.ts @@ -41,6 +41,26 @@ export const OldIVAContingencyTestSectionSpecialistGroup1: FormNode = { editType: FormNodeEditTypes.HIDDEN, validators: [{ name: ValidatorNames.AheadOfDate, args: 'testStartTimestamp' }], }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/contingency/old-contingency-specialist-group5.template.ts b/src/app/forms/templates/test-records/section-templates/test/contingency/old-contingency-specialist-group5.template.ts index a7af1b7cd..3e2cb96db 100644 --- a/src/app/forms/templates/test-records/section-templates/test/contingency/old-contingency-specialist-group5.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/contingency/old-contingency-specialist-group5.template.ts @@ -41,6 +41,26 @@ export const OldIVAContingencyTestSectionSpecialistGroup5: FormNode = { editType: FormNodeEditTypes.HIDDEN, validators: [{ name: ValidatorNames.AheadOfDate, args: 'testStartTimestamp' }], }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/desk-based/desk-based-test-section-group1-PSV.template.ts b/src/app/forms/templates/test-records/section-templates/test/desk-based/desk-based-test-section-group1-PSV.template.ts index 7f5faa9ad..526f4b8b4 100644 --- a/src/app/forms/templates/test-records/section-templates/test/desk-based/desk-based-test-section-group1-PSV.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/desk-based/desk-based-test-section-group1-PSV.template.ts @@ -32,6 +32,26 @@ export const DeskBasedTestSectionGroup1Psv: FormNode = { editType: FormNodeEditTypes.HIDDEN, viewType: FormNodeViewTypes.HIDDEN, }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test types', diff --git a/src/app/forms/templates/test-records/section-templates/test/desk-based/desk-based-test-section-group1And4-HGV-TRL.template.ts b/src/app/forms/templates/test-records/section-templates/test/desk-based/desk-based-test-section-group1And4-HGV-TRL.template.ts index 37dd52231..ba9c31ab4 100644 --- a/src/app/forms/templates/test-records/section-templates/test/desk-based/desk-based-test-section-group1And4-HGV-TRL.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/desk-based/desk-based-test-section-group1And4-HGV-TRL.template.ts @@ -30,6 +30,26 @@ export const DeskBasedTestSectionGroup1And4HgvTrl: FormNode = { editType: FormNodeEditTypes.HIDDEN, viewType: FormNodeViewTypes.HIDDEN, }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/desk-based/desk-based-test-section-group2.template.ts b/src/app/forms/templates/test-records/section-templates/test/desk-based/desk-based-test-section-group2.template.ts index ea30c4ca3..e35cfcfd2 100644 --- a/src/app/forms/templates/test-records/section-templates/test/desk-based/desk-based-test-section-group2.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/desk-based/desk-based-test-section-group2.template.ts @@ -34,6 +34,26 @@ export const DeskBasedTestSectionGroup2And5: FormNode = { editType: FormNodeEditTypes.HIDDEN, viewType: FormNodeViewTypes.HIDDEN, }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', type: FormNodeTypes.ARRAY, diff --git a/src/app/forms/templates/test-records/section-templates/test/desk-based/desk-based-test-section-group3.template.ts b/src/app/forms/templates/test-records/section-templates/test/desk-based/desk-based-test-section-group3.template.ts index 7246b79f1..e97bcdc72 100644 --- a/src/app/forms/templates/test-records/section-templates/test/desk-based/desk-based-test-section-group3.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/desk-based/desk-based-test-section-group3.template.ts @@ -30,6 +30,26 @@ export const DeskBasedTestSectionGroup3: FormNode = { editType: FormNodeEditTypes.HIDDEN, viewType: FormNodeViewTypes.HIDDEN, }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/desk-based/desk-based-test-section-group4-PSV.template.ts b/src/app/forms/templates/test-records/section-templates/test/desk-based/desk-based-test-section-group4-PSV.template.ts index eef61e6a6..40e9a8dd4 100644 --- a/src/app/forms/templates/test-records/section-templates/test/desk-based/desk-based-test-section-group4-PSV.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/desk-based/desk-based-test-section-group4-PSV.template.ts @@ -32,6 +32,26 @@ export const DeskBasedTestSectionGroup4Psv: FormNode = { editType: FormNodeEditTypes.HIDDEN, viewType: FormNodeViewTypes.HIDDEN, }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/desk-based/desk-based-test-section-group4-lgv-template.ts b/src/app/forms/templates/test-records/section-templates/test/desk-based/desk-based-test-section-group4-lgv-template.ts index a9d516e5e..1c9df59bc 100644 --- a/src/app/forms/templates/test-records/section-templates/test/desk-based/desk-based-test-section-group4-lgv-template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/desk-based/desk-based-test-section-group4-lgv-template.ts @@ -26,6 +26,26 @@ export const DeskBasedTestSectionGroup4LgvCarMotorcycle: FormNode = { viewType: FormNodeViewTypes.HIDDEN, editType: FormNodeEditTypes.HIDDEN, }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/desk-based/desk-based-test-section-group5-LGV.ts b/src/app/forms/templates/test-records/section-templates/test/desk-based/desk-based-test-section-group5-LGV.ts index 03957dc60..609257ca4 100644 --- a/src/app/forms/templates/test-records/section-templates/test/desk-based/desk-based-test-section-group5-LGV.ts +++ b/src/app/forms/templates/test-records/section-templates/test/desk-based/desk-based-test-section-group5-LGV.ts @@ -28,6 +28,26 @@ export const DeskBasedTestSectionLgvGroup5: FormNode = { editType: FormNodeEditTypes.HIDDEN, validators: [{ name: ValidatorNames.AheadOfDate, args: 'testStartTimestamp' }], }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/specialist/old-specialist-test-section-group1.template.ts b/src/app/forms/templates/test-records/section-templates/test/specialist/old-specialist-test-section-group1.template.ts index 515b9ccf0..0ec82863d 100644 --- a/src/app/forms/templates/test-records/section-templates/test/specialist/old-specialist-test-section-group1.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/specialist/old-specialist-test-section-group1.template.ts @@ -31,6 +31,26 @@ export const OldIVASpecialistTestSectionGroup1: FormNode = { viewType: FormNodeViewTypes.DATE, editType: FormNodeEditTypes.HIDDEN, }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/specialist/old-specialist-test-section-group5.template.ts b/src/app/forms/templates/test-records/section-templates/test/specialist/old-specialist-test-section-group5.template.ts index d3b0ab79e..a98b80a00 100644 --- a/src/app/forms/templates/test-records/section-templates/test/specialist/old-specialist-test-section-group5.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/specialist/old-specialist-test-section-group5.template.ts @@ -31,6 +31,26 @@ export const OldIVASpecialistTestSectionGroup5: FormNode = { viewType: FormNodeViewTypes.DATE, editType: FormNodeEditTypes.HIDDEN, }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/specialist/specialist-test-section-group1.template.ts b/src/app/forms/templates/test-records/section-templates/test/specialist/specialist-test-section-group1.template.ts index 841c599be..9e802efb4 100644 --- a/src/app/forms/templates/test-records/section-templates/test/specialist/specialist-test-section-group1.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/specialist/specialist-test-section-group1.template.ts @@ -33,6 +33,26 @@ export const SpecialistTestSectionGroup1: FormNode = { viewType: FormNodeViewTypes.DATE, editType: FormNodeEditTypes.HIDDEN, }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/specialist/specialist-test-section-group2.template.ts b/src/app/forms/templates/test-records/section-templates/test/specialist/specialist-test-section-group2.template.ts index f413aa45b..7080f2753 100644 --- a/src/app/forms/templates/test-records/section-templates/test/specialist/specialist-test-section-group2.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/specialist/specialist-test-section-group2.template.ts @@ -31,6 +31,26 @@ export const SpecialistTestSectionGroup2: FormNode = { viewType: FormNodeViewTypes.DATE, editType: FormNodeEditTypes.DATE, }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/specialist/specialist-test-section-group3.template.ts b/src/app/forms/templates/test-records/section-templates/test/specialist/specialist-test-section-group3.template.ts index be03dca73..2f2a970d6 100644 --- a/src/app/forms/templates/test-records/section-templates/test/specialist/specialist-test-section-group3.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/specialist/specialist-test-section-group3.template.ts @@ -30,6 +30,26 @@ export const SpecialistTestSectionGroup3: FormNode = { viewType: FormNodeViewTypes.DATE, editType: FormNodeEditTypes.HIDDEN, }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/specialist/specialist-test-section-group3And4.template.ts b/src/app/forms/templates/test-records/section-templates/test/specialist/specialist-test-section-group3And4.template.ts index ae85a5abe..e7b72f01a 100644 --- a/src/app/forms/templates/test-records/section-templates/test/specialist/specialist-test-section-group3And4.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/specialist/specialist-test-section-group3And4.template.ts @@ -31,6 +31,26 @@ export const SpecialistTestSectionGroup3And4: FormNode = { viewType: FormNodeViewTypes.DATE, editType: FormNodeEditTypes.DATE, }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/specialist/specialist-test-section-group5.template.ts b/src/app/forms/templates/test-records/section-templates/test/specialist/specialist-test-section-group5.template.ts index 4e8c1597b..7d2984c66 100644 --- a/src/app/forms/templates/test-records/section-templates/test/specialist/specialist-test-section-group5.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/specialist/specialist-test-section-group5.template.ts @@ -81,6 +81,26 @@ export const SpecialistTestSectionGroup5: FormNode = { ], type: FormNodeTypes.CONTROL, }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'reasonForAbandoning', type: FormNodeTypes.CONTROL, diff --git a/src/app/forms/templates/test-records/section-templates/test/test-section-group1.template.ts b/src/app/forms/templates/test-records/section-templates/test/test-section-group1.template.ts index 868820323..74800e6ec 100644 --- a/src/app/forms/templates/test-records/section-templates/test/test-section-group1.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/test-section-group1.template.ts @@ -30,6 +30,26 @@ export const TestSectionGroup1: FormNode = { viewType: FormNodeViewTypes.DATE, editType: FormNodeEditTypes.DATE, }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/test-section-group12And14.template.ts b/src/app/forms/templates/test-records/section-templates/test/test-section-group12And14.template.ts index c63cfe448..f6e4a5d5f 100644 --- a/src/app/forms/templates/test-records/section-templates/test/test-section-group12And14.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/test-section-group12And14.template.ts @@ -31,6 +31,26 @@ export const TestSectionGroup12And14: FormNode = { viewType: FormNodeViewTypes.DATE, editType: FormNodeEditTypes.DATE, }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/test-section-group15And16.template.ts b/src/app/forms/templates/test-records/section-templates/test/test-section-group15And16.template.ts index f53fcac15..95263820a 100644 --- a/src/app/forms/templates/test-records/section-templates/test/test-section-group15And16.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/test-section-group15And16.template.ts @@ -32,6 +32,26 @@ export const TestSectionGroup15And16: FormNode = { viewType: FormNodeViewTypes.DATE, editType: FormNodeEditTypes.DATE, }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/test-section-group2.template.ts b/src/app/forms/templates/test-records/section-templates/test/test-section-group2.template.ts index 7ccced7eb..7b8c4808c 100644 --- a/src/app/forms/templates/test-records/section-templates/test/test-section-group2.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/test-section-group2.template.ts @@ -30,6 +30,26 @@ export const TestSectionGroup2: FormNode = { viewType: FormNodeViewTypes.DATE, editType: FormNodeEditTypes.DATE, }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/test-section-group3And4And8.template.ts b/src/app/forms/templates/test-records/section-templates/test/test-section-group3And4And8.template.ts index ddceec927..fdbb14b0d 100644 --- a/src/app/forms/templates/test-records/section-templates/test/test-section-group3And4And8.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/test-section-group3And4And8.template.ts @@ -32,6 +32,26 @@ export const TestSectionGroup3And4And8: FormNode = { viewType: FormNodeViewTypes.DATE, editType: FormNodeEditTypes.DATE, }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/test-section-group5And13.template.ts b/src/app/forms/templates/test-records/section-templates/test/test-section-group5And13.template.ts index 6a91783ae..d3f8814da 100644 --- a/src/app/forms/templates/test-records/section-templates/test/test-section-group5And13.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/test-section-group5And13.template.ts @@ -32,6 +32,26 @@ export const TestSectionGroup5And13: FormNode = { viewType: FormNodeViewTypes.DATE, editType: FormNodeEditTypes.DATE, }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/test-section-group6And11.template.ts b/src/app/forms/templates/test-records/section-templates/test/test-section-group6And11.template.ts index 86f0a9171..15714e0b7 100644 --- a/src/app/forms/templates/test-records/section-templates/test/test-section-group6And11.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/test-section-group6And11.template.ts @@ -31,6 +31,26 @@ export const TestSectionGroup6And11: FormNode = { viewType: FormNodeViewTypes.DATE, editType: FormNodeEditTypes.DATE, }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/test-section-group7.template.ts b/src/app/forms/templates/test-records/section-templates/test/test-section-group7.template.ts index f9349a165..5f10bce9a 100644 --- a/src/app/forms/templates/test-records/section-templates/test/test-section-group7.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/test-section-group7.template.ts @@ -32,6 +32,26 @@ export const TestSectionGroup7: FormNode = { viewType: FormNodeViewTypes.DATE, editType: FormNodeEditTypes.DATE, }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/test-section-group8Notifiable.template.ts b/src/app/forms/templates/test-records/section-templates/test/test-section-group8Notifiable.template.ts index 057a5eb9c..00799d894 100644 --- a/src/app/forms/templates/test-records/section-templates/test/test-section-group8Notifiable.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/test-section-group8Notifiable.template.ts @@ -32,6 +32,26 @@ export const TestSectionGroup8Notifiable: FormNode = { viewType: FormNodeViewTypes.DATE, editType: FormNodeEditTypes.DATE, }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/test-section-group9And10.template.ts b/src/app/forms/templates/test-records/section-templates/test/test-section-group9And10.template.ts index 40a7470b2..4eb5e4c10 100644 --- a/src/app/forms/templates/test-records/section-templates/test/test-section-group9And10.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/test-section-group9And10.template.ts @@ -30,6 +30,26 @@ export const TestSectionGroup9And10: FormNode = { viewType: FormNodeViewTypes.DATE, editType: FormNodeEditTypes.DATE, }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/test-section-group9And10CentralDocs.template.ts b/src/app/forms/templates/test-records/section-templates/test/test-section-group9And10CentralDocs.template.ts index 0dabf86c8..9e4736960 100644 --- a/src/app/forms/templates/test-records/section-templates/test/test-section-group9And10CentralDocs.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/test-section-group9And10CentralDocs.template.ts @@ -30,6 +30,26 @@ export const TestSectionGroup9And10CentralDocs: FormNode = { viewType: FormNodeViewTypes.DATE, editType: FormNodeEditTypes.DATE, }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/test-records/section-templates/test/test-section.template.ts b/src/app/forms/templates/test-records/section-templates/test/test-section.template.ts index 426e3a14b..13f7ebfd2 100644 --- a/src/app/forms/templates/test-records/section-templates/test/test-section.template.ts +++ b/src/app/forms/templates/test-records/section-templates/test/test-section.template.ts @@ -30,6 +30,26 @@ export const TestSection: FormNode = { viewType: FormNodeViewTypes.DATE, editType: FormNodeEditTypes.DATE, }, + { + name: 'recalls', + type: FormNodeTypes.GROUP, + children: [ + { + name: 'hasRecall', + value: false, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + { + name: 'manufacturer', + value: null, + type: FormNodeTypes.CONTROL, + viewType: FormNodeViewTypes.HIDDEN, + editType: FormNodeEditTypes.HIDDEN, + }, + ], + }, { name: 'testTypes', label: 'Test Types', diff --git a/src/app/forms/templates/trl/trl-tech-record.template.ts b/src/app/forms/templates/trl/trl-tech-record.template.ts index b6dd409db..52430ccab 100644 --- a/src/app/forms/templates/trl/trl-tech-record.template.ts +++ b/src/app/forms/templates/trl/trl-tech-record.template.ts @@ -57,7 +57,7 @@ export const TrlTechRecordTemplate: FormNode = { editType: FormNodeEditTypes.SELECT, options: [ { value: 'January', label: 'January' }, - { value: 'February', label: 'Febraury' }, + { value: 'February', label: 'February' }, { value: 'March', label: 'March' }, { value: 'April', label: 'April' }, { value: 'May', label: 'May' }, diff --git a/src/app/models/test-results/test-result.model.ts b/src/app/models/test-results/test-result.model.ts index ae2fa217d..cd6cb692e 100644 --- a/src/app/models/test-results/test-result.model.ts +++ b/src/app/models/test-results/test-result.model.ts @@ -1,3 +1,4 @@ +import { RecallsSchema } from '@dvsa/cvs-type-definitions/types/v1/recalls'; import { EUVehicleCategory } from '@dvsa/cvs-type-definitions/types/v3/tech-record/enums/euVehicleCategory.enum.js'; import { TestStationType } from '@models/test-stations/test-station-type.enum'; import { OdometerReadingUnits } from '@models/test-types/odometer-unit.enum'; @@ -73,4 +74,6 @@ export interface TestResultModel { * Used only for TRL */ firstUseDate?: string; + + recalls?: RecallsSchema; } diff --git a/src/app/resolvers/recalls/__tests__/recalls.resolver.spec.ts b/src/app/resolvers/recalls/__tests__/recalls.resolver.spec.ts new file mode 100644 index 000000000..81ad70dab --- /dev/null +++ b/src/app/resolvers/recalls/__tests__/recalls.resolver.spec.ts @@ -0,0 +1,86 @@ +import { HttpService } from '@/src/app/services/http/http.service'; +import { techRecord } from '@/src/app/store/technical-records'; +import { patchEditingTestResult } from '@/src/app/store/test-records'; +import { HttpErrorResponse, provideHttpClient } from '@angular/common/http'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; +import { TestBed } from '@angular/core/testing'; +import { ActivatedRouteSnapshot, ResolveFn, RouterStateSnapshot } from '@angular/router'; +import { RecallsSchema } from '@dvsa/cvs-type-definitions/types/v1/recalls'; +import { TechRecordType } from '@dvsa/cvs-type-definitions/types/v3/tech-record/tech-record-verb'; +import { provideMockActions } from '@ngrx/effects/testing'; +import { Action } from '@ngrx/store'; +import { MockStore, provideMockStore } from '@ngrx/store/testing'; +import { State, initialAppState } from '@store/index'; +import { Observable, of, take, throwError } from 'rxjs'; +import { TestScheduler } from 'rxjs/testing'; +import { recallsResolver } from '../recalls.resolver'; + +describe('recallsResolver', () => { + let resolver: ResolveFn>; + const actions$ = new Observable(); + let testScheduler: TestScheduler; + let store: MockStore; + let httpService: HttpService; + const activatedRouteSnapshot = {} as ActivatedRouteSnapshot; + const routerStateSnapshot = {} as RouterStateSnapshot; + const mockRecall = { hasRecall: true, manufacturer: 'MAN' } as RecallsSchema; + const mockTechRecord = { vin: '12345678901234567' } as TechRecordType<'get'>; + + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [ + provideHttpClient(), + provideHttpClientTesting(), + provideMockStore({ initialState: initialAppState }), + provideMockActions(() => actions$), + ], + }); + + resolver = (...resolverParameters) => TestBed.runInInjectionContext(() => recallsResolver(...resolverParameters)); + + store = TestBed.inject(MockStore); + httpService = TestBed.inject(HttpService); + + store.overrideSelector(techRecord, mockTechRecord); + }); + + beforeEach(() => { + testScheduler = new TestScheduler((actual, expected) => { + expect(actual).toEqual(expected); + }); + }); + + it('should be created', () => { + expect(resolver).toBeTruthy(); + }); + + it('should add the result of the recalls check to the test record currently being edited', () => { + const spy = jest.spyOn(httpService, 'getRecalls').mockReturnValue(of(mockRecall)); + + const result = TestBed.runInInjectionContext(() => + resolver(activatedRouteSnapshot, routerStateSnapshot) + ) as Observable; + + result.pipe(take(1)).subscribe((result) => { + expect(spy).toHaveBeenCalledWith(mockTechRecord.vin); + expect(store.dispatch).toHaveBeenCalledWith(patchEditingTestResult({ testResult: { recalls: mockRecall } })); + expect(result).toBe(mockRecall); + }); + }); + + it('should add undefined (no recall) to the test record if an error occurs', () => { + const spy = jest + .spyOn(httpService, 'getRecalls') + .mockReturnValue(throwError(() => new HttpErrorResponse({ status: 500 }))); + + const result = TestBed.runInInjectionContext(() => + resolver(activatedRouteSnapshot, routerStateSnapshot) + ) as Observable; + + result.pipe(take(1)).subscribe((result) => { + expect(spy).toHaveBeenCalledWith(mockTechRecord.vin); + expect(store.dispatch).not.toHaveBeenCalled(); + expect(result).toBeUndefined(); + }); + }); +}); diff --git a/src/app/resolvers/recalls/recalls.resolver.ts b/src/app/resolvers/recalls/recalls.resolver.ts new file mode 100644 index 000000000..413122e53 --- /dev/null +++ b/src/app/resolvers/recalls/recalls.resolver.ts @@ -0,0 +1,24 @@ +import { inject } from '@angular/core'; +import { ResolveFn } from '@angular/router'; +import { RecallsSchema } from '@dvsa/cvs-type-definitions/types/v1/recalls'; +import { Store, select } from '@ngrx/store'; +import { Observable, catchError, filter, of, switchMap, tap } from 'rxjs'; +import { HttpService } from '../../services/http/http.service'; +import { techRecord } from '../../store/technical-records'; +import { patchEditingTestResult } from '../../store/test-records'; + +export const recallsResolver: ResolveFn> = () => { + const store = inject(Store); + const httpService = inject(HttpService); + + return store.pipe( + select(techRecord), + filter(Boolean), + switchMap((record) => + httpService.getRecalls(record.vin).pipe( + tap((recalls) => store.dispatch(patchEditingTestResult({ testResult: { recalls } }))), + catchError(() => of(undefined)) + ) + ) + ); +}; diff --git a/src/app/services/http/http.service.ts b/src/app/services/http/http.service.ts index 29f9bd084..6747145ad 100644 --- a/src/app/services/http/http.service.ts +++ b/src/app/services/http/http.service.ts @@ -1,6 +1,7 @@ import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; import { Injectable, inject } from '@angular/core'; import { DefectGETRequiredStandards } from '@dvsa/cvs-type-definitions/types/required-standards/defects/get'; +import { RecallsSchema } from '@dvsa/cvs-type-definitions/types/v1/recalls'; import { TechRecordSearchSchema } from '@dvsa/cvs-type-definitions/types/v3/tech-record/get/search'; import { TechRecordType } from '@dvsa/cvs-type-definitions/types/v3/tech-record/tech-record-verb'; import { environment } from '@environments/environment'; @@ -180,6 +181,10 @@ export class HttpService { ); } + getRecalls(vin: string) { + return this.http.get(`${environment.VTM_API_URI}/v3/technical-records/recalls/${vin}`); + } + getTechRecords(searchIdentifier: string, metadata?: boolean, status?: string, searchCriteria?: string) { if (searchIdentifier === null || searchIdentifier === undefined) { throw new Error('Required parameter searchIdentifier was null or undefined when calling getTechRecords.'); diff --git a/src/app/store/technical-records/technical-record-service.reducer.ts b/src/app/store/technical-records/technical-record-service.reducer.ts index d69fd98f9..2af9410a5 100644 --- a/src/app/store/technical-records/technical-record-service.reducer.ts +++ b/src/app/store/technical-records/technical-record-service.reducer.ts @@ -228,13 +228,12 @@ function handleUpdateBrakeForces( } if (data.grossLadenWeight) { - const prefix = `${Math.round(data.grossLadenWeight / 100)}`; + if (newState.editingTechRecord.techRecord_brakes_brakeCodeOriginal) { + const prefix = `${Math.round(data.grossLadenWeight / 100)}`; + newState.editingTechRecord.techRecord_brakes_brakeCode = + (prefix.length <= 2 ? `0${prefix}` : prefix) + newState.editingTechRecord.techRecord_brakes_brakeCodeOriginal; + } - newState.editingTechRecord.techRecord_brakes_brakeCode = - (prefix.length <= 2 - ? `0${prefix}` - : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - prefix) + newState.editingTechRecord.techRecord_brakes_brakeCodeOriginal!; newState.editingTechRecord.techRecord_brakes_brakeForceWheelsNotLocked_serviceBrakeForceA = Math.round( (data.grossLadenWeight * 16) / 100 ); diff --git a/src/app/store/test-records/test-records.actions.ts b/src/app/store/test-records/test-records.actions.ts index efe2e25d4..309a327a3 100644 --- a/src/app/store/test-records/test-records.actions.ts +++ b/src/app/store/test-records/test-records.actions.ts @@ -61,6 +61,12 @@ export const updateTestResultFailed = createAction( export const cleanTestResult = createAction('[test-results] Clean test result for submission'); export const editingTestResult = createAction('[test-results] Editing', props<{ testTypeId: string }>()); + +export const patchEditingTestResult = createAction( + '[test-results] Patch editing', + props<{ testResult: Partial }>() +); + export const updateEditingTestResult = createAction( '[test-results] Update editing', props<{ testResult: TestResultModel }>() diff --git a/src/app/store/test-records/test-records.effects.ts b/src/app/store/test-records/test-records.effects.ts index bdf2408e9..202b36e96 100644 --- a/src/app/store/test-records/test-records.effects.ts +++ b/src/app/store/test-records/test-records.effects.ts @@ -312,6 +312,7 @@ export class TestResultsEffects { mergedForms.testTypes[0].name = testTypeTaxonomy?.name ?? ''; mergedForms.testTypes[0].testTypeName = testTypeTaxonomy?.testTypeName ?? ''; mergedForms.typeOfTest = (testTypeTaxonomy?.typeOfTest as TypeOfTest) ?? TypeOfTest.CONTINGENCY; + mergedForms.recalls = editedTestResult.recalls; const now = new Date().toISOString(); diff --git a/src/app/store/test-records/test-records.reducer.ts b/src/app/store/test-records/test-records.reducer.ts index e9fdc77f5..1479dde58 100644 --- a/src/app/store/test-records/test-records.reducer.ts +++ b/src/app/store/test-records/test-records.reducer.ts @@ -33,6 +33,7 @@ import { fetchTestResultsBySystemNumberSuccess, fetchTestResultsSuccess, initialContingencyTest, + patchEditingTestResult, removeDefect, removeRequiredStandard, setResultOfTest, @@ -109,6 +110,11 @@ export const testResultsReducer = createReducer( editingTestResult: setTestResult(state.editingTestResult, action.result), })), + on(patchEditingTestResult, (state, action) => ({ + ...state, + editingTestResult: merge({}, state.editingTestResult, action.testResult), + })), + on(updateEditingTestResult, (state, action) => ({ ...state, editingTestResult: merge({}, action.testResult) })), on(cancelEditingTestResult, (state) => ({ ...state, editingTestResult: undefined, sectionTemplates: undefined })), diff --git a/src/styles.scss b/src/styles.scss index 753b486b9..fdc472902 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -67,3 +67,8 @@ .width-2 { max-width: 2.75em; } + +.govuk-warning-text { + display: flex; + align-items: center; +} \ No newline at end of file