@htilabs/platform-common-models 0.19.0 → 0.20.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.
- package/dist/cvcs/index.cjs +4769 -643
- package/dist/cvcs/index.cjs.map +1 -1
- package/dist/cvcs/index.d.cts +5036 -606
- package/dist/cvcs/index.d.ts +5036 -606
- package/dist/cvcs/index.js +4769 -643
- package/dist/cvcs/index.js.map +1 -1
- package/dist/enums/index.cjs +74 -1
- package/dist/enums/index.cjs.map +1 -1
- package/dist/enums/index.d.cts +77 -4
- package/dist/enums/index.d.ts +77 -4
- package/dist/enums/index.js +74 -1
- package/dist/enums/index.js.map +1 -1
- package/dist/index.cjs +5199 -588
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5189 -588
- package/dist/index.js.map +1 -1
- package/dist/information-scope/index.cjs +440 -0
- package/dist/information-scope/index.cjs.map +1 -0
- package/dist/information-scope/index.d.cts +313 -0
- package/dist/information-scope/index.d.ts +313 -0
- package/dist/information-scope/index.js +404 -0
- package/dist/information-scope/index.js.map +1 -0
- package/dist/services/index.cjs +414 -2
- package/dist/services/index.cjs.map +1 -1
- package/dist/services/index.d.cts +1 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.js +403 -1
- package/dist/services/index.js.map +1 -1
- package/package.json +32 -26
- package/src/__tests__/__snapshots__/cvc-sot.snap +3 -3
- package/src/__tests__/core-information-scope-invariant.test.ts +709 -456
- package/src/__tests__/cvc-sot-snapshot.test.ts +16 -17
- package/src/__tests__/cvc-structural.test.ts +2 -2
- package/src/__tests__/location-type-routing-invariant.test.ts +25 -8
- package/src/cvcs/coreInformationScope.v2.0.0.json +5396 -0
- package/src/cvcs/index.ts +2 -2
- package/src/cvcs/roiScope.v1.3.0.json +360 -0
- package/src/generated/cvc-enums.ts +77 -4
- package/src/services/__tests__/fixtures/infoscope-v4/information_scope_v4.migrations.csv +106 -0
- package/src/services/__tests__/fixtures/infoscope-v4/information_scope_v4.rows.csv +117 -0
- package/src/services/__tests__/fixtures/infoscope-v4/loadInfoscopeV4Fixtures.ts +116 -0
- package/src/services/__tests__/informationScopeResolver.test.ts +964 -0
- package/src/services/index.ts +10 -3
- package/src/services/informationScope.ts +10 -0
- package/src/services/informationScopeResolver.ts +672 -0
- package/src/services/informationScopeSot.ts +161 -0
- package/src/cvcs/coreInformationScope.v1.1.0.json +0 -1290
- package/src/cvcs/roiScope.v1.2.0.json +0 -340
|
@@ -652,11 +652,12 @@ const SOT_SPECS: readonly SotSpec[] = [
|
|
|
652
652
|
// 9 fine-grained Needs-Assessment CAR change types (@pave/domain
|
|
653
653
|
// NEEDS_ASSESSMENT_CHANGE_TYPES, casing normalized to lower_snake) + 4 = 13
|
|
654
654
|
{ file: "needsAssessmentChangeType.v1.0.0.json", domain: "needs_assessment_change_type", expectedCount: 13 },
|
|
655
|
-
// 27 ROI scope items (
|
|
656
|
-
// background 983-014
|
|
657
|
-
//
|
|
658
|
-
//
|
|
659
|
-
|
|
655
|
+
// 27 ROI scope items (14 live + 13 RETIRED tombstones: screen_notes 983-012
|
|
656
|
+
// and background 983-014 retired 2026-10-05 to match CVC-236 v1.1.0; 11 more
|
|
657
|
+
// retired to match CVC-236 v2.0.0, the v4 tree — codes kept, never reused)
|
|
658
|
+
// + 4 missingness = 31. SOT v1.3.0 (supersedes 1.2.0: the retirements are
|
|
659
|
+
// not additive; co-bwc "one answer to offerable").
|
|
660
|
+
{ file: "roiScope.v1.3.0.json", domain: "roi_scope", expectedCount: 31 },
|
|
660
661
|
// 5 stored-ROI lifecycle states (@pave/domain ROI_STATUSES) + 4 = 9
|
|
661
662
|
{ file: "roiStatus.v1.0.0.json", domain: "roi_status", expectedCount: 9 },
|
|
662
663
|
// 2 HMIS FY2026 "P2 Referrals Provided" outcomes (attained / not_attained)
|
|
@@ -739,19 +740,17 @@ const SOT_SPECS: readonly SotSpec[] = [
|
|
|
739
740
|
// 3 substantive age bands (@pave/domain AGE_BANDS_AT_EVENT minus `unknown`,
|
|
740
741
|
// which maps to the missingness sentinel) + 4 missingness = 7
|
|
741
742
|
{ file: "minorAdultStatus.v1.0.0.json", domain: "minor_adult_status", expectedCount: 7 },
|
|
742
|
-
// CVC-236 —
|
|
743
|
-
//
|
|
744
|
-
//
|
|
745
|
-
//
|
|
746
|
-
//
|
|
747
|
-
//
|
|
748
|
-
//
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
{
|
|
752
|
-
file: "coreInformationScope.v1.1.0.json",
|
|
743
|
+
// CVC-236 — the v4 tree (INFOSCOPE v4, 2026-10-09): 115 live rows (2 top
|
|
744
|
+
// groups · 3 person types · 38 categories · 43 sub-categories (34
|
|
745
|
+
// `subcategory` + 9 LEADS `sub-category`) · 1 rest row · 28 instrument rows) + 27 RETIRED tombstones (every v1.1.0 code v4 no longer
|
|
746
|
+
// carries — codes kept, never reused) + 1 missingness root + 3
|
|
747
|
+
// workspace-standard missingness children = 146. SOT v2.0.0 (supersedes
|
|
748
|
+
// 1.1.0: 25 new retirements, categories selectable). Generated by
|
|
749
|
+
// scripts/gen-core-information-scope.py; codes are FROZEN there.
|
|
750
|
+
{
|
|
751
|
+
file: "coreInformationScope.v2.0.0.json",
|
|
753
752
|
domain: "core_information_scope",
|
|
754
|
-
expectedCount:
|
|
753
|
+
expectedCount: 146,
|
|
755
754
|
},
|
|
756
755
|
] as const;
|
|
757
756
|
|
|
@@ -184,7 +184,7 @@ const SOT_FILES: readonly SotFile[] = [
|
|
|
184
184
|
// ─── 0.8.12 vocabulary batch ───
|
|
185
185
|
{ file: "coreFunctions.v1.1.0.json", expectedDomain: "core_functions" },
|
|
186
186
|
{ file: "needsAssessmentChangeType.v1.0.0.json", expectedDomain: "needs_assessment_change_type" },
|
|
187
|
-
{ file: "roiScope.v1.
|
|
187
|
+
{ file: "roiScope.v1.3.0.json", expectedDomain: "roi_scope" },
|
|
188
188
|
{ file: "roiStatus.v1.0.0.json", expectedDomain: "roi_status" },
|
|
189
189
|
{ file: "coreReferralOutcome.v1.0.0.json", expectedDomain: "core_referral_outcome" },
|
|
190
190
|
{ file: "assertionDomain.v1.1.0.json", expectedDomain: "assertion_domain" },
|
|
@@ -235,7 +235,7 @@ const SOT_FILES: readonly SotFile[] = [
|
|
|
235
235
|
{ file: "suggestionSource.v1.0.0.json", expectedDomain: "suggestion_source" },
|
|
236
236
|
// CVC-236 — generated by scripts/gen-core-information-scope.py. Omitted from
|
|
237
237
|
// this list since it was authored; added with the priorities_safety unit.
|
|
238
|
-
{ file: "coreInformationScope.
|
|
238
|
+
{ file: "coreInformationScope.v2.0.0.json", expectedDomain: "core_information_scope" },
|
|
239
239
|
// ─── GDR §10.1 CAR-contract vocabularies (provisional 900-block; PAVE
|
|
240
240
|
// @pave/domain verbatim; bead pv-pgdr-cvc-source-gdr-10-1-bulk-publish). ───
|
|
241
241
|
{ file: "assertionStatus.v1.0.0.json", expectedDomain: "assertion_status" },
|
|
@@ -40,6 +40,8 @@ interface Entry {
|
|
|
40
40
|
anchorDefault?: string | null;
|
|
41
41
|
shareUnit?: string | null;
|
|
42
42
|
safetyDefault?: string | null;
|
|
43
|
+
rowType?: string;
|
|
44
|
+
retired?: boolean;
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
const read = (f: string): { entries: Entry[]; _source?: string } =>
|
|
@@ -49,7 +51,7 @@ const read = (f: string): { entries: Entry[]; _source?: string } =>
|
|
|
49
51
|
};
|
|
50
52
|
|
|
51
53
|
const lt = read("locationType.v1.0.0.json");
|
|
52
|
-
const scope = read("coreInformationScope.
|
|
54
|
+
const scope = read("coreInformationScope.v2.0.0.json");
|
|
53
55
|
const byKey = new Map(lt.entries.map((e) => [e.key, e]));
|
|
54
56
|
const scopeByKey = new Map(scope.entries.map((e) => [e.key, e]));
|
|
55
57
|
const reasons = lt.entries.filter((e) => e.key !== "missingness_root");
|
|
@@ -168,13 +170,28 @@ describe("location_type — share routing at type grain (R1/R2)", () => {
|
|
|
168
170
|
it("names an authorization-grain UNIT, except canon's two LEADS-only derived reasons", () => {
|
|
169
171
|
// Canon's column names the category `commercial_activity` (not one of its
|
|
170
172
|
// units) for the two machine-derived reasons. Carried verbatim; a consumer
|
|
171
|
-
// authorizing at unit grain must resolve it as the category.
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
173
|
+
// authorizing at unit grain must resolve it as the category. Every other
|
|
174
|
+
// shareUnit must be a LIVE sub-category row: never a tombstone, a category,
|
|
175
|
+
// a branch or a person type (CVC-236 v2.0.0 makes those selectable, so
|
|
176
|
+
// selectability no longer tells them apart).
|
|
177
|
+
const AT_CATEGORY = ["ad_location_derived", "ip_derived_location"];
|
|
178
|
+
for (const e of reasons) {
|
|
179
|
+
if (e.shareUnit === null) continue;
|
|
180
|
+
const u = scopeByKey.get(e.shareUnit as string);
|
|
181
|
+
if (AT_CATEGORY.includes(e.key)) {
|
|
182
|
+
expect(u?.rowType, e.key).toBe("category");
|
|
183
|
+
expect(u?.retired, e.key).toBeUndefined();
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
expect(u?.retired, `${e.key} -> ${e.shareUnit}`).not.toBe(true);
|
|
187
|
+
expect(["subcategory", "sub-category"], `${e.key} -> ${e.shareUnit}`).toContain(u?.rowType);
|
|
188
|
+
}
|
|
189
|
+
expect(
|
|
190
|
+
reasons
|
|
191
|
+
.filter((e) => e.shareUnit !== null && scopeByKey.get(e.shareUnit as string)?.rowType === "category")
|
|
192
|
+
.map((e) => e.key)
|
|
193
|
+
.sort(),
|
|
194
|
+
).toEqual(AT_CATEGORY);
|
|
178
195
|
});
|
|
179
196
|
|
|
180
197
|
it("sends only the session/event encounter reasons under encounter_location", () => {
|