@pdtf/schemas 3.6.0-dev.1 → 3.6.0-dev.11

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 (53) hide show
  1. package/package.json +9 -1
  2. package/src/schemas/v3/combined.json +677 -182
  3. package/src/schemas/v3/compactSkeleton.txt +63 -0
  4. package/src/schemas/v3/overlays/baspi4.json +43 -73
  5. package/src/schemas/v3/overlays/baspi5.json +43 -73
  6. package/src/schemas/v3/overlays/extensions/ac.json +2 -1
  7. package/src/schemas/v3/overlays/extensions/dk.json +3 -2
  8. package/src/schemas/v3/overlays/extensions/ic.json +44 -9
  9. package/src/schemas/v3/overlays/extensions/lc.json +3 -2
  10. package/src/schemas/v3/overlays/extensions/mi.json +2 -1
  11. package/src/schemas/v3/overlays/extensions/nd.json +3 -2
  12. package/src/schemas/v3/overlays/extensions/pc.json +3 -2
  13. package/src/schemas/v3/overlays/extensions/ph.json +2 -1
  14. package/src/schemas/v3/overlays/extensions/rw.json +4 -3
  15. package/src/schemas/v3/overlays/extensions/sc.json +8 -4
  16. package/src/schemas/v3/overlays/extensions/sd.json +3 -2
  17. package/src/schemas/v3/overlays/extensions/ta.json +0 -48
  18. package/src/schemas/v3/overlays/extensions/tr.json +3 -2
  19. package/src/schemas/v3/overlays/extensions/wg.json +2 -1
  20. package/src/schemas/v3/overlays/llc1.json +1 -2
  21. package/src/schemas/v3/overlays/lpe1.json +1 -1
  22. package/src/schemas/v3/overlays/nts.json +3 -1
  23. package/src/schemas/v3/overlays/nts2.json +3 -1
  24. package/src/schemas/v3/overlays/ntsl.json +3 -1
  25. package/src/schemas/v3/overlays/ntsl2.json +3 -1
  26. package/src/schemas/v3/overlays/piq.json +23 -24
  27. package/src/schemas/v3/overlays/rds.json +22 -49
  28. package/src/schemas/v3/overlays/sef25.json +16 -2
  29. package/src/schemas/v3/overlays/ta10.json +0 -9
  30. package/src/schemas/v3/overlays/ta6.json +37 -69
  31. package/src/schemas/v3/overlays/ta6ed6.json +319 -180
  32. package/src/schemas/v3/overlays/ta7ed5.json +66 -20
  33. package/src/schemas/v3/pdtf-transaction.json +397 -95
  34. package/src/schemas/v3/skeleton.json +70 -5
  35. package/src/utils/extractExtensionOverlays.js +11 -2
  36. package/src/utils/extractOverlay.js +20 -0
  37. package/CLAUDE.md +0 -101
  38. package/docs/backend-lms-profile-filtering-spec.md +0 -180
  39. package/src/examples/v1/exampleAddParticipantVouch.json +0 -32
  40. package/src/examples/v1/exampleDocumentedVouch.json +0 -40
  41. package/src/examples/v1/exampleElectronicRecord.json +0 -30
  42. package/src/examples/v1/exampleTransaction.json +0 -878
  43. package/src/examples/v1/exampleVouch.json +0 -25
  44. package/src/examples/v2/exampleTransaction.json +0 -901
  45. package/src/examples/v3/exampleAddParticipantVouch.json +0 -38
  46. package/src/examples/v3/exampleCustomOverlay.json +0 -55
  47. package/src/examples/v3/exampleCustomOverlay2.json +0 -93
  48. package/src/examples/v3/exampleDocumentedVouch.json +0 -47
  49. package/src/examples/v3/exampleElectronicRecord.json +0 -36
  50. package/src/examples/v3/exampleTransaction.json +0 -1038
  51. package/src/examples/v3/exampleVouch.json +0 -32
  52. package/src/mappings/SendPropertyDetailsRequestSchema.json +0 -1588
  53. package/src/mappings/adf.js +0 -198
