Skip to content

Commit

Permalink
changes made to batch plate gen (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
naathanbrown authored Nov 18, 2024
1 parent 86871c7 commit 07567c7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/handler/batchPlateCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ import {
TechRecordType as TechRecordTypeByVehicle,
} from '@dvsa/cvs-type-definitions/types/v3/tech-record/tech-record-vehicle-type';
import { TechRecordType } from '@dvsa/cvs-type-definitions/types/v3/tech-record/tech-record-verb';
import { SQSEvent } from 'aws-lambda';
import 'dotenv/config';
import { v4 as uuidv4 } from 'uuid';
import { SQSEvent } from 'aws-lambda';
import { BatchPlateData } from '../models/batchPlate';
import { PlateReasonForIssue, Plates } from '../models/plate';
import { DocumentName, SQSRequestBody } from '../models/sqsPayload';
import { getBySystemNumberAndCreatedTimestamp, inPlaceRecordUpdate } from '../services/database';
import { addToSqs } from '../services/sqs';
import { StatusCode } from '../util/enum';
import { flattenArrays, formatTechRecord } from '../util/formatTechRecord';
import logger, { logError } from '../util/logger';
import { BatchPlateData } from '../models/batchPlate';

export const handler = async (event: SQSEvent): Promise<void> => {
const batchIssuerName = 'CVS Batch Plate Generation';
const batchIssuerName = 'CVS Batch Plate Generation 2';
let numberOfRecordsUpdated = 0;
let numberOfSqsAdded = 0;

Expand Down
12 changes: 6 additions & 6 deletions tests/unit/handler/batchPlateCreation.unit.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { TechRecordComplete } from '@dvsa/cvs-type-definitions/types/v3/tech-record/tech-record-status';
import { TechRecordGETHGV, TechRecordGETTRL } from '@dvsa/cvs-type-definitions/types/v3/tech-record/tech-record-verb-vehicle-type';
import { SQSEvent } from 'aws-lambda';
import { v4 as uuidv4 } from 'uuid';
import { TechRecordGETHGV, TechRecordGETTRL } from '@dvsa/cvs-type-definitions/types/v3/tech-record/tech-record-verb-vehicle-type';
import { TechRecordComplete } from '@dvsa/cvs-type-definitions/types/v3/tech-record/tech-record-status';
import { handler } from '../../../src/handler/batchPlateCreation';
import { getBySystemNumberAndCreatedTimestamp, inPlaceRecordUpdate } from '../../../src/services/database';
import { formatTechRecord } from '../../../src/util/formatTechRecord';
import { addToSqs } from '../../../src/services/sqs';
import { handler } from '../../../src/handler/batchPlateCreation';
import logger, { logError } from '../../../src/util/logger';
import { StatusCode } from '../../../src/util/enum';
import { formatTechRecord } from '../../../src/util/formatTechRecord';
import logger, { logError } from '../../../src/util/logger';

jest.mock('uuid');
jest.mock('../../../src/services/database');
Expand Down Expand Up @@ -131,7 +131,7 @@ describe('Batch Plate Handler', () => {
plateSerialNumber: 'existing-batch-plate',
plateIssueDate: '2024-01-01T00:00:00.000Z',
plateReasonForIssue: 'Replacement',
plateIssuer: 'CVS Batch Plate Generation',
plateIssuer: 'CVS Batch Plate Generation 2',
},
],
} as TechRecordGETHGV;
Expand Down

0 comments on commit 07567c7

Please sign in to comment.