placementt-core 1.400.1076 → 1.400.1077
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/lib/callables/jobRoles.d.ts +33 -1
- package/lib/callables/jobRoles.js +12 -1
- package/lib/callables/jobRoles.js.map +1 -1
- package/lib/callables/registry.d.ts +40 -0
- package/lib/lmi.d.ts +24 -0
- package/lib/lmi.js +30 -0
- package/lib/lmi.js.map +1 -1
- package/lib/typeDefinitions.d.ts +23 -3
- package/lib/typeDefinitions.js.map +1 -1
- package/package.json +1 -1
- package/src/callables/jobRoles.ts +12 -1
- package/src/lmi.ts +30 -0
- package/src/typeDefinitions.ts +26 -3
|
@@ -276,22 +276,31 @@ export declare const jobRolesCallables: {
|
|
|
276
276
|
results: z.ZodArray<z.ZodObject<{
|
|
277
277
|
soc: z.ZodString;
|
|
278
278
|
title: z.ZodString;
|
|
279
|
+
/** The 6-digit sub-unit group this title actually names, where the coding
|
|
280
|
+
* index gave one. Search collapses on this rather than on `soc`, so
|
|
281
|
+
* "Computer games designers" and "Software developers" come back as the two
|
|
282
|
+
* different jobs they are instead of one row for all of SOC 2134. */
|
|
283
|
+
ext: z.ZodOptional<z.ZodString>;
|
|
279
284
|
}, "strip", z.ZodTypeAny, {
|
|
280
285
|
title: string;
|
|
281
286
|
soc: string;
|
|
287
|
+
ext?: string | undefined;
|
|
282
288
|
}, {
|
|
283
289
|
title: string;
|
|
284
290
|
soc: string;
|
|
291
|
+
ext?: string | undefined;
|
|
285
292
|
}>, "many">;
|
|
286
293
|
}, "strip", z.ZodTypeAny, {
|
|
287
294
|
results: {
|
|
288
295
|
title: string;
|
|
289
296
|
soc: string;
|
|
297
|
+
ext?: string | undefined;
|
|
290
298
|
}[];
|
|
291
299
|
}, {
|
|
292
300
|
results: {
|
|
293
301
|
title: string;
|
|
294
302
|
soc: string;
|
|
303
|
+
ext?: string | undefined;
|
|
295
304
|
}[];
|
|
296
305
|
}>;
|
|
297
306
|
};
|
|
@@ -671,48 +680,71 @@ export declare const jobRolesCallables: {
|
|
|
671
680
|
add: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
672
681
|
soc: z.ZodString;
|
|
673
682
|
title: z.ZodString;
|
|
683
|
+
/** The 6-digit sub-unit group this title actually names, where the coding
|
|
684
|
+
* index gave one. Search collapses on this rather than on `soc`, so
|
|
685
|
+
* "Computer games designers" and "Software developers" come back as the two
|
|
686
|
+
* different jobs they are instead of one row for all of SOC 2134. */
|
|
687
|
+
ext: z.ZodOptional<z.ZodString>;
|
|
674
688
|
}, "strip", z.ZodTypeAny, {
|
|
675
689
|
title: string;
|
|
676
690
|
soc: string;
|
|
691
|
+
ext?: string | undefined;
|
|
677
692
|
}, {
|
|
678
693
|
title: string;
|
|
679
694
|
soc: string;
|
|
695
|
+
ext?: string | undefined;
|
|
680
696
|
}>, "many">>;
|
|
681
|
-
/**
|
|
697
|
+
/** Preference keys to un-heart, as `preferenceKey` builds them:
|
|
698
|
+
* "2134-01" for a sub-unit, "2134" for a bare SOC. */
|
|
682
699
|
remove: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
683
700
|
}, "strip", z.ZodTypeAny, {
|
|
684
701
|
add?: {
|
|
685
702
|
title: string;
|
|
686
703
|
soc: string;
|
|
704
|
+
ext?: string | undefined;
|
|
687
705
|
}[] | undefined;
|
|
688
706
|
remove?: string[] | undefined;
|
|
689
707
|
}, {
|
|
690
708
|
add?: {
|
|
691
709
|
title: string;
|
|
692
710
|
soc: string;
|
|
711
|
+
ext?: string | undefined;
|
|
693
712
|
}[] | undefined;
|
|
694
713
|
remove?: string[] | undefined;
|
|
695
714
|
}>;
|
|
696
715
|
response: z.ZodObject<{
|
|
716
|
+
/** Keyed by sub-unit group where the role has one ("2134-01"), by
|
|
717
|
+
* bare SOC otherwise. Build and read keys with core's
|
|
718
|
+
* `preferenceKey` / `socFromPreferenceKey`. */
|
|
697
719
|
currentJobPreferences: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
698
720
|
title: z.ZodString;
|
|
699
721
|
added: z.ZodString;
|
|
722
|
+
soc: z.ZodOptional<z.ZodString>;
|
|
723
|
+
ext: z.ZodOptional<z.ZodString>;
|
|
700
724
|
}, "strip", z.ZodTypeAny, {
|
|
701
725
|
title: string;
|
|
702
726
|
added: string;
|
|
727
|
+
soc?: string | undefined;
|
|
728
|
+
ext?: string | undefined;
|
|
703
729
|
}, {
|
|
704
730
|
title: string;
|
|
705
731
|
added: string;
|
|
732
|
+
soc?: string | undefined;
|
|
733
|
+
ext?: string | undefined;
|
|
706
734
|
}>>;
|
|
707
735
|
}, "strip", z.ZodTypeAny, {
|
|
708
736
|
currentJobPreferences: Record<string, {
|
|
709
737
|
title: string;
|
|
710
738
|
added: string;
|
|
739
|
+
soc?: string | undefined;
|
|
740
|
+
ext?: string | undefined;
|
|
711
741
|
}>;
|
|
712
742
|
}, {
|
|
713
743
|
currentJobPreferences: Record<string, {
|
|
714
744
|
title: string;
|
|
715
745
|
added: string;
|
|
746
|
+
soc?: string | undefined;
|
|
747
|
+
ext?: string | undefined;
|
|
716
748
|
}>;
|
|
717
749
|
}>;
|
|
718
750
|
};
|
|
@@ -17,6 +17,11 @@ const zod_1 = require("zod");
|
|
|
17
17
|
const jobRoleResult = zod_1.z.object({
|
|
18
18
|
soc: zod_1.z.string(),
|
|
19
19
|
title: zod_1.z.string(),
|
|
20
|
+
/** The 6-digit sub-unit group this title actually names, where the coding
|
|
21
|
+
* index gave one. Search collapses on this rather than on `soc`, so
|
|
22
|
+
* "Computer games designers" and "Software developers" come back as the two
|
|
23
|
+
* different jobs they are instead of one row for all of SOC 2134. */
|
|
24
|
+
ext: zod_1.z.string().optional(),
|
|
20
25
|
});
|
|
21
26
|
/** The student-facing profile of one job role. Deliberately a subset of
|
|
22
27
|
* LmiOccupation: no SOC codes, region codes or source/vintage fields, since none of
|
|
@@ -103,13 +108,19 @@ exports.jobRolesCallables = {
|
|
|
103
108
|
request: zod_1.z.object({
|
|
104
109
|
/** Roles to heart. Ignored if already present, so the added date sticks. */
|
|
105
110
|
add: zod_1.z.array(jobRoleResult).optional(),
|
|
106
|
-
/**
|
|
111
|
+
/** Preference keys to un-heart, as `preferenceKey` builds them:
|
|
112
|
+
* "2134-01" for a sub-unit, "2134" for a bare SOC. */
|
|
107
113
|
remove: zod_1.z.array(zod_1.z.string()).optional(),
|
|
108
114
|
}),
|
|
109
115
|
response: zod_1.z.object({
|
|
116
|
+
/** Keyed by sub-unit group where the role has one ("2134-01"), by
|
|
117
|
+
* bare SOC otherwise. Build and read keys with core's
|
|
118
|
+
* `preferenceKey` / `socFromPreferenceKey`. */
|
|
110
119
|
currentJobPreferences: zod_1.z.record(zod_1.z.object({
|
|
111
120
|
title: zod_1.z.string(),
|
|
112
121
|
added: zod_1.z.string(),
|
|
122
|
+
soc: zod_1.z.string().optional(),
|
|
123
|
+
ext: zod_1.z.string().optional(),
|
|
113
124
|
})),
|
|
114
125
|
}),
|
|
115
126
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jobRoles.js","sourceRoot":"","sources":["../../src/callables/jobRoles.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AAGtB;;;;;;;;;GASG;AAEH;4CAC4C;AAC5C,MAAM,aAAa,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3B,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;
|
|
1
|
+
{"version":3,"file":"jobRoles.js","sourceRoot":"","sources":["../../src/callables/jobRoles.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AAGtB;;;;;;;;;GASG;AAEH;4CAC4C;AAC5C,MAAM,aAAa,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3B,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;IACjB;;;yEAGqE;IACrE,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,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EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;SACzC,CAAC;QACF,QAAQ,EAAE,OAAC,CAAC,MAAM,CAAC;YACf;;2DAE+C;YAC/C,qBAAqB,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,CAAC;gBACrC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;gBACjB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;gBACjB,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;gBAC1B,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;aAC7B,CAAC,CAAC;SACN,CAAC;KACL;CACoB,CAAC"}
|
|
@@ -107,22 +107,27 @@ export declare const allCallables: {
|
|
|
107
107
|
results: z.ZodArray<z.ZodObject<{
|
|
108
108
|
soc: z.ZodString;
|
|
109
109
|
title: z.ZodString;
|
|
110
|
+
ext: z.ZodOptional<z.ZodString>;
|
|
110
111
|
}, "strip", z.ZodTypeAny, {
|
|
111
112
|
title: string;
|
|
112
113
|
soc: string;
|
|
114
|
+
ext?: string | undefined;
|
|
113
115
|
}, {
|
|
114
116
|
title: string;
|
|
115
117
|
soc: string;
|
|
118
|
+
ext?: string | undefined;
|
|
116
119
|
}>, "many">;
|
|
117
120
|
}, "strip", z.ZodTypeAny, {
|
|
118
121
|
results: {
|
|
119
122
|
title: string;
|
|
120
123
|
soc: string;
|
|
124
|
+
ext?: string | undefined;
|
|
121
125
|
}[];
|
|
122
126
|
}, {
|
|
123
127
|
results: {
|
|
124
128
|
title: string;
|
|
125
129
|
soc: string;
|
|
130
|
+
ext?: string | undefined;
|
|
126
131
|
}[];
|
|
127
132
|
}>;
|
|
128
133
|
};
|
|
@@ -493,24 +498,29 @@ export declare const allCallables: {
|
|
|
493
498
|
add: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
494
499
|
soc: z.ZodString;
|
|
495
500
|
title: z.ZodString;
|
|
501
|
+
ext: z.ZodOptional<z.ZodString>;
|
|
496
502
|
}, "strip", z.ZodTypeAny, {
|
|
497
503
|
title: string;
|
|
498
504
|
soc: string;
|
|
505
|
+
ext?: string | undefined;
|
|
499
506
|
}, {
|
|
500
507
|
title: string;
|
|
501
508
|
soc: string;
|
|
509
|
+
ext?: string | undefined;
|
|
502
510
|
}>, "many">>;
|
|
503
511
|
remove: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
504
512
|
}, "strip", z.ZodTypeAny, {
|
|
505
513
|
add?: {
|
|
506
514
|
title: string;
|
|
507
515
|
soc: string;
|
|
516
|
+
ext?: string | undefined;
|
|
508
517
|
}[] | undefined;
|
|
509
518
|
remove?: string[] | undefined;
|
|
510
519
|
}, {
|
|
511
520
|
add?: {
|
|
512
521
|
title: string;
|
|
513
522
|
soc: string;
|
|
523
|
+
ext?: string | undefined;
|
|
514
524
|
}[] | undefined;
|
|
515
525
|
remove?: string[] | undefined;
|
|
516
526
|
}>;
|
|
@@ -518,22 +528,32 @@ export declare const allCallables: {
|
|
|
518
528
|
currentJobPreferences: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
519
529
|
title: z.ZodString;
|
|
520
530
|
added: z.ZodString;
|
|
531
|
+
soc: z.ZodOptional<z.ZodString>;
|
|
532
|
+
ext: z.ZodOptional<z.ZodString>;
|
|
521
533
|
}, "strip", z.ZodTypeAny, {
|
|
522
534
|
title: string;
|
|
523
535
|
added: string;
|
|
536
|
+
soc?: string | undefined;
|
|
537
|
+
ext?: string | undefined;
|
|
524
538
|
}, {
|
|
525
539
|
title: string;
|
|
526
540
|
added: string;
|
|
541
|
+
soc?: string | undefined;
|
|
542
|
+
ext?: string | undefined;
|
|
527
543
|
}>>;
|
|
528
544
|
}, "strip", z.ZodTypeAny, {
|
|
529
545
|
currentJobPreferences: Record<string, {
|
|
530
546
|
title: string;
|
|
531
547
|
added: string;
|
|
548
|
+
soc?: string | undefined;
|
|
549
|
+
ext?: string | undefined;
|
|
532
550
|
}>;
|
|
533
551
|
}, {
|
|
534
552
|
currentJobPreferences: Record<string, {
|
|
535
553
|
title: string;
|
|
536
554
|
added: string;
|
|
555
|
+
soc?: string | undefined;
|
|
556
|
+
ext?: string | undefined;
|
|
537
557
|
}>;
|
|
538
558
|
}>;
|
|
539
559
|
};
|
|
@@ -1603,22 +1623,27 @@ export declare const callableGroups: {
|
|
|
1603
1623
|
results: z.ZodArray<z.ZodObject<{
|
|
1604
1624
|
soc: z.ZodString;
|
|
1605
1625
|
title: z.ZodString;
|
|
1626
|
+
ext: z.ZodOptional<z.ZodString>;
|
|
1606
1627
|
}, "strip", z.ZodTypeAny, {
|
|
1607
1628
|
title: string;
|
|
1608
1629
|
soc: string;
|
|
1630
|
+
ext?: string | undefined;
|
|
1609
1631
|
}, {
|
|
1610
1632
|
title: string;
|
|
1611
1633
|
soc: string;
|
|
1634
|
+
ext?: string | undefined;
|
|
1612
1635
|
}>, "many">;
|
|
1613
1636
|
}, "strip", z.ZodTypeAny, {
|
|
1614
1637
|
results: {
|
|
1615
1638
|
title: string;
|
|
1616
1639
|
soc: string;
|
|
1640
|
+
ext?: string | undefined;
|
|
1617
1641
|
}[];
|
|
1618
1642
|
}, {
|
|
1619
1643
|
results: {
|
|
1620
1644
|
title: string;
|
|
1621
1645
|
soc: string;
|
|
1646
|
+
ext?: string | undefined;
|
|
1622
1647
|
}[];
|
|
1623
1648
|
}>;
|
|
1624
1649
|
};
|
|
@@ -1989,24 +2014,29 @@ export declare const callableGroups: {
|
|
|
1989
2014
|
add: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1990
2015
|
soc: z.ZodString;
|
|
1991
2016
|
title: z.ZodString;
|
|
2017
|
+
ext: z.ZodOptional<z.ZodString>;
|
|
1992
2018
|
}, "strip", z.ZodTypeAny, {
|
|
1993
2019
|
title: string;
|
|
1994
2020
|
soc: string;
|
|
2021
|
+
ext?: string | undefined;
|
|
1995
2022
|
}, {
|
|
1996
2023
|
title: string;
|
|
1997
2024
|
soc: string;
|
|
2025
|
+
ext?: string | undefined;
|
|
1998
2026
|
}>, "many">>;
|
|
1999
2027
|
remove: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2000
2028
|
}, "strip", z.ZodTypeAny, {
|
|
2001
2029
|
add?: {
|
|
2002
2030
|
title: string;
|
|
2003
2031
|
soc: string;
|
|
2032
|
+
ext?: string | undefined;
|
|
2004
2033
|
}[] | undefined;
|
|
2005
2034
|
remove?: string[] | undefined;
|
|
2006
2035
|
}, {
|
|
2007
2036
|
add?: {
|
|
2008
2037
|
title: string;
|
|
2009
2038
|
soc: string;
|
|
2039
|
+
ext?: string | undefined;
|
|
2010
2040
|
}[] | undefined;
|
|
2011
2041
|
remove?: string[] | undefined;
|
|
2012
2042
|
}>;
|
|
@@ -2014,22 +2044,32 @@ export declare const callableGroups: {
|
|
|
2014
2044
|
currentJobPreferences: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
2015
2045
|
title: z.ZodString;
|
|
2016
2046
|
added: z.ZodString;
|
|
2047
|
+
soc: z.ZodOptional<z.ZodString>;
|
|
2048
|
+
ext: z.ZodOptional<z.ZodString>;
|
|
2017
2049
|
}, "strip", z.ZodTypeAny, {
|
|
2018
2050
|
title: string;
|
|
2019
2051
|
added: string;
|
|
2052
|
+
soc?: string | undefined;
|
|
2053
|
+
ext?: string | undefined;
|
|
2020
2054
|
}, {
|
|
2021
2055
|
title: string;
|
|
2022
2056
|
added: string;
|
|
2057
|
+
soc?: string | undefined;
|
|
2058
|
+
ext?: string | undefined;
|
|
2023
2059
|
}>>;
|
|
2024
2060
|
}, "strip", z.ZodTypeAny, {
|
|
2025
2061
|
currentJobPreferences: Record<string, {
|
|
2026
2062
|
title: string;
|
|
2027
2063
|
added: string;
|
|
2064
|
+
soc?: string | undefined;
|
|
2065
|
+
ext?: string | undefined;
|
|
2028
2066
|
}>;
|
|
2029
2067
|
}, {
|
|
2030
2068
|
currentJobPreferences: Record<string, {
|
|
2031
2069
|
title: string;
|
|
2032
2070
|
added: string;
|
|
2071
|
+
soc?: string | undefined;
|
|
2072
|
+
ext?: string | undefined;
|
|
2033
2073
|
}>;
|
|
2034
2074
|
}>;
|
|
2035
2075
|
};
|
package/lib/lmi.d.ts
CHANGED
|
@@ -18,6 +18,30 @@ export declare function isNotableGreenCareer(classification?: string): boolean;
|
|
|
18
18
|
* @return {string} the map key, e.g. "01".
|
|
19
19
|
*/
|
|
20
20
|
export declare const subUnitKey: (ext: string) => string;
|
|
21
|
+
/**
|
|
22
|
+
* The key one hearted job is stored under in `CurrentJobPreferences`.
|
|
23
|
+
*
|
|
24
|
+
* The sub-unit group where there is one, so a student can hold both "Computer
|
|
25
|
+
* games designers" and "Software developers" even though both sit in SOC 2134,
|
|
26
|
+
* and the bare SOC otherwise. "/" becomes "-" because a Firestore field name
|
|
27
|
+
* cannot carry a forward slash.
|
|
28
|
+
*
|
|
29
|
+
* @param {string} soc the 4-digit SOC 2020 code.
|
|
30
|
+
* @param {string} ext the 6-digit sub-unit group, when the role has one.
|
|
31
|
+
* @return {string} the storage key, e.g. "2134-01" or "2134".
|
|
32
|
+
*/
|
|
33
|
+
export declare function preferenceKey(soc: string, ext?: string): string;
|
|
34
|
+
/**
|
|
35
|
+
* The 4-digit SOC behind a preference key, whichever form it takes.
|
|
36
|
+
*
|
|
37
|
+
* Every consumer keyed on SOC goes through this: the alumni join matches on
|
|
38
|
+
* `EmploymentDetails.socCode`, and the aspiration cycle aggregates count by SOC
|
|
39
|
+
* so a staff chart shows a readable number of bars rather than 1,384.
|
|
40
|
+
*
|
|
41
|
+
* @param {string} key a key from CurrentJobPreferences.
|
|
42
|
+
* @return {string} the 4-digit SOC.
|
|
43
|
+
*/
|
|
44
|
+
export declare function socFromPreferenceKey(key: string): string;
|
|
21
45
|
/**
|
|
22
46
|
* The prose for one sub-unit group, if the extended SOC sync has run.
|
|
23
47
|
*
|
package/lib/lmi.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.subUnitKey = void 0;
|
|
4
4
|
exports.isNotableGreenCareer = isNotableGreenCareer;
|
|
5
|
+
exports.preferenceKey = preferenceKey;
|
|
6
|
+
exports.socFromPreferenceKey = socFromPreferenceKey;
|
|
5
7
|
exports.subUnitDescription = subUnitDescription;
|
|
6
8
|
exports.studentJobRoleProfile = studentJobRoleProfile;
|
|
7
9
|
/**
|
|
@@ -58,6 +60,34 @@ function isNotableGreenCareer(classification) {
|
|
|
58
60
|
*/
|
|
59
61
|
const subUnitKey = (ext) => ext.split("/")[1] ?? ext;
|
|
60
62
|
exports.subUnitKey = subUnitKey;
|
|
63
|
+
/**
|
|
64
|
+
* The key one hearted job is stored under in `CurrentJobPreferences`.
|
|
65
|
+
*
|
|
66
|
+
* The sub-unit group where there is one, so a student can hold both "Computer
|
|
67
|
+
* games designers" and "Software developers" even though both sit in SOC 2134,
|
|
68
|
+
* and the bare SOC otherwise. "/" becomes "-" because a Firestore field name
|
|
69
|
+
* cannot carry a forward slash.
|
|
70
|
+
*
|
|
71
|
+
* @param {string} soc the 4-digit SOC 2020 code.
|
|
72
|
+
* @param {string} ext the 6-digit sub-unit group, when the role has one.
|
|
73
|
+
* @return {string} the storage key, e.g. "2134-01" or "2134".
|
|
74
|
+
*/
|
|
75
|
+
function preferenceKey(soc, ext) {
|
|
76
|
+
return ext ? ext.replace("/", "-") : soc;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The 4-digit SOC behind a preference key, whichever form it takes.
|
|
80
|
+
*
|
|
81
|
+
* Every consumer keyed on SOC goes through this: the alumni join matches on
|
|
82
|
+
* `EmploymentDetails.socCode`, and the aspiration cycle aggregates count by SOC
|
|
83
|
+
* so a staff chart shows a readable number of bars rather than 1,384.
|
|
84
|
+
*
|
|
85
|
+
* @param {string} key a key from CurrentJobPreferences.
|
|
86
|
+
* @return {string} the 4-digit SOC.
|
|
87
|
+
*/
|
|
88
|
+
function socFromPreferenceKey(key) {
|
|
89
|
+
return key.split("-")[0];
|
|
90
|
+
}
|
|
61
91
|
/**
|
|
62
92
|
* The prose for one sub-unit group, if the extended SOC sync has run.
|
|
63
93
|
*
|
package/lib/lmi.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lmi.js","sourceRoot":"","sources":["../src/lmi.ts"],"names":[],"mappings":";;;AA0CA,oDAGC;
|
|
1
|
+
{"version":3,"file":"lmi.js","sourceRoot":"","sources":["../src/lmi.ts"],"names":[],"mappings":";;;AA0CA,oDAGC;AA0BD,sCAEC;AAYD,oDAEC;AASD,gDAIC;AAED,sDAuFC;AA1LD;;;;;;;;;;;;;;;;;GAiBG;AACH;;;;;;;;;;;;GAYG;AACH,MAAM,6BAA6B,GAAG,CAAC,YAAY,CAAC,CAAC;AAErD;;;;;GAKG;AACH,SAAgB,oBAAoB,CAAC,cAAuB;IACxD,OAAO,OAAO,CAAC,cAAc,IAAI,6BAA6B;SACzD,QAAQ,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;AACxD,CAAC;AAED;;;;;;;;;GASG;AACI,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC;AAAvD,QAAA,UAAU,cAA6C;AAEpE;;;;;;;;;;;GAWG;AACH,SAAgB,aAAa,CAAC,GAAW,EAAE,GAAY;IACnD,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;AAC7C,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,oBAAoB,CAAC,GAAW;IAC5C,OAAO,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7B,CAAC;AAED;;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AC,CAAC,CAAC;YAC/C,EAAC,KAAK,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC,KAAK,EAAE,cAAc,EAAC,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KAC9E,CAAC;AACN,CAAC"}
|
package/lib/typeDefinitions.d.ts
CHANGED
|
@@ -2646,15 +2646,35 @@ export type JobPreference = {
|
|
|
2646
2646
|
/** 4-digit SOC 2020 code — the lmiOccupations doc id. Never shown to students. */
|
|
2647
2647
|
soc: string;
|
|
2648
2648
|
title: string;
|
|
2649
|
+
/** 6-digit extended SOC sub-unit group ("2134/01"), when the title the student
|
|
2650
|
+
* picked resolves to one. This is the actual job they meant: "Computer games
|
|
2651
|
+
* designer" is 2134/01, while the SOC above covers all five jobs in
|
|
2652
|
+
* "Programmers and software development professionals". Optional because an
|
|
2653
|
+
* alias imported before the extended SOC columns were captured has none. */
|
|
2654
|
+
ext?: string;
|
|
2649
2655
|
};
|
|
2650
2656
|
/**
|
|
2651
|
-
* A student's live set of hearted job roles
|
|
2652
|
-
*
|
|
2657
|
+
* A student's live set of hearted job roles. `added` is what the home and profile
|
|
2658
|
+
* cards order by.
|
|
2659
|
+
*
|
|
2660
|
+
* Keyed by sub-unit group where the role has one ("2134-01"), and by bare SOC where
|
|
2661
|
+
* it does not ("2134"). Keying on the SOC alone used to mean a student who liked both
|
|
2662
|
+
* games design and software development could hold only one of them, because both are
|
|
2663
|
+
* 2134; the sub-unit is the job they actually meant.
|
|
2664
|
+
*
|
|
2665
|
+
* The separator is "-" rather than the "/" the code is written with, because a
|
|
2666
|
+
* Firestore field name cannot carry "/" — the same constraint that keeps the
|
|
2667
|
+
* aggregates keyed by code rather than by title. Build a key with `preferenceKey()`
|
|
2668
|
+
* and recover the SOC with `socFromPreferenceKey()`; never slice by hand.
|
|
2653
2669
|
*/
|
|
2654
2670
|
export type CurrentJobPreferences = {
|
|
2655
|
-
[
|
|
2671
|
+
[key: string]: {
|
|
2656
2672
|
title: string;
|
|
2657
2673
|
added: string;
|
|
2674
|
+
/** The 4-digit SOC, stored alongside so a reader never has to parse the key. */
|
|
2675
|
+
soc?: string;
|
|
2676
|
+
/** The 6-digit sub-unit group, "2134/01", when this is one. */
|
|
2677
|
+
ext?: string;
|
|
2658
2678
|
};
|
|
2659
2679
|
};
|
|
2660
2680
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeDefinitions.js","sourceRoot":"","sources":["../src/typeDefinitions.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"typeDefinitions.js","sourceRoot":"","sources":["../src/typeDefinitions.ts"],"names":[],"mappings":";;;AA8iIA,sDASC;AAeD,oDAKC;AAaD,0CAEC;AAjoED;;;;;kFAKkF;AACrE,QAAA,qBAAqB,GAAG,SAAS,CAAC;AAClC,QAAA,iBAAiB,GAAG,OAAO,CAAC;AA6iEzC;yEACyE;AAC5D,QAAA,0BAA0B,GAA2C;IAC9E,gBAAgB,EAAE,2BAA2B;IAC7C,mBAAmB,EAAE,sBAAsB;IAC3C,cAAc,EAAE,iBAAiB;IACjC,kBAAkB,EAAE,qBAAqB;IACzC,UAAU,EAAE,oCAAoC;IAChD,aAAa,EAAE,yBAAyB;IACxC,aAAa,EAAE,wBAAwB;IACvC,KAAK,EAAE,OAAO;CACjB,CAAC;AAEW,QAAA,0BAA0B,GAA+C;IAClF,QAAQ,EAAE,WAAW;IACrB,KAAK,EAAE,YAAY;IACnB,KAAK,EAAE,OAAO;CACjB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,SAAgB,qBAAqB,CAAC,SAAsC;IACxE,QAAQ,SAAS,EAAE,CAAC;QACpB,KAAK,MAAM,CAAC,CAAC,OAAO,OAAO,CAAC;QAC5B,KAAK,OAAO,CAAC,CAAC,OAAO,OAAO,CAAC;QAC7B,KAAK,WAAW,CAAC;QACjB,KAAK,OAAO,CAAC;QACb,KAAK,OAAO,CAAC;QACb,OAAO,CAAC,CAAC,OAAO,UAAU,CAAC;IAC3B,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,oBAAoB,CAChC,IAAwC,EACxC,MAA6C;IAE7C,OAAO,IAAI,EAAE,WAAW,IAAI,MAAM,EAAE,YAAY,IAAI,KAAK,CAAC;AAC9D,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,eAAe,CAAC,KAA6D;IACzF,OAAO,GAAG,KAAK,CAAC,cAAc,IAAI,EAAE,IAAI,KAAK,CAAC,aAAa,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;AAC/E,CAAC"}
|
package/package.json
CHANGED
|
@@ -17,6 +17,11 @@ import {CallableGroup} from "./types";
|
|
|
17
17
|
const jobRoleResult = z.object({
|
|
18
18
|
soc: z.string(),
|
|
19
19
|
title: z.string(),
|
|
20
|
+
/** The 6-digit sub-unit group this title actually names, where the coding
|
|
21
|
+
* index gave one. Search collapses on this rather than on `soc`, so
|
|
22
|
+
* "Computer games designers" and "Software developers" come back as the two
|
|
23
|
+
* different jobs they are instead of one row for all of SOC 2134. */
|
|
24
|
+
ext: z.string().optional(),
|
|
20
25
|
});
|
|
21
26
|
|
|
22
27
|
/** The student-facing profile of one job role. Deliberately a subset of
|
|
@@ -109,13 +114,19 @@ export const jobRolesCallables = {
|
|
|
109
114
|
request: z.object({
|
|
110
115
|
/** Roles to heart. Ignored if already present, so the added date sticks. */
|
|
111
116
|
add: z.array(jobRoleResult).optional(),
|
|
112
|
-
/**
|
|
117
|
+
/** Preference keys to un-heart, as `preferenceKey` builds them:
|
|
118
|
+
* "2134-01" for a sub-unit, "2134" for a bare SOC. */
|
|
113
119
|
remove: z.array(z.string()).optional(),
|
|
114
120
|
}),
|
|
115
121
|
response: z.object({
|
|
122
|
+
/** Keyed by sub-unit group where the role has one ("2134-01"), by
|
|
123
|
+
* bare SOC otherwise. Build and read keys with core's
|
|
124
|
+
* `preferenceKey` / `socFromPreferenceKey`. */
|
|
116
125
|
currentJobPreferences: z.record(z.object({
|
|
117
126
|
title: z.string(),
|
|
118
127
|
added: z.string(),
|
|
128
|
+
soc: z.string().optional(),
|
|
129
|
+
ext: z.string().optional(),
|
|
119
130
|
})),
|
|
120
131
|
}),
|
|
121
132
|
},
|
package/src/lmi.ts
CHANGED
|
@@ -57,6 +57,36 @@ export function isNotableGreenCareer(classification?: string): boolean {
|
|
|
57
57
|
*/
|
|
58
58
|
export const subUnitKey = (ext: string) => ext.split("/")[1] ?? ext;
|
|
59
59
|
|
|
60
|
+
/**
|
|
61
|
+
* The key one hearted job is stored under in `CurrentJobPreferences`.
|
|
62
|
+
*
|
|
63
|
+
* The sub-unit group where there is one, so a student can hold both "Computer
|
|
64
|
+
* games designers" and "Software developers" even though both sit in SOC 2134,
|
|
65
|
+
* and the bare SOC otherwise. "/" becomes "-" because a Firestore field name
|
|
66
|
+
* cannot carry a forward slash.
|
|
67
|
+
*
|
|
68
|
+
* @param {string} soc the 4-digit SOC 2020 code.
|
|
69
|
+
* @param {string} ext the 6-digit sub-unit group, when the role has one.
|
|
70
|
+
* @return {string} the storage key, e.g. "2134-01" or "2134".
|
|
71
|
+
*/
|
|
72
|
+
export function preferenceKey(soc: string, ext?: string): string {
|
|
73
|
+
return ext ? ext.replace("/", "-") : soc;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* The 4-digit SOC behind a preference key, whichever form it takes.
|
|
78
|
+
*
|
|
79
|
+
* Every consumer keyed on SOC goes through this: the alumni join matches on
|
|
80
|
+
* `EmploymentDetails.socCode`, and the aspiration cycle aggregates count by SOC
|
|
81
|
+
* so a staff chart shows a readable number of bars rather than 1,384.
|
|
82
|
+
*
|
|
83
|
+
* @param {string} key a key from CurrentJobPreferences.
|
|
84
|
+
* @return {string} the 4-digit SOC.
|
|
85
|
+
*/
|
|
86
|
+
export function socFromPreferenceKey(key: string): string {
|
|
87
|
+
return key.split("-")[0];
|
|
88
|
+
}
|
|
89
|
+
|
|
60
90
|
/**
|
|
61
91
|
* The prose for one sub-unit group, if the extended SOC sync has run.
|
|
62
92
|
*
|
package/src/typeDefinitions.ts
CHANGED
|
@@ -2611,13 +2611,36 @@ export type JobPreference = {
|
|
|
2611
2611
|
/** 4-digit SOC 2020 code — the lmiOccupations doc id. Never shown to students. */
|
|
2612
2612
|
soc: string,
|
|
2613
2613
|
title: string,
|
|
2614
|
+
/** 6-digit extended SOC sub-unit group ("2134/01"), when the title the student
|
|
2615
|
+
* picked resolves to one. This is the actual job they meant: "Computer games
|
|
2616
|
+
* designer" is 2134/01, while the SOC above covers all five jobs in
|
|
2617
|
+
* "Programmers and software development professionals". Optional because an
|
|
2618
|
+
* alias imported before the extended SOC columns were captured has none. */
|
|
2619
|
+
ext?: string,
|
|
2614
2620
|
}
|
|
2615
2621
|
|
|
2616
2622
|
/**
|
|
2617
|
-
* A student's live set of hearted job roles
|
|
2618
|
-
*
|
|
2623
|
+
* A student's live set of hearted job roles. `added` is what the home and profile
|
|
2624
|
+
* cards order by.
|
|
2625
|
+
*
|
|
2626
|
+
* Keyed by sub-unit group where the role has one ("2134-01"), and by bare SOC where
|
|
2627
|
+
* it does not ("2134"). Keying on the SOC alone used to mean a student who liked both
|
|
2628
|
+
* games design and software development could hold only one of them, because both are
|
|
2629
|
+
* 2134; the sub-unit is the job they actually meant.
|
|
2630
|
+
*
|
|
2631
|
+
* The separator is "-" rather than the "/" the code is written with, because a
|
|
2632
|
+
* Firestore field name cannot carry "/" — the same constraint that keeps the
|
|
2633
|
+
* aggregates keyed by code rather than by title. Build a key with `preferenceKey()`
|
|
2634
|
+
* and recover the SOC with `socFromPreferenceKey()`; never slice by hand.
|
|
2619
2635
|
*/
|
|
2620
|
-
export type CurrentJobPreferences = {[
|
|
2636
|
+
export type CurrentJobPreferences = {[key: string]: {
|
|
2637
|
+
title: string,
|
|
2638
|
+
added: string,
|
|
2639
|
+
/** The 4-digit SOC, stored alongside so a reader never has to parse the key. */
|
|
2640
|
+
soc?: string,
|
|
2641
|
+
/** The 6-digit sub-unit group, "2134/01", when this is one. */
|
|
2642
|
+
ext?: string,
|
|
2643
|
+
}};
|
|
2621
2644
|
|
|
2622
2645
|
/**
|
|
2623
2646
|
* Job-role profiles a student has opened, keyed by SOC code.
|