@htilabs/platform-common-models 0.12.3 → 0.12.4

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 (35) hide show
  1. package/dist/cvcs/index.cjs +153 -21
  2. package/dist/cvcs/index.cjs.map +1 -1
  3. package/dist/cvcs/index.d.cts +164 -27
  4. package/dist/cvcs/index.d.ts +164 -27
  5. package/dist/cvcs/index.js +153 -21
  6. package/dist/cvcs/index.js.map +1 -1
  7. package/dist/enums/index.cjs +1 -0
  8. package/dist/enums/index.cjs.map +1 -1
  9. package/dist/enums/index.d.cts +4 -3
  10. package/dist/enums/index.d.ts +4 -3
  11. package/dist/enums/index.js +1 -0
  12. package/dist/enums/index.js.map +1 -1
  13. package/dist/{index-4DiJrn7y.d.ts → index-C0J3f169.d.ts} +1 -1
  14. package/dist/{index-qreOzXYS.d.cts → index-EPjPjR0z.d.cts} +1 -1
  15. package/dist/index.cjs +154 -21
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.d.cts +2 -2
  18. package/dist/index.d.ts +2 -2
  19. package/dist/index.js +154 -21
  20. package/dist/index.js.map +1 -1
  21. package/dist/models/index.d.cts +2 -2
  22. package/dist/models/index.d.ts +2 -2
  23. package/dist/schemas/index.d.cts +25 -25
  24. package/dist/schemas/index.d.ts +25 -25
  25. package/package.json +1 -1
  26. package/src/__tests__/__snapshots__/cvc-sot.snap +3 -3
  27. package/src/__tests__/core-information-scope-invariant.test.ts +57 -3
  28. package/src/__tests__/cvc-sot-snapshot.test.ts +5 -4
  29. package/src/__tests__/location-type-routing-invariant.test.ts +202 -0
  30. package/src/cvcs/coreInformationScope.v1.0.0.json +22 -5
  31. package/src/cvcs/index.ts +3 -0
  32. package/src/cvcs/locationType.v1.0.0.json +131 -16
  33. package/src/generated/cvc-enums.ts +4 -3
  34. package/dist/{cvcEntry-ctHTp2df.d.cts → cvcEntry-DaDrEuTa.d.cts} +8 -8
  35. package/dist/{cvcEntry-ctHTp2df.d.ts → cvcEntry-DaDrEuTa.d.ts} +8 -8
@@ -1,3 +1,3 @@
1
- export { a as CvcEntry, b as CvcRegistry, F as Form, P as PlatformFunction, d as PlatformRole, Q as Question, f as ScoringRule, h as Section } from '../cvcEntry-ctHTp2df.cjs';
1
+ export { a as CvcEntry, b as CvcRegistry, F as Form, P as PlatformFunction, d as PlatformRole, Q as Question, f as ScoringRule, h as Section } from '../cvcEntry-DaDrEuTa.cjs';
2
2
  import 'mongoose';
3
- export { C as CvcEntryDoc, a as CvcRegistryDoc, F as FormDoc, P as PlatformFunctionDoc, b as PlatformModels, c as PlatformRoleDoc, Q as QuestionDoc, S as ScoringRuleDoc, d as SectionDoc, g as createPlatformModels, h as cvcEntryModel, i as cvcRegistryModel, j as formModel, p as platformFunctionModel, k as platformRoleModel, q as questionModel, s as scoringRuleModel, l as sectionModel } from '../index-qreOzXYS.cjs';
3
+ export { C as CvcEntryDoc, a as CvcRegistryDoc, F as FormDoc, P as PlatformFunctionDoc, b as PlatformModels, c as PlatformRoleDoc, Q as QuestionDoc, S as ScoringRuleDoc, d as SectionDoc, g as createPlatformModels, h as cvcEntryModel, i as cvcRegistryModel, j as formModel, p as platformFunctionModel, k as platformRoleModel, q as questionModel, s as scoringRuleModel, l as sectionModel } from '../index-EPjPjR0z.cjs';
@@ -1,3 +1,3 @@
1
- export { a as CvcEntry, b as CvcRegistry, F as Form, P as PlatformFunction, d as PlatformRole, Q as Question, f as ScoringRule, h as Section } from '../cvcEntry-ctHTp2df.js';
1
+ export { a as CvcEntry, b as CvcRegistry, F as Form, P as PlatformFunction, d as PlatformRole, Q as Question, f as ScoringRule, h as Section } from '../cvcEntry-DaDrEuTa.js';
2
2
  import 'mongoose';