@@ -109,6 +109,11 @@
109
109
  "easting": "number",
110
110
  "northing": "number"
111
111
  },
112
+ "ruralUrbanClassification": "string",
113
+ "ruralUrbanCode": "string",
114
+ "region": "string",
115
+ "parish": "string",
116
+ "outputArea": "string",
112
117
  "googleStreetViewPOV": {
113
118
  "heading": "number",
114
119
  "pitch": "number",
@@ -157,6 +162,7 @@
157
162
  "hasLift": "string",
158
163
  "overCommercialPremises": {
159
164
  "isLocatedOverCommercialPremises": "variant",
165
+ "detailsAnalysis": {},
160
166
  "details": "string"
161
167
  }
162
168
  },
@@ -975,6 +981,7 @@
975
981
  },
976
982
  "excessPaymentAnticipated": {
977
983
  "yesNo": "variant",
984
+ "detailsAnalysis": {},
978
985
  "details": "string"
979
986
  },
980
987
  "lastDemandPeriod": {
@@ -987,6 +994,7 @@
987
994
  },
988
995
  "reserveFund": {
989
996
  "yesNo": "variant",
997
+ "detailsAnalysis": {},
990
998
  "details": "string",
991
999
  "contributionIncludedInServiceCharge": "string",
992
1000
  "sufficentToCoverSection20Expenditure": {
@@ -1008,10 +1016,12 @@
1008
1016
  },
1009
1017
  "section20WorksProposed": {
1010
1018
  "yesNo": "variant",
1019
+ "detailsAnalysis": {},
1011
1020
  "details": "string"
1012
1021
  },
1013
1022
  "increaseInServiceChargeAnticipated": {
1014
1023
  "yesNo": "variant",
1024
+ "detailsAnalysis": {},
1015
1025
  "details": "string"
1016
1026
  },
1017
1027
  "outstandingServiceChargeConsultation": {
@@ -1095,10 +1105,12 @@
1095
1105
  },
1096
1106
  "unresolvedDisputes": {
1097
1107
  "yesNo": "variant",
1108
+ "detailsAnalysis": {},
1098
1109
  "details": "string"
1099
1110
  },
1100
1111
  "breachOfTermsOfLease": {
1101
1112
  "yesNo": "variant",
1113
+ "detailsAnalysis": {},
1102
1114
  "details": "string"
1103
1115
  }
1104
1116
  },
