@pdtf/schemas 3.2.1-11 → 3.2.1-13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdtf/schemas",
3
- "version": "3.2.1-11",
3
+ "version": "3.2.1-13",
4
4
  "description": "Property Data Trust Framework Schemas and Utilities",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -976,5 +976,53 @@
976
976
  "contentTypes": ["Environmental Risks"]
977
977
  }
978
978
  ]
979
- }
979
+ },
980
+ "contracts": [
981
+ {
982
+ "contract": {
983
+ "template": {
984
+ "name": "Example Agency Agreement",
985
+ "url": "https://example.com/example-agency-agreement",
986
+ "externalIds": {
987
+ "Moverly": "file123"
988
+ }
989
+ },
990
+ "terms": {
991
+ "propertyAddress": "123 Maple Street, London, SW1A 1AA",
992
+ "sellersNames": "Peter and Clarissa Hetherington-Smythe",
993
+ "sellersContactAddress": "47 Park Road, Harpenden, AL3 5AF",
994
+ "sellersTelephoneNumber": "07700 900123",
995
+ "sellersEmail": "peter.hetherington-smyth@email.com",
996
+ "typeOfAgency": "Sole Agency",
997
+ "feeAsPercent": "1.5%",
998
+ "fixedFeeExVat": "£2,500",
999
+ "estimatedFeeIncludingVat": "£3,000",
1000
+ "includeAdditionalChargeEpc": true,
1001
+ "additionalChargeForEpcExVat": "75",
1002
+ "includeAdditionalChargeForEpcAndFloorplan": true,
1003
+ "additionalChargeForEpcAndFloorplanExVat": "150",
1004
+ "includeAdditionalChargeForEpcFloorplanAndPhotos": true,
1005
+ "additionalChargeForEpcFloorplanAndPhotosExVat": "150",
1006
+ "includeAdditionalChargeForPremiumPhotos ": true,
1007
+ "additionalChargeForPremiumPhotosExVat": "150",
1008
+ "includeAdditionalChargeForBrochure": true,
1009
+ "additionalChargeForBrochureExVat": "150",
1010
+ "includeAdditionalChargeForBespokeAdvertising": true,
1011
+ "additionalChargeForBespokeAdvertisingExVat": "150",
1012
+ "initialMarketingPrice": "£450,000"
1013
+ }
1014
+ },
1015
+ "signatures": [
1016
+ {
1017
+ "name": "Peter Ronald Hetherington-Smythe",
1018
+ "signedOn": "2024-11-29T16:15:02.735Z",
1019
+ "externalIds": {
1020
+ "Moverly": "123434"
1021
+ },
1022
+ "role": "Seller",
1023
+ "contractHash": "IYnBjUI8TauXFop6WCvnPA=="
1024
+ }
1025
+ ]
1026
+ }
1027
+ ]
980
1028
  }
@@ -185,6 +185,9 @@
185
185
  },
186
186
  "externalIds": {
187
187
  "type": "object"
188
+ },
189
+ "isRemoved": {
190
+ "type": "boolean"
188
191
  }
189
192
  },
190
193
  "discriminator": {
@@ -235,6 +238,7 @@
235
238
  "Personal Representative for a Deceased Owner",
236
239
  "Under Power of Attorney",
237
240
  "Mortgagee in Possession",
241
+ "Assistant",
238
242
  "Other"
239
243
  ]
240
244
  }
@@ -271,6 +275,7 @@
271
275
  "enum": [
272
276
  "Personal Representative for a Deceased Owner",
273
277
  "Under Power of Attorney",
278
+ "Assistant",
274
279
  "Other"
275
280
  ]
276
281
  },
@@ -39311,6 +39316,69 @@
39311
39316
  }
39312
39317
  }
39313
39318
  }
39319
+ },
39320
+ "contracts": {
39321
+ "type": "array",
39322
+ "items": {
39323
+ "type": "object",
39324
+ "properties": {
39325
+ "contract": {
39326
+ "type": "object",
39327
+ "required": ["template", "terms"],
39328
+ "properties": {
39329
+ "template": {
39330
+ "type": "object",
39331
+ "required": ["name", "url"],
39332
+ "properties": {
39333
+ "name": { "type": "string" },
39334
+ "url": { "type": "string", "format": "uri" },
39335
+ "externalIds": {
39336
+ "type": "object"
39337
+ }
39338
+ }
39339
+ },
39340
+ "terms": {
39341
+ "type": "object"
39342
+ }
39343
+ }
39344
+ },
39345
+ "signatures": {
39346
+ "type": "array",
39347
+ "items": {
39348
+ "type": "object",
39349
+ "required": ["name", "signedOn", "role", "contractHash"],
39350
+ "properties": {
39351
+ "name": { "type": "string" },
39352
+ "signedOn": { "type": "string", "format": "date-time" },
39353
+ "externalIds": {
39354
+ "type": "object"
39355
+ }
39356
+ },
39357
+ "role": {
39358
+ "type": "string",
39359
+ "enum": [
39360
+ "Seller",
39361
+ "Seller's Conveyancer",
39362
+ "Prospective Buyer",
39363
+ "Buyer",
39364
+ "Buyer's Conveyancer",
39365
+ "Estate Agent",
39366
+ "Buyer's Agent",
39367
+ "Surveyor",
39368
+ "Mortgage Broker",
39369
+ "Lender",
39370
+ "Landlord",
39371
+ "Tenant"
39372
+ ]
39373
+ },
39374
+ "contractHash": {
39375
+ "title": "An MD5 hash of the stable-stringified contract object being signed",
39376
+ "type": "string"
39377
+ }
39378
+ }
39379
+ }
39380
+ }
39381
+ }
39314
39382
  }
39315
39383
  }
