@pdtf/schemas 3.6.0-7 → 3.6.0-9
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 +12 -0
- package/package.json +3 -2
- package/src/schemas/v3/combined.json +160 -10
- package/src/schemas/v3/compactSkeleton.txt +9 -9
- package/src/schemas/v3/pdtf-transaction.json +220 -10
- package/src/schemas/v3/skeleton.json +27 -9
- package/src/tests/v3/offers.test.js +37 -40
- package/src/tests/v3/patternProperties.test.js +149 -30
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-
|
|
3
|
+
"version": "3.6.0-9",
|
|
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",
|
|
@@ -27220,7 +27250,22 @@
|
|
|
27220
27250
|
"format": "date-time"
|
|
27221
27251
|
},
|
|
27222
27252
|
"externalIds": {
|
|
27223
|
-
"type": "object"
|
|
27253
|
+
"type": "object",
|
|
27254
|
+
"patternProperties": {
|
|
27255
|
+
".*": {
|
|
27256
|
+
"oneOf": [
|
|
27257
|
+
{ "type": "string" },
|
|
27258
|
+
{ "type": "number" },
|
|
27259
|
+
{ "type": "boolean" },
|
|
27260
|
+
{
|
|
27261
|
+
"type": "object",
|
|
27262
|
+
"patternProperties": {
|
|
27263
|
+
".*": {}
|
|
27264
|
+
}
|
|
27265
|
+
}
|
|
27266
|
+
]
|
|
27267
|
+
}
|
|
27268
|
+
}
|
|
27224
27269
|
}
|
|
27225
27270
|
}
|
|
27226
27271
|
}
|
|
@@ -39929,7 +39974,22 @@
|
|
|
39929
39974
|
"minLength": 1
|
|
39930
39975
|
},
|
|
39931
39976
|
"externalIds": {
|
|
39932
|
-
"type": "object"
|
|
39977
|
+
"type": "object",
|
|
39978
|
+
"patternProperties": {
|
|
39979
|
+
".*": {
|
|
39980
|
+
"oneOf": [
|
|
39981
|
+
{ "type": "string" },
|
|
39982
|
+
{ "type": "number" },
|
|
39983
|
+
{ "type": "boolean" },
|
|
39984
|
+
{
|
|
39985
|
+
"type": "object",
|
|
39986
|
+
"patternProperties": {
|
|
39987
|
+
".*": {}
|
|
39988
|
+
}
|
|
39989
|
+
}
|
|
39990
|
+
]
|
|
39991
|
+
}
|
|
39992
|
+
}
|
|
39933
39993
|
},
|
|
39934
39994
|
"isDeleted": {
|
|
39935
39995
|
"type": "boolean"
|
|
@@ -41576,7 +41636,22 @@
|
|
|
41576
41636
|
"name": { "type": "string" },
|
|
41577
41637
|
"url": { "type": "string", "format": "uri" },
|
|
41578
41638
|
"externalIds": {
|
|
41579
|
-
"type": "object"
|
|
41639
|
+
"type": "object",
|
|
41640
|
+
"patternProperties": {
|
|
41641
|
+
".*": {
|
|
41642
|
+
"oneOf": [
|
|
41643
|
+
{ "type": "string" },
|
|
41644
|
+
{ "type": "number" },
|
|
41645
|
+
{ "type": "boolean" },
|
|
41646
|
+
{
|
|
41647
|
+
"type": "object",
|
|
41648
|
+
"patternProperties": {
|
|
41649
|
+
".*": {}
|
|
41650
|
+
}
|
|
41651
|
+
}
|
|
41652
|
+
]
|
|
41653
|
+
}
|
|
41654
|
+
}
|
|
41580
41655
|
},
|
|
41581
41656
|
"requiredSignatories": {
|
|
41582
41657
|
"type": "array",
|
|
@@ -41620,7 +41695,22 @@
|
|
|
41620
41695
|
"name": { "type": "string" },
|
|
41621
41696
|
"signedOn": { "type": "string", "format": "date-time" },
|
|
41622
41697
|
"externalIds": {
|
|
41623
|
-
"type": "object"
|
|
41698
|
+
"type": "object",
|
|
41699
|
+
"patternProperties": {
|
|
41700
|
+
".*": {
|
|
41701
|
+
"oneOf": [
|
|
41702
|
+
{ "type": "string" },
|
|
41703
|
+
{ "type": "number" },
|
|
41704
|
+
{ "type": "boolean" },
|
|
41705
|
+
{
|
|
41706
|
+
"type": "object",
|
|
41707
|
+
"patternProperties": {
|
|
41708
|
+
".*": {}
|
|
41709
|
+
}
|
|
41710
|
+
}
|
|
41711
|
+
]
|
|
41712
|
+
}
|
|
41713
|
+
}
|
|
41624
41714
|
}
|
|
41625
41715
|
},
|
|
41626
41716
|
"role": {
|
|
@@ -41666,7 +41756,22 @@
|
|
|
41666
41756
|
"type": "string"
|
|
41667
41757
|
},
|
|
41668
41758
|
"externalIds": {
|
|
41669
|
-
"type": "object"
|
|
41759
|
+
"type": "object",
|
|
41760
|
+
"patternProperties": {
|
|
41761
|
+
".*": {
|
|
41762
|
+
"oneOf": [
|
|
41763
|
+
{ "type": "string" },
|
|
41764
|
+
{ "type": "number" },
|
|
41765
|
+
{ "type": "boolean" },
|
|
41766
|
+
{
|
|
41767
|
+
"type": "object",
|
|
41768
|
+
"patternProperties": {
|
|
41769
|
+
".*": {}
|
|
41770
|
+
}
|
|
41771
|
+
}
|
|
41772
|
+
]
|
|
41773
|
+
}
|
|
41774
|
+
}
|
|
41670
41775
|
},
|
|
41671
41776
|
"address": {
|
|
41672
41777
|
"title": "Address",
|
|
@@ -41743,7 +41848,22 @@
|
|
|
41743
41848
|
"type": "string"
|
|
41744
41849
|
},
|
|
41745
41850
|
"externalIds": {
|
|
41746
|
-
"type": "object"
|
|
41851
|
+
"type": "object",
|
|
41852
|
+
"patternProperties": {
|
|
41853
|
+
".*": {
|
|
41854
|
+
"oneOf": [
|
|
41855
|
+
{ "type": "string" },
|
|
41856
|
+
{ "type": "number" },
|
|
41857
|
+
{ "type": "boolean" },
|
|
41858
|
+
{
|
|
41859
|
+
"type": "object",
|
|
41860
|
+
"patternProperties": {
|
|
41861
|
+
".*": {}
|
|
41862
|
+
}
|
|
41863
|
+
}
|
|
41864
|
+
]
|
|
41865
|
+
}
|
|
41866
|
+
}
|
|
41747
41867
|
},
|
|
41748
41868
|
"address": {
|
|
41749
41869
|
"title": "Address",
|
|
@@ -41952,7 +42072,22 @@
|
|
|
41952
42072
|
"exclusions": { "type": "array", "items": { "type": "string" } },
|
|
41953
42073
|
"conditions": { "type": "array", "items": { "type": "string" } },
|
|
41954
42074
|
"externalIds": {
|
|
41955
|
-
"type": "object"
|
|
42075
|
+
"type": "object",
|
|
42076
|
+
"patternProperties": {
|
|
42077
|
+
".*": {
|
|
42078
|
+
"oneOf": [
|
|
42079
|
+
{ "type": "string" },
|
|
42080
|
+
{ "type": "number" },
|
|
42081
|
+
{ "type": "boolean" },
|
|
42082
|
+
{
|
|
42083
|
+
"type": "object",
|
|
42084
|
+
"patternProperties": {
|
|
42085
|
+
".*": {}
|
|
42086
|
+
}
|
|
42087
|
+
}
|
|
42088
|
+
]
|
|
42089
|
+
}
|
|
42090
|
+
}
|
|
41956
42091
|
},
|
|
41957
42092
|
"buyerCircumstances": {
|
|
41958
42093
|
"title": "Buyer circumstances",
|
|
@@ -42217,7 +42352,22 @@
|
|
|
42217
42352
|
}
|
|
42218
42353
|
},
|
|
42219
42354
|
"externalIds": {
|
|
42220
|
-
"type": "object"
|
|
42355
|
+
"type": "object",
|
|
42356
|
+
"patternProperties": {
|
|
42357
|
+
".*": {
|
|
42358
|
+
"oneOf": [
|
|
42359
|
+
{ "type": "string" },
|
|
42360
|
+
{ "type": "number" },
|
|
42361
|
+
{ "type": "boolean" },
|
|
42362
|
+
{
|
|
42363
|
+
"type": "object",
|
|
42364
|
+
"patternProperties": {
|
|
42365
|
+
".*": {}
|
|
42366
|
+
}
|
|
42367
|
+
}
|
|
42368
|
+
]
|
|
42369
|
+
}
|
|
42370
|
+
}
|
|
42221
42371
|
}
|
|
42222
42372
|
},
|
|
42223
42373
|
"required": ["subject", "status", "messages"],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
transactionId
|
|
2
|
-
externalIds
|
|
2
|
+
externalIds{*}
|
|
3
3
|
status
|
|
4
4
|
participants[
|
|
5
5
|
name
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
organisation
|
|
27
27
|
organisationReference
|
|
28
28
|
role
|
|
29
|
-
externalIds
|
|
29
|
+
externalIds{*}
|
|
30
30
|
participantStatus
|
|
31
31
|
verification
|
|
32
32
|
identity
|
|
@@ -2330,7 +2330,7 @@
|
|
|
2330
2330
|
sellerSignatures[
|
|
2331
2331
|
name
|
|
2332
2332
|
signedOn
|
|
2333
|
-
externalIds
|
|
2333
|
+
externalIds{*}
|
|
2334
2334
|
]
|
|
2335
2335
|
localSearches
|
|
2336
2336
|
localLandCharges[
|
|
@@ -3294,7 +3294,7 @@
|
|
|
3294
3294
|
fileName
|
|
3295
3295
|
mimeType
|
|
3296
3296
|
documentType
|
|
3297
|
-
externalIds
|
|
3297
|
+
externalIds{*}
|
|
3298
3298
|
isDeleted
|
|
3299
3299
|
summary
|
|
3300
3300
|
]
|
|
@@ -4043,7 +4043,7 @@
|
|
|
4043
4043
|
template
|
|
4044
4044
|
name
|
|
4045
4045
|
url
|
|
4046
|
-
externalIds
|
|
4046
|
+
externalIds{*}
|
|
4047
4047
|
requiredSignatories[
|
|
4048
4048
|
role
|
|
4049
4049
|
requiresAll
|
|
@@ -4052,13 +4052,13 @@
|
|
|
4052
4052
|
signatures[
|
|
4053
4053
|
name
|
|
4054
4054
|
signedOn
|
|
4055
|
-
externalIds
|
|
4055
|
+
externalIds{*}
|
|
4056
4056
|
]
|
|
4057
4057
|
]
|
|
4058
4058
|
chain
|
|
4059
4059
|
onwardPurchase[
|
|
4060
4060
|
transactionId
|
|
4061
|
-
externalIds
|
|
4061
|
+
externalIds{*}
|
|
4062
4062
|
address
|
|
4063
4063
|
buildingNumber
|
|
4064
4064
|
buildingName
|
|
@@ -4103,7 +4103,7 @@
|
|
|
4103
4103
|
inclusions[]
|
|
4104
4104
|
exclusions[]
|
|
4105
4105
|
conditions[]
|
|
4106
|
-
externalIds
|
|
4106
|
+
externalIds{*}
|
|
4107
4107
|
buyerCircumstances
|
|
4108
4108
|
intendedUse
|
|
4109
4109
|
firstTimeBuyer
|
|
@@ -4141,5 +4141,5 @@
|
|
|
4141
4141
|
originatorRole
|
|
4142
4142
|
destinationRole
|
|
4143
4143
|
messageText
|
|
4144
|
-
externalIds
|
|
4144
|
+
externalIds{*}
|
|
4145
4145
|
resolutionCondition
|
|
@@ -13,7 +13,28 @@
|
|
|
13
13
|
"type": "string"
|
|
14
14
|
},
|
|
15
15
|
"externalIds": {
|
|
16
|
-
"type": "object"
|
|
16
|
+
"type": "object",
|
|
17
|
+
"patternProperties": {
|
|
18
|
+
".*": {
|
|
19
|
+
"oneOf": [
|
|
20
|
+
{
|
|
21
|
+
"type": "string"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"type": "number"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"type": "boolean"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"type": "object",
|
|
31
|
+
"patternProperties": {
|
|
32
|
+
".*": {}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
17
38
|
},
|
|
18
39
|
"status": {
|
|
19
40
|
"type": "string",
|
|
@@ -181,7 +202,28 @@
|
|
|
181
202
|
]
|
|
182
203
|
},
|
|
183
204
|
"externalIds": {
|
|
184
|
-
"type": "object"
|
|
205
|
+
"type": "object",
|
|
206
|
+
"patternProperties": {
|
|
207
|
+
".*": {
|
|
208
|
+
"oneOf": [
|
|
209
|
+
{
|
|
210
|
+
"type": "string"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"type": "number"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"type": "boolean"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"type": "object",
|
|
220
|
+
"patternProperties": {
|
|
221
|
+
".*": {}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
]
|
|
225
|
+
}
|
|
226
|
+
}
|
|
185
227
|
},
|
|
186
228
|
"participantStatus": {
|
|
187
229
|
"type": "string",
|
|
@@ -22152,7 +22194,28 @@
|
|
|
22152
22194
|
"format": "date-time"
|
|
22153
22195
|
},
|
|
22154
22196
|
"externalIds": {
|
|
22155
|
-
"type": "object"
|
|
22197
|
+
"type": "object",
|
|
22198
|
+
"patternProperties": {
|
|
22199
|
+
".*": {
|
|
22200
|
+
"oneOf": [
|
|
22201
|
+
{
|
|
22202
|
+
"type": "string"
|
|
22203
|
+
},
|
|
22204
|
+
{
|
|
22205
|
+
"type": "number"
|
|
22206
|
+
},
|
|
22207
|
+
{
|
|
22208
|
+
"type": "boolean"
|
|
22209
|
+
},
|
|
22210
|
+
{
|
|
22211
|
+
"type": "object",
|
|
22212
|
+
"patternProperties": {
|
|
22213
|
+
".*": {}
|
|
22214
|
+
}
|
|
22215
|
+
}
|
|
22216
|
+
]
|
|
22217
|
+
}
|
|
22218
|
+
}
|
|
22156
22219
|
}
|
|
22157
22220
|
}
|
|
22158
22221
|
}
|
|
@@ -34297,7 +34360,28 @@
|
|
|
34297
34360
|
"minLength": 1
|
|
34298
34361
|
},
|
|
34299
34362
|
"externalIds": {
|
|
34300
|
-
"type": "object"
|
|
34363
|
+
"type": "object",
|
|
34364
|
+
"patternProperties": {
|
|
34365
|
+
".*": {
|
|
34366
|
+
"oneOf": [
|
|
34367
|
+
{
|
|
34368
|
+
"type": "string"
|
|
34369
|
+
},
|
|
34370
|
+
{
|
|
34371
|
+
"type": "number"
|
|
34372
|
+
},
|
|
34373
|
+
{
|
|
34374
|
+
"type": "boolean"
|
|
34375
|
+
},
|
|
34376
|
+
{
|
|
34377
|
+
"type": "object",
|
|
34378
|
+
"patternProperties": {
|
|
34379
|
+
".*": {}
|
|
34380
|
+
}
|
|
34381
|
+
}
|
|
34382
|
+
]
|
|
34383
|
+
}
|
|
34384
|
+
}
|
|
34301
34385
|
},
|
|
34302
34386
|
"isDeleted": {
|
|
34303
34387
|
"type": "boolean"
|
|
@@ -37079,7 +37163,28 @@
|
|
|
37079
37163
|
"format": "uri"
|
|
37080
37164
|
},
|
|
37081
37165
|
"externalIds": {
|
|
37082
|
-
"type": "object"
|
|
37166
|
+
"type": "object",
|
|
37167
|
+
"patternProperties": {
|
|
37168
|
+
".*": {
|
|
37169
|
+
"oneOf": [
|
|
37170
|
+
{
|
|
37171
|
+
"type": "string"
|
|
37172
|
+
},
|
|
37173
|
+
{
|
|
37174
|
+
"type": "number"
|
|
37175
|
+
},
|
|
37176
|
+
{
|
|
37177
|
+
"type": "boolean"
|
|
37178
|
+
},
|
|
37179
|
+
{
|
|
37180
|
+
"type": "object",
|
|
37181
|
+
"patternProperties": {
|
|
37182
|
+
".*": {}
|
|
37183
|
+
}
|
|
37184
|
+
}
|
|
37185
|
+
]
|
|
37186
|
+
}
|
|
37187
|
+
}
|
|
37083
37188
|
},
|
|
37084
37189
|
"requiredSignatories": {
|
|
37085
37190
|
"type": "array",
|
|
@@ -37135,7 +37240,28 @@
|
|
|
37135
37240
|
"format": "date-time"
|
|
37136
37241
|
},
|
|
37137
37242
|
"externalIds": {
|
|
37138
|
-
"type": "object"
|
|
37243
|
+
"type": "object",
|
|
37244
|
+
"patternProperties": {
|
|
37245
|
+
".*": {
|
|
37246
|
+
"oneOf": [
|
|
37247
|
+
{
|
|
37248
|
+
"type": "string"
|
|
37249
|
+
},
|
|
37250
|
+
{
|
|
37251
|
+
"type": "number"
|
|
37252
|
+
},
|
|
37253
|
+
{
|
|
37254
|
+
"type": "boolean"
|
|
37255
|
+
},
|
|
37256
|
+
{
|
|
37257
|
+
"type": "object",
|
|
37258
|
+
"patternProperties": {
|
|
37259
|
+
".*": {}
|
|
37260
|
+
}
|
|
37261
|
+
}
|
|
37262
|
+
]
|
|
37263
|
+
}
|
|
37264
|
+
}
|
|
37139
37265
|
}
|
|
37140
37266
|
},
|
|
37141
37267
|
"role": {
|
|
@@ -37181,7 +37307,28 @@
|
|
|
37181
37307
|
"type": "string"
|
|
37182
37308
|
},
|
|
37183
37309
|
"externalIds": {
|
|
37184
|
-
"type": "object"
|
|
37310
|
+
"type": "object",
|
|
37311
|
+
"patternProperties": {
|
|
37312
|
+
".*": {
|
|
37313
|
+
"oneOf": [
|
|
37314
|
+
{
|
|
37315
|
+
"type": "string"
|
|
37316
|
+
},
|
|
37317
|
+
{
|
|
37318
|
+
"type": "number"
|
|
37319
|
+
},
|
|
37320
|
+
{
|
|
37321
|
+
"type": "boolean"
|
|
37322
|
+
},
|
|
37323
|
+
{
|
|
37324
|
+
"type": "object",
|
|
37325
|
+
"patternProperties": {
|
|
37326
|
+
".*": {}
|
|
37327
|
+
}
|
|
37328
|
+
}
|
|
37329
|
+
]
|
|
37330
|
+
}
|
|
37331
|
+
}
|
|
37185
37332
|
},
|
|
37186
37333
|
"address": {
|
|
37187
37334
|
"title": "Address",
|
|
@@ -37263,7 +37410,28 @@
|
|
|
37263
37410
|
"type": "string"
|
|
37264
37411
|
},
|
|
37265
37412
|
"externalIds": {
|
|
37266
|
-
"type": "object"
|
|
37413
|
+
"type": "object",
|
|
37414
|
+
"patternProperties": {
|
|
37415
|
+
".*": {
|
|
37416
|
+
"oneOf": [
|
|
37417
|
+
{
|
|
37418
|
+
"type": "string"
|
|
37419
|
+
},
|
|
37420
|
+
{
|
|
37421
|
+
"type": "number"
|
|
37422
|
+
},
|
|
37423
|
+
{
|
|
37424
|
+
"type": "boolean"
|
|
37425
|
+
},
|
|
37426
|
+
{
|
|
37427
|
+
"type": "object",
|
|
37428
|
+
"patternProperties": {
|
|
37429
|
+
".*": {}
|
|
37430
|
+
}
|
|
37431
|
+
}
|
|
37432
|
+
]
|
|
37433
|
+
}
|
|
37434
|
+
}
|
|
37267
37435
|
},
|
|
37268
37436
|
"address": {
|
|
37269
37437
|
"title": "Address",
|
|
@@ -37498,7 +37666,28 @@
|
|
|
37498
37666
|
}
|
|
37499
37667
|
},
|
|
37500
37668
|
"externalIds": {
|
|
37501
|
-
"type": "object"
|
|
37669
|
+
"type": "object",
|
|
37670
|
+
"patternProperties": {
|
|
37671
|
+
".*": {
|
|
37672
|
+
"oneOf": [
|
|
37673
|
+
{
|
|
37674
|
+
"type": "string"
|
|
37675
|
+
},
|
|
37676
|
+
{
|
|
37677
|
+
"type": "number"
|
|
37678
|
+
},
|
|
37679
|
+
{
|
|
37680
|
+
"type": "boolean"
|
|
37681
|
+
},
|
|
37682
|
+
{
|
|
37683
|
+
"type": "object",
|
|
37684
|
+
"patternProperties": {
|
|
37685
|
+
".*": {}
|
|
37686
|
+
}
|
|
37687
|
+
}
|
|
37688
|
+
]
|
|
37689
|
+
}
|
|
37690
|
+
}
|
|
37502
37691
|
},
|
|
37503
37692
|
"buyerCircumstances": {
|
|
37504
37693
|
"title": "Buyer circumstances",
|
|
@@ -37776,7 +37965,28 @@
|
|
|
37776
37965
|
}
|
|
37777
37966
|
},
|
|
37778
37967
|
"externalIds": {
|
|
37779
|
-
"type": "object"
|
|
37968
|
+
"type": "object",
|
|
37969
|
+
"patternProperties": {
|
|
37970
|
+
".*": {
|
|
37971
|
+
"oneOf": [
|
|
37972
|
+
{
|
|
37973
|
+
"type": "string"
|
|
37974
|
+
},
|
|
37975
|
+
{
|
|
37976
|
+
"type": "number"
|
|
37977
|
+
},
|
|
37978
|
+
{
|
|
37979
|
+
"type": "boolean"
|
|
37980
|
+
},
|
|
37981
|
+
{
|
|
37982
|
+
"type": "object",
|
|
37983
|
+
"patternProperties": {
|
|
37984
|
+
".*": {}
|
|
37985
|
+
}
|
|
37986
|
+
}
|
|
37987
|
+
]
|
|
37988
|
+
}
|
|
37989
|
+
}
|
|
37780
37990
|
}
|
|
37781
37991
|
},
|
|
37782
37992
|
"required": [
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"transactionId": "string",
|
|
3
|
-
"externalIds": {
|
|
3
|
+
"externalIds": {
|
|
4
|
+
"*": {}
|
|
5
|
+
},
|
|
4
6
|
"status": "string",
|
|
5
7
|
"participants": [
|
|
6
8
|
{
|
|
@@ -30,7 +32,9 @@
|
|
|
30
32
|
"organisation": "string",
|
|
31
33
|
"organisationReference": "string",
|
|
32
34
|
"role": "variant",
|
|
33
|
-
"externalIds": {
|
|
35
|
+
"externalIds": {
|
|
36
|
+
"*": {}
|
|
37
|
+
},
|
|
34
38
|
"participantStatus": "string",
|
|
35
39
|
"verification": {
|
|
36
40
|
"identity": {
|
|
@@ -2972,7 +2976,9 @@
|
|
|
2972
2976
|
{
|
|
2973
2977
|
"name": "string",
|
|
2974
2978
|
"signedOn": "string",
|
|
2975
|
-
"externalIds": {
|
|
2979
|
+
"externalIds": {
|
|
2980
|
+
"*": {}
|
|
2981
|
+
}
|
|
2976
2982
|
}
|
|
2977
2983
|
]
|
|
2978
2984
|
},
|
|
@@ -4279,7 +4285,9 @@
|
|
|
4279
4285
|
"fileName": "string",
|
|
4280
4286
|
"mimeType": "string",
|
|
4281
4287
|
"documentType": "string",
|
|
4282
|
-
"externalIds": {
|
|
4288
|
+
"externalIds": {
|
|
4289
|
+
"*": {}
|
|
4290
|
+
},
|
|
4283
4291
|
"isDeleted": "boolean",
|
|
4284
4292
|
"summary": {}
|
|
4285
4293
|
}
|
|
@@ -5139,7 +5147,9 @@
|
|
|
5139
5147
|
"template": {
|
|
5140
5148
|
"name": "string",
|
|
5141
5149
|
"url": "string",
|
|
5142
|
-
"externalIds": {
|
|
5150
|
+
"externalIds": {
|
|
5151
|
+
"*": {}
|
|
5152
|
+
},
|
|
5143
5153
|
"requiredSignatories": [
|
|
5144
5154
|
{
|
|
5145
5155
|
"role": "string",
|
|
@@ -5153,7 +5163,9 @@
|
|
|
5153
5163
|
{
|
|
5154
5164
|
"name": "string",
|
|
5155
5165
|
"signedOn": "string",
|
|
5156
|
-
"externalIds": {
|
|
5166
|
+
"externalIds": {
|
|
5167
|
+
"*": {}
|
|
5168
|
+
}
|
|
5157
5169
|
}
|
|
5158
5170
|
]
|
|
5159
5171
|
}
|
|
@@ -5162,7 +5174,9 @@
|
|
|
5162
5174
|
"onwardPurchase": [
|
|
5163
5175
|
{
|
|
5164
5176
|
"transactionId": "string",
|
|
5165
|
-
"externalIds": {
|
|
5177
|
+
"externalIds": {
|
|
5178
|
+
"*": {}
|
|
5179
|
+
},
|
|
5166
5180
|
"address": {
|
|
5167
5181
|
"buildingNumber": "string",
|
|
5168
5182
|
"buildingName": "string",
|
|
@@ -5225,7 +5239,9 @@
|
|
|
5225
5239
|
"conditions": [
|
|
5226
5240
|
"string"
|
|
5227
5241
|
],
|
|
5228
|
-
"externalIds": {
|
|
5242
|
+
"externalIds": {
|
|
5243
|
+
"*": {}
|
|
5244
|
+
},
|
|
5229
5245
|
"buyerCircumstances": {
|
|
5230
5246
|
"intendedUse": "string",
|
|
5231
5247
|
"firstTimeBuyer": "boolean",
|
|
@@ -5270,7 +5286,9 @@
|
|
|
5270
5286
|
"messageText": "string"
|
|
5271
5287
|
}
|
|
5272
5288
|
},
|
|
5273
|
-
"externalIds": {
|
|
5289
|
+
"externalIds": {
|
|
5290
|
+
"*": {}
|
|
5291
|
+
},
|
|
5274
5292
|
"resolutionCondition": "string"
|
|
5275
5293
|
}
|
|
5276
5294
|
}
|
|
@@ -20,7 +20,7 @@ describe("Offers object validation", () => {
|
|
|
20
20
|
"550e8400-e29b-41d4-a716-446655440000": {
|
|
21
21
|
amount: 250000,
|
|
22
22
|
currency: "GBP",
|
|
23
|
-
status: "
|
|
23
|
+
status: "Pending",
|
|
24
24
|
},
|
|
25
25
|
},
|
|
26
26
|
};
|
|
@@ -44,7 +44,7 @@ describe("Offers object validation", () => {
|
|
|
44
44
|
"did:example:123456789abcdefghi": {
|
|
45
45
|
amount: 300000,
|
|
46
46
|
currency: "GBP",
|
|
47
|
-
status: "
|
|
47
|
+
status: "Accepted",
|
|
48
48
|
},
|
|
49
49
|
},
|
|
50
50
|
};
|
|
@@ -68,7 +68,7 @@ describe("Offers object validation", () => {
|
|
|
68
68
|
"did:web:example.com:users:alice": {
|
|
69
69
|
amount: 275000,
|
|
70
70
|
currency: "GBP",
|
|
71
|
-
status: "
|
|
71
|
+
status: "Pending",
|
|
72
72
|
},
|
|
73
73
|
},
|
|
74
74
|
};
|
|
@@ -92,17 +92,17 @@ describe("Offers object validation", () => {
|
|
|
92
92
|
"550e8400-e29b-41d4-a716-446655440000": {
|
|
93
93
|
amount: 250000,
|
|
94
94
|
currency: "GBP",
|
|
95
|
-
status: "
|
|
95
|
+
status: "Pending",
|
|
96
96
|
},
|
|
97
97
|
"did:example:buyer123": {
|
|
98
98
|
amount: 260000,
|
|
99
99
|
currency: "GBP",
|
|
100
|
-
status: "
|
|
100
|
+
status: "Accepted",
|
|
101
101
|
},
|
|
102
102
|
"offer-abc123": {
|
|
103
103
|
amount: 240000,
|
|
104
104
|
currency: "GBP",
|
|
105
|
-
status: "
|
|
105
|
+
status: "Rejected",
|
|
106
106
|
},
|
|
107
107
|
},
|
|
108
108
|
};
|
|
@@ -128,7 +128,7 @@ describe("Offers object validation", () => {
|
|
|
128
128
|
"-invalid-key": {
|
|
129
129
|
amount: 250000,
|
|
130
130
|
currency: "GBP",
|
|
131
|
-
status: "
|
|
131
|
+
status: "Pending",
|
|
132
132
|
},
|
|
133
133
|
},
|
|
134
134
|
};
|
|
@@ -153,7 +153,7 @@ describe("Offers object validation", () => {
|
|
|
153
153
|
"invalid key with spaces": {
|
|
154
154
|
amount: 250000,
|
|
155
155
|
currency: "GBP",
|
|
156
|
-
status: "
|
|
156
|
+
status: "Pending",
|
|
157
157
|
},
|
|
158
158
|
},
|
|
159
159
|
};
|
|
@@ -177,7 +177,7 @@ describe("Offers object validation", () => {
|
|
|
177
177
|
"invalid@key#here": {
|
|
178
178
|
amount: 250000,
|
|
179
179
|
currency: "GBP",
|
|
180
|
-
status: "
|
|
180
|
+
status: "Pending",
|
|
181
181
|
},
|
|
182
182
|
},
|
|
183
183
|
};
|
|
@@ -203,7 +203,7 @@ describe("Offers object validation", () => {
|
|
|
203
203
|
"offer-1": {
|
|
204
204
|
amount: 250000,
|
|
205
205
|
currency: "GBP",
|
|
206
|
-
status: "
|
|
206
|
+
status: "Pending",
|
|
207
207
|
},
|
|
208
208
|
},
|
|
209
209
|
};
|
|
@@ -227,7 +227,7 @@ describe("Offers object validation", () => {
|
|
|
227
227
|
"offer-1": {
|
|
228
228
|
amount: 250000,
|
|
229
229
|
currency: "GBP",
|
|
230
|
-
status: "
|
|
230
|
+
status: "Accepted",
|
|
231
231
|
inclusions: ["curtains", "carpets", "light fixtures"],
|
|
232
232
|
exclusions: ["garden furniture", "shed"],
|
|
233
233
|
conditions: [
|
|
@@ -245,11 +245,11 @@ describe("Offers object validation", () => {
|
|
|
245
245
|
test("accepts all valid status values", () => {
|
|
246
246
|
const validator = getValidator(schemaId);
|
|
247
247
|
const validStatuses = [
|
|
248
|
-
"
|
|
249
|
-
"
|
|
250
|
-
"
|
|
251
|
-
"
|
|
252
|
-
"
|
|
248
|
+
"Pending",
|
|
249
|
+
"Withdrawn",
|
|
250
|
+
"Rejected",
|
|
251
|
+
"Accepted",
|
|
252
|
+
"Note of Interest",
|
|
253
253
|
];
|
|
254
254
|
|
|
255
255
|
validStatuses.forEach((status) => {
|
|
@@ -294,7 +294,7 @@ describe("Offers object validation", () => {
|
|
|
294
294
|
"offer-1": {
|
|
295
295
|
amount: 250000,
|
|
296
296
|
currency: currency,
|
|
297
|
-
status: "
|
|
297
|
+
status: "Pending",
|
|
298
298
|
},
|
|
299
299
|
},
|
|
300
300
|
};
|
|
@@ -319,7 +319,7 @@ describe("Offers object validation", () => {
|
|
|
319
319
|
"offer-1": {
|
|
320
320
|
amount: 0,
|
|
321
321
|
currency: "GBP",
|
|
322
|
-
status: "
|
|
322
|
+
status: "Note of Interest",
|
|
323
323
|
},
|
|
324
324
|
},
|
|
325
325
|
};
|
|
@@ -330,7 +330,7 @@ describe("Offers object validation", () => {
|
|
|
330
330
|
});
|
|
331
331
|
|
|
332
332
|
describe("Invalid offer contents", () => {
|
|
333
|
-
test("
|
|
333
|
+
test("accepts offer without amount field (no required fields in schema)", () => {
|
|
334
334
|
const validator = getValidator(schemaId);
|
|
335
335
|
const transaction = {
|
|
336
336
|
transactionId: "123e4567-e89b-12d3-a456-426614174000",
|
|
@@ -344,19 +344,16 @@ describe("Offers object validation", () => {
|
|
|
344
344
|
offers: {
|
|
345
345
|
"offer-1": {
|
|
346
346
|
currency: "GBP",
|
|
347
|
-
status: "
|
|
347
|
+
status: "Pending",
|
|
348
348
|
},
|
|
349
349
|
},
|
|
350
350
|
};
|
|
351
351
|
|
|
352
352
|
const isValid = validator(transaction);
|
|
353
|
-
expect(isValid).toBe(
|
|
354
|
-
expect(
|
|
355
|
-
validator.errors.some((e) => e.message.includes("required property"))
|
|
356
|
-
).toBe(true);
|
|
353
|
+
expect(isValid).toBe(true);
|
|
357
354
|
});
|
|
358
355
|
|
|
359
|
-
test("
|
|
356
|
+
test("accepts offer without currency field (no required fields in schema)", () => {
|
|
360
357
|
const validator = getValidator(schemaId);
|
|
361
358
|
const transaction = {
|
|
362
359
|
transactionId: "123e4567-e89b-12d3-a456-426614174000",
|
|
@@ -370,16 +367,16 @@ describe("Offers object validation", () => {
|
|
|
370
367
|
offers: {
|
|
371
368
|
"offer-1": {
|
|
372
369
|
amount: 250000,
|
|
373
|
-
status: "
|
|
370
|
+
status: "Pending",
|
|
374
371
|
},
|
|
375
372
|
},
|
|
376
373
|
};
|
|
377
374
|
|
|
378
375
|
const isValid = validator(transaction);
|
|
379
|
-
expect(isValid).toBe(
|
|
376
|
+
expect(isValid).toBe(true);
|
|
380
377
|
});
|
|
381
378
|
|
|
382
|
-
test("
|
|
379
|
+
test("accepts offer without status field (no required fields in schema)", () => {
|
|
383
380
|
const validator = getValidator(schemaId);
|
|
384
381
|
const transaction = {
|
|
385
382
|
transactionId: "123e4567-e89b-12d3-a456-426614174000",
|
|
@@ -399,7 +396,7 @@ describe("Offers object validation", () => {
|
|
|
399
396
|
};
|
|
400
397
|
|
|
401
398
|
const isValid = validator(transaction);
|
|
402
|
-
expect(isValid).toBe(
|
|
399
|
+
expect(isValid).toBe(true);
|
|
403
400
|
});
|
|
404
401
|
|
|
405
402
|
test("rejects offer with invalid status value", () => {
|
|
@@ -441,7 +438,7 @@ describe("Offers object validation", () => {
|
|
|
441
438
|
"offer-1": {
|
|
442
439
|
amount: -100000,
|
|
443
440
|
currency: "GBP",
|
|
444
|
-
status: "
|
|
441
|
+
status: "Pending",
|
|
445
442
|
},
|
|
446
443
|
},
|
|
447
444
|
};
|
|
@@ -465,7 +462,7 @@ describe("Offers object validation", () => {
|
|
|
465
462
|
"offer-1": {
|
|
466
463
|
amount: 250000,
|
|
467
464
|
currency: "gb",
|
|
468
|
-
status: "
|
|
465
|
+
status: "Pending",
|
|
469
466
|
},
|
|
470
467
|
},
|
|
471
468
|
};
|
|
@@ -489,7 +486,7 @@ describe("Offers object validation", () => {
|
|
|
489
486
|
"offer-1": {
|
|
490
487
|
amount: 250000,
|
|
491
488
|
currency: "gbp",
|
|
492
|
-
status: "
|
|
489
|
+
status: "Pending",
|
|
493
490
|
},
|
|
494
491
|
},
|
|
495
492
|
};
|
|
@@ -513,7 +510,7 @@ describe("Offers object validation", () => {
|
|
|
513
510
|
"offer-1": {
|
|
514
511
|
amount: 250000,
|
|
515
512
|
currency: "GBP",
|
|
516
|
-
status: "
|
|
513
|
+
status: "Pending",
|
|
517
514
|
inclusions: "curtains",
|
|
518
515
|
},
|
|
519
516
|
},
|
|
@@ -538,7 +535,7 @@ describe("Offers object validation", () => {
|
|
|
538
535
|
"offer-1": {
|
|
539
536
|
amount: 250000,
|
|
540
537
|
currency: "GBP",
|
|
541
|
-
status: "
|
|
538
|
+
status: "Pending",
|
|
542
539
|
inclusions: ["curtains", 123, "carpets"],
|
|
543
540
|
},
|
|
544
541
|
},
|
|
@@ -563,7 +560,7 @@ describe("Offers object validation", () => {
|
|
|
563
560
|
"offer-1": {
|
|
564
561
|
amount: 250000,
|
|
565
562
|
currency: "GBP",
|
|
566
|
-
status: "
|
|
563
|
+
status: "Pending",
|
|
567
564
|
exclusions: { item: "garden furniture" },
|
|
568
565
|
},
|
|
569
566
|
},
|
|
@@ -588,7 +585,7 @@ describe("Offers object validation", () => {
|
|
|
588
585
|
"offer-1": {
|
|
589
586
|
amount: 250000,
|
|
590
587
|
currency: "GBP",
|
|
591
|
-
status: "
|
|
588
|
+
status: "Pending",
|
|
592
589
|
conditions: "Subject to survey",
|
|
593
590
|
},
|
|
594
591
|
},
|
|
@@ -653,7 +650,7 @@ describe("Offers object validation", () => {
|
|
|
653
650
|
"550e8400-e29b-41d4-a716-446655440000": {
|
|
654
651
|
amount: 250000,
|
|
655
652
|
currency: "GBP",
|
|
656
|
-
status: "
|
|
653
|
+
status: "Accepted",
|
|
657
654
|
},
|
|
658
655
|
},
|
|
659
656
|
};
|
|
@@ -678,7 +675,7 @@ describe("Offers object validation", () => {
|
|
|
678
675
|
"did:example:buyer123": {
|
|
679
676
|
amount: 260000,
|
|
680
677
|
currency: "GBP",
|
|
681
|
-
status: "
|
|
678
|
+
status: "Accepted",
|
|
682
679
|
},
|
|
683
680
|
},
|
|
684
681
|
};
|
|
@@ -766,12 +763,12 @@ describe("Offers object validation", () => {
|
|
|
766
763
|
"offer-1": {
|
|
767
764
|
amount: 250000,
|
|
768
765
|
currency: "GBP",
|
|
769
|
-
status: "
|
|
766
|
+
status: "Pending",
|
|
770
767
|
},
|
|
771
768
|
"offer-2": {
|
|
772
769
|
amount: 260000,
|
|
773
770
|
currency: "GBP",
|
|
774
|
-
status: "
|
|
771
|
+
status: "Accepted",
|
|
775
772
|
},
|
|
776
773
|
},
|
|
777
774
|
};
|
|
@@ -87,11 +87,11 @@ describe("patternProperties support in path validation", () => {
|
|
|
87
87
|
|
|
88
88
|
expect(subschema).toBeDefined();
|
|
89
89
|
expect(subschema.type).toBe("string");
|
|
90
|
-
expect(subschema.enum).toContain("
|
|
91
|
-
expect(subschema.enum).toContain("
|
|
92
|
-
expect(subschema.enum).toContain("
|
|
93
|
-
expect(subschema.enum).toContain("
|
|
94
|
-
expect(subschema.enum).toContain("
|
|
90
|
+
expect(subschema.enum).toContain("Pending");
|
|
91
|
+
expect(subschema.enum).toContain("Accepted");
|
|
92
|
+
expect(subschema.enum).toContain("Rejected");
|
|
93
|
+
expect(subschema.enum).toContain("Withdrawn");
|
|
94
|
+
expect(subschema.enum).toContain("Note of Interest");
|
|
95
95
|
});
|
|
96
96
|
|
|
97
97
|
test("returns correct subschema for currency pattern", () => {
|
|
@@ -132,7 +132,7 @@ describe("patternProperties support in path validation", () => {
|
|
|
132
132
|
const validOffer = {
|
|
133
133
|
amount: 500000,
|
|
134
134
|
currency: "GBP",
|
|
135
|
-
status: "
|
|
135
|
+
status: "Pending",
|
|
136
136
|
};
|
|
137
137
|
|
|
138
138
|
const isValid = validator(validOffer);
|
|
@@ -146,7 +146,7 @@ describe("patternProperties support in path validation", () => {
|
|
|
146
146
|
const validOffer = {
|
|
147
147
|
amount: 300000,
|
|
148
148
|
currency: "EUR",
|
|
149
|
-
status: "
|
|
149
|
+
status: "Accepted",
|
|
150
150
|
inclusions: ["carpets", "curtains"],
|
|
151
151
|
exclusions: ["garden furniture"],
|
|
152
152
|
conditions: ["Subject to survey"],
|
|
@@ -156,20 +156,17 @@ describe("patternProperties support in path validation", () => {
|
|
|
156
156
|
expect(isValid).toBe(true);
|
|
157
157
|
});
|
|
158
158
|
|
|
159
|
-
test("validator
|
|
159
|
+
test("validator accepts offer data without status (no required fields in schema)", () => {
|
|
160
160
|
const path = "/offers/offer-789";
|
|
161
161
|
const validator = getSubschemaValidator(path, schemaId);
|
|
162
162
|
|
|
163
|
-
const
|
|
163
|
+
const offer = {
|
|
164
164
|
amount: 400000,
|
|
165
165
|
currency: "GBP",
|
|
166
|
-
// missing required status field
|
|
167
166
|
};
|
|
168
167
|
|
|
169
|
-
const isValid = validator(
|
|
170
|
-
expect(isValid).toBe(
|
|
171
|
-
expect(validator.errors).toBeDefined();
|
|
172
|
-
expect(validator.errors.length).toBeGreaterThan(0);
|
|
168
|
+
const isValid = validator(offer);
|
|
169
|
+
expect(isValid).toBe(true);
|
|
173
170
|
});
|
|
174
171
|
|
|
175
172
|
test("validator correctly rejects invalid offer data - negative amount", () => {
|
|
@@ -179,7 +176,7 @@ describe("patternProperties support in path validation", () => {
|
|
|
179
176
|
const invalidOffer = {
|
|
180
177
|
amount: -100000,
|
|
181
178
|
currency: "GBP",
|
|
182
|
-
status: "
|
|
179
|
+
status: "Pending",
|
|
183
180
|
};
|
|
184
181
|
|
|
185
182
|
const isValid = validator(invalidOffer);
|
|
@@ -225,7 +222,7 @@ describe("patternProperties support in path validation", () => {
|
|
|
225
222
|
"/offers/offer-001": {
|
|
226
223
|
amount: 500000,
|
|
227
224
|
currency: "GBP",
|
|
228
|
-
status: "
|
|
225
|
+
status: "Pending",
|
|
229
226
|
},
|
|
230
227
|
},
|
|
231
228
|
};
|
|
@@ -245,7 +242,7 @@ describe("patternProperties support in path validation", () => {
|
|
|
245
242
|
"/offers/1sorzJCFHbWVlHA2tYXA": {
|
|
246
243
|
amount: 750000,
|
|
247
244
|
currency: "GBP",
|
|
248
|
-
status: "
|
|
245
|
+
status: "Accepted",
|
|
249
246
|
},
|
|
250
247
|
},
|
|
251
248
|
};
|
|
@@ -265,7 +262,7 @@ describe("patternProperties support in path validation", () => {
|
|
|
265
262
|
"/offers/did:example:buyer123": {
|
|
266
263
|
amount: 600000,
|
|
267
264
|
currency: "EUR",
|
|
268
|
-
status: "
|
|
265
|
+
status: "Note of Interest",
|
|
269
266
|
},
|
|
270
267
|
},
|
|
271
268
|
};
|
|
@@ -301,7 +298,7 @@ describe("patternProperties support in path validation", () => {
|
|
|
301
298
|
"/offers/offer-complete": {
|
|
302
299
|
amount: 550000,
|
|
303
300
|
currency: "GBP",
|
|
304
|
-
status: "
|
|
301
|
+
status: "Accepted",
|
|
305
302
|
inclusions: ["carpets", "curtains", "light fixtures"],
|
|
306
303
|
exclusions: ["garden shed"],
|
|
307
304
|
conditions: ["Subject to survey", "Subject to mortgage approval"],
|
|
@@ -313,7 +310,7 @@ describe("patternProperties support in path validation", () => {
|
|
|
313
310
|
expect(errors).toHaveLength(0);
|
|
314
311
|
});
|
|
315
312
|
|
|
316
|
-
test("
|
|
313
|
+
test("accepts claim with offer data without status (no required fields in schema)", () => {
|
|
317
314
|
const claim = {
|
|
318
315
|
timestamp: 1643115903108,
|
|
319
316
|
verification: {
|
|
@@ -321,16 +318,15 @@ describe("patternProperties support in path validation", () => {
|
|
|
321
318
|
time: "2025-01-15T12:00:00Z",
|
|
322
319
|
},
|
|
323
320
|
claims: {
|
|
324
|
-
"/offers/offer-
|
|
321
|
+
"/offers/offer-no-status": {
|
|
325
322
|
amount: 500000,
|
|
326
323
|
currency: "GBP",
|
|
327
|
-
// missing required status field
|
|
328
324
|
},
|
|
329
325
|
},
|
|
330
326
|
};
|
|
331
327
|
|
|
332
328
|
const errors = validateVerifiedClaims([claim], schemaId);
|
|
333
|
-
expect(errors
|
|
329
|
+
expect(errors).toHaveLength(0);
|
|
334
330
|
});
|
|
335
331
|
|
|
336
332
|
test("rejects claim with invalid offer data - negative amount", () => {
|
|
@@ -344,7 +340,7 @@ describe("patternProperties support in path validation", () => {
|
|
|
344
340
|
"/offers/offer-negative": {
|
|
345
341
|
amount: -100000,
|
|
346
342
|
currency: "GBP",
|
|
347
|
-
status: "
|
|
343
|
+
status: "Pending",
|
|
348
344
|
},
|
|
349
345
|
},
|
|
350
346
|
};
|
|
@@ -384,7 +380,7 @@ describe("patternProperties support in path validation", () => {
|
|
|
384
380
|
"/offers/offer-bad-currency": {
|
|
385
381
|
amount: 500000,
|
|
386
382
|
currency: "gbp", // should be uppercase
|
|
387
|
-
status: "
|
|
383
|
+
status: "Pending",
|
|
388
384
|
},
|
|
389
385
|
},
|
|
390
386
|
};
|
|
@@ -405,7 +401,7 @@ describe("patternProperties support in path validation", () => {
|
|
|
405
401
|
"/offers/offer-1": {
|
|
406
402
|
amount: 500000,
|
|
407
403
|
currency: "GBP",
|
|
408
|
-
status: "
|
|
404
|
+
status: "Pending",
|
|
409
405
|
},
|
|
410
406
|
},
|
|
411
407
|
},
|
|
@@ -419,7 +415,7 @@ describe("patternProperties support in path validation", () => {
|
|
|
419
415
|
"/offers/offer-2": {
|
|
420
416
|
amount: 520000,
|
|
421
417
|
currency: "GBP",
|
|
422
|
-
status: "
|
|
418
|
+
status: "Accepted",
|
|
423
419
|
},
|
|
424
420
|
},
|
|
425
421
|
},
|
|
@@ -440,14 +436,14 @@ describe("patternProperties support in path validation", () => {
|
|
|
440
436
|
"/offers/offer-1": {
|
|
441
437
|
amount: 500000,
|
|
442
438
|
currency: "GBP",
|
|
443
|
-
status: "
|
|
439
|
+
status: "Pending",
|
|
444
440
|
},
|
|
445
441
|
"/offers/offer-2": {
|
|
446
442
|
amount: 510000,
|
|
447
443
|
currency: "GBP",
|
|
448
|
-
status: "
|
|
444
|
+
status: "Withdrawn",
|
|
449
445
|
},
|
|
450
|
-
"/offers/offer-3/status": "
|
|
446
|
+
"/offers/offer-3/status": "Rejected",
|
|
451
447
|
},
|
|
452
448
|
};
|
|
453
449
|
|
|
@@ -534,6 +530,129 @@ describe("patternProperties support in path validation", () => {
|
|
|
534
530
|
});
|
|
535
531
|
});
|
|
536
532
|
|
|
533
|
+
describe("externalIds patternProperties paths", () => {
|
|
534
|
+
test("accepts claim for /externalIds with a nested key path", () => {
|
|
535
|
+
const claim = {
|
|
536
|
+
timestamp: 1643115903108,
|
|
537
|
+
verification: {
|
|
538
|
+
trust_framework: "uk_pdtf",
|
|
539
|
+
time: "2025-01-15T12:00:00Z",
|
|
540
|
+
},
|
|
541
|
+
claims: {
|
|
542
|
+
"/externalIds/nptn/selectedQuoteId": "12345577",
|
|
543
|
+
},
|
|
544
|
+
};
|
|
545
|
+
|
|
546
|
+
const errors = validateVerifiedClaims([claim], schemaId);
|
|
547
|
+
expect(errors).toHaveLength(0);
|
|
548
|
+
});
|
|
549
|
+
|
|
550
|
+
test("accepts claim for /externalIds with a simple string value", () => {
|
|
551
|
+
const claim = {
|
|
552
|
+
timestamp: 1643115903108,
|
|
553
|
+
verification: {
|
|
554
|
+
trust_framework: "uk_pdtf",
|
|
555
|
+
time: "2025-01-15T12:00:00Z",
|
|
556
|
+
},
|
|
557
|
+
claims: {
|
|
558
|
+
"/externalIds/lms": "abc-123",
|
|
559
|
+
},
|
|
560
|
+
};
|
|
561
|
+
|
|
562
|
+
const errors = validateVerifiedClaims([claim], schemaId);
|
|
563
|
+
expect(errors).toHaveLength(0);
|
|
564
|
+
});
|
|
565
|
+
|
|
566
|
+
test("accepts claim for /externalIds with a numeric value", () => {
|
|
567
|
+
const claim = {
|
|
568
|
+
timestamp: 1643115903108,
|
|
569
|
+
verification: {
|
|
570
|
+
trust_framework: "uk_pdtf",
|
|
571
|
+
time: "2025-01-15T12:00:00Z",
|
|
572
|
+
},
|
|
573
|
+
claims: {
|
|
574
|
+
"/externalIds/systemRef": 98765,
|
|
575
|
+
},
|
|
576
|
+
};
|
|
577
|
+
|
|
578
|
+
const errors = validateVerifiedClaims([claim], schemaId);
|
|
579
|
+
expect(errors).toHaveLength(0);
|
|
580
|
+
});
|
|
581
|
+
|
|
582
|
+
test("accepts claim for /externalIds with a boolean value", () => {
|
|
583
|
+
const claim = {
|
|
584
|
+
timestamp: 1643115903108,
|
|
585
|
+
verification: {
|
|
586
|
+
trust_framework: "uk_pdtf",
|
|
587
|
+
time: "2025-01-15T12:00:00Z",
|
|
588
|
+
},
|
|
589
|
+
claims: {
|
|
590
|
+
"/externalIds/isActive": true,
|
|
591
|
+
},
|
|
592
|
+
};
|
|
593
|
+
|
|
594
|
+
const errors = validateVerifiedClaims([claim], schemaId);
|
|
595
|
+
expect(errors).toHaveLength(0);
|
|
596
|
+
});
|
|
597
|
+
|
|
598
|
+
test("accepts claim for /externalIds with an object value", () => {
|
|
599
|
+
const claim = {
|
|
600
|
+
timestamp: 1643115903108,
|
|
601
|
+
verification: {
|
|
602
|
+
trust_framework: "uk_pdtf",
|
|
603
|
+
time: "2025-01-15T12:00:00Z",
|
|
604
|
+
},
|
|
605
|
+
claims: {
|
|
606
|
+
"/externalIds/nptn": {
|
|
607
|
+
selectedQuoteId: "12345577",
|
|
608
|
+
caseRef: "CASE-001",
|
|
609
|
+
},
|
|
610
|
+
},
|
|
611
|
+
};
|
|
612
|
+
|
|
613
|
+
const errors = validateVerifiedClaims([claim], schemaId);
|
|
614
|
+
expect(errors).toHaveLength(0);
|
|
615
|
+
});
|
|
616
|
+
|
|
617
|
+
test("accepts claim with multiple externalIds paths in same claim", () => {
|
|
618
|
+
const claim = {
|
|
619
|
+
timestamp: 1643115903108,
|
|
620
|
+
verification: {
|
|
621
|
+
trust_framework: "uk_pdtf",
|
|
622
|
+
time: "2025-01-15T12:00:00Z",
|
|
623
|
+
},
|
|
624
|
+
claims: {
|
|
625
|
+
"/externalIds/nptn/selectedQuoteId": "12345577",
|
|
626
|
+
"/externalIds/lms": "LMS-REF-001",
|
|
627
|
+
},
|
|
628
|
+
};
|
|
629
|
+
|
|
630
|
+
const errors = validateVerifiedClaims([claim], schemaId);
|
|
631
|
+
expect(errors).toHaveLength(0);
|
|
632
|
+
});
|
|
633
|
+
|
|
634
|
+
test("accepts claim for /externalIds root object", () => {
|
|
635
|
+
const claim = {
|
|
636
|
+
timestamp: 1643115903108,
|
|
637
|
+
verification: {
|
|
638
|
+
trust_framework: "uk_pdtf",
|
|
639
|
+
time: "2025-01-15T12:00:00Z",
|
|
640
|
+
},
|
|
641
|
+
claims: {
|
|
642
|
+
"/externalIds": {
|
|
643
|
+
nptn: {
|
|
644
|
+
selectedQuoteId: "12345577",
|
|
645
|
+
},
|
|
646
|
+
lms: "LMS-REF-001",
|
|
647
|
+
},
|
|
648
|
+
},
|
|
649
|
+
};
|
|
650
|
+
|
|
651
|
+
const errors = validateVerifiedClaims([claim], schemaId);
|
|
652
|
+
expect(errors).toHaveLength(0);
|
|
653
|
+
});
|
|
654
|
+
});
|
|
655
|
+
|
|
537
656
|
describe("edge cases", () => {
|
|
538
657
|
test("handles offer ID with dots", () => {
|
|
539
658
|
const path = "/offers/offer.123.abc";
|