@htilabs/platform-common-models 0.12.4 → 0.13.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 +599 -129
- package/dist/cvcs/index.cjs.map +1 -1
- package/dist/cvcs/index.d.cts +865 -391
- package/dist/cvcs/index.d.ts +865 -391
- package/dist/cvcs/index.js +599 -129
- package/dist/cvcs/index.js.map +1 -1
- package/dist/enums/index.cjs +17 -16
- package/dist/enums/index.cjs.map +1 -1
- package/dist/enums/index.d.cts +17 -16
- package/dist/enums/index.d.ts +17 -16
- package/dist/enums/index.js +17 -16
- package/dist/enums/index.js.map +1 -1
- package/dist/{index-C0J3f169.d.ts → index-4DiJrn7y.d.ts} +1 -1
- package/dist/{index-EPjPjR0z.d.cts → index-qreOzXYS.d.cts} +1 -1
- package/dist/index.cjs +616 -145
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +616 -145
- package/dist/index.js.map +1 -1
- package/dist/models/index.d.cts +2 -2
- package/dist/models/index.d.ts +2 -2
- package/dist/schemas/index.d.cts +25 -25
- package/dist/schemas/index.d.ts +25 -25
- package/package.json +1 -1
- package/src/__tests__/__snapshots__/cvc-sot.snap +3 -3
- package/src/__tests__/core-information-scope-invariant.test.ts +28 -0
- package/src/__tests__/cvc-sot-snapshot.test.ts +6 -3
- package/src/__tests__/cvc-structural.test.ts +1 -1
- package/src/__tests__/victim-abuse-types-canon.test.ts +301 -0
- package/src/cvcs/coreInformationScope.v1.0.0.json +3 -3
- package/src/cvcs/index.ts +1 -1
- package/src/cvcs/victimAbuseTypes.v1.1.0.json +744 -0
- package/src/generated/cvc-enums.ts +17 -16
- package/src/cvcs/victimAbuseTypes.v1.0.0.json +0 -276
- package/dist/{cvcEntry-DaDrEuTa.d.cts → cvcEntry-ctHTp2df.d.cts} +8 -8
- package/dist/{cvcEntry-DaDrEuTa.d.ts → cvcEntry-ctHTp2df.d.ts} +8 -8
package/dist/models/index.d.cts
CHANGED
|
@@ -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-
|
|
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';
|
|
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-
|
|
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';
|
package/dist/models/index.d.ts
CHANGED
|
@@ -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-
|
|
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';
|
|
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-
|
|
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';
|
package/dist/schemas/index.d.cts
CHANGED
|
@@ -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-
|
|
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';
|
|
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?: "
|
|
135
|
+
dataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | 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?: "
|
|
140
|
+
dataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | 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?: "
|
|
149
|
+
dataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | 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?: "
|
|
160
|
+
dataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | 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?: "
|
|
223
|
-
sexDataQuality?: "
|
|
224
|
-
genderDataQuality?: "
|
|
225
|
-
raceDataQuality?: "
|
|
226
|
-
ethnicityDataQuality?: "
|
|
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;
|
|
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?: "
|
|
247
|
-
sexDataQuality?: "
|
|
248
|
-
genderDataQuality?: "
|
|
249
|
-
raceDataQuality?: "
|
|
250
|
-
ethnicityDataQuality?: "
|
|
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;
|
|
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?: "
|
|
275
|
-
sexDataQuality?: "
|
|
276
|
-
genderDataQuality?: "
|
|
277
|
-
raceDataQuality?: "
|
|
278
|
-
ethnicityDataQuality?: "
|
|
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;
|
|
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?: "
|
|
305
|
-
sexDataQuality?: "
|
|
306
|
-
genderDataQuality?: "
|
|
307
|
-
raceDataQuality?: "
|
|
308
|
-
ethnicityDataQuality?: "
|
|
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;
|
|
309
309
|
} & {
|
|
310
310
|
_id: mongoose.Types.ObjectId;
|
|
311
311
|
} & {
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -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-
|
|
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';
|
|
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?: "
|
|
135
|
+
dataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | 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?: "
|
|
140
|
+
dataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | 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?: "
|
|
149
|
+
dataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | 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?: "
|
|
160
|
+
dataQuality?: "data_not_collected" | "client_doesnt_know" | "client_prefers_not_to_answer" | 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?: "
|
|
223
|
-
sexDataQuality?: "
|
|
224
|
-
genderDataQuality?: "
|
|
225
|
-
raceDataQuality?: "
|
|
226
|
-
ethnicityDataQuality?: "
|
|
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;
|
|
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?: "
|
|
247
|
-
sexDataQuality?: "
|
|
248
|
-
genderDataQuality?: "
|
|
249
|
-
raceDataQuality?: "
|
|
250
|
-
ethnicityDataQuality?: "
|
|
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;
|
|
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?: "
|
|
275
|
-
sexDataQuality?: "
|
|
276
|
-
genderDataQuality?: "
|
|
277
|
-
raceDataQuality?: "
|
|
278
|
-
ethnicityDataQuality?: "
|
|
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;
|
|
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?: "
|
|
305
|
-
sexDataQuality?: "
|
|
306
|
-
genderDataQuality?: "
|
|
307
|
-
raceDataQuality?: "
|
|
308
|
-
ethnicityDataQuality?: "
|
|
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;
|
|
309
309
|
} & {
|
|
310
310
|
_id: mongoose.Types.ObjectId;
|
|
311
311
|
} & {
|
package/package.json
CHANGED
|
@@ -491,8 +491,8 @@
|
|
|
491
491
|
"hash": "93b7a0f327edbc77553c7ebee01f3ac59e1fe9b939cc930588d88704efd8274f"
|
|
492
492
|
},
|
|
493
493
|
"victim_abuse_types": {
|
|
494
|
-
"count":
|
|
495
|
-
"hash": "
|
|
494
|
+
"count": 30,
|
|
495
|
+
"hash": "43ae622bb332e730aa3c8d9a6ba3d563d7f472b286bb21478c52509b881e64c6"
|
|
496
496
|
},
|
|
497
497
|
"ht_type": {
|
|
498
498
|
"count": 8,
|
|
@@ -704,7 +704,7 @@
|
|
|
704
704
|
},
|
|
705
705
|
"core_information_scope": {
|
|
706
706
|
"count": 72,
|
|
707
|
-
"hash": "
|
|
707
|
+
"hash": "9269401b4bcefccfffc490899bcd4c6faf021383ec6c5a0fda5680ed888eaf49"
|
|
708
708
|
}
|
|
709
709
|
}
|
|
710
710
|
}
|
|
@@ -309,3 +309,31 @@ describe("core_information_scope — encounter_location (2026-10-01)", () => {
|
|
|
309
309
|
expect(addresses?.platformFloor).toBeUndefined();
|
|
310
310
|
});
|
|
311
311
|
});
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* `safe_locations` — RATIFIED 2026-09-08 (CVC236-AUDIT R1, Crysta; prototype
|
|
315
|
+
* `data/cvcs/core_information_scope.yaml` @ 46a60114, lines 72-75 + 310-311).
|
|
316
|
+
* The id and label are canon and the row is minted in the Notion codebook, so
|
|
317
|
+
* the PROVISIONAL marker the package published from 2026-08-18 is retired.
|
|
318
|
+
* The code, label and posture did not change: only the wording did.
|
|
319
|
+
*/
|
|
320
|
+
describe("core_information_scope — safe_locations ratified (2026-09-08)", () => {
|
|
321
|
+
const raw = JSON.parse(
|
|
322
|
+
readFileSync(path.join(cvcDir, "coreInformationScope.v1.0.0.json"), "utf8"),
|
|
323
|
+
) as { _status: string; entries: (Entry & { title: string; definition: string })[] };
|
|
324
|
+
const unit = raw.entries.find((e) => e.key === "safe_locations");
|
|
325
|
+
|
|
326
|
+
it("keeps its published code, label and platform-floor posture", () => {
|
|
327
|
+
expect(unit?.code).toBe("236-003-002-000-000-000-000");
|
|
328
|
+
expect(unit?.title).toBe("Safe & confidential locations");
|
|
329
|
+
expect(unit?.platformFloor).toBe(true);
|
|
330
|
+
expect(unit?.shareableDefault).toBe(false);
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
it("no longer reads as provisional, in its definition or in the domain status", () => {
|
|
334
|
+
expect(unit?.definition).not.toMatch(/PROVISIONAL vocabulary/);
|
|
335
|
+
expect(unit?.definition).toContain("RATIFIED 2026-09-08 (CVC236-AUDIT R1, Crysta)");
|
|
336
|
+
expect(raw._status).not.toMatch(/`safe_locations` is PROVISIONAL/);
|
|
337
|
+
expect(raw._status).toContain("`safe_locations` is CANON");
|
|
338
|
+
});
|
|
339
|
+
});
|
|
@@ -573,9 +573,12 @@ const SOT_SPECS: readonly SotSpec[] = [
|
|
|
573
573
|
// missingness root + 3 canonical missingness children = 9. Entries carry
|
|
574
574
|
// an `hmisCode` passthrough field (HMIS numerics 1/2/3/4/5/99).
|
|
575
575
|
{ file: "hmisRelationshipToHoh.v1.0.0.json", domain: "hmis_relationship_to_hoh", expectedCount: 9 },
|
|
576
|
-
// CVC-73 victim_abuse_types —
|
|
577
|
-
//
|
|
578
|
-
|
|
576
|
+
// CVC-73 victim_abuse_types — canon v1.1's 30 victimization / abuse types
|
|
577
|
+
// and NO missingness (canon: "MISSINGNESS: deliberately none"; its gate G3
|
|
578
|
+
// fails on UNK/ANON/DNC). v1.1.0 supersedes the stale 29-entry v1.0.0
|
|
579
|
+
// (25 funder-dialect types + 4 missingness); see
|
|
580
|
+
// victim-abuse-types-canon.test.ts for the key-set pin.
|
|
581
|
+
{ file: "victimAbuseTypes.v1.1.0.json", domain: "victim_abuse_types", expectedCount: 30 },
|
|
579
582
|
// CVC-72 ht_type — 4 substantive types (sex, labor, sex_and_labor, none;
|
|
580
583
|
// `none` = negative determination, canonical per Crysta directive 2026-05-27)
|
|
581
584
|
// + 1 missingness root + 3 canonical missingness children = 8.
|
|
@@ -174,7 +174,7 @@ const SOT_FILES: readonly SotFile[] = [
|
|
|
174
174
|
{ file: "livingSituation.v1.0.0.json", expectedDomain: "living_situation" },
|
|
175
175
|
{ file: "serviceAudience.v1.0.0.json", expectedDomain: "service_audience" },
|
|
176
176
|
{ file: "hmisRelationshipToHoh.v1.0.0.json", expectedDomain: "hmis_relationship_to_hoh" },
|
|
177
|
-
{ file: "victimAbuseTypes.v1.
|
|
177
|
+
{ file: "victimAbuseTypes.v1.1.0.json", expectedDomain: "victim_abuse_types" },
|
|
178
178
|
{ file: "htType.v1.0.0.json", expectedDomain: "ht_type" },
|
|
179
179
|
{ file: "relationshipConcern.v1.0.0.json", expectedDomain: "relationship_concern" },
|
|
180
180
|
{ file: "recencyBand.v1.0.0.json", expectedDomain: "recency_band" },
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VICTIM ABUSE TYPES (CVC-73) — the canon v1.1 key-set pin
|
|
3
|
+
* ========================================================
|
|
4
|
+
*
|
|
5
|
+
* platform-common's CVC-73 mirror shipped STALE through 0.12.4: victimAbuseTypes
|
|
6
|
+
* v1.0.0 carried 25 substantive rows in the CVC-52 FUNDER dialect (adult/child
|
|
7
|
+
* age splits, `domestic_and_or_family_violence`, bare `other`, ...) plus an
|
|
8
|
+
* UNK/ANON/DNC block, while canon had been audited (2026-09-01, CVC73-AUDIT) and
|
|
9
|
+
* amended (2026-09-29, cyber_crimes) to 30 codes with no missingness. Nothing
|
|
10
|
+
* failed, because every gate in this package checks a SOT file against ITSELF
|
|
11
|
+
* (shape, tree, counts it was told) — none knew what canon's keys ARE.
|
|
12
|
+
*
|
|
13
|
+
* This test is that knowledge. The tables below are TRANSCRIBED from canon —
|
|
14
|
+
* htilabstech/prototype `data/cvcs/core_victim_abuse_types.yaml` @ 63913935
|
|
15
|
+
* (read from origin/main @ 06734d05) — NOT derived from the JSON, so a
|
|
16
|
+
* regenerated JSON that drifts from canon fails here instead of silently
|
|
17
|
+
* updating its own expectation. Canon line citations are to that blob:
|
|
18
|
+
*
|
|
19
|
+
* - The 30 codes, in canon row order (yaml `entries:` L185-L458).
|
|
20
|
+
* - "MISSINGNESS: deliberately none" (yaml L51-L57; gate G3 "FAILS if
|
|
21
|
+
* UNK/ANON/DNC appear here").
|
|
22
|
+
* - AGE + RECENCY are reporting gates, not codes (yaml L59-L64, Crysta R2):
|
|
23
|
+
* the adult/child split must NEVER come back as separate keys.
|
|
24
|
+
* - `trafficking_context: true` rows — censused, never counted (yaml L66-L72, R1).
|
|
25
|
+
* - `other_voca_ovc` is the only catch-all, `describe_required` (yaml L450-L458, R3).
|
|
26
|
+
*
|
|
27
|
+
* It also pins the FROZEN positional ordinals: a published ordinal is a
|
|
28
|
+
* concept's identity, never renumbered or reused (gen-victim-abuse-types.py).
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
import { readFileSync } from "node:fs";
|
|
32
|
+
import path from "node:path";
|
|
33
|
+
import { fileURLToPath } from "node:url";
|
|
34
|
+
|
|
35
|
+
import { describe, it, expect } from "vitest";
|
|
36
|
+
|
|
37
|
+
import { VictimAbuseTypesKeys } from "../generated/cvc-enums.js";
|
|
38
|
+
|
|
39
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
40
|
+
const FILE = path.join(here, "..", "cvcs", "victimAbuseTypes.v1.1.0.json");
|
|
41
|
+
|
|
42
|
+
interface Entry {
|
|
43
|
+
code: string;
|
|
44
|
+
key: string;
|
|
45
|
+
title: string;
|
|
46
|
+
selectable: boolean;
|
|
47
|
+
parentCode: string | null;
|
|
48
|
+
childCodes: string[];
|
|
49
|
+
definition: string | null;
|
|
50
|
+
uiGroup: string;
|
|
51
|
+
ageRequired: boolean;
|
|
52
|
+
recencyRequired: boolean;
|
|
53
|
+
traffickingContext: boolean;
|
|
54
|
+
describeRequired: boolean;
|
|
55
|
+
}
|
|
56
|
+
interface Envelope {
|
|
57
|
+
domain: string;
|
|
58
|
+
version: string;
|
|
59
|
+
_status: string;
|
|
60
|
+
_source: string;
|
|
61
|
+
_supersedes: {
|
|
62
|
+
version: string;
|
|
63
|
+
keyMap: Record<string, string | null>;
|
|
64
|
+
retiredCodes: {
|
|
65
|
+
code: string;
|
|
66
|
+
key: string;
|
|
67
|
+
successor: string | null;
|
|
68
|
+
impliedAgeBandAtEvent?: "adult" | "minor";
|
|
69
|
+
}[];
|
|
70
|
+
notes: Record<string, string>;
|
|
71
|
+
};
|
|
72
|
+
uiGroups: { key: string; label: string }[];
|
|
73
|
+
levels: Record<string, string>;
|
|
74
|
+
entries: Entry[];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const env = JSON.parse(readFileSync(FILE, "utf8")) as Envelope;
|
|
78
|
+
const keys = env.entries.map((e) => e.key);
|
|
79
|
+
|
|
80
|
+
/** Canon v1.1 code → frozen ordinal, in canon row order (yaml L186-L450). */
|
|
81
|
+
const CANON: ReadonlyArray<readonly [key: string, ordinal: number]> = [
|
|
82
|
+
["sexual_abuse_assault", 26],
|
|
83
|
+
["domestic_family_violence", 9],
|
|
84
|
+
["stalking_harassment", 22],
|
|
85
|
+
["child_pornography", 7],
|
|
86
|
+
["physical_abuse_or_neglect", 27],
|
|
87
|
+
["physical_assault", 28],
|
|
88
|
+
["commercial_sexual_exploitation_minor", 29],
|
|
89
|
+
["sexual_exploitation", 30],
|
|
90
|
+
["labor_exploitation", 31],
|
|
91
|
+
["teen_dating_victimization", 24],
|
|
92
|
+
["female_genital_mutilation_cutting", 32],
|
|
93
|
+
["forced_marriage", 33],
|
|
94
|
+
["gang_violence", 12],
|
|
95
|
+
["kidnapping_noncustodial", 17],
|
|
96
|
+
["kidnapping_custodial", 16],
|
|
97
|
+
["elder_abuse_or_neglect", 11],
|
|
98
|
+
["bullying", 4],
|
|
99
|
+
["homicide", 14],
|
|
100
|
+
["survivor_of_homicide_victim", 23],
|
|
101
|
+
["hate_crime", 13],
|
|
102
|
+
["robbery", 21],
|
|
103
|
+
["burglary", 5],
|
|
104
|
+
["arson", 3],
|
|
105
|
+
["dui_dwi_incident", 10],
|
|
106
|
+
["identity_theft_fraud_financial_crime", 15],
|
|
107
|
+
["other_vehicular_victimization", 20],
|
|
108
|
+
["cyber_crimes", 34],
|
|
109
|
+
["terrorism", 25],
|
|
110
|
+
["mass_violence", 18],
|
|
111
|
+
["other_voca_ovc", 19],
|
|
112
|
+
];
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Every key v1.0.0 published (platform-common <= 0.12.4) that is NOT a canon
|
|
116
|
+
* key. None may reappear — each is either a funder-dialect spelling, an age
|
|
117
|
+
* split canon R2 forbids encoding, or a missingness token canon G3 forbids.
|
|
118
|
+
*/
|
|
119
|
+
const RETIRED_V1_0_0_KEYS = [
|
|
120
|
+
"missingness_root",
|
|
121
|
+
"unknown",
|
|
122
|
+
"anonymous",
|
|
123
|
+
"data_not_collected",
|
|
124
|
+
"adult_physical_assault",
|
|
125
|
+
"adult_sexual_assault",
|
|
126
|
+
"child_physical_abuse_or_neglect",
|
|
127
|
+
"child_sexual_abuse_assault",
|
|
128
|
+
"domestic_and_or_family_violence",
|
|
129
|
+
"dui_dwi_incidents",
|
|
130
|
+
"elder_abuse",
|
|
131
|
+
"identity_theft",
|
|
132
|
+
"other",
|
|
133
|
+
"other_vehicular",
|
|
134
|
+
"survivors_of_homicide_victims",
|
|
135
|
+
] as const;
|
|
136
|
+
|
|
137
|
+
/** v1.0.0 ordinals whose meaning canon changed — retired, never reused. */
|
|
138
|
+
const RETIRED_ORDINALS = [1, 2, 6, 8] as const;
|
|
139
|
+
|
|
140
|
+
const ord = (n: number): string => `073-${String(n).padStart(3, "0")}-000-000-000-000-000`;
|
|
141
|
+
|
|
142
|
+
describe("CVC-73 victim_abuse_types — canon v1.1 key set", () => {
|
|
143
|
+
it("is the v1.1.0 victim_abuse_types envelope", () => {
|
|
144
|
+
expect(env.domain).toBe("victim_abuse_types");
|
|
145
|
+
expect(env.version).toBe("1.1.0");
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
it("carries exactly canon's 30 keys, in canon row order", () => {
|
|
149
|
+
expect(keys).toEqual(CANON.map(([k]) => k));
|
|
150
|
+
expect(keys).toHaveLength(30);
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
it("every key sits on its FROZEN ordinal", () => {
|
|
154
|
+
const actual = Object.fromEntries(env.entries.map((e) => [e.key, e.code]));
|
|
155
|
+
const expected = Object.fromEntries(CANON.map(([k, n]) => [k, ord(n)]));
|
|
156
|
+
expect(actual).toEqual(expected);
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
it("no retired v1.0.0 ordinal is reused", () => {
|
|
160
|
+
const codes = new Set(env.entries.map((e) => e.code));
|
|
161
|
+
for (const n of RETIRED_ORDINALS) expect(codes.has(ord(n)), ord(n)).toBe(false);
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
it("carries NO missingness (canon L51: 'deliberately none'; G3)", () => {
|
|
165
|
+
expect(env.entries.filter((e) => e.code.split("-")[1] === "000")).toEqual([]);
|
|
166
|
+
expect(Object.keys(env.levels)).toEqual(["1"]);
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
it("no retired v1.0.0 key (funder dialect / age split / missingness) reappears", () => {
|
|
170
|
+
for (const k of RETIRED_V1_0_0_KEYS) expect(keys, k).not.toContain(k);
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
it("every entry is a flat, selectable, defined L1 row", () => {
|
|
174
|
+
for (const e of env.entries) {
|
|
175
|
+
expect(e.selectable, e.key).toBe(true);
|
|
176
|
+
expect(e.parentCode, e.key).toBeNull();
|
|
177
|
+
expect(e.childCodes, e.key).toEqual([]);
|
|
178
|
+
expect(e.definition, e.key).toBeTruthy();
|
|
179
|
+
expect(e.title, e.key).toBeTruthy();
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
describe("CVC-73 — the reporting gates and rulings canon encodes", () => {
|
|
185
|
+
const where = (pred: (e: Entry) => boolean): string[] =>
|
|
186
|
+
env.entries.filter(pred).map((e) => e.key).sort();
|
|
187
|
+
|
|
188
|
+
it("ageRequired marks exactly canon's VOCA age-split codes (R2)", () => {
|
|
189
|
+
expect(where((e) => e.ageRequired)).toEqual(
|
|
190
|
+
[
|
|
191
|
+
"commercial_sexual_exploitation_minor",
|
|
192
|
+
"labor_exploitation",
|
|
193
|
+
"physical_abuse_or_neglect",
|
|
194
|
+
"physical_assault",
|
|
195
|
+
"sexual_abuse_assault",
|
|
196
|
+
"sexual_exploitation",
|
|
197
|
+
].sort(),
|
|
198
|
+
);
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
it("recencyRequired marks exactly the HMIS 4.11 code", () => {
|
|
202
|
+
expect(where((e) => e.recencyRequired)).toEqual(["domestic_family_violence"]);
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
it("traffickingContext marks exactly the three exploitation codes (R1)", () => {
|
|
206
|
+
expect(where((e) => e.traffickingContext)).toEqual(
|
|
207
|
+
["commercial_sexual_exploitation_minor", "labor_exploitation", "sexual_exploitation"].sort(),
|
|
208
|
+
);
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
it("other_voca_ovc is the only catch-all, and requires a description (R3)", () => {
|
|
212
|
+
expect(where((e) => e.describeRequired)).toEqual(["other_voca_ovc"]);
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
it("every uiGroup is one of canon's ui_groups, in canon order (yaml L104-L149)", () => {
|
|
216
|
+
expect(env.uiGroups.map((g) => g.key)).toEqual([
|
|
217
|
+
"common",
|
|
218
|
+
"exploitation",
|
|
219
|
+
"ipv",
|
|
220
|
+
"property",
|
|
221
|
+
"public",
|
|
222
|
+
"other",
|
|
223
|
+
]);
|
|
224
|
+
const groups = new Set(env.uiGroups.map((g) => g.key));
|
|
225
|
+
for (const e of env.entries) expect(groups.has(e.uiGroup), e.key).toBe(true);
|
|
226
|
+
});
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
describe("CVC-73 — supersession of v1.0.0 and provenance", () => {
|
|
230
|
+
it("_supersedes maps EVERY v1.0.0 key, to a live key or null", () => {
|
|
231
|
+
const live = new Set(keys);
|
|
232
|
+
const map = env._supersedes.keyMap;
|
|
233
|
+
expect(env._supersedes.version).toBe("1.0.0");
|
|
234
|
+
// 29 v1.0.0 entries: 4 missingness + 25 substantive.
|
|
235
|
+
expect(Object.keys(map)).toHaveLength(29);
|
|
236
|
+
for (const k of RETIRED_V1_0_0_KEYS) expect(Object.keys(map), k).toContain(k);
|
|
237
|
+
for (const [old, next] of Object.entries(map)) {
|
|
238
|
+
if (next !== null) expect(live.has(next), `${old} -> ${next}`).toBe(true);
|
|
239
|
+
}
|
|
240
|
+
for (const k of ["missingness_root", "unknown", "anonymous", "data_not_collected"]) {
|
|
241
|
+
expect(map[k], k).toBeNull();
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
it("the funder-dialect renames land on canon spellings", () => {
|
|
246
|
+
const map = env._supersedes.keyMap;
|
|
247
|
+
expect(map.domestic_and_or_family_violence).toBe("domestic_family_violence");
|
|
248
|
+
expect(map.adult_sexual_assault).toBe("sexual_abuse_assault");
|
|
249
|
+
expect(map.child_sexual_abuse_assault).toBe("sexual_abuse_assault");
|
|
250
|
+
expect(map.other).toBe("other_voca_ovc");
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
it("each retired age-split code records the age band its key implied", () => {
|
|
254
|
+
// Canon codebook 4: physical_assault Logic Notes "... when age_band_at_event
|
|
255
|
+
// = adult"; physical_abuse_or_neglect Guidance "set age_band_at_event = minor".
|
|
256
|
+
const bands = Object.fromEntries(
|
|
257
|
+
env._supersedes.retiredCodes
|
|
258
|
+
.filter((r) => r.impliedAgeBandAtEvent !== undefined)
|
|
259
|
+
.map((r) => [r.key, r.impliedAgeBandAtEvent]),
|
|
260
|
+
);
|
|
261
|
+
expect(bands).toEqual({
|
|
262
|
+
adult_physical_assault: "adult",
|
|
263
|
+
adult_sexual_assault: "adult",
|
|
264
|
+
child_physical_abuse_or_neglect: "minor",
|
|
265
|
+
child_sexual_abuse_assault: "minor",
|
|
266
|
+
});
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
it("flags that v1.0.0 `other` reads narrower under v1.1.0", () => {
|
|
270
|
+
const note = env._supersedes.notes.other;
|
|
271
|
+
for (const k of [
|
|
272
|
+
"commercial_sexual_exploitation_minor",
|
|
273
|
+
"sexual_exploitation",
|
|
274
|
+
"labor_exploitation",
|
|
275
|
+
"female_genital_mutilation_cutting",
|
|
276
|
+
"forced_marriage",
|
|
277
|
+
"cyber_crimes",
|
|
278
|
+
]) {
|
|
279
|
+
expect(note, k).toContain(k);
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
it("_source pins the canon yaml at a SHA, read from origin/main", () => {
|
|
284
|
+
expect(env._source).toMatch(
|
|
285
|
+
/htilabstech\/prototype\/data\/cvcs\/core_victim_abuse_types\.yaml @ [0-9a-f]{8}/,
|
|
286
|
+
);
|
|
287
|
+
// The ref commit READ is deliberately NOT pinned (it would churn the SOT on
|
|
288
|
+
// every unrelated prototype commit) — only the canon-file commit is.
|
|
289
|
+
expect(env._source).toMatch(/read from origin\/main\)$/);
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
it("_status is a CANONICAL provenance note", () => {
|
|
293
|
+
expect(env._status.startsWith("CANONICAL — Notion CVC-73")).toBe(true);
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
it("the generated VictimAbuseTypesKeys is the same key → code map", () => {
|
|
297
|
+
expect(VictimAbuseTypesKeys).toEqual(
|
|
298
|
+
Object.fromEntries(env.entries.map((e) => [e.key, e.code])),
|
|
299
|
+
);
|
|
300
|
+
});
|
|
301
|
+
});
|