Skip to content

Commit

Permalink
feat(CB2-12693): use common test type id fine, linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-Searle committed Jul 10, 2024
1 parent be625a9 commit 36556a8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/models/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ interface IInvokeConfig {
}

interface IActivityParam {
testerStaffId: string
fromStartTime: string,
toStartTime?: null | string,
testStationPNumber: string,
activityType: string
testerStaffId: string;
fromStartTime: string;
toStartTime?: null | string;
testStationPNumber: string;
activityType: string;
}

export { ISPConfig, IInvokeConfig, IActivitiesList, IActivityParam};
7 changes: 3 additions & 4 deletions src/services/RetroGenerationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import moment = require("moment-timezone");
import { ActivitySchema} from "@dvsa/cvs-type-definitions/types/v1/activity";
import { TestResultSchema, TestTypeSchema} from "@dvsa/cvs-type-definitions/types/v1/test-result";
import { ModTypeSchema} from "@dvsa/cvs-type-definitions/types/v1/test-type";
import {LEC_TEST} from "@dvsa/cvs-microservice-common/classes/testTypes/Constants";
import { LEC_TEST } from "@dvsa/cvs-microservice-common/classes/testTypes/Constants";
import {TestTypeHelper} from "@dvsa/cvs-microservice-common/classes/testTypes/testTypeHelper";

class RetroGenerationService {
private readonly testResultsService: TestResultsService;
Expand Down Expand Up @@ -381,9 +382,7 @@ class RetroGenerationService {
* @param testType
*/
private isPassingLECTestType(testType: any): boolean {

const lecTestTypeIds = LEC_TEST.IDS;
return lecTestTypeIds.includes(testType.testTypeId) && testType.testResult === TEST_RESULT_STATES.PASS;
return TestTypeHelper.validateTestTypeIdInList(LEC_TEST, testType.testTypeId) && testType.testResult === TEST_RESULT_STATES.PASS;
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/RetroGenerationService.unitTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import hgvTrlResults from "../resources/hgv-trl-test-results.json";
import activities from "../resources/wait-time-response.json";
import queueEvent from "../resources/queue-event.json";
import { ActivitySchema } from "@dvsa/cvs-type-definitions/types/v1/activity";
import { TestResultSchema } from "@dvsa/cvs-type-definitions/types/v1/test-result";
import { TestResultSchema } from "@dvsa/cvs-type-definitions/types/v1/test-result";
// import mockConfig from "../util/mockConfig";

describe("RetroGenerationService", () => {
Expand Down

0 comments on commit 36556a8

Please sign in to comment.