@pdtf/schemas 3.6.0-1 → 3.6.0-10

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/index.js CHANGED
@@ -246,6 +246,18 @@ const getCachedSchemaData = (path, schemaId, overlays) => {
246
246
  matchingProperty = aOneOf.items;
247
247
  } else if (aOneOf.properties?.[pathElement]) {
248
248
  matchingProperty = aOneOf.properties?.[pathElement];
249
+ } else if (aOneOf.patternProperties) {
250
+ for (const pattern in aOneOf.patternProperties) {
251
+ try {
252
+ const regex = new RegExp(pattern);
253
+ if (regex.test(pathElement)) {
254
+ matchingProperty = aOneOf.patternProperties[pattern];
255
+ break;
256
+ }
257
+ } catch (e) {
258
+ // Invalid regex pattern - skip
259
+ }
260
+ }
249
261
  }
250
262
  });
251
263
  if (matchingProperty) return matchingProperty;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdtf/schemas",
3
- "version": "3.6.0-1",
3
+ "version": "3.6.0-10",
4
4
  "description": "Property Data Trust Framework Schemas and Utilities",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -8,7 +8,8 @@
8
8
  },
9
9
  "scripts": {
10
10
  "test": "jest",
11
- "test:watch": "jest --watch"
11
+ "test:watch": "jest --watch",
12
+ "extract-overlays": "cd src/utils && node extractOverlay.js"
12
13
  },
13
14
  "repository": {
14
15
  "type": "git",
@@ -20,7 +20,22 @@
20
20
  "type": "string"
21
21
  },
22
22
  "externalIds": {
23
- "type": "object"
23
+ "type": "object",
24
+ "patternProperties": {
25
+ ".*": {
26
+ "oneOf": [
27
+ { "type": "string" },
28
+ { "type": "number" },
29
+ { "type": "boolean" },
30
+ {
31
+ "type": "object",
32
+ "patternProperties": {
33
+ ".*": {}
34
+ }
35
+ }
36
+ ]
37
+ }
38
+ }
24
39
  },
25
40
  "status": {
26
41
  "type": "string",
@@ -185,7 +200,22 @@
185
200
  ]
186
201
  },
187
202
  "externalIds": {
188
- "type": "object"
203
+ "type": "object",
204
+ "patternProperties": {
205
+ ".*": {
206
+ "oneOf": [
207
+ { "type": "string" },
208
+ { "type": "number" },
209
+ { "type": "boolean" },
210
+ {
211
+ "type": "object",
212
+ "patternProperties": {
213
+ ".*": {}
214
+ }
215
+ }
216
+ ]
217
+ }
218
+ }
189
219
  },
