@planning-inspectorate/data-model 1.11.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.
Files changed (131) hide show
  1. package/.azure/ci.yml +60 -0
  2. package/.azure/release.yml +57 -0
  3. package/.github/dependabot.yml +11 -0
  4. package/.husky/install.mjs +7 -0
  5. package/.husky/pre-commit +1 -0
  6. package/.prettierignore +11 -0
  7. package/.prettierrc +19 -0
  8. package/LICENSE +21 -0
  9. package/README.md +237 -0
  10. package/commitlint.config.js +8 -0
  11. package/docs/README.md +85 -0
  12. package/docs/appeal-document.md +776 -0
  13. package/docs/appeal-event-estimate.md +108 -0
  14. package/docs/appeal-event.md +404 -0
  15. package/docs/appeal-has.md +1960 -0
  16. package/docs/appeal-representation.md +375 -0
  17. package/docs/appeal-s78.md +3607 -0
  18. package/docs/appeal.md +1879 -0
  19. package/docs/case-schedule.md +8 -0
  20. package/docs/dart-response.md +1413 -0
  21. package/docs/employee.md +70 -0
  22. package/docs/entraid.md +108 -0
  23. package/docs/folder.md +147 -0
  24. package/docs/gettimesheets-response.md +188 -0
  25. package/docs/interested-party.md +284 -0
  26. package/docs/listed-building.md +113 -0
  27. package/docs/listed-buildings.md +113 -0
  28. package/docs/nsip-document.md +966 -0
  29. package/docs/nsip-exam-timetable-defs-event.md +223 -0
  30. package/docs/nsip-exam-timetable-defs-line-item.md +51 -0
  31. package/docs/nsip-exam-timetable-defs.md +3 -0
  32. package/docs/nsip-exam-timetable-submission.md +113 -0
  33. package/docs/nsip-exam-timetable.md +352 -0
  34. package/docs/nsip-project-update.md +163 -0
  35. package/docs/nsip-project.md +2098 -0
  36. package/docs/nsip-representation-defs-attachment.md +133 -0
  37. package/docs/nsip-representation-defs.md +3 -0
  38. package/docs/nsip-representation.md +448 -0
  39. package/docs/nsip-subscription.md +193 -0
  40. package/docs/pins-inspector.md +184 -0
  41. package/docs/pins-lpa.md +260 -0
  42. package/docs/s51-advice.md +460 -0
  43. package/docs/service-user.md +575 -0
  44. package/eslint.config.js +21 -0
  45. package/jsconfig.json +12 -0
  46. package/package.json +55 -0
  47. package/pins_data_model/__init__.py +0 -0
  48. package/pins_data_model/gen_models.py +51 -0
  49. package/pins_data_model/load_schemas.py +51 -0
  50. package/pins_data_model/models/__init__.py +0 -0
  51. package/pins_data_model/models/model_appeal_document.py +294 -0
  52. package/pins_data_model/models/model_appeal_event.py +117 -0
  53. package/pins_data_model/models/model_appeal_event_estimate.py +37 -0
  54. package/pins_data_model/models/model_appeal_has.py +585 -0
  55. package/pins_data_model/models/model_appeal_representation.py +132 -0
  56. package/pins_data_model/models/model_appeal_s78.py +864 -0
  57. package/pins_data_model/models/model_case_schedule.py +11 -0
  58. package/pins_data_model/models/model_dart_response.py +292 -0
  59. package/pins_data_model/models/model_entraid.py +37 -0
  60. package/pins_data_model/models/model_folder.py +56 -0
  61. package/pins_data_model/models/model_gettimesheets_response.py +45 -0
  62. package/pins_data_model/models/model_listed_building.py +33 -0
  63. package/pins_data_model/models/model_listed_buildings.py +33 -0
  64. package/pins_data_model/models/model_nsip_document.py +199 -0
  65. package/pins_data_model/models/model_nsip_exam_timetable.py +90 -0
  66. package/pins_data_model/models/model_nsip_project.py +488 -0
  67. package/pins_data_model/models/model_nsip_project_update.py +60 -0
  68. package/pins_data_model/models/model_nsip_representation.py +83 -0
  69. package/pins_data_model/models/model_nsip_subscription.py +60 -0
  70. package/pins_data_model/models/model_pins_inspector.py +53 -0
  71. package/pins_data_model/models/model_pins_lpa.py +69 -0
  72. package/pins_data_model/models/model_s51_advice.py +109 -0
  73. package/pins_data_model/models/model_service_user.py +121 -0
  74. package/requirements.txt +2 -0
  75. package/schemas/__init__.py +0 -0
  76. package/schemas/appeal-document.schema.json +250 -0
  77. package/schemas/appeal-event-estimate.schema.json +31 -0
  78. package/schemas/appeal-event.schema.json +123 -0
  79. package/schemas/appeal-has.schema.json +576 -0
  80. package/schemas/appeal-representation.schema.json +131 -0
  81. package/schemas/appeal-s78.schema.json +1060 -0
  82. package/schemas/commands/__init__.py +0 -0
  83. package/schemas/commands/appeal-common-submission.schema.json +202 -0
  84. package/schemas/commands/appeal-has-submission.schema.json +82 -0
  85. package/schemas/commands/appeal-representation-submission.schema.json +192 -0
  86. package/schemas/commands/appeal-s78-submission.schema.json +100 -0
  87. package/schemas/commands/appellant-submission.schema.json +164 -0
  88. package/schemas/commands/interested-party.schema.json +80 -0
  89. package/schemas/commands/lpa-questionnaire-common.schema.json +110 -0
  90. package/schemas/commands/lpa-questionnaire-has.schema.json +69 -0
  91. package/schemas/commands/lpa-questionnaire-s78.schema.json +218 -0
  92. package/schemas/commands/lpa-questionnaire.schema.json +125 -0
  93. package/schemas/commands/new-deadline-submission.schema.json +59 -0
  94. package/schemas/commands/nsip-exam-timetable-submission.schema.json +27 -0
  95. package/schemas/commands/register-nsip-subscription.schema.json +32 -0
  96. package/schemas/commands/register-representation.schema.json +51 -0
  97. package/schemas/dart-response.schema.json +350 -0
  98. package/schemas/entraid.schema.json +31 -0
  99. package/schemas/folder.schema.json +49 -0
  100. package/schemas/gettimesheets-response.schema.json +46 -0
  101. package/schemas/listed-building.schema.json +31 -0
  102. package/schemas/listed-buildings.schema.json +31 -0
  103. package/schemas/nsip-document.schema.json +235 -0
  104. package/schemas/nsip-exam-timetable.schema.json +101 -0
  105. package/schemas/nsip-project-update.schema.json +49 -0
  106. package/schemas/nsip-project.schema.json +539 -0
  107. package/schemas/nsip-representation.schema.json +110 -0
  108. package/schemas/nsip-subscription.schema.json +52 -0
  109. package/schemas/pins-inspector.schema.json +47 -0
  110. package/schemas/pins-lpa.schema.json +63 -0
  111. package/schemas/s51-advice.schema.json +113 -0
  112. package/schemas/service-user.schema.json +152 -0
  113. package/setup.py +15 -0
  114. package/src/enums.cjs +632 -0
  115. package/src/enums.d.ts +573 -0
  116. package/src/enums.js +573 -0
  117. package/src/gen-docs.js +34 -0
  118. package/src/gen-enums.js +119 -0
  119. package/src/gen-types.js +70 -0
  120. package/src/index.cjs +746 -0
  121. package/src/index.d.ts +18 -0
  122. package/src/index.js +34 -0
  123. package/src/lib/load.js +78 -0
  124. package/src/schemas.d.ts +4570 -0
  125. package/tests/appeals/appeal-event.test.js +62 -0
  126. package/tests/appeals/commands/appeal-representation-submission.test.js +107 -0
  127. package/tests/appeals/commands/has-questionnaire.test.js +92 -0
  128. package/tests/appeals/commands/has-submission.test.js +113 -0
  129. package/tests/appeals/commands/s78-questionnaire.test.js +96 -0
  130. package/tests/appeals/commands/s78-submission.test.js +119 -0
  131. package/tests/schemas.test.js +97 -0
