{"id":23066970,"url":"https://github.com/dvsa/cvs-tsk-smc-prohibition","last_synced_at":"2025-04-03T09:14:02.385Z","repository":{"id":86167310,"uuid":"537469334","full_name":"dvsa/cvs-tsk-smc-prohibition","owner":"dvsa","description":"This is for MC Prohibition","archived":false,"fork":false,"pushed_at":"2024-05-22T15:34:36.000Z","size":911,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":6,"default_branch":"develop","last_synced_at":"2024-05-22T16:33:44.978Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dvsa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-16T13:26:46.000Z","updated_at":"2024-05-22T16:33:54.718Z","dependencies_parsed_at":"2023-09-22T20:55:20.481Z","dependency_job_id":"1188d24e-0d88-4ee3-8fc6-baf0126ae8ee","html_url":"https://github.com/dvsa/cvs-tsk-smc-prohibition","commit_stats":null,"previous_names":[],"tags_count":1179,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvsa%2Fcvs-tsk-smc-prohibition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvsa%2Fcvs-tsk-smc-prohibition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvsa%2Fcvs-tsk-smc-prohibition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvsa%2Fcvs-tsk-smc-prohibition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dvsa","download_url":"https://codeload.github.com/dvsa/cvs-tsk-smc-prohibition/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246970323,"owners_count":20862509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-16T05:15:42.025Z","updated_at":"2025-04-03T09:14:02.349Z","avatar_url":"https://github.com/dvsa.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cvs-svc-mc-prohibitions\nService for feeding test results from DynamoDb to SMC\n\n## Dependencies\n\nThe project runs on node 18.x with typescript and serverless framework. For further details about project dependencies, please refer to the `package.json` file.\n[nvm](https://github.com/nvm-sh/nvm/blob/master/README.md) is used to manage node versions and configuration is per project using an `.npmrc` file.\n\n## Running the project\n\nBefore running the project, the dependencies need to be installed using `npm install`. Once the dependencies are installed, you will be required to copy the `.env.example` file to `.env.local` in the root of the project. See these for information about [variables](https://www.serverless.com/framework/docs/providers/aws/guide/variables/) and [environment variables](https://www.serverless.com/framework/docs/environment-variables/) with serverless.\nPlease note that multiple `.env` files can be created, one per environment. Our current development environment is 'local'.\n\nThe application runs on port `:3001` by default.\n\n## Packaging the project locally\n\nThe `package` npm script takes a ZIP_NAME variable. To set the variable when running manually use `ZIP_NAME=zipName npm run package`. This will produce a file called zipName.zip.\n\n### Environments\n\nWe use `NODE_ENV` environment variable to set the stage. `NODE_ENV` is set through npm scripts (package.json) to load the relevant `.env.\u003cNODE_ENV\u003e` file from the root folder into the `serverless.yml`.\nIf no `NODE_ENV` value is provided when running the scripts, it will default its `NODE_ENV` value to 'local' with the `.env.local` config file.\n\nThe defaulted values for 'stage' and 'region' are `'local'`. Please refer to the values provided in the `serverless.yml` file.\n\nThe following values can be provided when running the scripts with `NODE_ENV`:\n\n```ts\n// ./.env.\u003cNODE_ENV\u003e files\n'local'; // used for local development\n'development'; // used development staging should we wish to require external services\n'test'; // used during test scripts where local services, mocks can be used in conjunction\n```\n\n```ts\n/** Running serverless offline as an example for a specific stage - 'local'.\n* Stage 'local' will be injected in the serverless.yml\n**/\nNODE_ENV=local serverless offline\n\n```\n\nFurther details about environment setup can be found in the provided documentation and `.env.example` file.\n\nAll secrets will stored in `AWS Secrets Manager`.\n\n### Scripts\n\nThe following scripts are available, for further information please refer to the project `package.json` file:\n\n- \u003cb\u003estart\u003c/b\u003e: `npm start` - _launch serverless offline service_\n- \u003cb\u003edev\u003c/b\u003e: `npm run dev` - _run in parallel, the service and unit tests in_ `--watch` _mode with live reload_.\n- \u003cb\u003etest\u003c/b\u003e: `npm t` - _execute the unit test suite_\n- \u003cb\u003ebuild\u003c/b\u003e: `npm run build` - _build the project, transpiling typescript to javascript_\n- \u003cb\u003eproduction build\u003c/b\u003e: `npm run package` - _generate the project zip file ready for deployment_\n\n### Offline\n\nServerless-offline is used to run the project locally. Use `npm run start` script to do so. The endpoints below are available.\n\n```\n(POST) http://localhost:3002/2015-03-31/functions/cvs-tsk-smc-prohibition-local-smcProhibitionClearance/invocations\n(POST) http://localhost:3002/2014-11-13/functions/cvs-tsk-smc-prohibition-local-smcProhibitionClearance/invoke-async/\n```\n\nThe function expects a DynamoDB stream event.\n```json\n{\n  \"Records\": [\n    {\n      \"eventID\": \"mock-id\",\n      \"eventName\": \"MODIFY\",\n      \"eventVersion\": \"1.1\",\n      \"eventSource\": \"aws:dynamodb\",\n      \"awsRegion\": \"eu-west-1\",\n      \"dynamodb\": {\n        \"ApproximateCreationDateTime\": 1641807422,\n        \"Keys\": {\n          \"vin\": {\n            \"S\": \"XMGDE02FS0H012303\"\n          },\n          \"testResultId\": {\n            \"S\": \"9\"\n          }\n        },\n        \"NewImage\": {\n          \"testerStaffId\": {\n            \"S\": \"2\"\n          },\n          \"testStartTimestamp\": {\n            \"S\": \"2019-01-14T10:36:33.987Z\"\n          },\n          \"odometerReadingUnits\": {\n            \"S\": \"kilometres\"\n          },\n          \"testEndTimestamp\": {\n            \"S\": \"2019-01-14T10:36:33.987Z\"\n          },\n          \"testStatus\": {\n            \"S\": \"submitted\"\n          },\n          \"testTypes\": {\n            \"L\": [\n              {\n                \"M\": {\n                  \"prohibitionIssued\": {\n                    \"BOOL\": false\n                  },\n                  \"testCode\": {\n                    \"S\": \"aas\"\n                  },\n                  \"testNumber\": {\n                    \"S\": \"1\"\n                  },\n                  \"lastUpdatedAt\": {\n                    \"S\": \"2019-02-23T08:47:59.269Z\"\n                  },\n                  \"testAnniversaryDate\": {\n                    \"S\": \"2019-12-22T08:47:59.749Z\"\n                  },\n                  \"testTypeClassification\": {\n                    \"S\": \"Annual With Certificate\"\n                  },\n                  \"customDefects\": {\n                    \"L\": [\n                      {\n                        \"M\": {\n                          \"defectNotes\": {\n                            \"S\": \"some defect noe\"\n                          },\n                          \"referenceNumber\": {\n                            \"S\": \"abcd\"\n                          },\n                          \"defectName\": {\n                            \"S\": \"Some custom defect\"\n                          }\n                        }\n                      }\n                    ]\n                  },\n                  \"additionalCommentsForAbandon\": {\n                    \"S\": \"none\"\n                  },\n                  \"numberOfSeatbeltsFitted\": {\n                    \"N\": \"2\"\n                  },\n                  \"testTypeEndTimestamp\": {\n                    \"S\": \"2019-01-14T10:36:33.987Z\"\n                  },\n                  \"reasonForAbandoning\": {\n                    \"S\": \"none\"\n                  },\n                  \"lastSeatbeltInstallationCheckDate\": {\n                    \"S\": \"2019-01-14\"\n                  },\n                  \"deletionFlag\": {\n                    \"BOOL\": true\n                  },\n                  \"createdAt\": {\n                    \"S\": \"2019-02-22T08:47:59.269Z\"\n                  },\n                  \"testTypeId\": {\n                    \"S\": \"1\"\n                  },\n                  \"secondaryCertificateNumber\": {\n                    \"S\": \"1234\"\n                  },\n                  \"certificateNumber\": {\n                    \"S\": \"1234\"\n                  },\n                  \"testTypeStartTimestamp\": {\n                    \"S\": \"2019-01-14T10:36:33.987Z\"\n                  },\n                  \"testTypeName\": {\n                    \"S\": \"Paid prohibition clearance (full inspection with certificate)\"\n                  },\n                  \"seatbeltInstallationCheckDate\": {\n                    \"BOOL\": true\n                  },\n                  \"additionalNotesRecorded\": {\n                    \"S\": \"VEHICLE FRONT REGISTRATION PLATE MISSING\"\n                  },\n                  \"defects\": {\n                    \"L\": [\n                      {\n                        \"M\": {\n                          \"deficiencyCategory\": {\n                            \"S\": \"major\"\n                          },\n                          \"deficiencyText\": {\n                            \"S\": \"missing.\"\n                          },\n                          \"prs\": {\n                            \"BOOL\": false\n                          },\n                          \"additionalInformation\": {\n                            \"M\": {\n                              \"notes\": {\n                                \"S\": \"None\"\n                              },\n                              \"location\": {\n                                \"M\": {\n                                  \"axleNumber\": {\n                                    \"NULL\": true\n                                  },\n                                  \"horizontal\": {\n                                    \"NULL\": true\n                                  },\n                                  \"vertical\": {\n                                    \"NULL\": true\n                                  },\n                                  \"longitudinal\": {\n                                    \"S\": \"front\"\n                                  },\n                                  \"rowNumber\": {\n                                    \"NULL\": true\n                                  },\n                                  \"lateral\": {\n                                    \"NULL\": true\n                                  },\n                                  \"seatNumber\": {\n                                    \"NULL\": true\n                                  }\n                                }\n                              }\n                            }\n                          },\n                          \"itemNumber\": {\n                            \"N\": \"1\"\n                          },\n                          \"deficiencyRef\": {\n                            \"S\": \"1.1.a\"\n                          },\n                          \"stdForProhibition\": {\n                            \"BOOL\": false\n                          },\n                          \"deficiencySubId\": {\n                            \"NULL\": true\n                          },\n                          \"imDescription\": {\n                            \"S\": \"Registration Plate\"\n                          },\n                          \"deficiencyId\": {\n                            \"S\": \"a\"\n                          },\n                          \"itemDescription\": {\n                            \"S\": \"A registration plate:\"\n                          },\n                          \"imNumber\": {\n                            \"N\": \"1\"\n                          }\n                        }\n                      }\n                    ]\n                  },\n                  \"name\": {\n                    \"S\": \"Annual test\"\n                  },\n                  \"certificateLink\": {\n                    \"S\": \"http://dvsagov.co.uk\"\n                  },\n                  \"testResult\": {\n                    \"S\": \"prs\"\n                  }\n                }\n              }\n            ]\n          },\n          \"systemNumber\": {\n            \"S\": \"1120\"\n          },\n          \"vehicleClass\": {\n            \"M\": {\n              \"code\": {\n                \"S\": \"2\"\n              },\n              \"description\": {\n                \"S\": \"motorbikes over 200cc or with a sidecar\"\n              }\n            }\n          },\n          \"testResultId\": {\n            \"S\": \"9\"\n          },\n          \"vehicleSize\": {\n            \"S\": \"small\"\n          },\n          \"vin\": {\n            \"S\": \"XMGDE02FS0H012303\"\n          },\n          \"noOfAxles\": {\n            \"N\": \"2\"\n          },\n          \"testStationName\": {\n            \"S\": \"Rowe, Wunsch and Wisoky\"\n          },\n          \"vehicleId\": {\n            \"S\": \"JY58FPP\"\n          },\n          \"countryOfRegistration\": {\n            \"S\": \"united kingdom\"\n          },\n          \"vehicleType\": {\n            \"S\": \"hgv\"\n          },\n          \"preparerId\": {\n            \"S\": \"ak4434\"\n          },\n          \"preparerName\": {\n            \"S\": \"Durrell Vehicles Limited\"\n          },\n          \"odometerReading\": {\n            \"N\": \"100000\"\n          },\n          \"vehicleConfiguration\": {\n            \"S\": \"rigid\"\n          },\n          \"testStationType\": {\n            \"S\": \"gvts\"\n          },\n          \"reasonForCancellation\": {\n            \"S\": \"none\"\n          },\n          \"testerName\": {\n            \"S\": \"Dorel\"\n          },\n          \"deletionFlag\": {\n            \"BOOL\": false\n          },\n          \"vrm\": {\n            \"S\": \"JY58FPP\"\n          },\n          \"testStationPNumber\": {\n            \"S\": \"P99006\"\n          },\n          \"numberOfSeats\": {\n            \"N\": \"45\"\n          },\n          \"testerEmailAddress\": {\n            \"S\": \"dorel.popescu@dvsagov.uk\"\n          },\n          \"euVehicleCategory\": {\n            \"S\": \"m2\"\n          },\n          \"numberOfWheelsDriven\": {\n            \"N\": \"3\"\n          }\n        },\n        \"OldImage\": {\n          \"testerStaffId\": {\n            \"S\": \"1\"\n          },\n          \"testStartTimestamp\": {\n            \"S\": \"2019-01-14T10:36:33.987Z\"\n          },\n          \"odometerReadingUnits\": {\n            \"S\": \"kilometres\"\n          },\n          \"testEndTimestamp\": {\n            \"S\": \"2019-01-14T10:36:33.987Z\"\n          },\n          \"testStatus\": {\n            \"S\": \"submitted\"\n          },\n          \"testTypes\": {\n            \"L\": [\n              {\n                \"M\": {\n                  \"prohibitionIssued\": {\n                    \"BOOL\": false\n                  },\n                  \"testCode\": {\n                    \"S\": \"aas\"\n                  },\n                  \"testNumber\": {\n                    \"S\": \"1\"\n                  },\n                  \"lastUpdatedAt\": {\n                    \"S\": \"2019-02-22T08:47:59.269Z\"\n                  },\n                  \"testAnniversaryDate\": {\n                    \"S\": \"2019-12-22T08:47:59.749Z\"\n                  },\n                  \"testTypeClassification\": {\n                    \"S\": \"Annual With Certificate\"\n                  },\n                  \"customDefects\": {\n                    \"L\": [\n                      {\n                        \"M\": {\n                          \"defectNotes\": {\n                            \"S\": \"some defect noe\"\n                          },\n                          \"referenceNumber\": {\n                            \"S\": \"abcd\"\n                          },\n                          \"defectName\": {\n                            \"S\": \"Some custom defect\"\n                          }\n                        }\n                      }\n                    ]\n                  },\n                  \"additionalCommentsForAbandon\": {\n                    \"S\": \"none\"\n                  },\n                  \"numberOfSeatbeltsFitted\": {\n                    \"N\": \"2\"\n                  },\n                  \"testTypeEndTimestamp\": {\n                    \"S\": \"2019-01-14T10:36:33.987Z\"\n                  },\n                  \"reasonForAbandoning\": {\n                    \"S\": \"none\"\n                  },\n                  \"lastSeatbeltInstallationCheckDate\": {\n                    \"S\": \"2019-01-14\"\n                  },\n                  \"deletionFlag\": {\n                    \"BOOL\": true\n                  },\n                  \"createdAt\": {\n                    \"S\": \"2019-02-22T08:47:59.269Z\"\n                  },\n                  \"testTypeId\": {\n                    \"S\": \"1\"\n                  },\n                  \"secondaryCertificateNumber\": {\n                    \"S\": \"1234\"\n                  },\n                  \"testTypeStartTimestamp\": {\n                    \"S\": \"2019-01-14T10:36:33.987Z\"\n                  },\n                  \"testTypeName\": {\n                    \"S\": \"Paid prohibition clearance (full inspection with certificate)\"\n                  },\n                  \"seatbeltInstallationCheckDate\": {\n                    \"BOOL\": true\n                  },\n                  \"additionalNotesRecorded\": {\n                    \"S\": \"VEHICLE FRONT REGISTRATION PLATE MISSING\"\n                  },\n                  \"defects\": {\n                    \"L\": [\n                      {\n                        \"M\": {\n                          \"deficiencyCategory\": {\n                            \"S\": \"major\"\n                          },\n                          \"deficiencyText\": {\n                            \"S\": \"missing.\"\n                          },\n                          \"prs\": {\n                            \"BOOL\": false\n                          },\n                          \"additionalInformation\": {\n                            \"M\": {\n                              \"notes\": {\n                                \"S\": \"None\"\n                              },\n                              \"location\": {\n                                \"M\": {\n                                  \"axleNumber\": {\n                                    \"NULL\": true\n                                  },\n                                  \"horizontal\": {\n                                    \"NULL\": true\n                                  },\n                                  \"vertical\": {\n                                    \"NULL\": true\n                                  },\n                                  \"longitudinal\": {\n                                    \"S\": \"front\"\n                                  },\n                                  \"rowNumber\": {\n                                    \"NULL\": true\n                                  },\n                                  \"lateral\": {\n                                    \"NULL\": true\n                                  },\n                                  \"seatNumber\": {\n                                    \"NULL\": true\n                                  }\n                                }\n                              }\n                            }\n                          },\n                          \"itemNumber\": {\n                            \"N\": \"1\"\n                          },\n                          \"deficiencyRef\": {\n                            \"S\": \"1.1.a\"\n                          },\n                          \"stdForProhibition\": {\n                            \"BOOL\": false\n                          },\n                          \"deficiencySubId\": {\n                            \"NULL\": true\n                          },\n                          \"imDescription\": {\n                            \"S\": \"Registration Plate\"\n                          },\n                          \"deficiencyId\": {\n                            \"S\": \"a\"\n                          },\n                          \"itemDescription\": {\n                            \"S\": \"A registration plate:\"\n                          },\n                          \"imNumber\": {\n                            \"N\": \"1\"\n                          }\n                        }\n                      }\n                    ]\n                  },\n                  \"name\": {\n                    \"S\": \"Annual test\"\n                  },\n                  \"certificateLink\": {\n                    \"S\": \"http://dvsagov.co.uk\"\n                  },\n                  \"testResult\": {\n                    \"S\": \"prs\"\n                  }\n                }\n              },\n              {\n                \"prohibitionIssued\": {\n                  \"BOOL\": false\n                },\n                \"testCode\": {\n                  \"S\": \"aas\"\n                },\n                \"testNumber\": {\n                  \"S\": \"1\"\n                },\n                \"lastUpdatedAt\": {\n                  \"S\": \"2019-02-23T08:47:59.269Z\"\n                },\n                \"testAnniversaryDate\": {\n                  \"S\": \"2019-12-22T08:47:59.749Z\"\n                },\n                \"testTypeClassification\": {\n                  \"S\": \"Annual With Certificate\"\n                },\n                \"customDefects\": {\n                  \"L\": [\n                    {\n                      \"M\": {\n                        \"defectNotes\": {\n                          \"S\": \"some defect noe\"\n                        },\n                        \"referenceNumber\": {\n                          \"S\": \"abcd\"\n                        },\n                        \"defectName\": {\n                          \"S\": \"Some custom defect\"\n                        }\n                      }\n                    }\n                  ]\n                },\n                \"additionalCommentsForAbandon\": {\n                  \"S\": \"none\"\n                },\n                \"numberOfSeatbeltsFitted\": {\n                  \"N\": \"2\"\n                },\n                \"testTypeEndTimestamp\": {\n                  \"S\": \"2019-01-14T10:36:33.987Z\"\n                },\n                \"reasonForAbandoning\": {\n                  \"S\": \"none\"\n                },\n                \"lastSeatbeltInstallationCheckDate\": {\n                  \"S\": \"2019-01-14\"\n                },\n                \"deletionFlag\": {\n                  \"BOOL\": true\n                },\n                \"createdAt\": {\n                  \"S\": \"2019-02-22T08:47:59.269Z\"\n                },\n                \"testTypeId\": {\n                  \"S\": \"1\"\n                },\n                \"secondaryCertificateNumber\": {\n                  \"S\": \"1234\"\n                },\n                \"testTypeStartTimestamp\": {\n                  \"S\": \"2019-01-14T10:36:33.987Z\"\n                },\n                \"testTypeName\": {\n                  \"S\": \"Paid prohibition clearance (full inspection with certificate)\"\n                },\n                \"seatbeltInstallationCheckDate\": {\n                  \"BOOL\": true\n                },\n                \"additionalNotesRecorded\": {\n                  \"S\": \"VEHICLE FRONT REGISTRATION PLATE MISSING\"\n                },\n                \"defects\": {\n                  \"L\": [\n                    {\n                      \"M\": {\n                        \"deficiencyCategory\": {\n                          \"S\": \"major\"\n                        },\n                        \"deficiencyText\": {\n                          \"S\": \"missing.\"\n                        },\n                        \"prs\": {\n                          \"BOOL\": false\n                        },\n                        \"additionalInformation\": {\n                          \"M\": {\n                            \"notes\": {\n                              \"S\": \"None\"\n                            },\n                            \"location\": {\n                              \"M\": {\n                                \"axleNumber\": {\n                                  \"NULL\": true\n                                },\n                                \"horizontal\": {\n                                  \"NULL\": true\n                                },\n                                \"vertical\": {\n                                  \"NULL\": true\n                                },\n                                \"longitudinal\": {\n                                  \"S\": \"front\"\n                                },\n                                \"rowNumber\": {\n                                  \"NULL\": true\n                                },\n                                \"lateral\": {\n                                  \"NULL\": true\n                                },\n                                \"seatNumber\": {\n                                  \"NULL\": true\n                                }\n                              }\n                            }\n                          }\n                        },\n                        \"itemNumber\": {\n                          \"N\": \"1\"\n                        },\n                        \"deficiencyRef\": {\n                          \"S\": \"1.1.a\"\n                        },\n                        \"stdForProhibition\": {\n                          \"BOOL\": false\n                        },\n                        \"deficiencySubId\": {\n                          \"NULL\": true\n                        },\n                        \"imDescription\": {\n                          \"S\": \"Registration Plate\"\n                        },\n                        \"deficiencyId\": {\n                          \"S\": \"a\"\n                        },\n                        \"itemDescription\": {\n                          \"S\": \"A registration plate:\"\n                        },\n                        \"imNumber\": {\n                          \"N\": \"1\"\n                        }\n                      }\n                    }\n                  ]\n                },\n                \"name\": {\n                  \"S\": \"Annual test\"\n                },\n                \"certificateLink\": {\n                  \"S\": \"http://dvsagov.co.uk\"\n                },\n                \"testResult\": {\n                  \"S\": \"pass\"\n                }\n              }\n            ]\n          },\n          \"systemNumber\": {\n            \"S\": \"1120\"\n          },\n          \"vehicleClass\": {\n            \"M\": {\n              \"code\": {\n                \"S\": \"2\"\n              },\n              \"description\": {\n                \"S\": \"motorbikes over 200cc or with a sidecar\"\n              }\n            }\n          },\n          \"testResultId\": {\n            \"S\": \"9\"\n          },\n          \"vehicleSize\": {\n            \"S\": \"small\"\n          },\n          \"vin\": {\n            \"S\": \"XMGDE02FS0H012303\"\n          },\n          \"noOfAxles\": {\n            \"N\": \"2\"\n          },\n          \"testStationName\": {\n            \"S\": \"Rowe, Wunsch and Wisoky\"\n          },\n          \"vehicleId\": {\n            \"S\": \"JY58FPP\"\n          },\n          \"countryOfRegistration\": {\n            \"S\": \"united kingdom\"\n          },\n          \"vehicleType\": {\n            \"S\": \"lgv\"\n          },\n          \"preparerId\": {\n            \"S\": \"ak4434\"\n          },\n          \"preparerName\": {\n            \"S\": \"Durrell Vehicles Limited\"\n          },\n          \"odometerReading\": {\n            \"N\": \"100000\"\n          },\n          \"vehicleConfiguration\": {\n            \"S\": \"rigid\"\n          },\n          \"testStationType\": {\n            \"S\": \"gvts\"\n          },\n          \"reasonForCancellation\": {\n            \"S\": \"none\"\n          },\n          \"testerName\": {\n            \"S\": \"Dorel\"\n          },\n          \"deletionFlag\": {\n            \"BOOL\": false\n          },\n          \"vrm\": {\n            \"S\": \"JY58FPP\"\n          },\n          \"testStationPNumber\": {\n            \"S\": \"P99006\"\n          },\n          \"numberOfSeats\": {\n            \"N\": \"45\"\n          },\n          \"testerEmailAddress\": {\n            \"S\": \"dorel.popescu@dvsagov.uk\"\n          },\n          \"euVehicleCategory\": {\n            \"S\": \"m2\"\n          },\n          \"numberOfWheelsDriven\": {\n            \"N\": \"3\"\n          }\n        },\n        \"SequenceNumber\": \"123456789\",\n        \"SizeBytes\": 3701,\n        \"StreamViewType\": \"NEW_AND_OLD_IMAGES\"\n      },\n      \"eventSourceARN\": \"mock-arn\"\n    }\n  ]\n}\n```\nComplete examples can be found in the `./tests/unit/data` folder.\n\n### Debugging\n\nExisting configuration to debug the running service has been made available for vscode, please refer to `.vscode/launch.json`. Two jest configurations are also provided which will allow debugging a test or multiple tests.\n\n## Environmental variables\n\nThe following variables are supported in the `.env.\u003cNODE_ENV\u003e` file.\n- AWS_PROVIDER_PROFILE=default\n- AWS_REGION=eu-west-1\n- AWS_SERVER_PORT=3009\n- AWS_EVENT_BUS_NAME=default\n- AWS_EVENT_BUS_SOURCE=eventBusName\n\n## Testing\n\n### Unit\n\nJest is used for unit testing. Jest mocks have been added for external services and other dependencies when needed. Debugging tests is possible using the two options configured in ./vscode/launch.json `Jest Debug all tests` and `Jest Debug opened file`. Using the Jest vscode extension is also a very good option. Please refer to the [Jest documentation](https://jestjs.io/docs/en/getting-started) for further details.\n\n### Integration\n\nTBC\n\n## Infrastructure\n\n### Release\n\nReleases (tag, release notes, changelog, github release, assets) are automatically managed by [semantic-release](https://semantic-release.gitbook.io/semantic-release/) and when pushing (or merging) to `develop` branch which is protected. [semver](https://semver.org/) convention is followed.\n\nPlease be familiar with conventional commit as described in the Contributing section below.\n\nDefault preset used is angular for conventional commits, please see the [angular conventions](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional#type-enum).\n\nThe `\u003ctype\u003e` `'breaking'` in the commit message will trigger a major version bump as well as any of the following text contained in the commit body: `\"BREAKING CHANGE\", \"BREAKING CHANGES\", \"BREAKING_CHANGES\", \"BREAKING\", \"BREAKING_CHANGE\"`. Please refer to the `.releaserc.json` file for the full configuration.\n\nThe script `npm run release` will automatically trigger the release in CI. To manually test the release the following flags -`--dry-run --no-ci` - can be passed to the release script.\n\nPublishing and artifacts are managed separately by the pipeline.\n\n## Contributing\n\nTo facilitate the standardisation of the code, a few helpers and tools have been adopted for this repository.\n\n### External dependencies\n\nThe projects has multiple hooks configured using [husky](https://github.com/typicode/husky#readme) which will execute the following scripts: `audit`, `lint`, `build`, `test` and format your code with [eslint](https://github.com/typescript-eslint/typescript-eslint#readme) and [prettier](https://github.com/prettier/prettier).\n\nYou will be required to install [git-secrets](https://github.com/awslabs/git-secrets) (_brew approach is recommended_) and DVSA [repo-security-scanner](https://github.com/UKHomeOffice/repo-security-scanner) that runs against your git log history to find accidentally committed passwords, private keys.\n\nWe follow the [conventional commit format](https://www.conventionalcommits.org/en/v1.0.0/) when we commit code to the repository and follow the [angular convention](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional#type-enum).\n\nThe type is mandatory and must be all lowercase.\nThe scope of your commit remain is also mandatory, it must include your ticket number and be all lowercase. The format for the ticket number can be set in the commitlint.config.js file.\n\n```js\n// Please see /commitlint.config.js for customised format\n\ntype(scope?): subject\n\n// examples\n'chore(cvsb-1234): my commit msg' // pass\n'CHORE(cvsb-1234): my commit msg' // will fail\n\n```\n\n### Code standards\n\n#### Toolings\n\nThe code uses [eslint](https://eslint.org/docs/user-guide/getting-started), [typescript clean code standards](https://github.com/labs42io/clean-code-typescript) as well as sonarqube for static analysis.\nSonarQube is available locally, please follow the instructions below if you wish to run the service locally (brew is the preferred approach):\n\n- _Brew_:\n\n    - Install sonarqube using brew\n    - Change `sonar.host.url` to point to localhost, by default, sonar runs on `http://localhost:9000`\n    - run the sonar server `sonar start`, then perform your analysis `npm run sonar-scanner`\n\n- _Manual_:\n    - Add sonar-scanner in environment variables in your \\_profile file add the line: `export PATH=\u003cPATH_TO_SONAR_SCANNER\u003e/sonar-scanner-3.3.0.1492-macosx/bin:$PATH`\n    - Start the SonarQube server: `cd \u003cPATH_TO_SONARQUBE_SERVER\u003e/bin/macosx-universal-64 ./sonar.sh start`\n    - In the microservice folder run the command: `npm run sonar-scanner`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvsa%2Fcvs-tsk-smc-prohibition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdvsa%2Fcvs-tsk-smc-prohibition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvsa%2Fcvs-tsk-smc-prohibition/lists"}