190
220
  "participantStatus": {
191
221
  "type": "string",
@@ -197,6 +227,17 @@
197
227
  "identity": {
198
228
  "type": "object",
199
229
  "properties": {
230
+ "status": {
231
+ "type": "string",
232
+ "enum": [
233
+ "Requested",
234
+ "In progress",
235
+ "User tasks complete",
236
+ "Report available",
237
+ "Complete",
238
+ "Cancelled"
239
+ ]
240
+ },
200
241
  "result": {
201
242
  "type": "string",
202
243
  "enum": ["pass", "fail", "consider"]
@@ -224,6 +265,55 @@
224
265
  "antiMoneyLaundering": {
225
266
  "type": "object",
226
267
  "properties": {
268
+ "status": {
269
+ "type": "string",
270
+ "enum": [
271
+ "Requested",
272
+ "In progress",
273
+ "User tasks complete",
274
+ "Report available",
275
+ "Complete",
276
+ "Cancelled"
277
+ ]
278
+ },
279
+ "result": {
280
+ "type": "string",
281
+ "enum": ["pass", "fail", "consider"]
282
+ },
283
+ "reports": {
284
+ "type": "array",
285
+ "items": {
286
+ "type": "object",
287
+ "properties": {
288
+ "reportName": {
289
+ "type": "string"
290
+ },
291
+ "result": {
292
+ "type": "string",
293
+ "enum": ["pass", "fail", "consider"]
294
+ },
295
+ "details": {
296
+ "type": "string"
297
+ }
298
+ }
299
+ }
300
+ }
301
+ }
302
+ },
303
+ "sourceOfFunds": {
304
+ "type": "object",
305
+ "properties": {
306
+ "status": {
307
+ "type": "string",
308
+ "enum": [
309
+ "Requested",
310
+ "In progress",
311
+ "User tasks complete",
312
+ "Report available",
313
+ "Complete",
314
+ "Cancelled"
315
+ ]
316
+ },
227
317
  "result": {
228
318
  "type": "string",
229
319
  "enum": ["pass", "fail", "consider"]
@@ -310,6 +400,9 @@
310
400
  "Personal Representative for a Deceased Owner",
311
401
  "Under Power of Attorney",
312
402
  "Mortgagee in Possession",
403
+ "Company Director",
404
+ "Company Secretary",
405
+ "Trustee",
313
406
  "Assistant",
314
407
  "Other"
315
408
  ]
@@ -347,6 +440,9 @@
347
440
  "enum": [
348
441
  "Personal Representative for a Deceased Owner",
349
442
  "Under Power of Attorney",
443
+ "Company Director",
444
+ "Company Secretary",
445
+ "Trustee",
350
446
  "Assistant",
351
447
  "Other"
352
448
  ]
@@ -1757,6 +1853,15 @@
1757
1853
  "description": "This may differ from the number of legal owners, for example if the property is being sold by executors of a deceased owner",
1758
1854
  "type": "integer"
1759
1855
  },
1856
+ "outstandingMortgage": {
1857
+ "title": "Are there any outstanding mortgages on the property?",
1858
+ "type": "string",
1859
+ "enum": ["Yes", "No"]
1860
+ },
1861
+ "existingLender": {
1862
+ "title": "What is the name of the existing lender?",
1863
+ "type": "string"
1864
+ },
1760
1865
  "hasHelpToBuyEquityLoan": {
1761
1866
  "title": "Is the property being sold with a Help to Buy equity loan outstanding?",
1762
1867
  "type": "string",
@@ -26101,6 +26206,39 @@
26101
26206
  "title": "",
26102
26207
  "type": "string",
26103
26208
  "enum": ["Attached", "To follow"]
26209
+ },
26210
+ "fensaCertificates": {
26211
+ "type": "object",
26212
+ "properties": {
26213
+ "certificates": {
26214
+ "type": "array",
26215
+ "items": {
26216
+ "type": "object",
26217
+ "properties": {
26218
+ "certificateId": {
26219
+ "type": "string",
26220
+ "minLength": 1
26221
+ },
26222
+ "numberOfWindows": {
26223
+ "type": "integer",
26224
+ "minimum": 0
26225
+ },
26226
+ "numberOfDoors": {
26227
+ "type": "integer",
26228
+ "minimum": 0
26229
+ },
26230
+ "certificateIssued": {
26231
+ "type": "string",
26232
+ "format": "date"
26233
+ },
26234
+ "workCompleted": {
26235
+ "type": "string",
26236
+ "format": "date"
26237
+ }
26238
+ }
26239
+ }
26240
+ }
26241
+ }
26104
26242
  }
26105
26243
  },
26106
26244
  "baspi4Required": ["attachments"],
@@ -27121,7 +27259,22 @@
27121
27259
  "format": "date-time"
27122
27260
  },
27123
27261
  "externalIds": {
27124
- "type": "object"
27262
+ "type": "object",
27263
+ "patternProperties": {
27264
+ ".*": {
27265
+ "oneOf": [
27266
+ { "type": "string" },
27267
+ { "type": "number" },
27268
+ { "type": "boolean" },
27269
+ {
27270
+ "type": "object",
27271
+ "patternProperties": {
27272
+ ".*": {}
27273
+ }
27274
+ }
27275
+ ]
27276
+ }
27277
+ }
27125
27278
  }
27126
27279
  }
27127
27280
  }
@@ -39830,10 +39983,29 @@
39830
39983
  "minLength": 1
39831
39984
  },
