@planning-inspectorate/data-model 2.21.1 → 2.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/appeal-has-anyof-grid-reference.md +46 -0
- package/docs/appeal-has-anyof-site-address.md +65 -0
- package/docs/appeal-has.md +2 -2
- package/docs/appeal-s78-anyof-grid-reference.md +46 -0
- package/docs/appeal-s78-anyof-site-address.md +65 -0
- package/docs/appeal-s78.md +2 -2
- package/package.json +1 -1
- package/pins_data_model/models/model_appeal_document.py +1 -1
- package/pins_data_model/models/model_appeal_event.py +1 -1
- package/pins_data_model/models/model_appeal_event_estimate.py +1 -1
- package/pins_data_model/models/model_appeal_has.py +1 -1
- package/pins_data_model/models/model_appeal_representation.py +1 -1
- package/pins_data_model/models/model_appeal_s78.py +1 -1
- package/pins_data_model/models/model_dart_response.py +1 -1
- package/pins_data_model/models/model_entraid.py +1 -1
- package/pins_data_model/models/model_folder.py +1 -1
- package/pins_data_model/models/model_gettimesheets_response.py +1 -1
- package/pins_data_model/models/model_listed_building.py +1 -1
- package/pins_data_model/models/model_listed_buildings.py +1 -1
- package/pins_data_model/models/model_nsip_document.py +1 -1
- package/pins_data_model/models/model_nsip_exam_timetable.py +1 -1
- package/pins_data_model/models/model_nsip_invoice.py +1 -1
- package/pins_data_model/models/model_nsip_meeting.py +1 -1
- package/pins_data_model/models/model_nsip_project.py +1 -1
- package/pins_data_model/models/model_nsip_project_update.py +1 -1
- package/pins_data_model/models/model_nsip_representation.py +1 -1
- package/pins_data_model/models/model_nsip_subscription.py +1 -1
- package/pins_data_model/models/model_pins_inspector.py +1 -1
- package/pins_data_model/models/model_pins_lpa.py +1 -1
- package/pins_data_model/models/model_s51_advice.py +1 -1
- package/pins_data_model/models/model_service_user.py +1 -1
- package/schemas/appeal-has.schema.json +2 -0
- package/schemas/appeal-s78.schema.json +2 -0
- package/schemas/commands/appeals-components/appeal-enforcement-common-submission.schema.json +52 -5
- package/schemas/commands/appeals-components/appeal-enforcement-listed-submission.schema.json +1 -49
- package/schemas/commands/appeals-components/{appeal-enforcement-submission.schema.json → appeal-enforcement-notice-submission.schema.json} +16 -93
- package/schemas/commands/appeals-components/lpa-questionnaire-enforcement.schema.json +0 -2
- package/schemas/commands/appellant-submission.schema.json +1 -1
- package/src/lib/gen-docs.js +1 -1
- package/src/schemas.d.ts +169 -219
- package/tests/appeals/commands/enforcement-listed-submission.test.js +0 -3
- package/tests/appeals/commands/{enforcement-submission.test.js → enforcement-notice-submission.test.js} +2 -45
|
@@ -60,8 +60,6 @@ const exampleEnforcementSubmissionSchema = {
|
|
|
60
60
|
siteAddressTown: 'et',
|
|
61
61
|
siteAddressCounty: 'velit',
|
|
62
62
|
siteAddressPostcode: 'nisi minim laboris sed',
|
|
63
|
-
siteGridReferenceEasting: '357144',
|
|
64
|
-
siteGridReferenceNorthing: '400534',
|
|
65
63
|
contactAddressLine1: null,
|
|
66
64
|
contactAddressLine2: null,
|
|
67
65
|
contactAddressTown: null,
|
|
@@ -76,7 +74,7 @@ const exampleEnforcementSubmissionSchema = {
|
|
|
76
74
|
appellantProcedurePreferenceDetails: 'eiusmod ex exercitation',
|
|
77
75
|
appellantProcedurePreferenceDuration: 10816414.941069126,
|
|
78
76
|
appellantProcedurePreferenceWitnessCount: -91300569.36444478,
|
|
79
|
-
statusPlanningObligation: '
|
|
77
|
+
statusPlanningObligation: 'finalised',
|
|
80
78
|
nearbyCaseReferences: ['incididunt'],
|
|
81
79
|
namedIndividuals: [
|
|
82
80
|
{
|
|
@@ -108,52 +106,11 @@ describe('enforcement submission command schema', () => {
|
|
|
108
106
|
assert.strictEqual(validationResult, true);
|
|
109
107
|
});
|
|
110
108
|
|
|
111
|
-
it('should enforce
|
|
112
|
-
const invalidPatterns = [
|
|
113
|
-
{ easting: 'abc123', northing: '400534', description: 'easting with letters' },
|
|
114
|
-
{ easting: '1234567*', northing: '400534', description: 'easting too long' },
|
|
115
|
-
{ easting: '12345', northing: '400534', description: 'easting too short' },
|
|
116
|
-
{ easting: '357144', northing: 'xyz123', description: 'northing with letters' },
|
|
117
|
-
{ easting: '357144', northing: '12345678', description: 'northing too long' },
|
|
118
|
-
{ easting: '357144', northing: '12345', description: 'northing too short' },
|
|
119
|
-
{ easting: '', northing: '400534', description: 'empty easting' },
|
|
120
|
-
{ easting: '357144', northing: '', description: 'empty northing' }
|
|
121
|
-
];
|
|
122
|
-
|
|
123
|
-
for (const pattern of invalidPatterns) {
|
|
124
|
-
const test = structuredClone(exampleEnforcementSubmissionSchema);
|
|
125
|
-
test.casedata.siteGridReferenceEasting = pattern.easting;
|
|
126
|
-
test.casedata.siteGridReferenceNorthing = pattern.northing;
|
|
127
|
-
|
|
128
|
-
const validationResult = ajv.validate(schema, test);
|
|
129
|
-
assert.strictEqual(validationResult, false, `Expected validation to fail for ${pattern.description}`);
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
it('should allow only eastings-northings', () => {
|
|
134
|
-
const test = structuredClone(exampleEnforcementSubmissionSchema);
|
|
135
|
-
test.casedata.siteAddressPostcode = undefined;
|
|
136
|
-
test.casedata.siteAddressLine1 = null;
|
|
137
|
-
test.casedata.siteAddressTown = null;
|
|
138
|
-
const validationResult = ajv.validate(schema, test);
|
|
139
|
-
assert.strictEqual(validationResult, true);
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
it('should allow only site address', () => {
|
|
143
|
-
const test = structuredClone(exampleEnforcementSubmissionSchema);
|
|
144
|
-
test.casedata.siteGridReferenceEasting = undefined;
|
|
145
|
-
test.casedata.siteGridReferenceNorthing = null;
|
|
146
|
-
const validationResult = ajv.validate(schema, test);
|
|
147
|
-
assert.strictEqual(validationResult, true);
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
it('should enforce either site address or easting-northing', () => {
|
|
109
|
+
it('should enforce site address', () => {
|
|
151
110
|
const test = structuredClone(exampleEnforcementSubmissionSchema);
|
|
152
111
|
test.casedata.siteAddressPostcode = undefined;
|
|
153
112
|
test.casedata.siteAddressLine1 = null;
|
|
154
113
|
test.casedata.siteAddressTown = null;
|
|
155
|
-
test.casedata.siteGridReferenceEasting = undefined;
|
|
156
|
-
test.casedata.siteGridReferenceNorthing = null;
|
|
157
114
|
const validationResult = ajv.validate(schema, test);
|
|
158
115
|
assert.strictEqual(validationResult, false);
|
|
159
116
|
});
|