@htilabs/platform-common-models 0.8.8 → 0.9.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.
Files changed (78) hide show
  1. package/README.md +44 -0
  2. package/dist/config/index.cjs +191 -0
  3. package/dist/config/index.cjs.map +1 -0
  4. package/dist/config/index.d.cts +101 -0
  5. package/dist/config/index.d.ts +101 -0
  6. package/dist/config/index.js +165 -0
  7. package/dist/config/index.js.map +1 -0
  8. package/dist/constants/index.cjs +5 -432
  9. package/dist/constants/index.cjs.map +1 -1
  10. package/dist/constants/index.d.cts +1 -1
  11. package/dist/constants/index.d.ts +1 -1
  12. package/dist/constants/index.js +5 -429
  13. package/dist/constants/index.js.map +1 -1
  14. package/dist/{cvcEntry-DaDrEuTa.d.cts → cvcEntry-0BIB9sen.d.cts} +44 -44
  15. package/dist/{cvcEntry-DaDrEuTa.d.ts → cvcEntry-0BIB9sen.d.ts} +44 -44
  16. package/dist/cvcs/index.cjs +5863 -7181
  17. package/dist/cvcs/index.cjs.map +1 -1
  18. package/dist/cvcs/index.d.cts +3127 -4581
  19. package/dist/cvcs/index.d.ts +3127 -4581
  20. package/dist/cvcs/index.js +5863 -7173
  21. package/dist/cvcs/index.js.map +1 -1
  22. package/dist/{index-C0J3f169.d.ts → index-CDoqrfc1.d.ts} +1 -1
  23. package/dist/{index-EPjPjR0z.d.cts → index-Zu_mOJRn.d.cts} +1 -1
  24. package/dist/index.cjs +1780 -3613
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.cts +191 -544
  27. package/dist/index.d.ts +191 -544
  28. package/dist/index.js +5967 -7775
  29. package/dist/index.js.map +1 -1
  30. package/dist/models/index.d.cts +2 -2
  31. package/dist/models/index.d.ts +2 -2
  32. package/dist/{platform-auth-BSKYSDKe.d.cts → platform-auth-XVB9aHqR.d.cts} +3 -19
  33. package/dist/{platform-auth-BSKYSDKe.d.ts → platform-auth-XVB9aHqR.d.ts} +3 -19
  34. package/dist/schemas/index.cjs +9 -26
  35. package/dist/schemas/index.cjs.map +1 -1
  36. package/dist/schemas/index.d.cts +39 -35
  37. package/dist/schemas/index.d.ts +39 -35
  38. package/dist/schemas/index.js +9 -26
  39. package/dist/schemas/index.js.map +1 -1
  40. package/dist/types/index.d.cts +2 -2
  41. package/dist/types/index.d.ts +2 -2
  42. package/package.json +25 -19
  43. package/src/__tests__/__snapshots__/cvc-sot.snap +13 -77
  44. package/src/__tests__/cvc-sot-snapshot.test.ts +11 -62
  45. package/src/__tests__/cvc-structural.test.ts +2 -11
  46. package/src/__tests__/runtime-contract-validator.test.ts +556 -0
  47. package/src/config/fixtures/valid.yaml +90 -0
  48. package/src/config/index.ts +352 -0
  49. package/src/constants/ic.ts +3 -445
  50. package/src/cvcs/highestEducationLevelCompleted.v1.0.0.json +0 -9
  51. package/src/cvcs/hmisSex.v1.0.0.json +89 -0
  52. package/src/cvcs/identificationStatus.v1.0.0.json +0 -18
  53. package/src/cvcs/incomeBenefitsSources.v1.0.0.json +2 -31
  54. package/src/cvcs/index.ts +1 -17
  55. package/src/cvcs/juvenileJusticeEpisodeType.v1.0.0.json +96 -0
  56. package/src/cvcs/recencyBand.v1.0.0.json +57 -38
  57. package/src/cvcs/{serviceCategories.v1.1.0.json → serviceCategories.v1.0.0.json} +1091 -1091
  58. package/src/cvcs/serviceStates.v1.0.0.json +1 -23
  59. package/src/cvcs/sourceSubtype.v1.1.0.json +0 -36
  60. package/src/cvcs/verificationMethod.v1.0.0.json +0 -18
  61. package/src/generated/cvc-enums.ts +149 -572
  62. package/src/index.ts +20 -0
  63. package/src/schemas/common.ts +4 -0
  64. package/src/cvcs/activityType.v1.0.0.json +0 -143
  65. package/src/cvcs/assertionDomain.v1.0.0.json +0 -629
  66. package/src/cvcs/contactLinkType.v1.0.0.json +0 -89
  67. package/src/cvcs/hmisRelationshipToHoh.v1.0.0.json +0 -104
  68. package/src/cvcs/housingSubsidyTypes.v1.0.0.json +0 -159
  69. package/src/cvcs/htType.v1.0.0.json +0 -87
  70. package/src/cvcs/livingSituation.v1.0.0.json +0 -213
  71. package/src/cvcs/provenanceSourceId.v1.0.0.json +0 -134
  72. package/src/cvcs/radiusBucket.v1.0.0.json +0 -98
  73. package/src/cvcs/relationshipConcern.v1.0.0.json +0 -114
  74. package/src/cvcs/roiMethod.v1.0.0.json +0 -107
  75. package/src/cvcs/serviceAudience.v1.0.0.json +0 -96
  76. package/src/cvcs/sessionNoteVisibility.v1.0.0.json +0 -80
  77. package/src/cvcs/suggestionSource.v1.0.0.json +0 -71
  78. package/src/cvcs/victimAbuseTypes.v1.0.0.json +0 -276