3
- export { C as CvcEntryDoc, a as CvcRegistryDoc, F as FormDoc, P as PlatformFunctionDoc, b as PlatformModels, c as PlatformRoleDoc, Q as QuestionDoc, S as ScoringRuleDoc, d as SectionDoc, g as createPlatformModels, h as cvcEntryModel, i as cvcRegistryModel, j as formModel, p as platformFunctionModel, k as platformRoleModel, q as questionModel, s as scoringRuleModel, l as sectionModel } from '../index-4DiJrn7y.js';
3
+ export { C as CvcEntryDoc, a as CvcRegistryDoc, F as FormDoc, P as PlatformFunctionDoc, b as PlatformModels, c as PlatformRoleDoc, Q as QuestionDoc, S as ScoringRuleDoc, d as SectionDoc, g as createPlatformModels, h as cvcEntryModel, i as cvcRegistryModel, j as formModel, p as platformFunctionModel, k as platformRoleModel, q as questionModel, s as scoringRuleModel, l as sectionModel } from '../index-C0J3f169.js';
@@ -1,6 +1,6 @@
1
1
  import * as mongoose from 'mongoose';
2
2
  import { InferRawDocType, Schema } from 'mongoose';
3
- export { C as Choice, a as CvcEntry, b as CvcRegistry, F as Form, c as FormSectionRef, G as Guidance, L as Layout, P as PlatformFunction, d as PlatformRole, Q as Question, S as ScoringCondition, e as ScoringRecommendation, f as ScoringRule, g as ScoringThreshold, h as Section, i as SectionQuestionRef, V as VisibilityRule, j as buildCvcEntrySchema, k as buildCvcRegistrySchema, l as buildFormSchema, m as buildPlatformFunctionSchema, n as buildPlatformRoleSchema, o as buildQuestionSchema, p as buildScoringRuleSchema, q as buildSectionSchema, r as choiceSchema, s as cvcEntrySchemaDefinition, t as cvcEntrySchemaOptions, u as cvcRegistrySchemaDefinition, v as cvcRegistrySchemaOptions, w as formSchemaDefinition, x as formSchemaOptions, y as formSectionRefSchema, z as guidanceSchema, A as layoutSchema, B as platformFunctionSchemaDefinition, D as platformFunctionSchemaOptions, E as platformRoleSchemaDefinition, H as platformRoleSchemaOptions, I as questionSchemaDefinition, J as questionSchemaOptions, K as scoringConditionSchema, M as scoringRecommendationSchema, N as scoringRuleSchemaDefinition, O as scoringRuleSchemaOptions, R as scoringThresholdSchema, T as sectionQuestionRefSchema, U as sectionSchemaDefinition, W as sectionSchemaOptions, X as visibilityRuleSchema } from '../cvcEntry-ctHTp2df.cjs';
3
+ export { C as Choice, a as CvcEntry, b as CvcRegistry, F as Form, c as FormSectionRef, G as Guidance, L as Layout, P as PlatformFunction, d as PlatformRole, Q as Question, S as ScoringCondition, e as ScoringRecommendation, f as ScoringRule, g as ScoringThreshold, h as Section, i as SectionQuestionRef, V as VisibilityRule, j as buildCvcEntrySchema, k as buildCvcRegistrySchema, l as buildFormSchema, m as buildPlatformFunctionSchema, n as buildPlatformRoleSchema, o as buildQuestionSchema, p as buildScoringRuleSchema, q as buildSectionSchema, r as choiceSchema, s as cvcEntrySchemaDefinition, t as cvcEntrySchemaOptions, u as cvcRegistrySchemaDefinition, v as cvcRegistrySchemaOptions, w as formSchemaDefinition, x as formSchemaOptions, y as formSectionRefSchema, z as guidanceSchema, A as layoutSchema, B as platformFunctionSchemaDefinition, D as platformFunctionSchemaOptions, E as platformRoleSchemaDefinition, H as platformRoleSchemaOptions, I as questionSchemaDefinition, J as questionSchemaOptions, K as scoringConditionSchema, M as scoringRecommendationSchema, N as scoringRuleSchemaDefinition, O as scoringRuleSchemaOptions, R as scoringThresholdSchema, T as sectionQuestionRefSchema, U as sectionSchemaDefinition, W as sectionSchemaOptions, X as visibilityRuleSchema } from '../cvcEntry-DaDrEuTa.cjs';
4
4
 
5
5
  declare const addressSchema: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
6
6
  _id: false;
@@ -132,12 +132,12 @@ declare const phoneSchema: Schema<any, mongoose.Model<any, any, any, any, any, a
132
132
  number?: string | null | undefined;
133
133
  type?: string | null | undefined;
134
134
  safeToContact?: boolean | null | undefined;