@@ -0,0 +1,52 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "nsip-subscription.schema.json",
4
+ "title": "nsip-subscription",
5
+ "description": "Subscribers are a subset of Service Users, part of the PINS Data Model",
6
+ "type": "object",
7
+ "additionalProperties": true,
8
+ "required": [
9
+ "subscriptionId",
10
+ "caseReference",
11
+ "emailAddress",
12
+ "subscriptionType",
13
+ "startDate",
14
+ "endDate",
15
+ "language"
16
+ ],
17
+ "properties": {
18
+ "subscriptionId": {
19
+ "type": ["integer", "null"],
20
+ "description": "The unique identifier within the Back Office. Ignored as part of register-nsip-subscription."
21
+ },
22
+ "caseReference": {
23
+ "type": "string",
24
+ "description": "the case reference the subscription relates to"
25
+ },
26
+ "emailAddress": {
27
+ "type": "string",
28
+ "format": "email",
29
+ "examples": ["alan.turing@planninginspectorate.gov.uk"]
30
+ },
31
+ "subscriptionType": {
32
+ "type": "string",
33
+ "enum": ["allUpdates", "applicationSubmitted", "applicationDecided", "registrationOpen"],
34
+ "description": "which update does the subscriber want to get notified of. For multiple types, use multiple messages."
35
+ },
36
+ "startDate": {
37
+ "type": ["string", "null"],
38
+ "format": "date-time",
39
+ "description": "The date to start getting updates"
40
+ },
41
+ "endDate": {
42
+ "type": ["string", "null"],
43
+ "format": "date-time",
44
+ "description": "The date to stop getting updates"
45
+ },
46
+ "language": {
47
+ "type": ["string", "null"],
48
+ "enum": ["English", "Welsh", null],
49
+ "default": "English"
50
+ }
51
+ }
52
+ }
@@ -0,0 +1,47 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "pins-inspector.schema.json",
4
+ "title": "PINS Inspector",
5
+ "description": "Inspector attributes as per Horizon. This will be extended with SAP/Entra data",
6
+ "type": "object",
7
+ "additionalProperties": true,
8
+ "required": ["firstName", "lastName", "horizonId", "email"],
9
+ "properties": {
10
+ "horizonId": {
11
+ "type": "string",
12
+ "description": "The PINS-generated unique horizon ID"
13
+ },
14
+ "firstName": {
15
+ "type": "string",
16
+ "description": "The first name of the inspector"
17
+ },
18
+ "lastName": {
19
+ "type": "string",
20
+ "description": "The last name of the inspector"
21
+ },
22
+ "postName": {
23
+ "type": ["string", "null"],
24
+ "description": "The post name of the inspector"
25
+ },
26
+ "organisationName": {
27
+ "type": ["string", "null"],
28
+ "description": "The organisation name of the inspector"
29
+ },
30
+ "title": {
31
+ "type": ["string", "null"],
32
+ "description": "The title of the inspector"
33
+ },
34
+ "salutation": {
35
+ "type": ["string", "null"],
36
+ "description": "The salutation of the inspector"
37
+ },
38
+ "qualifications": {
39
+ "type": ["string", "null"],
40
+ "description": "The qualifications of the inspector"
41
+ },
42
+ "email": {
43
+ "type": ["string", "null"],
44
+ "description": "The email address of the inspector"
45
+ }
46
+ }
47
+ }
@@ -0,0 +1,63 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "pins-lpa.schema.json",
4
+ "title": "PINS LPA",
5
+ "description": "Local Planning Authority (LPA) attributes as per Horizon. This will be extended with ONS data",
6
+ "type": "object",
7
+ "additionalProperties": true,
8
+ "required": ["lpaName", "pinsLpaCode"],
9
+ "properties": {
10
+ "lpaName": {
11
+ "type": "string",
12
+ "description": "The PINS name of the LPA"
13
+ },
14
+ "organisationType": {
15
+ "type": "string",
16
+ "description": "The organisation type of the LPA"
17
+ },
18
+ "pinsLpaCode": {
19
+ "type": "string",
20
+ "description": "The PINS-generated unqiue LPA code"
21
+ },
22
+ "poBox": {
23
+ "type": ["string", "null"],
24
+ "description": "LPA address Post Office Box"
25
+ },
26
+ "address1": {
27
+ "type": ["string", "null"],
28
+ "description": "First line of LPA address"
29
+ },
30
+ "address2": {
31
+ "type": ["string", "null"],
32
+ "description": "Second line of LPA address"
33
+ },
34
+ "city": {
35
+ "type": ["string", "null"],
36
+ "description": "LPA address city or town"
37
+ },
38
+ "county": {
39
+ "type": ["string", "null"],
40
+ "description": "LPA address county"
41
+ },
42
+ "postcode": {
43
+ "type": ["string", "null"],
44
+ "description": "LPA address postcode"
45
+ },
46
+ "country": {
47
+ "type": ["string", "null"],
48
+ "description": "LPA address country"
49
+ },
50
+ "telephoneNumber": {
51
+ "type": ["string", "null"],
52
+ "description": "LPA telephine number"
53
+ },
54
+ "fax": {
55
+ "type": ["string", "null"],
56
+ "description": "LPA fax number"
57
+ },
58
+ "emailAddress": {
59
+ "type": ["string", "null"],
60
+ "description": "LPA email address"
61
+ }
62
+ }
63
+ }
@@ -0,0 +1,113 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "s51-advice.schema.json",
4
+ "title": "S51 Advice",
5
+ "description": "Section 51 Advice schema",
6
+ "type": "object",
7
+ "additionalProperties": true,
8
+ "required": [
9
+ "adviceId",
10
+ "adviceReference",
11
+ "caseId",
12
+ "caseReference",
13
+ "title",
14
+ "from",
15
+ "agent",
16
+ "method",
17
+ "enquiryDate",
18
+ "enquiryDetails",
19
+ "adviceGivenBy",
20
+ "adviceDate",
21
+ "adviceDetails",
22
+ "status",
23
+ "redactionStatus",
24
+ "attachmentIds"
25
+ ],
26
+ "properties": {
27
+ "adviceId": {
28
+ "type": "integer",
29
+ "examples": [1234]
30
+ },
31
+ "adviceReference": {
32
+ "type": "string",
33
+ "examples": ["TR0200007-0005"]
34
+ },
35
+ "caseId": {
36
+ "type": ["integer", "null"],
37
+ "examples": [1234]
38
+ },
39
+ "caseReference": {
40
+ "type": ["string", "null"],
41
+ "examples": ["BC0110002"]
42
+ },
43
+ "title": {
44
+ "type": "string",
45
+ "description": "Title of the advice",
46
+ "examples": ["Advice following issue of decision to accept the application for examination"]
47
+ },
48
+ "titleWelsh": {
49
+ "type": ["string", "null"],
50
+ "description": "Title of the advice in Welsh"
51
+ },
52
+ "from": {
53
+ "type": ["string", "null"],
54
+ "description": "Who the enquiry is from"
55
+ },
56
+ "agent": {
57
+ "type": ["string", "null"],
58
+ "description": "Who the enquiry is on behalf of"
59
+ },
60
+ "method": {
61
+ "type": ["string", "null"],
62
+ "description": "How the enquiry was made",
63
+ "enum": ["phone", "email", "meeting", "post", "fax", null]
64
+ },
65
+ "enquiryDate": {
66
+ "type": ["string", "null"],
67
+ "description": "Date the enquiry was made",
68
+ "format": "date-time",
69
+ "examples": ["2023-07-27T20:30:00.000Z"]
70
+ },
71
+ "enquiryDetails": {
72
+ "type": ["string", "null"],
73
+ "description": "Details of the enquiry"
74
+ },
75
+ "enquiryDetailsWelsh": {
76
+ "type": ["string", "null"],
77
+ "description": "Details of the enquiry in Welsh"
78
+ },
79
+ "adviceGivenBy": {
80
+ "type": ["string", "null"],
81
+ "description": "Who issued the advice"
82
+ },
83
+ "adviceDate": {
84
+ "type": ["string", "null"],
85
+ "description": "Date the advice was given",
86
+ "format": "date-time",
87
+ "examples": ["2023-07-27T20:30:00.000Z"]
88
+ },
89
+ "adviceDetails": {
90
+ "type": ["string", "null"],
91
+ "description": "Details of the advice"
92
+ },
93
+ "adviceDetailsWelsh": {
94
+ "type": ["string", "null"],
95
+ "description": "Details of the advice in Welsh"
96
+ },
97
+ "status": {
98
+ "type": ["string", "null"],
99
+ "enum": ["checked", "unchecked", "readytopublish", "published", "donotpublish", null]
100
+ },
101
+ "redactionStatus": {
102
+ "type": ["string", "null"],
103
+ "enum": ["unredacted", "redacted", null]
104
+ },
105
+ "attachmentIds": {
106
+ "type": "array",
107
+ "items": {
108
+ "type": "string",
109
+ "description": "Collection of document IDs which are related to the S51 Advice"
110
+ }
111
+ }
112
+ }
113
+ }
@@ -0,0 +1,152 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "service-user.schema.json",
4
+ "title": "Service User",
5
+ "description": "Service User of the planning inspectorate. Also contains role information by combining serviceUserType and caseReference.",
6
+ "type": "object",
7
+ "additionalProperties": true,
8
+ "required": [
9
+ "id",
10
+ "salutation",
11
+ "firstName",
12
+ "lastName",
13
+ "addressLine1",
14
+ "addressLine2",
15
+ "addressTown",
16
+ "addressCounty",
17
+ "postcode",
18
+ "addressCountry",
19
+ "organisation",
20
+ "organisationType",
21
+ "role",
22
+ "telephoneNumber",
23
+ "otherPhoneNumber",
24
+ "faxNumber",
25
+ "emailAddress",
26
+ "webAddress",
27
+ "serviceUserType",
28
+ "caseReference",
29
+ "sourceSystem",
30
+ "sourceSuid"
31
+ ],
32
+ "properties": {
33
+ "id": {
34
+ "type": "string",
35
+ "description": "A unique identifier for the entity.",
36
+ "examples": ["12345"]
37
+ },
38
+ "salutation": {
39
+ "type": ["string", "null"],
40
+ "description": "A formal greeting, e.g., Mr, Mrs, Ms.",
41
+ "examples": ["Mr"]
42
+ },
43
+ "firstName": {
44
+ "type": ["string", "null"],
45
+ "description": "The first name of the individual.",
46
+ "examples": ["John"]
47
+ },
48
+ "lastName": {
49
+ "type": ["string", "null"],
50
+ "description": "The last name of the individual.",
51
+ "examples": ["Doe"]
52
+ },
53
+ "addressLine1": {
54
+ "type": ["string", "null"],
55
+ "description": "The first line of the address.",
56
+ "examples": ["123 Elm Street"]
57
+ },
58
+ "addressLine2": {
59
+ "type": ["string", "null"],
60
+ "description": "The second line of the address, usually includes suite or apartment number.",
61
+ "examples": ["Apt 4B"]
62
+ },
63
+ "addressTown": {
64
+ "type": ["string", "null"],
65
+ "description": "The town or city of the address.",
66
+ "examples": ["Springfield"]
67
+ },
68
+ "addressCounty": {
69
+ "type": ["string", "null"],
70
+ "description": "The county in which the town or city is located.",
71
+ "examples": ["Hampshire"]
72
+ },
73
+ "postcode": {
74
+ "type": ["string", "null"],
75
+ "description": "The postal code for the address.",
76
+ "examples": ["M12 4AF"]
77
+ },
78
+ "addressCountry": {
79
+ "type": ["string", "null"],
80
+ "description": "The country of the address.",
81
+ "examples": ["United Kingdom"]
82
+ },
83
+ "organisation": {
84
+ "type": ["string", "null"],
85
+ "description": "The name of the organisation associated with the individual.",
86
+ "examples": ["Tech Corp"]
87
+ },
88
+ "organisationType": {
89
+ "type": ["string", "null"],
90
+ "description": "The type or nature of the organisation.",
91
+ "examples": ["Private Company"]
92
+ },
93
+ "role": {
94
+ "type": ["string", "null"],
95
+ "description": "The individual's role or position within the organisation.",
96
+ "examples": ["Agent"]
97
+ },
98
+ "telephoneNumber": {
99
+ "type": ["string", "null"],
100
+ "description": "The primary telephone contact number.",
101
+ "examples": ["+447123456789"]
102
+ },
103
+ "otherPhoneNumber": {
104
+ "type": ["string", "null"],
105
+ "description": "An alternate or secondary phone number.",
106
+ "examples": ["+447123456789"]
107
+ },
108
+ "faxNumber": {
109
+ "type": ["string", "null"],
110
+ "description": "A fax contact number.",
111
+ "examples": ["+447123456789"]
112
+ },
113
+ "emailAddress": {
114
+ "type": ["string", "null"],
115
+ "description": "The primary email address for contact.",
116
+ "examples": ["john.doe@example.com"]
117
+ },
118
+ "webAddress": {
119
+ "type": ["string", "null"],
120
+ "description": "Website address or URL.",
121
+ "examples": ["https://www.example.com"]
122
+ },
123
+ "serviceUserType": {
124
+ "type": "string",
125
+ "description": "Type or category of the service user.",
126
+ "enum": [
127
+ "Applicant",
128
+ "Appellant",
129
+ "Agent",
130
+ "Rule6Party",
131
+ "InterestedParty",
132
+ "RepresentationContact",
133
+ "Subscriber"
134
+ ]
135
+ },
136
+ "caseReference": {
137
+ "type": "string",
138
+ "description": "Reference number for a particular case or incident.",
139
+ "examples": ["BC0510001"]
140
+ },
141
+ "sourceSystem": {
142
+ "type": "string",
143
+ "description": "The originating system from where the data was sourced.",
144
+ "examples": ["ODT", "Horizon"]
145
+ },
146
+ "sourceSuid": {
147
+ "type": "string",
148
+ "description": "Unique identifier from the source system.",
149
+ "examples": ["12345"]
150
+ }
151
+ }
152
+ }
package/setup.py ADDED
@@ -0,0 +1,15 @@
1
+ from setuptools import find_packages, setup
2
+
3
+ setup(
4
+ name='pins_data_model',
5
+ packages=find_packages(),
6
+ include_package_data=True,
7
+ package_data={
8
+ "schemas": ["*"],
9
+ "schemas.commands": ["*"],
10
+ },
11
+ version='1.0.0',
12
+ description='JSON Schemas for the Planning Inspectorate\'s Data Model',
13
+ install_requires=['jsonc-parser==1.1.0'],
14
+ setup_requires=[]
15
+ )