Skip to content

Commit

Permalink
minor(cb2-9718): update vehicleType and inspectionType to use enums (#…
Browse files Browse the repository at this point in the history
…138)

Co-authored-by: Owen Corrigan (BJSS, VTM) <122352145+owen-corrigan-bjss@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 31, 2023
1 parent d9165ef commit 6e94f2c
Show file tree
Hide file tree
Showing 15 changed files with 119 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"title": "Inspection Type",
"type": "string",
"tsEnumNames":[
"basic",
"normal"
],
"enum":[
"basic",
"normal"
Expand Down
4 changes: 2 additions & 2 deletions json-definitions/iva/defects/get/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"items": {
"anyOf": [
{
"$ref": "../../../v3/tech-record/enums/vehicleType.ignore.json"
"$ref": "../../../v3/tech-record/enums/vehicleType.enum.json"
}
]
}
Expand Down Expand Up @@ -66,7 +66,7 @@
"items": {
"anyOf": [
{
"$ref": "../enums/inspectionType.ignore.json"
"$ref": "../enums/inspectionType.enum.json"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{
"title": "Vehicle Type",
"type": "string",
"tsEnumNames":[
"psv",
"trl",
"hgv",
"car",
"lgv",
"motorcycle"
],
"enum":[
"psv",
"trl",
Expand Down
2 changes: 1 addition & 1 deletion json-definitions/v3/tech-record/get/search/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"$ref": "../../enums/statusCode.ignore.json"
},
"techRecord_vehicleType": {
"$ref": "../../enums/vehicleType.ignore.json"
"$ref": "../../enums/vehicleType.enum.json"
},
"createdTimestamp": {
"type": "string"
Expand Down
12 changes: 12 additions & 0 deletions json-schemas/iva/defects/enums/inspectionType.enum.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"title": "Inspection Type",
"type": "string",
"tsEnumNames": [
"basic",
"normal"
],
"enum": [
"basic",
"normal"
]
}
12 changes: 12 additions & 0 deletions json-schemas/iva/defects/get/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@
{
"title": "Vehicle Type",
"type": "string",
"tsEnumNames": [
"psv",
"trl",
"hgv",
"car",
"lgv",
"motorcycle"
],
"enum": [
"psv",
"trl",
Expand Down Expand Up @@ -130,6 +138,10 @@
{
"title": "Inspection Type",
"type": "string",
"tsEnumNames": [
"basic",
"normal"
],
"enum": [
"basic",
"normal"
Expand Down
20 changes: 20 additions & 0 deletions json-schemas/v3/tech-record/enums/vehicleType.enum.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"title": "Vehicle Type",
"type": "string",
"tsEnumNames": [
"psv",
"trl",
"hgv",
"car",
"lgv",
"motorcycle"
],
"enum": [
"psv",
"trl",
"hgv",
"car",
"lgv",
"motorcycle"
]
}
8 changes: 8 additions & 0 deletions json-schemas/v3/tech-record/get/search/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@
"techRecord_vehicleType": {
"title": "Vehicle Type",
"type": "string",
"tsEnumNames": [
"psv",
"trl",
"hgv",
"car",
"lgv",
"motorcycle"
],
"enum": [
"psv",
"trl",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dvsa/cvs-type-definitions",
"version": "3.4.0",
"version": "3.5.0",
"description": "type definitions for cvs vta and vtm applications",
"main": "index.js",
"repository": {
Expand Down
2 changes: 2 additions & 0 deletions schemas.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const schemas = [
"iva/defects/enums/inspectionType.enum.json",
"iva/defects/get/index.json",
"v1/activity/index.json",
"v1/defect-category-reference-data/index.json",
Expand All @@ -25,6 +26,7 @@ export const schemas = [
"v3/tech-record/enums/vehicleConfigurationHgvPsv.enum.json",
"v3/tech-record/enums/vehicleConfigurationLightVehicle.enum.json",
"v3/tech-record/enums/vehicleConfigurationTrl.enum.json",
"v3/tech-record/enums/vehicleType.enum.json",
"v3/tech-record/get/car/complete/index.json",
"v3/tech-record/get/car/skeleton/index.json",
"v3/tech-record/get/hgv/complete/index.json",
Expand Down
11 changes: 11 additions & 0 deletions types/iva/defects/enums/inspectionType.enum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* tslint:disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/

export enum InspectionType {
basic = "basic",
normal = "normal"
}
15 changes: 12 additions & 3 deletions types/iva/defects/get/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
* and run json-schema-to-typescript to regenerate this file.
*/

export type VehicleType = "psv" | "trl" | "hgv" | "car" | "lgv" | "motorcycle";
export type InspectionType = "basic" | "normal";

export interface DefectGETIVA {
sectionNumber: string;
sectionDescription: string;
Expand All @@ -22,6 +19,14 @@ export interface DefectGETIVA {
}[];
}

export enum VehicleType {
psv = "psv",
trl = "trl",
hgv = "hgv",
car = "car",
lgv = "lgv",
motorcycle = "motorcycle"
}
export enum EUVehicleCategory {
M1 = "m1",
M2 = "m2",
Expand All @@ -42,3 +47,7 @@ export enum EUVehicleCategory {
L6E = "l6e",
L7E = "l7e"
}
export enum InspectionType {
basic = "basic",
normal = "normal"
}
15 changes: 15 additions & 0 deletions types/v3/tech-record/enums/vehicleType.enum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* tslint:disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/

export enum VehicleType {
psv = "psv",
trl = "trl",
hgv = "hgv",
car = "car",
lgv = "lgv",
motorcycle = "motorcycle"
}
10 changes: 9 additions & 1 deletion types/v3/tech-record/get/search/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

export type StatusCode = "provisional" | "current" | "archived";
export type VehicleType = "psv" | "trl" | "hgv" | "car" | "lgv" | "motorcycle";

export interface TechRecordSearchSchema {
primaryVrm?: string;
Expand All @@ -24,3 +23,12 @@ export interface TechRecordSearchSchema {
techRecord_reasonForCreation?: string;
techRecord_createdByName?: string;
}

export enum VehicleType {
psv = "psv",
trl = "trl",
hgv = "hgv",
car = "car",
lgv = "lgv",
motorcycle = "motorcycle"
}

0 comments on commit 6e94f2c

Please sign in to comment.