Skip to content

Commit

Permalink
feat(CB2-12785): implement common/cvs-packages test type ids into smc…
Browse files Browse the repository at this point in the history
…-prohibition
  • Loading branch information
m-mullen committed Jul 11, 2024
1 parent c5b8371 commit 2fb8587
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
18 changes: 16 additions & 2 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"@aws-sdk/client-eventbridge": "^3.577.0",
"@aws-sdk/util-dynamodb": "^3.577.0",
"@dvsa/cvs-type-definitions": "^7.2.0",
"@dvsa/cvs-microservice-common": "1.1.0",
"aws-lambda": "^1.0.7",
"dateformat": "^5.0.3",
"joi": "^17.13.1",
Expand Down
10 changes: 0 additions & 10 deletions src/assets/Enums.ts

This file was deleted.

6 changes: 3 additions & 3 deletions src/utils/ExtractTestResults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { TestResultSchema } from '@dvsa/cvs-type-definitions/types/v1/test-resul
import { TestResults } from '@dvsa/cvs-type-definitions/types/v1/enums/testResult.enum'
import { TestStatus } from '@dvsa/cvs-type-definitions/types/v1/enums/testStatus.enum'
import { TestTypeSchema } from '@dvsa/cvs-type-definitions/types/v1/test-type';
import { PROHIB_CLEARANCE_TEST_TYPE_IDS } from '../assets/Enums';
import { PROHIBITION_CLEARANCE_TEST } from '@dvsa/cvs-microservice-common/classes/testTypes/Constants';
import logger from '../observability/Logger';
import { HTTPError } from './HTTPError';
import { MCRequest } from './MCRequest';
Expand All @@ -33,7 +33,7 @@ export const extractMCTestResults = (record: DynamoDBRecord): MCRequest[] => {
);
const mcRequest: MCRequest[] = testResultUnmarshall.testTypes
.filter((testType) =>
PROHIB_CLEARANCE_TEST_TYPE_IDS.IDS.includes(testType.testTypeId),
PROHIBITION_CLEARANCE_TEST.IDS.includes(testType.testTypeId),
)
.filter(
(testType) =>
Expand All @@ -46,7 +46,7 @@ export const extractMCTestResults = (record: DynamoDBRecord): MCRequest[] => {
testResultUnmarshall.vehicleType === 'trl',
)
.filter(() => testResultUnmarshall.testStatus === TestStatus.SUBMITTED)
.map((testType: TestTypeSchema) : MCRequest => ({
.map((testType: TestTypeSchema): MCRequest => ({
vehicleIdentifier: testResultUnmarshall.vehicleType === 'trl'
? testResultUnmarshall.trailerId
: testResultUnmarshall.vrm,
Expand Down

0 comments on commit 2fb8587

Please sign in to comment.