package/src/index.ts CHANGED
@@ -88,3 +88,23 @@ export { compileModel as compileCvcEntryModel } from "./models/cvcEntryModel.js"
88
88
  // filesystem access. See `./cvcs/index.ts` for the full list and naming.
89
89
 
90
90
  export * from "./cvcs/index.js";
91
+
92
+ // ─── SOT-first CVC flat-array aliases ───────────────────────────────────────
93
+ // Legacy-shaped `CVC_<N>_VALUES` arrays for CVCs that are SOT-native (no
94
+ // ic.ts constants). Derived from the SOT JSON envelope's `entries` filtered
95
+ // to `selectable: true` so the SOT JSON remains the single source of truth
96
+ // AND the non-selectable `missingness_root` grouping code is excluded (it
97
+ // would otherwise fail schema enum validation on write).
98
+
99
+ import recencyBandSot from "./cvcs/recencyBand.v1.0.0.json" with { type: "json" };
100
+ import juvenileJusticeEpisodeTypeSot from "./cvcs/juvenileJusticeEpisodeType.v1.0.0.json" with { type: "json" };
101
+
102
+ const selectableCodes = (envelope: {
103
+ entries: ReadonlyArray<{ code: string; selectable: boolean }>;
104
+ }): string[] =>
105
+ envelope.entries.filter((e) => e.selectable).map((e) => e.code);
106
+
107
+ export const CVC_137_VALUES: string[] = selectableCodes(recencyBandSot);
108
+ export const CVC_197_VALUES: string[] = selectableCodes(
109
+ juvenileJusticeEpisodeTypeSot,
110
+ );
@@ -42,6 +42,10 @@ export const personNameSchema = new Schema(
42
42
  alias: Boolean,
43
43
  isUnknown: Boolean,
44
44
  isAnonymous: Boolean,
45
+ // Shape flag: this person has only one name (e.g., Madonna). A mononym
46
+ // can itself be legal, a nickname, a trade name, etc. — it's orthogonal
47
+ // to nameType, not a value of it.
48
+ isMononym: Boolean,
45
49
  },
46
50
  { _id: false },
47
51
  );