135
- dataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
135
+ dataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
136
136
  }, mongoose.Document<unknown, {}, {
137
137
  number?: string | null | undefined;
138
138
  type?: string | null | undefined;
139
139
  safeToContact?: boolean | null | undefined;
140
- dataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
140
+ dataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
141
141
  }, {
142
142
  id: string;
143
143
  }, mongoose.MergeType<mongoose.DefaultSchemaOptions, {
@@ -146,7 +146,7 @@ declare const phoneSchema: Schema<any, mongoose.Model<any, any, any, any, any, a
146
146
  number?: string | null | undefined;
147
147
  type?: string | null | undefined;
148
148
  safeToContact?: boolean | null | undefined;
149
- dataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
149
+ dataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
150
150
  } & {
151
151
  _id: mongoose.Types.ObjectId;
152
152
  } & {
@@ -157,7 +157,7 @@ declare const phoneSchema: Schema<any, mongoose.Model<any, any, any, any, any, a
157
157
  number?: string | null | undefined;
158
158
  type?: string | null | undefined;
159
159
  safeToContact?: boolean | null | undefined;
160
- dataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
160
+ dataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
161
161
  } & {
162
162
  _id: mongoose.Types.ObjectId;
163
163
  } & {
@@ -219,11 +219,11 @@ declare const demographicsSchema: Schema<any, mongoose.Model<any, any, any, any,
219
219
  raceOtherText?: string | null | undefined;
220
220
  genderOtherText?: string | null | undefined;
221
221
  accommodationOtherText?: string | null | undefined;
222
- ageDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
223
- sexDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
224
- genderDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
225
- raceDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
226
- ethnicityDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
222
+ ageDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
223
+ sexDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
224
+ genderDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
225
+ raceDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
226
+ ethnicityDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
227
227
  }, mongoose.Document<unknown, {}, {
228
228
  race: number[];
229
229
  ethnicity: number[];
@@ -243,11 +243,11 @@ declare const demographicsSchema: Schema<any, mongoose.Model<any, any, any, any,
243
243
  raceOtherText?: string | null | undefined;
244
244
  genderOtherText?: string | null | undefined;
245
245
  accommodationOtherText?: string | null | undefined;
246
- ageDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
247
- sexDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
248
- genderDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
249
- raceDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
250
- ethnicityDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
246
+ ageDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
247
+ sexDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
248
+ genderDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
249
+ raceDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
250
+ ethnicityDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
251
251
  }, {
252
252
  id: string;
253
253
  }, mongoose.MergeType<mongoose.DefaultSchemaOptions, {
@@ -271,11 +271,11 @@ declare const demographicsSchema: Schema<any, mongoose.Model<any, any, any, any,
271
271
  raceOtherText?: string | null | undefined;
272
272
  genderOtherText?: string | null | undefined;
273
273
  accommodationOtherText?: string | null | undefined;
274
- ageDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
275
- sexDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
276
- genderDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
277
- raceDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
278
- ethnicityDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
274
+ ageDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
275
+ sexDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
276
+ genderDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
277
+ raceDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
278
+ ethnicityDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
279
279
  } & {
280
280
  _id: mongoose.Types.ObjectId;
281
281
  } & {
@@ -301,11 +301,11 @@ declare const demographicsSchema: Schema<any, mongoose.Model<any, any, any, any,
301
301
  raceOtherText?: string | null | undefined;
302
302
  genderOtherText?: string | null | undefined;
303
303
  accommodationOtherText?: string | null | undefined;
304
- ageDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
305
- sexDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
306
- genderDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
307
- raceDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
308
- ethnicityDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
304
+ ageDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
305
+ sexDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
306
+ genderDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
307
+ raceDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
308
+ ethnicityDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
309
309
  } & {
310
310
  _id: mongoose.Types.ObjectId;
311
311
  } & {
@@ -1,6 +1,6 @@
1
1
  import * as mongoose from 'mongoose';
2
2
  import { InferRawDocType, Schema } from 'mongoose';
3
- export { C as Choice, a as CvcEntry, b as CvcRegistry, F as Form, c as FormSectionRef, G as Guidance, L as Layout, P as PlatformFunction, d as PlatformRole, Q as Question, S as ScoringCondition, e as ScoringRecommendation, f as ScoringRule, g as ScoringThreshold, h as Section, i as SectionQuestionRef, V as VisibilityRule, j as buildCvcEntrySchema, k as buildCvcRegistrySchema, l as buildFormSchema, m as buildPlatformFunctionSchema, n as buildPlatformRoleSchema, o as buildQuestionSchema, p as buildScoringRuleSchema, q as buildSectionSchema, r as choiceSchema, s as cvcEntrySchemaDefinition, t as cvcEntrySchemaOptions, u as cvcRegistrySchemaDefinition, v as cvcRegistrySchemaOptions, w as formSchemaDefinition, x as formSchemaOptions, y as formSectionRefSchema, z as guidanceSchema, A as layoutSchema, B as platformFunctionSchemaDefinition, D as platformFunctionSchemaOptions, E as platformRoleSchemaDefinition, H as platformRoleSchemaOptions, I as questionSchemaDefinition, J as questionSchemaOptions, K as scoringConditionSchema, M as scoringRecommendationSchema, N as scoringRuleSchemaDefinition, O as scoringRuleSchemaOptions, R as scoringThresholdSchema, T as sectionQuestionRefSchema, U as sectionSchemaDefinition, W as sectionSchemaOptions, X as visibilityRuleSchema } from '../cvcEntry-ctHTp2df.js';
3
+ export { C as Choice, a as CvcEntry, b as CvcRegistry, F as Form, c as FormSectionRef, G as Guidance, L as Layout, P as PlatformFunction, d as PlatformRole, Q as Question, S as ScoringCondition, e as ScoringRecommendation, f as ScoringRule, g as ScoringThreshold, h as Section, i as SectionQuestionRef, V as VisibilityRule, j as buildCvcEntrySchema, k as buildCvcRegistrySchema, l as buildFormSchema, m as buildPlatformFunctionSchema, n as buildPlatformRoleSchema, o as buildQuestionSchema, p as buildScoringRuleSchema, q as buildSectionSchema, r as choiceSchema, s as cvcEntrySchemaDefinition, t as cvcEntrySchemaOptions, u as cvcRegistrySchemaDefinition, v as cvcRegistrySchemaOptions, w as formSchemaDefinition, x as formSchemaOptions, y as formSectionRefSchema, z as guidanceSchema, A as layoutSchema, B as platformFunctionSchemaDefinition, D as platformFunctionSchemaOptions, E as platformRoleSchemaDefinition, H as platformRoleSchemaOptions, I as questionSchemaDefinition, J as questionSchemaOptions, K as scoringConditionSchema, M as scoringRecommendationSchema, N as scoringRuleSchemaDefinition, O as scoringRuleSchemaOptions, R as scoringThresholdSchema, T as sectionQuestionRefSchema, U as sectionSchemaDefinition, W as sectionSchemaOptions, X as visibilityRuleSchema } from '../cvcEntry-DaDrEuTa.js';
4
4
 
5
5
  declare const addressSchema: Schema<any, mongoose.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, {
6
6
  _id: false;
@@ -132,12 +132,12 @@ declare const phoneSchema: Schema<any, mongoose.Model<any, any, any, any, any, a
132
132
  number?: string | null | undefined;
133
133
  type?: string | null | undefined;
134
134
  safeToContact?: boolean | null | undefined;
135
- dataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
135
+ dataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
136
136
  }, mongoose.Document<unknown, {}, {
137
137
  number?: string | null | undefined;
138
138
  type?: string | null | undefined;
139
139
  safeToContact?: boolean | null | undefined;
140
- dataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
140
+ dataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
141
141
  }, {
142
142
  id: string;
143
143
  }, mongoose.MergeType<mongoose.DefaultSchemaOptions, {
@@ -146,7 +146,7 @@ declare const phoneSchema: Schema<any, mongoose.Model<any, any, any, any, any, a
146
146
  number?: string | null | undefined;
147
147
  type?: string | null | undefined;
148
148
  safeToContact?: boolean | null | undefined;
149
- dataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
149
+ dataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
150
150
  } & {
151
151
  _id: mongoose.Types.ObjectId;
152
152
  } & {
@@ -157,7 +157,7 @@ declare const phoneSchema: Schema<any, mongoose.Model<any, any, any, any, any, a
157
157
  number?: string | null | undefined;
158
158
  type?: string | null | undefined;
159
159
  safeToContact?: boolean | null | undefined;
160
- dataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
160
+ dataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
161
161
  } & {
162
162
  _id: mongoose.Types.ObjectId;
163
163
  } & {
@@ -219,11 +219,11 @@ declare const demographicsSchema: Schema<any, mongoose.Model<any, any, any, any,
219
219
  raceOtherText?: string | null | undefined;
220
220
  genderOtherText?: string | null | undefined;
221
221
  accommodationOtherText?: string | null | undefined;
222
- ageDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
223
- sexDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
224
- genderDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
225
- raceDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
226
- ethnicityDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
222
+ ageDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
223
+ sexDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
224
+ genderDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
225
+ raceDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
226
+ ethnicityDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
227
227
  }, mongoose.Document<unknown, {}, {
228
228
  race: number[];
229
229
  ethnicity: number[];
@@ -243,11 +243,11 @@ declare const demographicsSchema: Schema<any, mongoose.Model<any, any, any, any,
243
243
  raceOtherText?: string | null | undefined;
244
244
  genderOtherText?: string | null | undefined;
245
245
  accommodationOtherText?: string | null | undefined;
246
- ageDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
247
- sexDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
248
- genderDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
249
- raceDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
250
- ethnicityDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
246
+ ageDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
247
+ sexDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
248
+ genderDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
249
+ raceDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
250
+ ethnicityDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
251
251
  }, {
252
252
  id: string;
253
253
  }, mongoose.MergeType<mongoose.DefaultSchemaOptions, {
@@ -271,11 +271,11 @@ declare const demographicsSchema: Schema<any, mongoose.Model<any, any, any, any,
271
271
  raceOtherText?: string | null | undefined;
272
272
  genderOtherText?: string | null | undefined;
273
273
  accommodationOtherText?: string | null | undefined;
274
- ageDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
275
- sexDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
276
- genderDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
277
- raceDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
278
- ethnicityDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
274
+ ageDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
275
+ sexDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
276
+ genderDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
277
+ raceDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
278
+ ethnicityDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
279
279
  } & {
280
280
  _id: mongoose.Types.ObjectId;
281
281
  } & {
@@ -301,11 +301,11 @@ declare const demographicsSchema: Schema<any, mongoose.Model<any, any, any, any,
301
301
  raceOtherText?: string | null | undefined;
302
302
  genderOtherText?: string | null | undefined;
303
303
  accommodationOtherText?: string | null | undefined;
304
- ageDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
305
- sexDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
306
- genderDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
307
- raceDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
308
- ethnicityDataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | null | undefined;
304
+ ageDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
305
+ sexDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
306
+ genderDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
307
+ raceDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
308
+ ethnicityDataQuality?: "client_doesnt_know" | "client_prefers_not_to_answer" | "data_not_collected" | null | undefined;
309
309
  } & {
310
310
  _id: mongoose.Types.ObjectId;
311
311
  } & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@htilabs/platform-common-models",
3
- "version": "0.12.3",
3
+ "version": "0.12.4",
4
4
  "description": "Shared constants, types, and models for HTI Labs applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -156,7 +156,7 @@
156
156
  },
