Skip to content

Commit

Permalink
add shared Area and VehicleParkingCount types
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak committed Sep 29, 2023
1 parent 5bfde47 commit 099836b
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 181 deletions.
155 changes: 73 additions & 82 deletions schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,22 @@
],
"description": "Planning application types supported by this schema"
},
"Area": {
"$id": "#Area",
"additionalProperties": false,
"properties": {
"hectares": {
"type": "number"
},
"squareMetres": {
"type": "number"
}
},
"required": [
"squareMetres"
],
"type": "object"
},
"BaseApplicant": {
"$id": "#BaseApplicant",
"additionalProperties": false,
Expand Down Expand Up @@ -972,16 +988,7 @@
"additionalProperties": false,
"properties": {
"area": {
"additionalProperties": false,
"properties": {
"squareMetres": {
"type": "number"
}
},
"required": [
"squareMetres"
],
"type": "object"
"$ref": "#/definitions/Area"
}
},
"required": [
Expand All @@ -993,16 +1000,7 @@
"additionalProperties": false,
"properties": {
"area": {
"additionalProperties": false,
"properties": {
"squareMetres": {
"type": "number"
}
},
"required": [
"squareMetres"
],
"type": "object"
"$ref": "#/definitions/Area"
},
"count": {
"additionalProperties": false,
Expand Down Expand Up @@ -1703,16 +1701,7 @@
"additionalProperties": false,
"properties": {
"area": {
"additionalProperties": false,
"properties": {
"squareMetres": {
"type": "number"
}
},
"required": [
"squareMetres"
],
"type": "object"
"$ref": "#/definitions/Area"
}
},
"required": [
Expand All @@ -1724,16 +1713,7 @@
"additionalProperties": false,
"properties": {
"area": {
"additionalProperties": false,
"properties": {
"squareMetres": {
"type": "number"
}
},
"required": [
"squareMetres"
],
"type": "object"
"$ref": "#/definitions/Area"
},
"count": {
"additionalProperties": false,
Expand Down Expand Up @@ -1967,6 +1947,31 @@
"count"
],
"type": "object"
},
"residents": {
"additionalProperties": false,
"properties": {
"count": {
"additionalProperties": false,
"properties": {
"existing": {
"type": "number"
},
"proposed": {
"type": "number"
}
},
"required": [
"existing",
"proposed"
],
"type": "object"
}
},
"required": [
"count"
],
"type": "object"
}
},
"type": "object"
Expand Down Expand Up @@ -2048,6 +2053,31 @@
"count"
],
"type": "object"
},
"residents": {
"additionalProperties": false,
"properties": {
"count": {
"additionalProperties": false,
"properties": {
"existing": {
"type": "number"
},
"proposed": {
"type": "number"
}
},
"required": [
"existing",
"proposed"
],
"type": "object"
}
},
"required": [
"count"
],
"type": "object"
}
},
"type": "object"
Expand Down Expand Up @@ -2228,20 +2258,7 @@
"additionalProperties": false,
"properties": {
"area": {
"additionalProperties": false,
"properties": {
"hectares": {
"type": "number"
},
"squareMetres": {
"type": "number"
}
},
"required": [
"squareMetres",
"hectares"
],
"type": "object"
"$ref": "#/definitions/Area"
},
"site": {
"type": "object"
Expand Down Expand Up @@ -12717,20 +12734,7 @@
"additionalProperties": false,
"properties": {
"area": {
"additionalProperties": false,
"properties": {
"hectares": {
"type": "number"
},
"squareMetres": {
"type": "number"
}
},
"required": [
"squareMetres",
"hectares"
],
"type": "object"
"$ref": "#/definitions/Area"
},
"site": {
"type": "object"
Expand Down Expand Up @@ -13565,20 +13569,7 @@
"additionalProperties": false,
"properties": {
"area": {
"additionalProperties": false,
"properties": {
"hectares": {
"type": "number"
},
"squareMetres": {
"type": "number"
}
},
"required": [
"squareMetres",
"hectares"
],
"type": "object"
"$ref": "#/definitions/Area"
},
"site": {
"type": "object"
Expand Down
6 changes: 2 additions & 4 deletions types/schema/data/Property.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {PropertyTypes} from '../../enums/PropertyTypes';
import {Area} from '../../utils';

/**
* @id #Property
Expand All @@ -17,10 +18,7 @@ export interface UKProperty {
type: PropertyType;
boundary?: {
site: Record<string, any>; // @todo use GeoJSON from utils here, but ajv tests failing
area: {
squareMetres: number;
hectares: number;
};
area: Area;
};
constraints?: {
planning: PlanningConstraint[];
Expand Down
Loading

0 comments on commit 099836b

Please sign in to comment.