@@ -1,143 +0,0 @@
1
- {
2
- "domain": "activity_type",
3
- "name": "activityType",
4
- "version": "1.0.0",
5
- "_status": "PROVISIONAL — net-new value-CVC not yet in Notion; provisional 900+ numbering; substantive values sourced verbatim from the PAVE @pave/domain enum of the same name (D10 source-from-platform-common). PENDING canonical Notion authoring + steward ratification of titles/definitions.",
6
- "_source": "pave-2.0/packages/domain/src/enums.ts",
7
- "levels": {
8
- "0": "Unknown or Missing",
9
- "1": "Activity type"
10
- },
11
- "entries": [
12
- {
13
- "code": "965-000-000-000-000-000-000",
14
- "key": "missingness_root",
15
- "title": "Unknown, Redacted, or Missing",
16
- "selectable": false,
17
- "parentCode": null,
18
- "childCodes": [
19
- "965-000-000-000-000-000-001",
20
- "965-000-000-000-000-000-002",
21
- "965-000-000-000-000-000-003"
22
- ],
23
- "definition": "Root group for values indicating absent, withheld, or uncollected data."
24
- },
25
- {
26
- "code": "965-000-000-000-000-000-001",
27
- "key": "unknown",
28
- "title": "Unknown",
29
- "selectable": true,
30
- "parentCode": "965-000-000-000-000-000-000",
31
- "childCodes": [],
32
- "definition": "The activity_type is unknown or cannot be determined."
33
- },
34
- {
35
- "code": "965-000-000-000-000-000-002",
36
- "key": "anonymous",
37
- "title": "Anonymous / declined to answer",
38
- "selectable": true,
39
- "parentCode": "965-000-000-000-000-000-000",
40
- "childCodes": [],
41
- "definition": "Value is intentionally withheld, declined, or redacted."
42
- },
43
- {
44
- "code": "965-000-000-000-000-000-003",
45
- "key": "data_not_collected",
46
- "title": "Data not collected",
47
- "selectable": true,
48
- "parentCode": "965-000-000-000-000-000-000",
49
- "childCodes": [],
50
- "definition": "No attempt was made to collect the value."
51
- },
52
- {
53
- "code": "965-001-000-000-000-000-000",
54
- "key": "resided",
55
- "title": "Resided",
56
- "selectable": true,
57
- "parentCode": null,
58
- "childCodes": [],
59
- "definition": "Activity type 'resided' recorded on a person/relationship interaction."
60
- },
61
- {
62
- "code": "965-002-000-000-000-000-000",
63
- "key": "sheltered",
64
- "title": "Sheltered",
65
- "selectable": true,
66
- "parentCode": null,
67
- "childCodes": [],
68
- "definition": "Activity type 'sheltered' recorded on a person/relationship interaction."
69
- },
70
- {
71
- "code": "965-003-000-000-000-000-000",
72
- "key": "service_delivered",
73
- "title": "Service Delivered",
74
- "selectable": true,
75
- "parentCode": null,
76
- "childCodes": [],
77
- "definition": "Activity type 'service_delivered' recorded on a person/relationship interaction."
78
- },
79
- {
80
- "code": "965-004-000-000-000-000-000",
81
- "key": "met",
82
- "title": "Met",
83
- "selectable": true,
84
- "parentCode": null,
85
- "childCodes": [],
86
- "definition": "Activity type 'met' recorded on a person/relationship interaction."
87
- },
88
- {
89
- "code": "965-005-000-000-000-000-000",
90
- "key": "advertised",
91
- "title": "Advertised",
92
- "selectable": true,
93
- "parentCode": null,
94
- "childCodes": [],
95
- "definition": "Activity type 'advertised' recorded on a person/relationship interaction."
96
- },
97
- {
98
- "code": "965-006-000-000-000-000-000",
99
- "key": "arrested",
100
- "title": "Arrested",
101
- "selectable": true,
102
- "parentCode": null,
103
- "childCodes": [],
104
- "definition": "Activity type 'arrested' recorded on a person/relationship interaction."
105
- },
106
- {
107
- "code": "965-007-000-000-000-000-000",
108
- "key": "visited",
109
- "title": "Visited",
110
- "selectable": true,
111
- "parentCode": null,
112
- "childCodes": [],
113
- "definition": "Activity type 'visited' recorded on a person/relationship interaction."
114
- },
115
- {
116
- "code": "965-008-000-000-000-000-000",
117
- "key": "child_welfare_visit",
118
- "title": "Child Welfare Visit",
119
- "selectable": true,
120
- "parentCode": null,
121
- "childCodes": [],
122
- "definition": "Activity type 'child_welfare_visit' recorded on a person/relationship interaction."
123
- },
124
- {
125
- "code": "965-009-000-000-000-000-000",
126
- "key": "incident",
127
- "title": "Incident",
128
- "selectable": true,
129
- "parentCode": null,
130
- "childCodes": [],
131
- "definition": "Activity type 'incident' recorded on a person/relationship interaction."
132
- },
133
- {
134
- "code": "965-010-000-000-000-000-000",
135
- "key": "other",
136
- "title": "Other",
137
- "selectable": true,
138
- "parentCode": null,
139
- "childCodes": [],
140
- "definition": "Activity type 'other' recorded on a person/relationship interaction."
141
- }
142
- ]
143
- }