placementt-core 1.400.1029 → 1.400.1031
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/firebase/firebase.js +11 -2
- package/lib/firebase/firebase.js.map +1 -1
- package/lib/productResolver.d.ts +25 -3
- package/lib/productResolver.js +37 -16
- package/lib/productResolver.js.map +1 -1
- package/lib/tasksAndTips.d.ts +3 -1
- package/lib/tasksAndTips.js +61 -44
- package/lib/tasksAndTips.js.map +1 -1
- package/lib/typeDefinitions.d.ts +9 -0
- package/package.json +1 -1
- package/src/firebase/firebase.tsx +12 -2
- package/src/productResolver.ts +48 -21
- package/src/tasksAndTips.ts +61 -45
- package/src/typeDefinitions.ts +9 -0
package/lib/firebase/firebase.js
CHANGED
|
@@ -47,7 +47,16 @@ const register = async (credentials, type) => {
|
|
|
47
47
|
});
|
|
48
48
|
};
|
|
49
49
|
exports.register = register;
|
|
50
|
-
|
|
50
|
+
// Matched as substrings, case-insensitively, rather than as exact keys. Exact
|
|
51
|
+
// matching quietly missed anything with a prefix — `idToken` sailed straight
|
|
52
|
+
// past a list containing "token" and got written to the jobs collection in
|
|
53
|
+
// full, which for an Entra id_token means a replayable credential sitting in
|
|
54
|
+
// Firestore.
|
|
55
|
+
const SENSITIVE_KEYS = ["password", "token", "secret", "credential", "apikey"];
|
|
56
|
+
function isSensitiveKey(key) {
|
|
57
|
+
const k = key.toLowerCase();
|
|
58
|
+
return SENSITIVE_KEYS.some((s) => k.includes(s));
|
|
59
|
+
}
|
|
51
60
|
function sanitiseData(data) {
|
|
52
61
|
if (!data || typeof data !== "object")
|
|
53
62
|
return data;
|
|
@@ -55,7 +64,7 @@ function sanitiseData(data) {
|
|
|
55
64
|
return data.map(sanitiseData);
|
|
56
65
|
return Object.fromEntries(Object.entries(data).map(([k, v]) => [
|
|
57
66
|
k,
|
|
58
|
-
|
|
67
|
+
isSensitiveKey(k) ? "[REDACTED]" : sanitiseData(v),
|
|
59
68
|
]));
|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W,EAAE;gBACjC,KAAK,EAAE,CAAC,EAAE,OAAO,IAAI,MAAM,CAAC,CAAC,CAAC;aACjC,CAAC;YACF,MAAM,aAAa,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,WAAW,CAAC,CAAC;YACzD,QAAQ,CAAC,IAAA,qBAAS,EAAC,EAAC,KAAK,EAAE,IAAI,EAAE,WAAW,EAAiB,CAAC,CAAC,CAAC;YAChE,yDAAyD;YACzD,IAAA,0CAAuB,EAAC,UAAU,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;QACH,OAAO;YACH,QAAQ,EAAE,SAAS;YACnB,OAAO,EAAE,sIAAsI;YAC/I,KAAK,EAAE,KAAK;SACf,CAAC;IACN,CAAC,CAAC;IAEF,OAAO,EAAC,OAAO,EAAC,CAAC;AACrB,CAAC"}
|
package/lib/productResolver.d.ts
CHANGED
|
@@ -25,6 +25,9 @@ export type ResolvedProducts = Record<ProductKey, boolean> & {
|
|
|
25
25
|
isTrust: boolean;
|
|
26
26
|
isHub: boolean;
|
|
27
27
|
isHubSchool: boolean;
|
|
28
|
+
/** Whether the account holds students, cohorts and placements of its own —
|
|
29
|
+
* every package except the two hub-side ones, which consume a hub's. */
|
|
30
|
+
runsOwnStudents: boolean;
|
|
28
31
|
/** An approved careersHubLinks entry — a school inside someone else's hub. */
|
|
29
32
|
hubLinked: boolean;
|
|
30
33
|
/** Ids of the hubs this institute has accepted. Empty unless hubLinked. */
|
|
@@ -37,15 +40,34 @@ export type ResolvedProducts = Record<ProductKey, boolean> & {
|
|
|
37
40
|
* (a trust school row, a customer-success record) without casting. */
|
|
38
41
|
export type ProductResolverInput = Partial<Pick<InstituteData, "package" | "workExperience" | "employerEvents" | "network" | "careersEvents" | "skillsAssessmentsProduct" | "trackExtracurriculars" | "destinationTracking" | "alumniManagement" | "careersHubLinks">>;
|
|
39
42
|
/**
|
|
40
|
-
* Resolve an institute's products.
|
|
43
|
+
* Resolve an institute's products from its flags alone.
|
|
44
|
+
*
|
|
45
|
+
* The synchronous half of {@link useProductResolver}, for the code that can't
|
|
46
|
+
* hold a hook — task and tip callbacks, backend cron, anything outside React.
|
|
47
|
+
* Everything but `parents` is a pure read of the flags; the parent count is a
|
|
48
|
+
* query, so a caller that has already run it passes it in and a caller that
|
|
49
|
+
* hasn't gets `parents: false`.
|
|
41
50
|
*
|
|
42
51
|
* @param {ProductResolverInput} [institute] the institute, or a partial of it.
|
|
43
52
|
* @param {object} [options] extra context.
|
|
44
|
-
* @param {string[]} [options.oIds] whose parent database to count. A trust holds
|
|
45
|
-
* none on its own oId, so pass its schools'.
|
|
46
53
|
* @param {ProductResolverInput[]} [options.trustSchools] schools beneath a trust.
|
|
47
54
|
* A trust shows a product when any of its schools has it, matching the nav's
|
|
48
55
|
* existing destinations rule.
|
|
56
|
+
* @param {number} [options.parentCount] parents already counted, if known.
|
|
57
|
+
* @return {ResolvedProducts} what this institute has.
|
|
58
|
+
*/
|
|
59
|
+
export declare function resolveProducts(institute?: ProductResolverInput, options?: {
|
|
60
|
+
trustSchools?: ProductResolverInput[];
|
|
61
|
+
parentCount?: number;
|
|
62
|
+
}): ResolvedProducts;
|
|
63
|
+
/**
|
|
64
|
+
* Resolve an institute's products, counting its parent database as it goes.
|
|
65
|
+
*
|
|
66
|
+
* @param {ProductResolverInput} [institute] the institute, or a partial of it.
|
|
67
|
+
* @param {object} [options] extra context.
|
|
68
|
+
* @param {string[]} [options.oIds] whose parent database to count. A trust holds
|
|
69
|
+
* none on its own oId, so pass its schools'.
|
|
70
|
+
* @param {ProductResolverInput[]} [options.trustSchools] schools beneath a trust.
|
|
49
71
|
* @return {ResolvedProducts} what this institute has.
|
|
50
72
|
*/
|
|
51
73
|
export declare function useProductResolver(institute?: ProductResolverInput, options?: {
|
package/lib/productResolver.js
CHANGED
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.PRODUCT_LABELS = void 0;
|
|
7
|
+
exports.resolveProducts = resolveProducts;
|
|
7
8
|
exports.useProductResolver = useProductResolver;
|
|
8
9
|
const react_1 = require("react");
|
|
9
10
|
const firestore_1 = require("firebase/firestore");
|
|
@@ -13,30 +14,24 @@ const PRODUCT_ORDER = ["wex", "destinations", "events", "skills", "activities",
|
|
|
13
14
|
const on = (flag) => flag !== false;
|
|
14
15
|
const firebaseQuery = new firebaseQuery_1.default();
|
|
15
16
|
/**
|
|
16
|
-
* Resolve an institute's products.
|
|
17
|
+
* Resolve an institute's products from its flags alone.
|
|
18
|
+
*
|
|
19
|
+
* The synchronous half of {@link useProductResolver}, for the code that can't
|
|
20
|
+
* hold a hook — task and tip callbacks, backend cron, anything outside React.
|
|
21
|
+
* Everything but `parents` is a pure read of the flags; the parent count is a
|
|
22
|
+
* query, so a caller that has already run it passes it in and a caller that
|
|
23
|
+
* hasn't gets `parents: false`.
|
|
17
24
|
*
|
|
18
25
|
* @param {ProductResolverInput} [institute] the institute, or a partial of it.
|
|
19
26
|
* @param {object} [options] extra context.
|
|
20
|
-
* @param {string[]} [options.oIds] whose parent database to count. A trust holds
|
|
21
|
-
* none on its own oId, so pass its schools'.
|
|
22
27
|
* @param {ProductResolverInput[]} [options.trustSchools] schools beneath a trust.
|
|
23
28
|
* A trust shows a product when any of its schools has it, matching the nav's
|
|
24
29
|
* existing destinations rule.
|
|
30
|
+
* @param {number} [options.parentCount] parents already counted, if known.
|
|
25
31
|
* @return {ResolvedProducts} what this institute has.
|
|
26
32
|
*/
|
|
27
|
-
function
|
|
28
|
-
const
|
|
29
|
-
const oIds = options?.oIds || [];
|
|
30
|
-
const scope = oIds.join(",");
|
|
31
|
-
(0, react_1.useEffect)(() => {
|
|
32
|
-
if (!oIds.length) {
|
|
33
|
-
setParentCount(0);
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
Promise.all(oIds.map((o) => firebaseQuery.getCount(["parents"], [(0, firestore_1.where)("oId", "==", o)])))
|
|
37
|
-
.then((counts) => setParentCount(counts.reduce((t, c) => t + c, 0)))
|
|
38
|
-
.catch(() => setParentCount(0));
|
|
39
|
-
}, [scope]);
|
|
33
|
+
function resolveProducts(institute, options) {
|
|
34
|
+
const parentCount = options?.parentCount || 0;
|
|
40
35
|
const i = institute || {};
|
|
41
36
|
const pkg = i.package;
|
|
42
37
|
const isTrust = pkg === "institutes-two";
|
|
@@ -72,11 +67,37 @@ function useProductResolver(institute, options) {
|
|
|
72
67
|
isTrust,
|
|
73
68
|
isHub,
|
|
74
69
|
isHubSchool,
|
|
70
|
+
runsOwnStudents,
|
|
75
71
|
hubLinked: hubIds.length > 0,
|
|
76
72
|
hubIds,
|
|
77
73
|
enabled: PRODUCT_ORDER.filter((k) => products[k]),
|
|
78
74
|
};
|
|
79
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Resolve an institute's products, counting its parent database as it goes.
|
|
78
|
+
*
|
|
79
|
+
* @param {ProductResolverInput} [institute] the institute, or a partial of it.
|
|
80
|
+
* @param {object} [options] extra context.
|
|
81
|
+
* @param {string[]} [options.oIds] whose parent database to count. A trust holds
|
|
82
|
+
* none on its own oId, so pass its schools'.
|
|
83
|
+
* @param {ProductResolverInput[]} [options.trustSchools] schools beneath a trust.
|
|
84
|
+
* @return {ResolvedProducts} what this institute has.
|
|
85
|
+
*/
|
|
86
|
+
function useProductResolver(institute, options) {
|
|
87
|
+
const [parentCount, setParentCount] = (0, react_1.useState)(0);
|
|
88
|
+
const oIds = options?.oIds || [];
|
|
89
|
+
const scope = oIds.join(",");
|
|
90
|
+
(0, react_1.useEffect)(() => {
|
|
91
|
+
if (!oIds.length) {
|
|
92
|
+
setParentCount(0);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
Promise.all(oIds.map((o) => firebaseQuery.getCount(["parents"], [(0, firestore_1.where)("oId", "==", o)])))
|
|
96
|
+
.then((counts) => setParentCount(counts.reduce((t, c) => t + c, 0)))
|
|
97
|
+
.catch(() => setParentCount(0));
|
|
98
|
+
}, [scope]);
|
|
99
|
+
return resolveProducts(institute, { trustSchools: options?.trustSchools, parentCount });
|
|
100
|
+
}
|
|
80
101
|
/** Human labels, for checklists, settings and the trust product strip. */
|
|
81
102
|
exports.PRODUCT_LABELS = {
|
|
82
103
|
wex: "Work experience",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"productResolver.js","sourceRoot":"","sources":["../src/productResolver.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"productResolver.js","sourceRoot":"","sources":["../src/productResolver.ts"],"names":[],"mappings":";;;;;;AA8EA,0CA4EC;AAYD,gDAqBC;AA3LD,iCAA0C;AAC1C,kDAAyC;AACzC,6EAAqD;AAmDrD,MAAM,aAAa,GACf,CAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AAE9F,kFAAkF;AAClF,MAAM,EAAE,GAAG,CAAC,IAAc,EAAE,EAAE,CAAC,IAAI,KAAK,KAAK,CAAC;AAE9C,MAAM,aAAa,GAAG,IAAI,uBAAa,EAAE,CAAC;AAE1C;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,eAAe,CAC3B,SAAgC,EAChC,OAAuE;IAEvE,MAAM,WAAW,GAAG,OAAO,EAAE,WAAW,IAAI,CAAC,CAAC;IAC9C,MAAM,CAAC,GAAG,SAAS,IAAI,EAAE,CAAC;IAC1B,MAAM,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC;IAEtB,MAAM,OAAO,GAAG,GAAG,KAAK,gBAAgB,CAAC;IACzC,MAAM,KAAK,GAAG,GAAG,KAAK,YAAY,CAAC;IACnC,MAAM,WAAW,GAAG,GAAG,KAAK,eAAe,CAAC;IAE5C,6EAA6E;IAC7E,sDAAsD;IACtD,MAAM,eAAe,GAAG,CAAC,KAAK,IAAI,CAAC,WAAW,CA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rganisationAddress, ProviderData, UserData } from "./typeDefinitions";
|
|
2
|
+
import { ResolvedProducts } from "./productResolver";
|
|
2
3
|
type InstituteTipNames = "createCohort" | "addSchools" | "uploadStaff" | "assignStaffRoles" | "allowExternalPlacementUpload" | "uploadStaffGuidance" | "uploadStudentGuidance";
|
|
3
4
|
type ProviderTipNames = string;
|
|
4
5
|
type StudentTipNames = string;
|
|
@@ -30,9 +31,10 @@ export type TipQueryReturnObject = {
|
|
|
30
31
|
} | undefined;
|
|
31
32
|
export type InstituteTaskObject = {
|
|
32
33
|
[key in InstituteTaskNames]: {
|
|
33
|
-
callback: ({ user, organisation, cohorts, schools, eventId, type }: {
|
|
34
|
+
callback: ({ user, organisation, products, cohorts, schools, eventId, type }: {
|
|
34
35
|
user: UserData;
|
|
35
36
|
organisation: InstituteData & ProviderData;
|
|
37
|
+
products: ResolvedProducts;
|
|
36
38
|
cohorts: CohortData | [string, CohortData][];
|
|
37
39
|
schools?: InstituteData | [string, InstituteData][];
|
|
38
40
|
eventId?: string;
|
package/lib/tasksAndTips.js
CHANGED
|
@@ -9,6 +9,7 @@ const firebaseQuery_1 = __importDefault(require("./firebase/firebaseQuery"));
|
|
|
9
9
|
const util_1 = require("./firebase/util");
|
|
10
10
|
const workflows_1 = require("./workflows");
|
|
11
11
|
const util_2 = require("./firebase/util");
|
|
12
|
+
const productResolver_1 = require("./productResolver");
|
|
12
13
|
const firebaseQuery = new firebaseQuery_1.default;
|
|
13
14
|
const providerTips = {};
|
|
14
15
|
const studentTips = {};
|
|
@@ -32,7 +33,7 @@ const instituteTips = {
|
|
|
32
33
|
},
|
|
33
34
|
createCohort: {
|
|
34
35
|
callback: async (user, institute) => {
|
|
35
|
-
if (!(0, util_1.getAccess)(user, institute || null, "createCohorts") ||
|
|
36
|
+
if (!(0, util_1.getAccess)(user, institute || null, "createCohorts") || !(0, productResolver_1.resolveProducts)(institute).wex)
|
|
36
37
|
return;
|
|
37
38
|
const cohorts = await firebaseQuery.getCount("cohorts", [(0, firestore_1.where)("product", "==", user.product), (0, firestore_1.where)("oId", "==", user.oId)]);
|
|
38
39
|
if (cohorts === 0 && institute?.package === "institutes-one") {
|
|
@@ -77,6 +78,9 @@ const instituteTips = {
|
|
|
77
78
|
callback: async (user, organisation) => {
|
|
78
79
|
if (user.product !== "institutes")
|
|
79
80
|
return;
|
|
81
|
+
// Nothing to open up when the employer network is switched off.
|
|
82
|
+
if (!(0, productResolver_1.resolveProducts)(organisation).network)
|
|
83
|
+
return;
|
|
80
84
|
if (organisation.acceptingEmployers)
|
|
81
85
|
return;
|
|
82
86
|
return {
|
|
@@ -91,7 +95,10 @@ const instituteTips = {
|
|
|
91
95
|
},
|
|
92
96
|
uploadStaffGuidance: {
|
|
93
97
|
callback: async (user, organisation) => {
|
|
94
|
-
|
|
98
|
+
// The guidance this prompts for is work experience guidance, and a hub
|
|
99
|
+
// school has no Guidance page of its own.
|
|
100
|
+
const products = (0, productResolver_1.resolveProducts)(organisation);
|
|
101
|
+
if (user.product !== "institutes" || !products.wex || products.isHubSchool)
|
|
95
102
|
return;
|
|
96
103
|
const returnObj = {
|
|
97
104
|
link: "",
|
|
@@ -113,7 +120,8 @@ const instituteTips = {
|
|
|
113
120
|
},
|
|
114
121
|
uploadStudentGuidance: {
|
|
115
122
|
callback: async (user, organisation) => {
|
|
116
|
-
|
|
123
|
+
// Only accounts that hold their own students, and so have a Guidance page.
|
|
124
|
+
if (user.product !== "institutes" || !(0, productResolver_1.resolveProducts)(organisation).runsOwnStudents)
|
|
117
125
|
return;
|
|
118
126
|
const returnObj = {
|
|
119
127
|
link: "",
|
|
@@ -157,8 +165,8 @@ const instituteTasks = {
|
|
|
157
165
|
},
|
|
158
166
|
},
|
|
159
167
|
latePlacementStage: {
|
|
160
|
-
callback: async ({
|
|
161
|
-
if (!["home", "cohort"].includes(type))
|
|
168
|
+
callback: async ({ products, cohorts, type }) => {
|
|
169
|
+
if (!["home", "cohort"].includes(type) || !products.wex)
|
|
162
170
|
return;
|
|
163
171
|
if (!Array.isArray(cohorts)) {
|
|
164
172
|
const placementCount = (await firebaseQuery.getCount(["placements"], [(0, firestore_1.where)("oId", "==", cohorts.oId), (0, firestore_1.where)("cohort", "==", cohorts.id), (0, firestore_1.where)("flags", "array-contains", "latePlacementStage")]));
|
|
@@ -192,8 +200,8 @@ const instituteTasks = {
|
|
|
192
200
|
},
|
|
193
201
|
},
|
|
194
202
|
stagnantPlacementStage: {
|
|
195
|
-
callback: async ({
|
|
196
|
-
if (!["home", "cohort"].includes(type))
|
|
203
|
+
callback: async ({ products, cohorts, type }) => {
|
|
204
|
+
if (!["home", "cohort"].includes(type) || !products.wex)
|
|
197
205
|
return;
|
|
198
206
|
if (!Array.isArray(cohorts)) {
|
|
199
207
|
const placementCount = (await firebaseQuery.getCount(["placements"], [(0, firestore_1.where)("oId", "==", cohorts.oId), (0, firestore_1.where)("cohort", "==", cohorts.id), (0, firestore_1.where)("flags", "array-contains", "stagnantPlacementStage")]));
|
|
@@ -227,8 +235,8 @@ const instituteTasks = {
|
|
|
227
235
|
},
|
|
228
236
|
},
|
|
229
237
|
approveAlumniConversation: {
|
|
230
|
-
callback: async ({ user, organisation, schools, type }) => {
|
|
231
|
-
if (type !== "home")
|
|
238
|
+
callback: async ({ user, organisation, products, schools, type }) => {
|
|
239
|
+
if (type !== "home" || !products.alumni)
|
|
232
240
|
return;
|
|
233
241
|
if (!schools) {
|
|
234
242
|
if (!organisation.alumniConversations)
|
|
@@ -248,6 +256,8 @@ const instituteTasks = {
|
|
|
248
256
|
}
|
|
249
257
|
if (!Array.isArray(schools)) {
|
|
250
258
|
// One school
|
|
259
|
+
if (!schools.alumniConversations)
|
|
260
|
+
return;
|
|
251
261
|
const convos = (await firebaseQuery.getCount(["alumniConversations"], [(0, firestore_1.where)("oId", "==", user.oId), (0, firestore_1.where)("schoolId", "==", schools.id), (0, firestore_1.where)("open", "==", true), (0, firestore_1.where)("delivered", "==", "pending")]));
|
|
252
262
|
if (convos > 0) {
|
|
253
263
|
return { approveAlumniConversation: {
|
|
@@ -281,8 +291,8 @@ const instituteTasks = {
|
|
|
281
291
|
},
|
|
282
292
|
},
|
|
283
293
|
invalidStudentEmails: {
|
|
284
|
-
callback: async ({ user, cohorts, type }) => {
|
|
285
|
-
if (type !== "home")
|
|
294
|
+
callback: async ({ user, products, cohorts, type }) => {
|
|
295
|
+
if (type !== "home" || !products.runsOwnStudents)
|
|
286
296
|
return;
|
|
287
297
|
if (!(0, util_1.getAccess)(user, null, "viewStudents") || (user.userGroup !== "admin" && user.viewStudents === "none"))
|
|
288
298
|
return;
|
|
@@ -318,8 +328,8 @@ const instituteTasks = {
|
|
|
318
328
|
},
|
|
319
329
|
},
|
|
320
330
|
outstandingReminders: {
|
|
321
|
-
callback: async ({ user, cohorts, type }) => {
|
|
322
|
-
if (!["home", "cohort"].includes(type))
|
|
331
|
+
callback: async ({ user, products, cohorts, type }) => {
|
|
332
|
+
if (!["home", "cohort"].includes(type) || !products.wex)
|
|
323
333
|
return;
|
|
324
334
|
if (!Array.isArray(cohorts)) {
|
|
325
335
|
const reminderCount = (await firebaseQuery.getCount(["reminders"], [(0, firestore_1.where)("oId", "==", cohorts.oId), (0, firestore_1.where)("uid", "==", user.id), (0, firestore_1.where)("dueDate", "<=", (0, util_2.convertDate)(new Date(), "dbstring")), (0, firestore_1.where)("cohort", "==", cohorts.id), (0, firestore_1.where)("status", "==", "upcoming")]));
|
|
@@ -353,8 +363,8 @@ const instituteTasks = {
|
|
|
353
363
|
},
|
|
354
364
|
},
|
|
355
365
|
invalidParentEmails: {
|
|
356
|
-
callback: async ({ user, cohorts, type }) => {
|
|
357
|
-
if (!["home", "cohort"].includes(type))
|
|
366
|
+
callback: async ({ user, products, cohorts, type }) => {
|
|
367
|
+
if (!["home", "cohort"].includes(type) || !products.wex)
|
|
358
368
|
return;
|
|
359
369
|
if (!(0, util_1.getAccess)(user, null, "signOffPlacements") || (user.userGroup !== "admin" && user.viewStudents === "none"))
|
|
360
370
|
return;
|
|
@@ -392,8 +402,8 @@ const instituteTasks = {
|
|
|
392
402
|
},
|
|
393
403
|
},
|
|
394
404
|
promptCohortAttendanceTracking: {
|
|
395
|
-
callback: async ({
|
|
396
|
-
if (!["home", "cohort"].includes(type))
|
|
405
|
+
callback: async ({ products, cohorts, type }) => {
|
|
406
|
+
if (!["home", "cohort"].includes(type) || !products.wex)
|
|
397
407
|
return;
|
|
398
408
|
const todayDate = new Date();
|
|
399
409
|
todayDate.setDate(todayDate.getDate() + 14);
|
|
@@ -431,8 +441,8 @@ const instituteTasks = {
|
|
|
431
441
|
},
|
|
432
442
|
},
|
|
433
443
|
expiredInsurance: {
|
|
434
|
-
callback: async ({ user, cohorts, type }) => {
|
|
435
|
-
if (!["home", "cohort"].includes(type))
|
|
444
|
+
callback: async ({ user, products, cohorts, type }) => {
|
|
445
|
+
if (!["home", "cohort"].includes(type) || !products.wex)
|
|
436
446
|
return;
|
|
437
447
|
const today = (0, util_2.convertDate)(new Date(), "dbstring");
|
|
438
448
|
if (!(0, util_1.getAccess)(user, null, "signOffPlacements") || (user.userGroup !== "admin" && user.viewStudents === "none"))
|
|
@@ -470,8 +480,8 @@ const instituteTasks = {
|
|
|
470
480
|
},
|
|
471
481
|
},
|
|
472
482
|
invalidProviderEmails: {
|
|
473
|
-
callback: async ({ user, cohorts, type }) => {
|
|
474
|
-
if (!["home", "cohort"].includes(type))
|
|
483
|
+
callback: async ({ user, products, cohorts, type }) => {
|
|
484
|
+
if (!["home", "cohort"].includes(type) || !products.wex)
|
|
475
485
|
return;
|
|
476
486
|
if (!(0, util_1.getAccess)(user, null, "signOffPlacements") || (user.userGroup !== "admin" && user.viewStudents === "none"))
|
|
477
487
|
return;
|
|
@@ -509,8 +519,8 @@ const instituteTasks = {
|
|
|
509
519
|
},
|
|
510
520
|
},
|
|
511
521
|
requiredStage: {
|
|
512
|
-
callback: async ({ user, cohorts, type }) => {
|
|
513
|
-
if (!["home", "cohort"].includes(type))
|
|
522
|
+
callback: async ({ user, products, cohorts, type }) => {
|
|
523
|
+
if (!["home", "cohort"].includes(type) || !products.wex)
|
|
514
524
|
return;
|
|
515
525
|
if (!(0, util_1.getAccess)(user, null, "signOffPlacements") || (user.userGroup !== "admin" && user.viewStudents === "none"))
|
|
516
526
|
return;
|
|
@@ -551,8 +561,8 @@ const instituteTasks = {
|
|
|
551
561
|
},
|
|
552
562
|
},
|
|
553
563
|
verifyInsurance: {
|
|
554
|
-
callback: async ({ user, cohorts, type }) => {
|
|
555
|
-
if (!["home", "cohort"].includes(type))
|
|
564
|
+
callback: async ({ user, products, cohorts, type }) => {
|
|
565
|
+
if (!["home", "cohort"].includes(type) || !products.wex)
|
|
556
566
|
return;
|
|
557
567
|
if (!(0, util_1.getAccess)(user, null, "verifyInsurance") || (user.userGroup !== "admin" && user.viewStudents === "none"))
|
|
558
568
|
return;
|
|
@@ -624,8 +634,8 @@ const instituteTasks = {
|
|
|
624
634
|
// },
|
|
625
635
|
// },
|
|
626
636
|
verifyDbsCheck: {
|
|
627
|
-
callback: async ({ user, cohorts, type }) => {
|
|
628
|
-
if (!["home", "cohort"].includes(type))
|
|
637
|
+
callback: async ({ user, products, cohorts, type }) => {
|
|
638
|
+
if (!["home", "cohort"].includes(type) || !products.wex)
|
|
629
639
|
return;
|
|
630
640
|
if (!(0, util_1.getAccess)(user, null, "verifyDbsChecks") || (user.userGroup !== "admin" && user.viewStudents === "none"))
|
|
631
641
|
return;
|
|
@@ -664,8 +674,8 @@ const instituteTasks = {
|
|
|
664
674
|
},
|
|
665
675
|
},
|
|
666
676
|
employerEventRequests: {
|
|
667
|
-
callback: async ({ user, type }) => {
|
|
668
|
-
if (type !== "home")
|
|
677
|
+
callback: async ({ user, products, type }) => {
|
|
678
|
+
if (type !== "home" || !products.events)
|
|
669
679
|
return;
|
|
670
680
|
const openRequests = await firebaseQuery.getCount(["externalEventRequests"], [(0, firestore_1.where)("oId", "==", user.oId), (0, firestore_1.where)("requestedBy", "==", "employer"), (0, firestore_1.where)("status", "==", "pendingInstitute")]);
|
|
671
681
|
if (openRequests > 0) {
|
|
@@ -682,8 +692,9 @@ const instituteTasks = {
|
|
|
682
692
|
},
|
|
683
693
|
},
|
|
684
694
|
schoolEventRequests: {
|
|
685
|
-
callback: async ({ user, type }) => {
|
|
686
|
-
|
|
695
|
+
callback: async ({ user, products, type }) => {
|
|
696
|
+
// Only a hub or trust is on the receiving end of a school's request.
|
|
697
|
+
if (type !== "home" || !products.events || !(products.isHub || products.isTrust))
|
|
687
698
|
return;
|
|
688
699
|
const openRequests = await firebaseQuery.getCount(["externalEventRequests"], [(0, firestore_1.where)("oId", "==", user.oId), (0, firestore_1.where)("requestedBy", "==", "school"), (0, firestore_1.where)("status", "==", "pendingInstitute")]);
|
|
689
700
|
if (openRequests > 0) {
|
|
@@ -700,8 +711,8 @@ const instituteTasks = {
|
|
|
700
711
|
},
|
|
701
712
|
},
|
|
702
713
|
eventsGetAvailableProviders: {
|
|
703
|
-
callback: async ({ user, eventId, type }) => {
|
|
704
|
-
if (!["home", "event"].includes(type))
|
|
714
|
+
callback: async ({ user, products, eventId, type }) => {
|
|
715
|
+
if (!["home", "event"].includes(type) || !products.events)
|
|
705
716
|
return;
|
|
706
717
|
if (type === "event" && eventId) {
|
|
707
718
|
const availableAttendees = await firebaseQuery.getCount(["externalEventAttendees"], [(0, firestore_1.where)("oId", "==", user.oId), (0, firestore_1.where)("eventId", "==", eventId), (0, firestore_1.where)("status", "==", "providerAvailable")]);
|
|
@@ -745,8 +756,8 @@ const instituteTasks = {
|
|
|
745
756
|
},
|
|
746
757
|
},
|
|
747
758
|
verifyRiskAssessment: {
|
|
748
|
-
callback: async ({ user, cohorts, type }) => {
|
|
749
|
-
if (!["home", "cohort"].includes(type))
|
|
759
|
+
callback: async ({ user, products, cohorts, type }) => {
|
|
760
|
+
if (!["home", "cohort"].includes(type) || !products.wex)
|
|
750
761
|
return;
|
|
751
762
|
if (!(0, util_1.getAccess)(user, null, "verifyRiskAssessments") || (user.userGroup !== "admin" && user.viewStudents === "none"))
|
|
752
763
|
return;
|
|
@@ -785,8 +796,8 @@ const instituteTasks = {
|
|
|
785
796
|
},
|
|
786
797
|
},
|
|
787
798
|
missingParentEmail: {
|
|
788
|
-
callback: async ({ user, cohorts, type }) => {
|
|
789
|
-
if (!["home", "cohort"].includes(type))
|
|
799
|
+
callback: async ({ user, products, cohorts, type }) => {
|
|
800
|
+
if (!["home", "cohort"].includes(type) || !products.wex)
|
|
790
801
|
return;
|
|
791
802
|
if (!(0, util_1.getAccess)(user, null, "editStudents") || (user.userGroup !== "admin" && user.viewStudents === "none"))
|
|
792
803
|
return;
|
|
@@ -837,8 +848,8 @@ const instituteTasks = {
|
|
|
837
848
|
},
|
|
838
849
|
},
|
|
839
850
|
inactiveStudents: {
|
|
840
|
-
callback: async ({ user, cohorts, type }) => {
|
|
841
|
-
if (!["home", "cohort"].includes(type))
|
|
851
|
+
callback: async ({ user, products, cohorts, type }) => {
|
|
852
|
+
if (!["home", "cohort"].includes(type) || !products.runsOwnStudents)
|
|
842
853
|
return;
|
|
843
854
|
if (!(0, util_1.getAccess)(user, null, "activateStudents") || (user.userGroup !== "admin" && user.viewStudents === "none"))
|
|
844
855
|
return;
|
|
@@ -883,8 +894,8 @@ const instituteTasks = {
|
|
|
883
894
|
},
|
|
884
895
|
},
|
|
885
896
|
uploadStudents: {
|
|
886
|
-
callback: async ({ user, cohorts, type }) => {
|
|
887
|
-
if (!["home", "cohort"].includes(type))
|
|
897
|
+
callback: async ({ user, products, cohorts, type }) => {
|
|
898
|
+
if (!["home", "cohort"].includes(type) || !products.wex)
|
|
888
899
|
return;
|
|
889
900
|
if (!Array.isArray(cohorts))
|
|
890
901
|
return;
|
|
@@ -948,8 +959,8 @@ const instituteTasks = {
|
|
|
948
959
|
},
|
|
949
960
|
},
|
|
950
961
|
approveProvider: {
|
|
951
|
-
callback: async ({ user,
|
|
952
|
-
if (!["home", "employerDatabase"].includes(type))
|
|
962
|
+
callback: async ({ user, products, type }) => {
|
|
963
|
+
if (!["home", "employerDatabase"].includes(type) || !products.network)
|
|
953
964
|
return;
|
|
954
965
|
const availableAttendees = await firebaseQuery.getCount(["providerContacts"], [(0, firestore_1.where)(`savedBy.${user.oId}.exists`, "==", true), (0, firestore_1.where)(`savedBy.${user.oId}.status`, "==", "providerReviewed")]);
|
|
955
966
|
if (availableAttendees > 0) {
|
|
@@ -1452,13 +1463,19 @@ const getInstituteTasks = async ({ user, organisation, cohort, school, type, eve
|
|
|
1452
1463
|
fCohort = await getCohortsOrSchoolsIfNotProvided("cohorts", fSchool);
|
|
1453
1464
|
}
|
|
1454
1465
|
console.log("FCOHORTS FOR TASKS", fCohort);
|
|
1466
|
+
// A trust's own flags say nothing about its schools' products, so resolve
|
|
1467
|
+
// against its schools too — the same rule the nav uses. Only meaningful when
|
|
1468
|
+
// the caller handed us real institute records (Tasks.tsx passes
|
|
1469
|
+
// trustOrHubSchools); the `schools` collection fallback carries no flags.
|
|
1470
|
+
const trustSchools = Array.isArray(fSchool) ? fSchool.map(([, school]) => school) : fSchool ? [fSchool] : undefined;
|
|
1471
|
+
const products = (0, productResolver_1.resolveProducts)(organisation, { trustSchools });
|
|
1455
1472
|
const processedTasks = await Object.entries(instituteTasks).reduce(async (accPromise, [itemName, item]) => {
|
|
1456
1473
|
if (!fCohort) {
|
|
1457
1474
|
console.log("No cohorts to retrieve tasks for");
|
|
1458
1475
|
return ({});
|
|
1459
1476
|
}
|
|
1460
1477
|
const acc = await accPromise;
|
|
1461
|
-
const queryResult = await item.callback({ user, organisation, cohorts: fCohort, schools: fSchool, type, eventId });
|
|
1478
|
+
const queryResult = await item.callback({ user, organisation, products, cohorts: fCohort, schools: fSchool, type, eventId });
|
|
1462
1479
|
if (!queryResult)
|
|
1463
1480
|
return acc;
|
|
1464
1481
|
return { ...acc, ...queryResult }; // Merge the query result into the accumulator object
|