39832
39985
  "externalIds": {
39833
- "type": "object"
39986
+ "type": "object",
39987
+ "patternProperties": {
39988
+ ".*": {
39989
+ "oneOf": [
39990
+ { "type": "string" },
39991
+ { "type": "number" },
39992
+ { "type": "boolean" },
39993
+ {
39994
+ "type": "object",
39995
+ "patternProperties": {
39996
+ ".*": {}
39997
+ }
39998
+ }
39999
+ ]
40000
+ }
40001
+ }
39834
40002
  },
39835
40003
  "isDeleted": {
39836
40004
  "type": "boolean"
40005
+ },
40006
+ "summary": {
40007
+ "title": "Structured summary of the document",
40008
+ "type": "object"
39837
40009
  }
39838
40010
  }
39839
40011
  }
@@ -41473,7 +41645,22 @@
41473
41645
  "name": { "type": "string" },
41474
41646
  "url": { "type": "string", "format": "uri" },
41475
41647
  "externalIds": {
41476
- "type": "object"
41648
+ "type": "object",
41649
+ "patternProperties": {
41650
+ ".*": {
41651
+ "oneOf": [
41652
+ { "type": "string" },
41653
+ { "type": "number" },
41654
+ { "type": "boolean" },
41655
+ {
41656
+ "type": "object",
41657
+ "patternProperties": {
41658
+ ".*": {}
41659
+ }
41660
+ }
41661
+ ]
41662
+ }
41663
+ }
41477
41664
  },
41478
41665
  "requiredSignatories": {
41479
41666
  "type": "array",
@@ -41517,7 +41704,22 @@
41517
41704
  "name": { "type": "string" },
41518
41705
  "signedOn": { "type": "string", "format": "date-time" },
41519
41706
  "externalIds": {
41520
- "type": "object"
41707
+ "type": "object",
41708
+ "patternProperties": {
41709
+ ".*": {
41710
+ "oneOf": [
41711
+ { "type": "string" },
41712
+ { "type": "number" },
41713
+ { "type": "boolean" },
41714
+ {
41715
+ "type": "object",
41716
+ "patternProperties": {
41717
+ ".*": {}
41718
+ }
41719
+ }
41720
+ ]
41721
+ }
41722
+ }
41521
41723
  }
41522
41724
  },
41523
41725
  "role": {
@@ -41563,7 +41765,22 @@
41563
41765
  "type": "string"
41564
41766
  },
41565
41767
  "externalIds": {
41566
- "type": "object"
41768
+ "type": "object",
41769
+ "patternProperties": {
41770
+ ".*": {
41771
+ "oneOf": [
41772
+ { "type": "string" },
41773
+ { "type": "number" },
41774
+ { "type": "boolean" },
41775
+ {
41776
+ "type": "object",
41777
+ "patternProperties": {
41778
+ ".*": {}
41779
+ }
41780
+ }
41781
+ ]
41782
+ }
41783
+ }
41567
41784
  },
41568
41785
  "address": {
41569
41786
  "title": "Address",
@@ -41640,7 +41857,22 @@
41640
41857
  "type": "string"
41641
41858
  },
41642
41859
  "externalIds": {
41643
- "type": "object"
41860
+ "type": "object",
41861
+ "patternProperties": {
41862
+ ".*": {
41863
+ "oneOf": [
41864
+ { "type": "string" },
41865
+ { "type": "number" },
41866
+ { "type": "boolean" },
41867
+ {
41868
+ "type": "object",
41869
+ "patternProperties": {
41870
+ ".*": {}
41871
+ }
41872
+ }
41873
+ ]
41874
+ }
41875
+ }
41644
41876
  },