39316
39384
  }
@@ -67,6 +67,7 @@
67
67
  "enum": [
68
68
  "Personal Representative for a Deceased Owner",
69
69
  "Under Power of Attorney",
70
+ "Assistant",
70
71
  "Other"
71
72
  ]
72
73
  },
@@ -67,6 +67,7 @@
67
67
  "enum": [
68
68
  "Personal Representative for a Deceased Owner",
69
69
  "Under Power of Attorney",
70
+ "Assistant",
70
71
  "Other"
71
72
  ]
72
73
  },
@@ -57,6 +57,7 @@
57
57
  "enum": [
58
58
  "Personal Representative for a Deceased Owner",
59
59
  "Under Power of Attorney",
60
+ "Assistant",
60
61
  "Other"
61
62
  ]
62
63
  }
@@ -33,6 +33,7 @@
33
33
  "enum": [
34
34
  "Personal Representative for a Deceased Owner",
35
35
  "Under Power of Attorney",
36
+ "Assistant",
36
37
  "Other"
37
38
  ]
38
39
  },
@@ -182,6 +182,9 @@
182
182
  },
183
183
  "externalIds": {
184
184
  "type": "object"
185
+ },
186
+ "isRemoved": {
187
+ "type": "boolean"
185
188
  }
186
189
  },
187
190
  "oneOf": [
@@ -223,6 +226,7 @@
223
226
  "Personal Representative for a Deceased Owner",
224
227
  "Under Power of Attorney",
225
228
  "Mortgagee in Possession",
229
+ "Assistant",
226
230
  "Other"
227
231
  ]
228
232
  }
@@ -257,6 +261,7 @@
257
261
  "enum": [
258
262
  "Personal Representative for a Deceased Owner",
259
263
  "Under Power of Attorney",
264
+ "Assistant",
260
265
  "Other"
261
266
  ]
262
267
  },
@@ -34115,6 +34120,90 @@
34115
34120
  }
34116
34121
  }
34117
34122
  }
34123
+ },
34124
+ "contracts": {
34125
+ "type": "array",
34126
+ "items": {
34127
+ "type": "object",
34128
+ "properties": {
34129
+ "contract": {
34130
+ "type": "object",
34131
+ "required": [
34132
+ "template",
34133
+ "terms"
34134
+ ],
34135
+ "properties": {
34136
+ "template": {
34137
+ "type": "object",
34138
+ "required": [
34139
+ "name",
34140
+ "url"
34141
+ ],
34142
+ "properties": {
34143
+ "name": {
34144
+ "type": "string"
34145
+ },
34146
+ "url": {
34147
+ "type": "string",
34148
+ "format": "uri"
34149
+ },
34150
+ "externalIds": {
34151
+ "type": "object"
34152
+ }
34153
+ }
34154
+ },
34155
+ "terms": {
34156
+ "type": "object"
34157
+ }
34158
+ }
34159
+ },
34160
+ "signatures": {
34161
+ "type": "array",
34162
+ "items": {
34163
+ "type": "object",
34164
+ "required": [
34165
+ "name",
34166
+ "signedOn",
34167
+ "role",
34168
+ "contractHash"
34169
+ ],
34170
+ "properties": {
34171
+ "name": {
34172
+ "type": "string"
34173
+ },
34174
+ "signedOn": {
34175
+ "type": "string",
34176
+ "format": "date-time"
34177
+ },
34178
+ "externalIds": {
34179
+ "type": "object"
34180
+ }
34181
+ },
34182
+ "role": {
34183
+ "type": "string",
34184
+ "enum": [
34185
+ "Seller",
34186
+ "Seller's Conveyancer",
34187
+ "Prospective Buyer",
34188
+ "Buyer",
34189
+ "Buyer's Conveyancer",
34190
+ "Estate Agent",
34191
+ "Buyer's Agent",
34192
+ "Surveyor",
34193
+ "Mortgage Broker",
34194
+ "Lender",
34195
+ "Landlord",
34196
+ "Tenant"
34197
+ ]
34198
+ },
34199
+ "contractHash": {
34200
+ "title": "An MD5 hash of the stable-stringified contract object being signed",
34201
+ "type": "string"
34202
+ }
34203
+ }
34204
+ }
34205
+ }
34206
+ }
34118
34207
  }
34119
34208
  }
34120
34209
  }
@@ -30,6 +30,7 @@
30
30
  "organisationReference": {},
31
31
  "role": {},
32
32
  "externalIds": {},
33
+ "isRemoved": {},
33
34
  "sellersCapacity": {
34
35
  "capacity": {},
35
36
  "sellersCapacityDetails": {},
@@ -4094,5 +4095,20 @@
4094
4095
  "pricingMethodology": {}
4095
4096
  }
4096
4097
  }
4098
+ },
4099
+ "contracts": {
4100
+ "contract": {
4101
+ "template": {
4102
+ "name": {},
4103
+ "url": {},
4104
+ "externalIds": {}
4105
+ },
4106
+ "terms": {}
4107
+ },
4108
+ "signatures": {
4109
+ "name": {},
4110
+ "signedOn": {},
4111
+ "externalIds": {}
4112
+ }
4097
4113
  }
4098
4114
  }
@@ -396,3 +396,10 @@ test("correctly gets titles across schemas, arrays and non-existient title prope
396
396
  )
397
397
  ).toBe("Please provide their full names and ages.");
398
398
  });
399
+ test("validates a valid contract", () => {
400
+ const path = "/contracts";
401
+ const data = jp.get(exampleTransaction, path);
402
+ const validator = getSubschemaValidator(path, exampleTransaction.$schema);
403
+ const isValid = validator(data);
404
+ expect(isValid).toBe(true);
405
+ });