Skip to content

Commit

Permalink
feat(CB2-13178): added in vef to the test station type and vulnerabil…
Browse files Browse the repository at this point in the history
…ity (#415)

* feat(CB2-13178): added in vef to the test station type and vulnerability

* feat(CB2-13178): added in vef to the test station type and vulnerability

* feat(CB2-13178): added in vef to the test station type and vulnerability

* feat(CB2-13178): api spec

* feat(CB2-13178): use type definitions type instead

* feat(CB2-13178): use type definitions type instead

* feat(CB2-13178): use type definitions type instead

* feat(CB2-13178): use type definitions type instead

* feat(CB2-13178): use type definition type inside test result model
  • Loading branch information
Daniel-Searle authored Aug 20, 2024
1 parent 7faef54 commit 2ec8c66
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions docs/test-results-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ components:
- gvts
- hq
- potf
- vef
testerName:
type: string
maxLength: 60
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@
"@aws-sdk/client-lambda": "^3.552.0",
"@aws-sdk/lib-dynamodb": "^3.552.0",
"@aws-sdk/smithy-client": "^3.374.0",
"@dvsa/cvs-type-definitions": "6.0.0",
"@dvsa/cvs-microservice-common": "1.2.1",
"@dvsa/cvs-type-definitions": "^7.4.0",
"@smithy/smithy-client": "^2.5.1",
"@smithy/util-utf8": "^2.3.0",
"aws-lambda": "^1.0.7",
"aws-xray-sdk": "^3.3.4",
"joi": "^17.12.1",
"js-yaml": "^3.14.1",
"lodash": "^4.17.21",
"@dvsa/cvs-microservice-common": "1.2.1",
"moment": "^2.29.4",
"moment-timezone": "^0.5.40",
"node-yaml": "^4.0.1",
Expand Down
3 changes: 2 additions & 1 deletion src/models/ITestResult.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { InspectionType } from '@dvsa/cvs-type-definitions/types/required-standards/defects/get';
import { TestStationTypes } from '@dvsa/cvs-type-definitions/types/v1/enums/testStationType.enum';

export interface ITestResult {
testResultId: string;
Expand All @@ -21,7 +22,7 @@ export interface ITestResult {
preparerName: string;
odometerReading: number;
vehicleConfiguration: string;
testStationType: string;
testStationType: TestStationTypes;
reasonForCancellation: string | null;
testerName: string;
vrm?: string; // Mandatory for PSV and HGV, not applicable to TRL
Expand Down
6 changes: 3 additions & 3 deletions src/models/validators/CommonSchema.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as Joi from 'joi';
import { ValidationErrorItem } from 'joi';
import { TESTING_ERRORS, VEHICLE_TYPES } from '../../assets/Enums';
import { TestStationTypes } from "@dvsa/cvs-type-definitions/types/v1/enums/testStationType.enum";
import { VEHICLE_TYPES } from '../../assets/Enums';

const baseTestTypesCommonSchema = Joi.object().keys({
name: Joi.string().required(),
Expand Down Expand Up @@ -138,7 +138,7 @@ export const testResultsCommonSchema = Joi.object().keys({
vin: Joi.string().min(1).max(21).required(),
testStationName: Joi.string().max(999).required().allow('', null),
testStationPNumber: Joi.string().max(20).required().allow('', null),
testStationType: Joi.string().valid('atf', 'gvts', 'hq', 'potf').required(),
testStationType: Joi.string().valid(...Object.values(TestStationTypes)).required(),
testerName: Joi.string().max(60).required().allow('', null),
testerEmailAddress: Joi.string().max(60).required().allow('', null),
testerStaffId: Joi.string().max(36).required().allow(''),
Expand Down

0 comments on commit 2ec8c66

Please sign in to comment.