@@ -1118,6 +1130,7 @@
1118
1130
  "alterations": {
1119
1131
  "sellerAwareOfAlterations": {
1120
1132
  "yesNo": "variant",
1133
+ "detailsAnalysis": {},
1121
1134
  "details": "string",
1122
1135
  "landlordConsentObtained": {
1123
1136
  "yesNo": "variant",
@@ -1252,6 +1265,7 @@
1252
1265
  "listingAndConservation": {
1253
1266
  "isListed": {
1254
1267
  "yesNo": "variant",
1268
+ "detailsAnalysis": {},
1255
1269
  "details": "string",
1256
1270
  "attachments": "string"
1257
1271
  },
@@ -1264,6 +1278,7 @@
1264
1278
  "yesNo": "variant",
1265
1279
  "workCarriedOut": {
1266
1280
  "yesNo": "variant",
1281
+ "detailsAnalysis": {},
1267
1282
  "details": "string",
1268
1283
  "consentsObtained": "string",
1269
1284
  "attachments": "string"
@@ -1273,11 +1288,13 @@
1273
1288
  "typeOfConstruction": {
1274
1289
  "isStandardForm": {
1275
1290
  "yesNo": "variant",
1291
+ "detailsAnalysis": {},
1276
1292
  "constructionType": "string",
1277
1293
  "details": "string"
1278
1294
  },
1279
1295
  "buildingSafety": {
1280
1296
  "yesNo": "variant",
1297
+ "detailsAnalysis": {},
1281
1298
  "details": "string",
1282
1299
  "workAlreadyDone": "string",
1283
1300
  "workToBeDone": "string",
@@ -1287,12 +1304,14 @@
1287
1304
  },
1288
1305
  "loft": {
1289
1306
  "loftAccess": "variant",
1307
+ "detailsAnalysis": {},
1290
1308
  "details": "string",
1291
1309
  "loftBoarded": "string",
1292
1310
  "loftInsulated": "string"
1293
1311
  },
1294
1312
  "sprayFoamInsulation": {
1295
1313
  "hasSprayFoamInstalled": "variant",
1314
+ "detailsAnalysis": {},
1296
1315
  "details": "string",
1297
1316
  "attachments": "string"
1298
1317
  },
@@ -1428,24 +1447,29 @@
1428
1447
  "disputesAndComplaints": {
1429
1448
  "hasDisputesAndComplaints": {
1430
1449
  "yesNo": "variant",
1450
+ "detailsAnalysis": {},
1431
1451
  "details": "string"
1432
1452
  },
1433
1453
  "leadingToDisputesAndComplaints": {
1434
1454
  "yesNo": "variant",
1455
+ "detailsAnalysis": {},
1435
1456
  "details": "string"
1436
1457
  }
1437
1458
  },
1438
1459
  "alterationsAndChanges": {
1439
1460
  "hasStructuralAlterations": {
1440
1461
  "yesNo": "variant",
1462
+ "detailsAnalysis": {},
1441
1463
  "details": "string",
1442
1464
  "buildingRegApproval": {
1443
1465
  "yesNo": "variant",
1466
+ "detailsAnalysis": {},
1444
1467
  "attachments": "string",
1445
1468
  "details": "string"
1446
1469
  },
1447
1470
  "planningPermission": {
1448
1471
  "yesNo": "variant",
1472
+ "detailsAnalysis": {},
1449
1473
  "attachments": "string",
1450
1474
  "details": "string"
1451
1475
  },
@@ -1462,10 +1486,12 @@
1462
1486
  },
1463
1487
  "changeOfUse": {
1464
1488
  "yesNo": "variant",
1489
+ "detailsAnalysis": {},
1465
1490
  "details": "string",
1466
1491
  "yearCompleted": "integer",
1467
1492
  "buildingRegApproval": {
1468
1493
  "yesNo": "variant",
1494
+ "detailsAnalysis": {},
1469
1495
  "attachments": "string",
1470
1496
  "details": "string"
1471
1497
  },
@@ -1492,10 +1518,12 @@
1492
1518
  },
1493
1519
  "windowReplacementsSince2002": {
1494
1520
  "yesNo": "variant",
1521
+ "detailsAnalysis": {},
1495
1522
  "details": "string",
1496
1523
  "yearCompleted": "integer",
1497
1524
  "buildingRegApproval": {
1498
1525
  "yesNo": "variant",
1526
+ "detailsAnalysis": {},
1499
1527
  "attachments": "string",
1500
1528
  "details": "string"
1501
1529
  },
@@ -1541,10 +1569,12 @@
1541
1569
  },
1542
1570
  "hasAddedConservatory": {
1543
1571
  "yesNo": "variant",
1572
+ "detailsAnalysis": {},
1544
1573
  "details": "string",
1545
1574
  "yearCompleted": "integer",
1546
1575
  "buildingRegApproval": {
1547
1576
  "yesNo": "variant",
1577
+ "detailsAnalysis": {},
1548
1578
  "attachments": "string",
1549
1579
  "details": "string"
1550
1580
  },
@@ -1685,17 +1715,20 @@
1685
1715
  },
1686
1716
  "worksUnfinished": {
1687
1717
  "yesNo": "variant",
1718
+ "detailsAnalysis": {},
1688
1719
  "details": "string",
1689
1720
  "attachments": "string"
1690
1721
  },
1691
1722
  "planningPermissionBreaches": {
1692
1723
  "yesNo": "variant",
1724
+ "detailsAnalysis": {},
1693
1725
  "details": "string",
1694
1726
  "willingToInsure": "string",
1695
1727
  "attachments": "string"
1696
1728
  },
1697
1729
  "unresolvedPlanningIssues": {
1698
1730
  "yesNo": "variant",
1731
+ "detailsAnalysis": {},
1699
1732
  "details": "string",
1700
1733
  "willingToInsure": "string",
1701
1734
  "attachments": "string"
@@ -1729,6 +1762,7 @@
1729
1762
  },
1730
1763
  "partyWallAct": {
1731
1764
  "yesNo": "variant",
1765
+ "detailsAnalysis": {},
1732
1766
  "details": "string",
1733
1767
  "attachments": "string"
1734
1768
  },
@@ -1760,6 +1794,7 @@
1760
1794
  },
1761
1795
  "subsidenceOrStructuralFault": {
1762
1796
  "yesNo": "variant",
1797
+ "detailsAnalysis": {},
1763
1798
  "details": "string",
1764
1799
  "attachments": "string"
1765
1800
  },
@@ -2392,6 +2427,7 @@
2392
2427
  "yearInstalled": "integer",
2393
2428
  "panelsOwnedOutright": {
2394
2429
  "yesNo": "variant",
2430
+ "detailsAnalysis": {},
2395
2431
  "details": "string",
2396
2432
  "attachments": "string",
2397
2433
  "associatedCost": {
@@ -2401,6 +2437,7 @@
2401
2437
  },
2402
2438
  "panelProviderLease": {
2403
2439
  "yesNo": "variant",
2440
+ "detailsAnalysis": {},
2404
2441
  "details": "string",
2405
2442
  "attachments": "string"
2406
2443
  },
@@ -2589,6 +2626,7 @@
2589
2626
  "heating": {
2590
2627
  "heatingSystem": {
2591
2628
  "heatingType": "variant",
2629
+ "detailsAnalysis": {},
2592
2630
  "centralHeatingDetails": {
2593
2631
  "centralHeatingFuel": {
2594
2632
  "centralHeatingFuelType": "variant",
@@ -2695,18 +2733,22 @@
2695
2733
  "difficultiesObtainingInsurance": {
2696
2734
  "abnormalRiseInPremiums": {
2697
2735
  "yesNo": "variant",
2736
+ "detailsAnalysis": {},
2698
2737
  "details": "string"
2699
2738
  },
2700
2739
  "subjectToHighExcesses": {
2701
2740
  "yesNo": "variant",
2741
+ "detailsAnalysis": {},
2702
2742
  "details": "string"
2703
2743
  },
2704
2744
  "subjectToUnusualConditions": {
2705
2745
  "yesNo": "variant",
2746
+ "detailsAnalysis": {},
2706
2747
  "details": "string"
2707
2748
  },
2708
2749
  "refused": {
2709
2750
  "yesNo": "variant",
2751
+ "detailsAnalysis": {},
2710
2752
  "details": "string"
2711
2753
  }
2712
2754
  },
@@ -2716,6 +2758,7 @@
2716
2758
  "whoInsures": "string",
2717
2759
  "insuranceClaims": {
2718
2760
  "yesNo": "variant",
2761
+ "detailsAnalysis": {},
2719
2762
  "details": "string"
2720
2763
  }
2721
2764
  },
@@ -3140,23 +3183,27 @@
3140
3183
  "legalBoundaries": {
3141
3184
  "partOutsideLegalOwnership": {
3142
3185
  "yesNo": "variant",
3186
+ "detailsAnalysis": {},
3143
3187
  "details": "string"
3144
3188
  },
3145
3189
  "partOnSeparateSiteOrDeed": {
3146
3190
  "yesNo": "variant",
3191
+ "detailsAnalysis": {},
3147
3192
  "details": "string"
3148
3193
  },
3149
3194
  "boundariesDifferFromTitlePlan": {
3150
3195
  "yesNo": "variant",
3196
+ "detailsAnalysis": {},
3151
3197
  "details": "string",
3152
3198
  "attachments": "string"
3153
3199
  },
3154
3200
  "boundaryAlterationProposal": {
3155
3201
  "yesNo": "variant",
3202
+ "detailsAnalysis": {},
3156
3203
  "details": "string"
3157
3204
  },
3158
3205
  "ownership": {
3159
- "areBoundariesUniform": "variant",
3206
+ "areBoundariesUniform": "string",
3160
3207
  "uniformBoundaries": {
3161
3208
  "left": "string",
3162
3209
  "right": "string",
@@ -3164,18 +3211,22 @@
3164
3211
  "front": "string"
3165
3212
  },
3166
3213
  "details": "string",
3167
- "attachments": "string"
3214
+ "attachments": "string",
3215
+ "detailsAnalysis": {}
3168
3216
  },
3169
3217
  "haveBoundaryFeaturesMoved": {
3170
3218
  "yesNo": "variant",
3219
+ "detailsAnalysis": {},
3171
3220
  "details": "string"
3172
3221
  },
3173
3222
  "adjacentLandIncluded": {
3174
3223
  "yesNo": "variant",
3224
+ "detailsAnalysis": {},
3175
3225
  "details": "string"
3176
3226
  },
3177
3227
  "flyingFreehold": {
3178
3228
  "yesNo": "variant",
3229
+ "detailsAnalysis": {},
3179
3230
  "details": "string"
3180
3231
  }
3181
3232
  },
@@ -3204,6 +3255,7 @@
3204
3255
  },
3205
3256
  "electricalWorkSince2005": {
3206
3257
  "yesNo": "variant",
3258
+ "detailsAnalysis": {},
3207
3259
  "yearWorkCarriedOut": "integer",
3208
3260
  "details": "string",
3209
3261
  "suppliedCertificate": {
@@ -3232,6 +3284,7 @@
3232
3284
  "hasValidGuaranteesOrWarranties": "variant",
3233
3285
  "newHomeWarranty": {
3234
3286
  "yesNo": "variant",
3287
+ "detailsAnalysis": {},
3235
3288
  "details": "string",
3236
3289
  "attachments": "string"
3237
3290
  },
@@ -3289,6 +3342,7 @@
3289
3342
  },
3290
3343
  "outstandingClaimsOrApplications": {
3291
3344
  "yesNo": "variant",
3345
+ "detailsAnalysis": {},
3292
3346
  "details": "string",
3293
3347
  "attachments": "string"
3294
3348
  },
@@ -3298,6 +3352,7 @@
3298
3352
  },
3299
3353
  "titleDefectInsurance": {
3300
3354
  "yesNo": "variant",
3355
+ "detailsAnalysis": {},
3301
3356
  "details": "string",
3302
3357
  "attachments": "string"
3303
3358
  }
@@ -4654,9 +4709,18 @@
4654
4709
  "documentTypeCode": "string",
4655
4710
  "documentDate": "string",
4656
4711
  "retrievedOn": "string",
4657
- "filedUnder": "string"
4712
+ "filedUnder": "string",
4713
+ "summary": {},
4714
+ "availability": "string",
4715
+ "availabilityCode": "string",
4716
+ "entryNumbers": [
4717
+ "string"
4718
+ ],
4719
+ "backdated": "boolean"
4658
4720
  }
4659
- ]
4721
+ ],
4722
+ "keyFacts": {},
4723
+ "covenantAnalysis": {}
4660
4724
  }
4661
4725
  ],
4662
4726
  "searches": [
@@ -5688,7 +5752,8 @@
5688
5752
  "datetime": "string",
5689
5753
  "originatorRole": "string",
5690
5754
  "destinationRole": "string",
5691
- "messageText": "string"
5755
+ "messageText": "string",
5756
+ "pdtfPath": "string"
5692
5757
  }
5693
5758
  },
5694
5759
  "externalIds": {
@@ -274,7 +274,7 @@ const extensionMappings = {
274
274
  description: "Insurance claims upfront for SEF25",
275
275
  refType: "sef25Ref",
276
276
  paths: [
277
- "/properties/propertyPack/properties/insurance/oneOf/1/properties/insuranceClaims",
277
+ "/properties/propertyPack/properties/insurance",
278
278
  ],
279
279
  },
280
280
 
@@ -575,7 +575,16 @@ function addIntermediateRefs(overlay, schema, refConfig) {
575
575
  const schemaPath = "/" + this.path.join("/");
576
576
  try {
577
577
  const schemaNode = jp.get(schema, schemaPath);
578
- if (schemaNode && schemaNode[refConfig.ref]) {
578
+ if (!schemaNode) return;
579
+ // When the output key differs from the source key (e.g. sef25Ref -> ntsRef),
580
+ // prefer the schema's existing outputRef on intermediate parents so we
581
+ // don't clobber legitimate NTS refs when the extension is later merged.
582
+ if (
583
+ refConfig.ref !== refConfig.outputRef &&
584
+ schemaNode[refConfig.outputRef]
585
+ ) {
586
+ node[refConfig.outputRef] = schemaNode[refConfig.outputRef];
587
+ } else if (schemaNode[refConfig.ref]) {
579
588
  node[refConfig.outputRef] = schemaNode[refConfig.ref];
580
589
  }
581
590
  } catch (err) {
@@ -220,6 +220,25 @@ const extractOverlay = (sourceSchema, ref) => {
220
220
  jp.set(returnSchema, `${path}/enum`, element[refEnum]);
221
221
  }
222
222
 
223
+ // Per-overlay display labels for enum values. The underlying enum (the
224
+ // stored value) is left untouched — we only emit positional `enumNames`
225
+ // aligned to the effective enum, so a form-facing overlay can present the
226
+ // form's own wording (e.g. "Ground"/"Surface water") while the data keeps
227
+ // its canonical value. Invisible to the core/base schema (stripped below).
228
+ const refEnumNames = `${ref}EnumNames`;
229
+ if (element[refEnumNames]) {
230
+ const labelMap = element[refEnumNames];
231
+ const effectiveEnum = element[refEnum] || element.enum;
232
+ if (Array.isArray(effectiveEnum)) {
233
+ const enumNames = effectiveEnum.map((value) =>
234
+ Object.prototype.hasOwnProperty.call(labelMap, value)
235
+ ? labelMap[value]
236
+ : value
237
+ );
238
+ jp.set(returnSchema, `${path}/enumNames`, enumNames);
239
+ }
240
+ }
241
+
223
242
  const refConst = `${ref}Const`;
224
243
  if (Object.prototype.hasOwnProperty.call(element, refConst)) {
225
244
  jp.set(returnSchema, `${path}/const`, element[refConst]);
@@ -265,6 +284,7 @@ const coreSchema = deleteProperties(combinedSchema, [
265
284
  ...metadataFields.map((item) => `${item}Title`),
266
285
  ...metadataFields.map((item) => `${item}Description`),
267
286
  ...metadataFields.map((item) => `${item}Enum`),
287
+ ...metadataFields.map((item) => `${item}EnumNames`),
268
288
  ...metadataFields.map((item) => `${item}Type`),
269
289
  ...metadataFields.map((item) => `${item}MinLength`),
270
290
  ...metadataFields.map((item) => `${item}MaxLength`),
package/CLAUDE.md DELETED
@@ -1,101 +0,0 @@
1
- # CLAUDE.md
2
-
3
- This file provides guidance for AI coding agents when working with code in this repository.
4
-
5
- ## Overview
6
-
7
- This repository contains the Property Data Trust Framework (PDTF) schemas - JSON Schema-based definitions for digital residential property data exchange in England and Wales. The framework enables frictionless exchange of property data between software products and services.
8
-
9
- ## Commands
10
-
11
- ### Testing
12
- ```bash
13
- npm test # Run all tests
14
- npm run test:watch # Run tests in watch mode
15
- ```
16
-
17
- ### Development
18
- ```bash
19
- npm install # Install dependencies
20
- npm run extract-overlays # Regenerate v3 schemas and overlays from combined.json
21
- npm run extract-extension-overlays # Regenerate v3 extension overlays from combined.json
22
- npm run publish:dev # Publish the dev branch package to npm tag dev
23
- npm run publish:next # Publish the next branch package to npm tag next
24
- npm run publish:latest # Publish the main branch package to npm tag latest
25
- ```
26
-
27
- **Important**: `src/schemas/v3/combined.json` is the source of truth for v3 schema changes. Never edit generated schema artifacts directly; there are no exceptions. Utility/source files may be edited normally. After changing `combined.json`, always run both overlay extraction commands so derived files stay in sync.
28
-
29
- ## Architecture
30
-
31
- ### Schema System
32
- The PDTF uses a flexible overlay system where a base transaction schema can be extended with form-specific overlays:
33
-
34
- - **Base Schema**: Core transaction schema at `/src/schemas/v3/pdtf-transaction.json`
35
- - **Overlays**: Form-specific extensions in `/src/schemas/v3/overlays/` (e.g., baspi5.json, ta6.json)
36
- - **Merging**: Overlays are merged with the base schema using deepmerge with custom merge strategies
37
- - **Generated Files**: `pdtf-transaction.json`, `skeleton.json`, `compactSkeleton.txt`, `src/schemas/v3/overlays/*.json`, and `src/schemas/v3/overlays/extensions/*.json` are generated from `combined.json`
38
-
39
- ### Key Components
40
-
41
- 1. **index.js**: Main module exposing schema utilities
42
- - `getTransactionSchema(schemaId, overlays)`: Merges base schema with overlays
43
- - `getValidator(schemaId, overlays)`: Returns AJV validator for schema
44
- - `validateVerifiedClaims()`: Validates verified claims structure
45
-
46
- 2. **Schema Versions**: Currently on v3, with v2 still supported
47
- - Use `https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json` for v3
48
-
49
- 3. **Overlay System**: Supports multiple UK property forms
50
- - BASPI (v4 and v5)
51
- - Law Society TA forms (TA6, TA7, TA10)
52
- - NTS forms (2023 and 2025 versions)
53
- - CON29R, PIQ, RDS, and others
54
-
55
- ### Testing Approach
56
- Tests in `/src/tests/` validate:
57
- - Schema structure with different overlay combinations
58
- - Path validation for nested properties
59
- - Custom overlay merging
60
- - Verified claims validation
61
-
62
- Use existing test patterns when adding new tests.
63
-
64
- ## Branch And Release Workflow
65
-
66
- This repository publishes `@pdtf/schemas` through three branches and npm
67
- dist-tags:
68
-
69
- - `main` -> npm `latest`: stable PDTF releases for broad industry use.
70
- - `next` -> npm `next`: tested capabilities proposed for the next managed PDTF
71
- point release.
72
- - `dev` -> npm `dev`: the unstable coal face for faster-moving integration work
73
- and early adopters.
74
-
75
- PRs may be merged into `dev` to prove out work before it is ready for the managed
76
- release path. Once a `dev` PR has been tested and is suitable for standards
77
- review, promote the same change into `next` via a focused PR. Do not treat `dev`
78
- as the standard, and do not publish `dev` or `next` builds to npm `latest`.
79
-
80
- Promotion is automatic by default: after a PR is merged into `dev`,
81
- `.github/workflows/promote-dev-to-next.yml` creates a matching PR into `next` by
82
- cherry-picking the merged dev PR. Add the `no-promote-next` label before merging
83
- a dev PR only when it should stay out of the `next` review queue. Reviewers
84
- should still inspect the promotion PR, resolve conflicts, and adjust
85
- release/version metadata if needed before merging to `next`.
86
-
87
- Each npm publish needs a unique semver version. Use `-dev.N` versions on `dev`,
88
- prerelease versions on `next`, and normal release versions on `main`.
89
-
90
- Consumer-specific compatibility profiles belong in the consuming application or
91
- service unless the capability becomes generic PDTF package functionality.
92
- Consumers should pin/hash supplied schemas and use their own target-profile
93
- configuration for API calls and webhooks.
94
-
95
- See `docs/branch-release-workflow.md` for the full workflow.
96
-
97
- ## Important Notes
98
-
99
- - All schemas use JSON Schema Draft 07
100
- - The repository publishes to npm as `@pdtf/schemas`
101
- - Overlays may contain fields from licensed forms (BASPI, PIQ, Law Society) - ensure compliance when rendering data