Skip to content

Commit

Permalink
minor(cb2-10282): Update types definition for new data structure (#158)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Daniel Searle <[email protected]>
  • Loading branch information
3 people authored Dec 21, 2023
1 parent 6d56344 commit 99dcdc1
Show file tree
Hide file tree
Showing 9 changed files with 127 additions and 94 deletions.
44 changes: 44 additions & 0 deletions json-definitions/iva/defects/enums/euVehicleCategory.enum.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"title": "EU Vehicle Category",
"type": "string",
"tsEnumNames": [
"M1",
"M2",
"M3",
"N1",
"N2",
"N3",
"O1",
"O2",
"O3",
"O4",
"L1E_A",
"l1E",
"L2e",
"L3E",
"L4E",
"L5E",
"L6E",
"L7E"
],
"enum": [
"m1",
"m2",
"m3",
"n1",
"n2",
"n3",
"o1",
"o2",
"o3",
"o4",
"l1e-a",
"l1e",
"l2e",
"l3e",
"l4e",
"l5e",
"l6e",
"l7e"
]
}
16 changes: 3 additions & 13 deletions json-definitions/iva/defects/get/index.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"title": "Defect GET IVA",
"title": "Section IVA",
"type": "object",
"additionalProperties": false,
"required": [
"sectionNumber",
"sectionDescription",
"vehicleTypes",
"euVehicleCategories",
"requiredStandards"
],
"properties": {
Expand All @@ -16,16 +15,6 @@
"sectionDescription": {
"type": ["string"]
},
"euVehicleCategories": {
"type": "array",
"items": {
"anyOf": [
{
"$ref": "../../../v3/tech-record/enums/euVehicleCategory.enum.json"
}
]
}
},
"requiredStandards": {
"type": "array",
"items": {
Expand All @@ -35,7 +24,8 @@
"rsNumber",
"requiredStandard",
"refCalculation",
"additionalInfo"
"additionalInfo",
"inspectionTypes"
],
"properties": {
"rsNumber": {
Expand Down
44 changes: 44 additions & 0 deletions json-schemas/iva/defects/enums/euVehicleCategory.enum.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"title": "EU Vehicle Category",
"type": "string",
"tsEnumNames": [
"M1",
"M2",
"M3",
"N1",
"N2",
"N3",
"O1",
"O2",
"O3",
"O4",
"L1E_A",
"l1E",
"L2e",
"L3E",
"L4E",
"L5E",
"L6E",
"L7E"
],
"enum": [
"m1",
"m2",
"m3",
"n1",
"n2",
"n3",
"o1",
"o2",
"o3",
"o4",
"l1e-a",
"l1e",
"l2e",
"l3e",
"l4e",
"l5e",
"l6e",
"l7e"
]
}
57 changes: 3 additions & 54 deletions json-schemas/iva/defects/get/index.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"title": "Defect GET IVA",
"title": "Section IVA",
"type": "object",
"additionalProperties": false,
"required": [
"sectionNumber",
"sectionDescription",
"vehicleTypes",
"euVehicleCategories",
"requiredStandards"
],
"properties": {
Expand All @@ -20,57 +19,6 @@
"string"
]
},
"euVehicleCategories": {
"type": "array",
"items": {
"anyOf": [
{
"title": "EU vehicle category",
"type": "string",
"tsEnumNames": [
"M1",
"M2",
"M3",
"N1",
"N2",
"N3",
"O1",
"O2",
"O3",
"O4",
"L1E_A",
"l1E",
"L2e",
"L3E",
"L4E",
"L5E",
"L6E",
"L7E"
],
"enum": [
"m1",
"m2",
"m3",
"n1",
"n2",
"n3",
"o1",
"o2",
"o3",
"o4",
"l1e-a",
"l1e",
"l2e",
"l3e",
"l4e",
"l5e",
"l6e",
"l7e"
]
}
]
}
},
"requiredStandards": {
"type": "array",
"items": {
Expand All @@ -80,7 +28,8 @@
"rsNumber",
"requiredStandard",
"refCalculation",
"additionalInfo"
"additionalInfo",
"inspectionTypes"
],
"properties": {
"rsNumber": {
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": "4.3.1",
"version": "4.4.0",
"description": "type definitions for cvs vta and vtm applications",
"main": "index.js",
"repository": {
Expand Down
1 change: 1 addition & 0 deletions schemas.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const schemas = [
"iva/defects/enums/euVehicleCategory.enum.json",
"iva/defects/get/index.json",
"v1/activity/index.json",
"v1/defect-category-reference-data/index.json",
Expand Down
27 changes: 27 additions & 0 deletions types/iva/defects/enums/euVehicleCategory.enum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/* 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 EUVehicleCategory {
M1 = "m1",
M2 = "m2",
M3 = "m3",
N1 = "n1",
N2 = "n2",
N3 = "n3",
O1 = "o1",
O2 = "o2",
O3 = "o3",
O4 = "o4",
L1E_A = "l1e-a",
l1E = "l1e",
L2e = "l2e",
L3E = "l3e",
L4E = "l4e",
L5E = "l5e",
L6E = "l6e",
L7E = "l7e"
}
26 changes: 2 additions & 24 deletions types/iva/defects/get/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,17 @@

export type InspectionType = "basic" | "normal";

export interface DefectGETIVA {
export interface SectionIVA {
sectionNumber: string;
sectionDescription: string;
euVehicleCategories: EUVehicleCategory[];
requiredStandards: {
rsNumber: number;
requiredStandard: string;
refCalculation: string;
additionalInfo: boolean;
inspectionTypes?: InspectionType[];
inspectionTypes: InspectionType[];
}[];
additionalInformation?: {
notes: string;
};
}

export enum EUVehicleCategory {
M1 = "m1",
M2 = "m2",
M3 = "m3",
N1 = "n1",
N2 = "n2",
N3 = "n3",
O1 = "o1",
O2 = "o2",
O3 = "o3",
O4 = "o4",
L1E_A = "l1e-a",
l1E = "l1e",
L2e = "l2e",
L3E = "l3e",
L4E = "l4e",
L5E = "l5e",
L6E = "l6e",
L7E = "l7e"
}

0 comments on commit 99dcdc1

Please sign in to comment.