157
157
  "location_type": {
158
158
  "count": 17,
159
- "hash": "72d6fd6e89c8ffd2f2ab1682a3ed2ea52d73cfb41c635f7af6334078c0f4b959"
159
+ "hash": "18375cd14466851a6bcbd9bf3c37c28568d77cf6e26dc9ec76fa297900e9fbe6"
160
160
  },
161
161
  "referral_entity_category": {
162
162
  "count": 43,
@@ -703,8 +703,8 @@
703
703
  "hash": "9d8972c65373a9981aab6b8749661659ecc632004e67bc9c2b3c88aa76f30977"
704
704
  },
705
705
  "core_information_scope": {
706
- "count": 71,
707
- "hash": "30fbeeefc9515e5efbfff6dded12fafb554fe47590d217ccc5b51aef83eafaf9"
706
+ "count": 72,
707
+ "hash": "452561ad017b567f82f448bae1edbc482b8a6ef06b8ecdff3171edd46bec13b4"
708
708
  }
709
709
  }
710
710
  }
@@ -5,7 +5,7 @@
5
5
  * Two vocabularies describe the same thing at different grains:
6
6
  *
7
7
  * `roi_scope` flat item vocabulary, 27 substantive keys, no category axis
8
- * `core_information_scope` 12 policy-grain CATEGORIES + 55 authorization-grain UNITS
8
+ * `core_information_scope` 12 policy-grain CATEGORIES + 56 authorization-grain UNITS
9
9
  *