41645
41877
  "address": {
41646
41878
  "title": "Address",
@@ -41838,18 +42070,214 @@
41838
42070
  "status": {
41839
42071
  "type": "string",
41840
42072
  "enum": [
41841
- "pending",
41842
- "withdrawn",
41843
- "rejected",
41844
- "accepted",
41845
- "noteOfInterest"
42073
+ "Pending",
42074
+ "Withdrawn",
42075
+ "Rejected",
42076
+ "Accepted",
42077
+ "Note of Interest"
41846
42078
  ]
41847
42079
  },
41848
42080
  "inclusions": { "type": "array", "items": { "type": "string" } },
41849
42081
  "exclusions": { "type": "array", "items": { "type": "string" } },
41850
- "conditions": { "type": "array", "items": { "type": "string" } }
41851
- },
41852
- "required": ["amount", "currency", "status"]
42082
+ "conditions": { "type": "array", "items": { "type": "string" } },
42083
+ "externalIds": {
42084
+ "type": "object",
42085
+ "patternProperties": {
42086
+ ".*": {
42087
+ "oneOf": [
42088
+ { "type": "string" },
42089
+ { "type": "number" },
42090
+ { "type": "boolean" },
42091
+ {
42092
+ "type": "object",
42093
+ "patternProperties": {
42094
+ ".*": {}
42095
+ }
42096
+ }
42097
+ ]
42098
+ }
42099
+ }
42100
+ },
42101
+ "buyerCircumstances": {
42102
+ "title": "Buyer circumstances",
42103
+ "description": "Information about the buyer's circumstances for lender compatibility analysis and conveyancing quotes",
42104
+ "type": "object",
42105
+ "properties": {
42106
+ "intendedUse": {
42107
+ "type": "string",
42108
+ "title": "Intended use of property",
42109
+ "enum": [
42110
+ "Owner occupied",
42111
+ "Buy-to-let",
42112
+ "Holiday let",
42113
+ "Second home"
42114
+ ]
42115
+ },
42116
+ "firstTimeBuyer": {
42117
+ "type": "boolean",
42118
+ "title": "First-time buyer"
42119
+ },
42120
+ "rightToBuy": {
42121
+ "type": "boolean",
42122
+ "title": "Right to Buy purchase"
42123
+ },
42124
+ "ltdCompanyPurchase": {
42125
+ "type": "boolean",
42126
+ "title": "Limited company purchase"
42127
+ },
42128
+ "numberOfOwners": {
42129
+ "type": "integer",
42130
+ "title": "Number of owners",
42131
+ "nullable": true
42132
+ },
42133
+ "numberOfExpats": {
42134
+ "type": "integer",
42135
+ "title": "Number of expat buyers",
42136
+ "nullable": true
42137
+ },
42138
+ "giftedEquity": {
42139
+ "type": "boolean",
42140
+ "title": "Gifted equity"
42141
+ },
42142
+ "numberOfGiftedDeposits": {
42143
+ "type": "integer",
42144
+ "title": "Number of gifted deposits",
42145
+ "nullable": true
42146
+ },
42147
+ "requiresMortgage": {
42148
+ "type": "string",
42149
+ "title": "Requires mortgage",
42150
+ "enum": ["Yes", "No"]
42151
+ }
42152
+ },
42153
+ "discriminator": {
42154
+ "propertyName": "requiresMortgage"
42155
+ },
42156
+ "required": ["requiresMortgage"],
42157
+ "oneOf": [
42158
+ {
42159
+ "properties": {
42160
+ "requiresMortgage": {
42161
+ "enum": ["No"]
42162
+ }
42163
+ }
42164
+ },
42165
+ {
42166
+ "properties": {
42167
+ "requiresMortgage": {
42168
+ "enum": ["Yes"]
42169
+ },
42170
+ "helpToBuyEquityLoan": {
42171
+ "type": "boolean",
42172
+ "title": "Help to Buy equity loan"
42173
+ },
42174
+ "armedForcesHelpToBuy": {
42175
+ "type": "boolean",
42176
+ "title": "Armed Forces Help to Buy"
42177
+ },
42178
+ "numberOfHelpToBuyIsas": {
42179
+ "type": "integer",
42180
+ "title": "Number of Help to Buy ISAs",
42181
+ "nullable": true
42182
+ },
42183
+ "bridgingFinanceRepresentation": {
42184
+ "type": "string",
42185
+ "title": "Bridging finance representation",
42186
+ "enum": ["Dual", "Separate"],
42187
+ "nullable": true
42188
+ },
42189
+ "depositAmount": {
42190
+ "type": "number",
42191
+ "title": "Deposit amount",
42192
+ "minimum": 0
42193
+ },
42194
+ "loanToValue": {
42195
+ "type": "number",
42196
+ "title": "Loan-to-Value (LTV)",
42197
+ "minimum": 0,
42198
+ "maximum": 100
42199
+ },
42200
+ "numberOfBorrowers": {
42201
+ "type": "integer",
42202
+ "title": "Number of borrowers",
42203
+ "minimum": 1,
42204
+ "maximum": 4,
42205
+ "default": 1
42206
+ },
42207
+ "jointProprietorSoleMortgagor": {
42208
+ "type": "boolean",
42209
+ "title": "Joint proprietor, sole mortgagor"
42210
+ },
42211
+ "soleProprietorJointMortgagor": {
42212
+ "type": "boolean",
42213
+ "title": "Sole proprietor, joint mortgagor"
42214
+ },
42215
+ "deedOfPostponement": {
42216
+ "type": "boolean",
42217
+ "title": "Deed of postponement required"
42218
+ },
42219
+ "separateRepresentation": {
42220
+ "type": "boolean",
42221
+ "title": "Separate legal representation required",
42222
+ "nullable": true
42223
+ },
42224
+ "oldestBorrowerAge": {
42225
+ "type": "integer",
42226
+ "title": "Oldest borrower age",
42227
+ "minimum": 18,
42228
+ "maximum": 85
42229
+ },
42230
+ "mortgageTerm": {
42231
+ "type": "integer",
42232
+ "title": "Mortgage term",
42233
+ "minimum": 5,
42234
+ "maximum": 40
42235
+ },
42236
+ "adverseCredit": {
42237
+ "type": "string",
42238
+ "title": "Adverse credit",
42239
+ "enum": ["No", "Yes", "Prefer not to say"]
42240
+ },
42241
+ "employmentType": {
42242
+ "type": "string",
42243
+ "title": "Employment type",
42244
+ "enum": [
42245
+ "Employed",
42246
+ "Self-employed",
42247
+ "Retired",
42248
+ "Contractor",
42249
+ "Other"
42250
+ ]
42251
+ },
42252
+ "existingMortgagedProperties": {
42253
+ "type": "integer",
42254
+ "title": "Existing mortgaged properties",
42255
+ "minimum": 0
42256
+ },
42257
+ "annualIncome": {
42258
+ "type": "number",
42259
+ "title": "Annual gross income",
42260
+ "minimum": 0
42261
+ },
42262
+ "residencyStatus": {
42263
+ "type": "string",
42264
+ "title": "Residency status",
42265
+ "enum": [
42266
+ "UK citizen",
42267
+ "Permanent resident",
42268
+ "Visa holder",
42269
+ "Non-resident"
42270
+ ]
42271
+ },
42272
+ "nominatedLender": {
42273
+ "type": "string",
42274
+ "title": "Nominated lender"
42275
+ }
42276
+ }
42277
+ }
42278
+ ]
42279
+ }
42280
+ }
41853
42281
  }
41854
42282
  }
41855
42283
  },
@@ -41931,6 +42359,24 @@
41931
42359
  ]
41932
42360
  }
41933
42361
  }
42362
+ },
42363
+ "externalIds": {
42364
+ "type": "object",
42365
+ "patternProperties": {
42366
+ ".*": {
42367
+ "oneOf": [
42368
+ { "type": "string" },
42369
+ { "type": "number" },
42370
+ { "type": "boolean" },
42371
+ {
42372
+ "type": "object",
42373
+ "patternProperties": {
42374
+ ".*": {}
42375
+ }
42376
+ }
42377
+ ]
42378
+ }
42379
+ }
41934
42380
  }
41935
42381
  },
41936
42382
  "required": ["subject", "status", "messages"],