Skip to content

Commit

Permalink
feat(cb2-11802): update enums and their values
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcrawleyy committed Oct 24, 2024
1 parent 706ff68 commit 00756bb
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 3 deletions.
36 changes: 36 additions & 0 deletions src/app/forms/templates/general/adr-summary.template.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ADRAdditionalNotesNumber } from '@dvsa/cvs-type-definitions/types/v3/tech-record/enums/adrAdditionalNotesNumber.enum.js';
import { ADRBodyDeclarationTypes } from '@dvsa/cvs-type-definitions/types/v3/tech-record/enums/adrBodyDeclarationType.enum.js';
import { ADRBodyType } from '@dvsa/cvs-type-definitions/types/v3/tech-record/enums/adrBodyType.enum.js';
import { ADRCompatibilityGroupJ } from '@dvsa/cvs-type-definitions/types/v3/tech-record/enums/adrCompatibilityGroupJ.enum.js';
import { ADRDangerousGood } from '@dvsa/cvs-type-definitions/types/v3/tech-record/enums/adrDangerousGood.enum.js';
Expand Down Expand Up @@ -199,6 +200,20 @@ export const AdrSummaryTemplate: FormNode = {
hide: true,
options: getOptionsFromEnum(ADRDangerousGood),
validators: [
{
name: ValidatorNames.ShowGroupsWhenIncludes,
args: {
values: [ADRDangerousGood, ADRDangerousGood.EXPLOSIVES_TYPE_3],
groups: ['body_declaration'],
},
},
{
name: ValidatorNames.HideGroupsWhenExcludes,
args: {
values: [ADRDangerousGood.EXPLOSIVES_TYPE_3],
groups: ['body_declaration'],
},
},
{
name: ValidatorNames.ShowGroupsWhenIncludes,
args: {
Expand All @@ -219,6 +234,27 @@ export const AdrSummaryTemplate: FormNode = {
},
],
},
{
name: 'techRecord_adrDetails_bodyDeclaration',
label: 'Body declaration',
type: FormNodeTypes.CONTROL,
groups: ['body_declaration', 'adr_details', 'dangerous_goods'],
hide: true,
options: [
{ value: ADRBodyDeclarationTypes.PRE_1ST_JULY_2005, label: ADRBodyDeclarationTypes.PRE_1ST_JULY_2005 },
{
value: ADRBodyDeclarationTypes.ON_OR_AFTER_1ST_JULY_2005,
label: ADRBodyDeclarationTypes.ON_OR_AFTER_1ST_JULY_2005,
},
{ value: ADRBodyDeclarationTypes.UNKNOWN, label: ADRBodyDeclarationTypes.UNKNOWN },
],
validators: [
{
name: ValidatorNames.RequiredIfEquals,
args: { sibling: 'techRecord_adrDetails_dangerousGoods', value: [true] },
},
],
},
{
name: 'techRecord_adrDetails_compatibilityGroupJ',
label: 'Compatibility group J',
Expand Down
10 changes: 7 additions & 3 deletions src/app/forms/templates/general/adr.template.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ADRAdditionalNotesNumber } from '@dvsa/cvs-type-definitions/types/v3/tech-record/enums/adrAdditionalNotesNumber.enum.js';
import { ADRBodyDeclarationTypes } from '@dvsa/cvs-type-definitions/types/v3/tech-record/enums/adrBodyDeclarationType.enum.js';
import { ADRBodyType } from '@dvsa/cvs-type-definitions/types/v3/tech-record/enums/adrBodyType.enum.js';
import { ADRCompatibilityGroupJ } from '@dvsa/cvs-type-definitions/types/v3/tech-record/enums/adrCompatibilityGroupJ.enum.js';
import { ADRDangerousGood } from '@dvsa/cvs-type-definitions/types/v3/tech-record/enums/adrDangerousGood.enum.js';
Expand Down Expand Up @@ -248,9 +249,12 @@ export const AdrTemplate: FormNode = {
groups: ['body_declaration', 'adr_details', 'dangerous_goods'],
hide: true,
options: [
{ value: true, label: 'Pre 1st July 2005' },
{ value: false, label: 'On or after 1st July 2005' },
{ value: null, label: 'Unknown' },
{ value: ADRBodyDeclarationTypes.PRE_1ST_JULY_2005, label: ADRBodyDeclarationTypes.PRE_1ST_JULY_2005 },
{
value: ADRBodyDeclarationTypes.ON_OR_AFTER_1ST_JULY_2005,
label: ADRBodyDeclarationTypes.ON_OR_AFTER_1ST_JULY_2005,
},
{ value: ADRBodyDeclarationTypes.UNKNOWN, label: ADRBodyDeclarationTypes.UNKNOWN },
],
validators: [
{
Expand Down

0 comments on commit 00756bb

Please sign in to comment.