10
10
  * PAVE and Thread are both pinned to `roi_scope` today, and both persist stored
11
11
  * ROIs against it. Migrating them to this domain is safe for exactly one reason:
@@ -90,7 +90,7 @@ describe("core_information_scope — adoption invariants", () => {
90
90
 
91
91
  it("is a strict superset — the additions are additions, not renames", () => {
92
92
  expect(units.length).toBeGreaterThan(27);
93
- expect(units).toHaveLength(55);
93
+ expect(units).toHaveLength(56);
94
94
  });
95
95
 
96
96
  it("keeps the two grains distinct: categories decide policy, units carry consent", () => {
@@ -168,7 +168,7 @@ const PUBLISHED: ReadonlyArray<readonly [string, readonly string[]]> = [
168
168
  "derived_risk_signals",
169
169
  ],
170
170
  ],
171
- ["contact", ["contact_info", "safe_locations", "priorities_safety"]],
171
+ ["contact", ["contact_info", "safe_locations", "priorities_safety", "encounter_location"]],
172
172
  ["services", ["contact_history", "service_history", "plans_goals"]],
173
173
  ["notes", ["screen_notes", "case_notes", "background"]],
174
174
  [
@@ -255,3 +255,57 @@ describe("core_information_scope — priorities_safety (2026-09-29)", () => {
255
255
  expect(unit?.appRelevance).toEqual(["PAVE", "Thread"]);
256
256
  });
257
257
  });
258
+
259
+ /**
260
+ * `encounter_location` — canon CVC-236 amendment 2026-10-01
261
+ * (LOCATION-TYPE-LOGIC, Crysta R2; prototype `data/cvcs/
262
+ * core_information_scope.yaml` @ 55088d44). The session's own location
263
+ * entries — where the advocate met the survivor, or where the incident
264
+ * happened (CVC-191 reasons MEET_LOC + INCIDENT) — belonged to no person, so no
265
+ * share could reach them, and Thread was sending every session location under
266
+ * the `addresses` pick. They now ride this one unit.
267
+ */
268
+ describe("core_information_scope — encounter_location (2026-10-01)", () => {
269
+ const unit = byKey.get("encounter_location");
270
+
271
+ it("is ONE selectable unit under Contact & safety, appended at the next contact slot", () => {
272
+ expect(unit).toBeDefined();
273
+ expect(unit?.code).toBe("236-003-004-000-000-000-000");
274
+ expect(unit?.selectable).toBe(true);
275
+ expect(unit?.parentCode).toBe(byKey.get("contact")?.code);
276
+ // Appended after priorities_safety: no published contact code moved.
277
+ expect(byKey.get("contact")?.childCodes).toEqual([
278
+ "236-003-001-000-000-000-000",
279
+ "236-003-002-000-000-000-000",
280
+ "236-003-003-000-000-000-000",
281
+ "236-003-004-000-000-000-000",
282
+ ]);
283
+ // R2: one new unit. No second "residence" unit — residence vs. incident
284
+ // is already split by the CVC-191 reason.
285
+ expect(
286
+ scope.entries.filter((e) => e.key.includes("encounter")).map((e) => e.key),
287
+ ).toEqual(["encounter_location"]);
288
+ });
289
+
290
+ it("carries canon's posture: shareable by default, never the platform floor", () => {
291
+ // R2: where the survivor was found or met is the safety fact the next
292
+ // advocate needs, so the picker pre-checks it.
293
+ expect(unit?.shareableDefault).toBe(true);
294
+ // The floor stays on safe_locations alone; a shelter address picked as an
295
+ // encounter location is still caught by the floor, not by this unit.
296
+ expect(unit?.platformFloor).toBeUndefined();
297
+ expect(unit?.required).toBeUndefined();
298
+ expect(unit?.levelFloor).toBe(3);
299
+ expect(unit?.specialDataType).toBe("survivor_confidential");
300
+ expect(unit?.appRelevance).toEqual(["PAVE", "Thread"]);
301
+ });
302
+
303
+ it("leaves addresses where it was: the survivor's own whereabouts keep riding it", () => {
304
+ // R3: addresses keeps its code and posture; only its definition gains the
305
+ // type-grain routing note.
306
+ const addresses = byKey.get("addresses");
307
+ expect(addresses?.code).toBe("236-001-003-000-000-000-000");
308
+ expect(addresses?.shareableDefault).toBe(true);
309
+ expect(addresses?.platformFloor).toBeUndefined();
310
+ });
311
+ });
@@ -724,14 +724,15 @@ const SOT_SPECS: readonly SotSpec[] = [
724
724
  // 3 substantive age bands (@pave/domain AGE_BANDS_AT_EVENT minus `unknown`,
725
725
  // which maps to the missingness sentinel) + 4 missingness = 7
726
726
  { file: "minorAdultStatus.v1.0.0.json", domain: "minor_adult_status", expectedCount: 7 },
727
- // CVC-236 — 12 policy-grain categories + 55 authorization-grain units
728
- // (priorities_safety, 236-003-003, added 2026-09-29) + 1 missingness root + 3
729
- // workspace-standard missingness children = 71. Generated by
727
+ // CVC-236 — 12 policy-grain categories + 56 authorization-grain units
728
+ // (priorities_safety, 236-003-003, added 2026-09-29; encounter_location,
729
+ // 236-003-004, added 2026-10-01) + 1 missingness root + 3
730
+ // workspace-standard missingness children = 72. Generated by
730
731
  // scripts/gen-core-information-scope.py; codes are FROZEN there.
731
732
  {
732
733
  file: "coreInformationScope.v1.0.0.json",
733
734
  domain: "core_information_scope",
734
- expectedCount: 71,
735
+ expectedCount: 72,
735
736
  },
736
737
  ] as const;
737
738
 
@@ -0,0 +1,202 @@
1
+ /**
2
+ * LOCATION TYPE (CVC-191) — the location reason carries the share routing
3
+ * ======================================================================
4
+ *
5
+ * Canon amendment 2026-10-01 (LOCATION-TYPE-LOGIC, Crysta R1–R4; prototype
6
+ * `data/cvcs/core_location_type.yaml` + the `Final CVCs/Location (IC-4)`
7
+ * codebook extracts @ 55088d44). Every location reason declares five columns:
8
+ * tier · anchors · anchor default · the CVC-236 unit it rides on a share ·
9
+ * safety default. Share routing for the address family moved from the
10
+ * assertion-domain grain (every location under `addresses`) to the TYPE grain:
11
+ * a stored location is delivered under the unit its reason names, and a reason
12
+ * that names nothing is never delivered.
13
+ *
14
+ * That makes `shareUnit` a consent fact. A reason that silently starts riding a
15
+ * broader unit sends a location the survivor never authorized for that pick, so
16
+ * the full routing table is pinned here, not just its shape.
17
+ *
18
+ * `scripts/gen-location-type.py` OVERLAYS these columns on the rows published
19
+ * 2026-04-22. It never adds, removes, re-keys or renumbers a row. Canon's eight
20
+ * rows the package does not publish (the trafficking, birthplace and legal
21
+ * reasons ratified 2026-08-28) are reported by that script, not absorbed.
22
+ */
23
+
24
+ import { readFileSync } from "node:fs";
25
+ import path from "node:path";
26
+ import { fileURLToPath } from "node:url";
27
+
28
+ import { describe, it, expect } from "vitest";
29
+
30
+ const here = path.dirname(fileURLToPath(import.meta.url));
31
+ const cvcDir = path.join(here, "..", "cvcs");
32
+
33
+ interface Entry {
34
+ code: string;
35
+ key: string;
36
+ selectable: boolean;
37
+ parentCode: string | null;
38
+ tier?: string;
39
+ anchors?: string[];
40
+ anchorDefault?: string | null;
41
+ shareUnit?: string | null;
42
+ safetyDefault?: string | null;
43
+ }
44
+
45
+ const read = (f: string): { entries: Entry[]; _source?: string } =>
46
+ JSON.parse(readFileSync(path.join(cvcDir, f), "utf8")) as {
47
+ entries: Entry[];
48
+ _source?: string;
49
+ };
50
+
51
+ const lt = read("locationType.v1.0.0.json");
52
+ const scope = read("coreInformationScope.v1.0.0.json");
53
+ const byKey = new Map(lt.entries.map((e) => [e.key, e]));
54
+ const scopeByKey = new Map(scope.entries.map((e) => [e.key, e]));
55
+ const reasons = lt.entries.filter((e) => e.key !== "missingness_root");
56
+
57
+ const SENTINELS = ["unknown", "anonymous", "data_not_collected"];
58
+
59
+ /**
60
+ * The published rows, at their frozen positional codes. The overlay may not
61
+ * move them; a new canon row joins only by appending, in its own change.
62
+ */
63
+ const PUBLISHED: ReadonlyArray<readonly [string, string]> = [
64
+ ["191-000-000-000-000-000-000", "missingness_root"],
65
+ ["191-000-000-000-000-000-001", "unknown"],
66
+ ["191-000-000-000-000-000-002", "anonymous"],
67
+ ["191-000-000-000-000-000-003", "data_not_collected"],
68
+ ["191-001-000-000-000-000-000", "current_residence"],
69
+ ["191-002-000-000-000-000-000", "service_delivery_location"],
70
+ ["191-003-000-000-000-000-000", "current_client_location"],
71
+ ["191-004-000-000-000-000-000", "meet_contact_location"],
72
+ ["191-005-000-000-000-000-000", "prior_residence"],
73
+ ["191-006-000-000-000-000-000", "jurisdiction_routing_location"],
74
+ ["191-007-000-000-000-000-000", "ad_location_derived"],
75
+ ["191-008-000-000-000-000-000", "travel_stop_visit"],
76
+ ["191-009-000-000-000-000-000", "work_school_business"],
77
+ ["191-010-000-000-000-000-000", "ip_derived_location"],
78
+ ["191-011-000-000-000-000-000", "program_project_location"],
79
+ ["191-012-000-000-000-000-000", "other"],
80
+ ["191-013-000-000-000-000-000", "incident"],
81
+ ];
82
+
83
+ /**
84
+ * Canon's routing for every published reason (the codebook's "Rides on a share
85
+ * (CVC-236)" column, R1). `null` = never delivered on a share.
86
+ */
87
+ const ROUTING: Record<string, string | null> = {
88
+ unknown: null,
89
+ anonymous: null,
90
+ data_not_collected: null,
91
+ current_residence: "addresses",
92
+ prior_residence: "addresses",
93
+ current_client_location: "addresses",
94
+ jurisdiction_routing_location: "addresses",
95
+ travel_stop_visit: "addresses",
96
+ work_school_business: "addresses",
97
+ other: "addresses",
98
+ meet_contact_location: "encounter_location",
99
+ incident: "encounter_location",
100
+ service_delivery_location: "service_history",
101
+ program_project_location: null,
102
+ ad_location_derived: "commercial_activity",
103
+ ip_derived_location: "commercial_activity",
104
+ };
105
+
106
+ describe("location_type — published rows never move", () => {
107
+ it("keeps every published row at its frozen code, and adds none", () => {
108
+ expect(lt.entries.map((e) => [e.code, e.key])).toEqual(PUBLISHED);
109
+ });
110
+
111
+ it("pins the overlay's provenance to canon, and names what it did not absorb", () => {
112
+ expect(lt._source).toContain("data/cvcs/core_location_type.yaml @ 55088d44");
113
+ expect(lt._source).toContain("NOT absorbed: 8 canon rows");
114
+ });
115
+ });
116
+
117
+ describe("location_type — every reason declares the five logic columns", () => {
118
+ it("carries all five columns on every reason, and none on the missingness root", () => {
119
+ for (const e of reasons) {
120
+ for (const f of ["tier", "anchors", "anchorDefault", "shareUnit", "safetyDefault"]) {
121
+ expect(e, `${e.key} lacks ${f}`).toHaveProperty(f);
122
+ }
123
+ }
124
+ expect(byKey.get("missingness_root")).not.toHaveProperty("tier");
125
+ });
126
+
127
+ it("draws each column from canon's closed value sets", () => {
128
+ const TIERS = ["residence", "encounter", "trafficking", "legal", "service", "derived", "sentinel"];
129
+ const ANCHORS = ["person", "session", "event", "service_instance", "agency_program"];
130
+ for (const e of reasons) {
131
+ expect(TIERS, e.key).toContain(e.tier);
132
+ for (const a of e.anchors ?? []) expect(ANCHORS, e.key).toContain(a);
133
+ expect([null, "ask", "unsafe", "safe"], e.key).toContain(e.safetyDefault);
134
+ }
135
+ });
136
+
137
+ it("lands a bare pick on one of the reason's own anchors", () => {
138
+ for (const e of reasons) {
139
+ if (e.anchorDefault === null) continue;
140
+ expect(e.anchors, e.key).toContain(e.anchorDefault);
141
+ }
142
+ });
143
+
144
+ it("treats the missingness sentinels as carrying no place", () => {
145
+ for (const k of SENTINELS) {
146
+ const e = byKey.get(k);
147
+ expect(e?.tier).toBe("sentinel");
148
+ expect(e?.anchors).toEqual([]);
149
+ expect(e?.anchorDefault).toBeNull();
150
+ expect(e?.shareUnit).toBeNull();
151
+ expect(e?.safetyDefault).toBeNull();
152
+ }
153
+ });
154
+ });
155
+
156
+ describe("location_type — share routing at type grain (R1/R2)", () => {
157
+ it("routes every published reason exactly as canon declares", () => {
158
+ expect(Object.fromEntries(reasons.map((e) => [e.key, e.shareUnit]))).toEqual(ROUTING);
159
+ });
160
+
161
+ it("names only CVC-236 keys the package publishes", () => {
162
+ for (const e of reasons) {
163
+ if (e.shareUnit === null) continue;
164
+ expect(scopeByKey.has(e.shareUnit as string), `${e.key} -> ${e.shareUnit}`).toBe(true);
165
+ }
166
+ });
167
+
168
+ it("names an authorization-grain UNIT, except canon's two LEADS-only derived reasons", () => {
169
+ // Canon's column names the category `commercial_activity` (not one of its
170
+ // units) for the two machine-derived reasons. Carried verbatim; a consumer
171
+ // authorizing at unit grain must resolve it as the category.
172
+ const isCategory = (k: string): boolean => scopeByKey.get(k)?.selectable === false;
173
+ const atCategory = reasons
174
+ .filter((e) => e.shareUnit !== null && isCategory(e.shareUnit as string))
175
+ .map((e) => e.key)
176
+ .sort();
177
+ expect(atCategory).toEqual(["ad_location_derived", "ip_derived_location"]);
178
+ });
179
+
180
+ it("sends only the session/event encounter reasons under encounter_location", () => {
181
+ const enc = reasons.filter((e) => e.shareUnit === "encounter_location");
182
+ expect(enc.map((e) => e.key).sort()).toEqual(["incident", "meet_contact_location"]);
183
+ // Meet / contact is the session card's Meetup role: session-anchored by default.
184
+ expect(byKey.get("meet_contact_location")?.anchorDefault).toBe("session");
185
+ expect(byKey.get("incident")?.anchorDefault).toBe("event");
186
+ expect(scopeByKey.get("encounter_location")?.selectable).toBe(true);
187
+ });
188
+
189
+ it("never delivers the agency's own program site, and presets it safe (R3)", () => {
190
+ const prog = byKey.get("program_project_location");
191
+ expect(prog?.shareUnit).toBeNull();
192
+ expect(prog?.anchors).toEqual(["agency_program"]);
193
+ expect(prog?.safetyDefault).toBe("safe");
194
+ });
195
+
196
+ it("keeps the survivor's own whereabouts on addresses", () => {
197
+ for (const k of ["current_client_location", "travel_stop_visit", "current_residence"]) {
198
+ expect(byKey.get(k)?.shareUnit, k).toBe("addresses");
199
+ expect(byKey.get(k)?.anchorDefault, k).toBe("person");
200
+ }
201
+ });
202
+ });