placementt-core 1.400.1107 → 1.400.1109
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/activityLogging.d.ts +6 -28
- package/lib/activityLogging.js +9 -40
- package/lib/activityLogging.js.map +1 -1
- package/lib/activityLogging.test.js +39 -61
- package/lib/activityLogging.test.js.map +1 -1
- package/lib/callables/index.d.ts +0 -1
- package/lib/callables/index.js +0 -1
- package/lib/callables/index.js.map +1 -1
- package/lib/callables/registry.d.ts +424 -198
- package/lib/callables/registry.js +1 -3
- package/lib/callables/registry.js.map +1 -1
- package/lib/callables/studentLaunches.d.ts +107 -26
- package/lib/callables/studentLaunches.js +39 -20
- package/lib/callables/studentLaunches.js.map +1 -1
- package/lib/callables/surveys.d.ts +137 -53
- package/lib/callables/surveys.js +38 -23
- package/lib/callables/surveys.js.map +1 -1
- package/lib/featureMarketing.test.js +11 -5
- package/lib/featureMarketing.test.js.map +1 -1
- package/lib/firebase/callableJobContext.js +0 -5
- package/lib/firebase/callableJobContext.js.map +1 -1
- package/lib/firebase/firebase.d.ts +1 -1
- package/lib/firebase/firebase.js +0 -10
- package/lib/firebase/firebase.js.map +1 -1
- package/lib/groups.d.ts +0 -51
- package/lib/groups.js +1 -11
- package/lib/groups.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/onboardingPathways.test.js +10 -4
- package/lib/onboardingPathways.test.js.map +1 -1
- package/lib/skillsResolver.d.ts +32 -19
- package/lib/skillsResolver.js +31 -22
- package/lib/skillsResolver.js.map +1 -1
- package/lib/studentGroups.d.ts +357 -0
- package/lib/studentGroups.js +476 -0
- package/lib/studentGroups.js.map +1 -0
- package/lib/studentGroups.test.js +220 -0
- package/lib/studentGroups.test.js.map +1 -0
- package/lib/studentTools.d.ts +13 -13
- package/lib/studentTools.js +12 -12
- package/lib/studentTools.js.map +1 -1
- package/lib/surveys/checks.d.ts +5 -5
- package/lib/surveys/checks.js +4 -4
- package/lib/surveys/checks.js.map +1 -1
- package/lib/surveys/checks.test.js +5 -5
- package/lib/surveys/checks.test.js.map +1 -1
- package/lib/surveys/schedule.d.ts +22 -21
- package/lib/surveys/schedule.js +43 -47
- package/lib/surveys/schedule.js.map +1 -1
- package/lib/surveys/schedule.test.js +28 -18
- package/lib/surveys/schedule.test.js.map +1 -1
- package/lib/surveys/selection.d.ts +33 -40
- package/lib/surveys/selection.js +57 -58
- package/lib/surveys/selection.js.map +1 -1
- package/lib/surveys/selection.test.js +36 -34
- package/lib/surveys/selection.test.js.map +1 -1
- package/lib/surveys/types.d.ts +72 -65
- package/lib/surveys/types.js +33 -9
- package/lib/surveys/types.js.map +1 -1
- package/lib/typeDefinitions.d.ts +162 -191
- package/lib/typeDefinitions.js.map +1 -1
- package/package.json +1 -1
- package/src/activityLogging.test.ts +47 -75
- package/src/activityLogging.ts +12 -43
- package/src/callables/index.ts +0 -1
- package/src/callables/registry.ts +1 -3
- package/src/callables/studentLaunches.ts +38 -19
- package/src/callables/surveys.ts +39 -23
- package/src/featureMarketing.test.ts +14 -6
- package/src/firebase/callableJobContext.ts +0 -6
- package/src/firebase/firebase.tsx +1 -12
- package/src/groups.ts +1 -53
- package/src/index.ts +1 -1
- package/src/onboardingPathways.test.ts +13 -5
- package/src/skillsResolver.ts +37 -29
- package/src/studentGroups.test.ts +288 -0
- package/src/studentGroups.ts +578 -0
- package/src/studentTools.ts +19 -18
- package/src/surveys/checks.test.ts +5 -5
- package/src/surveys/checks.ts +5 -5
- package/src/surveys/schedule.test.ts +30 -19
- package/src/surveys/schedule.ts +47 -50
- package/src/surveys/selection.test.ts +38 -34
- package/src/surveys/selection.ts +65 -62
- package/src/surveys/types.ts +81 -67
- package/src/typeDefinitions.ts +163 -186
- package/lib/callables/activityLogging.d.ts +0 -69
- package/lib/callables/activityLogging.js +0 -49
- package/lib/callables/activityLogging.js.map +0 -1
- package/lib/callables/aspirations.d.ts +0 -32
- package/lib/callables/aspirations.js +0 -23
- package/lib/callables/aspirations.js.map +0 -1
- package/lib/studentAudiences.d.ts +0 -284
- package/lib/studentAudiences.js +0 -416
- package/lib/studentAudiences.js.map +0 -1
- package/lib/studentAudiences.test.js +0 -206
- package/lib/studentAudiences.test.js.map +0 -1
- package/lib/studentTools.test.d.ts +0 -1
- package/lib/studentTools.test.js +0 -57
- package/lib/studentTools.test.js.map +0 -1
- package/src/callables/activityLogging.ts +0 -47
- package/src/studentAudiences.test.ts +0 -260
- package/src/studentAudiences.ts +0 -509
- /package/lib/{studentAudiences.test.d.ts → studentGroups.test.d.ts} +0 -0
package/lib/activityLogging.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { InstituteData } from "./typeDefinitions";
|
|
2
|
+
import { StudentGroupCandidate } from "./studentGroups";
|
|
3
3
|
/**
|
|
4
4
|
* Whether a student can log activities, and whether we may email them about it.
|
|
5
5
|
*
|
|
@@ -8,40 +8,18 @@ import { AudienceCandidate } from "./studentAudiences";
|
|
|
8
8
|
* - `trackExtracurriculars` is the PRODUCT. Absent means on, which is right for
|
|
9
9
|
* staff: a school that has never touched the switch still gets the Activities
|
|
10
10
|
* area, its analytics and its Gatsby reporting.
|
|
11
|
-
* - `
|
|
11
|
+
* - `activityLoggingConfig` is the LAUNCH. It is what a school says to its students, and
|
|
12
12
|
* absent means nothing has been said. A feature that appears in a pupil's account
|
|
13
13
|
* unannounced gets used by nobody and asked about by everybody, so a group of
|
|
14
14
|
* students sees activity logging only once the school has launched it to them.
|
|
15
15
|
*
|
|
16
16
|
* Activity logging was the first thing a school launched, and for a while the only
|
|
17
17
|
* one; launching is now one shape for it and the two destinations tools alike, in
|
|
18
|
-
* ./
|
|
18
|
+
* ./studentGroups. What is left here is the product switch and the names the
|
|
19
19
|
* activity surfaces already know the launch by.
|
|
20
20
|
*/
|
|
21
21
|
/** Does the school have the Activities area at all? Absent means yes. */
|
|
22
22
|
export declare const activityLoggingProductOn: (institute?: Pick<InstituteData, "trackExtracurriculars">) => boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Does the stored launch still count today?
|
|
25
|
-
*
|
|
26
|
-
* @param {ActivityLoggingConfig} [config] the school's launch.
|
|
27
|
-
* @param {Date} [now] the date to judge it against.
|
|
28
|
-
* @return {boolean} whether the groups it names are live.
|
|
29
|
-
*/
|
|
30
|
-
export declare const activityLaunchCurrent: (config?: ActivityLoggingConfig, now?: Date) => boolean;
|
|
31
|
-
/**
|
|
32
|
-
* The year groups activity logging is live for right now.
|
|
33
|
-
*
|
|
34
|
-
* Only the year group form of a launch, which is how every launch was made before
|
|
35
|
-
* groups existed and what the original `launchActivityLogging` callable still
|
|
36
|
-
* writes. A launch made of groups answers a different question — see
|
|
37
|
-
* `liveAudiences` — and is deliberately not flattened into year groups here, since
|
|
38
|
-
* "Year 10 pupil premium" is not Year 10.
|
|
39
|
-
*
|
|
40
|
-
* @param {InstituteData} [institute] the school.
|
|
41
|
-
* @param {Date} [now] the date to judge the launch against.
|
|
42
|
-
* @return {string[]} the year group tags, empty when none is live.
|
|
43
|
-
*/
|
|
44
|
-
export declare const activityLoggingLiveYearGroups: (institute?: InstituteData, now?: Date) => string[];
|
|
45
23
|
/**
|
|
46
24
|
* Can THIS student log activities, and may we email them about it?
|
|
47
25
|
*
|
|
@@ -50,11 +28,11 @@ export declare const activityLoggingLiveYearGroups: (institute?: InstituteData,
|
|
|
50
28
|
* than being shown something their school hasn't announced.
|
|
51
29
|
*
|
|
52
30
|
* @param {InstituteData} [institute] their school.
|
|
53
|
-
* @param {
|
|
31
|
+
* @param {StudentGroupCandidate} [student] their record, with their uid as `id`.
|
|
54
32
|
* @param {Date} [now] the date to judge the launch against.
|
|
55
33
|
* @return {boolean} whether activity logging is live for them.
|
|
56
34
|
*/
|
|
57
|
-
export declare const activityLoggingLive: (institute?: InstituteData, student?:
|
|
35
|
+
export declare const activityLoggingLive: (institute?: InstituteData, student?: StudentGroupCandidate, now?: Date) => boolean;
|
|
58
36
|
/** Where a school's activity logging stands, in the vocabulary the careers year
|
|
59
37
|
* setup uses for every other programme. A launch with no groups reads as
|
|
60
38
|
* "unconfigured" rather than "unlaunched", because the setup questions and the
|
package/lib/activityLogging.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.activityLoggingState = exports.activityLoggingLive = exports.
|
|
4
|
-
const
|
|
3
|
+
exports.activityLoggingState = exports.activityLoggingLive = exports.activityLoggingProductOn = void 0;
|
|
4
|
+
const studentGroups_1 = require("./studentGroups");
|
|
5
5
|
/**
|
|
6
6
|
* Whether a student can log activities, and whether we may email them about it.
|
|
7
7
|
*
|
|
@@ -10,50 +10,19 @@ const studentAudiences_1 = require("./studentAudiences");
|
|
|
10
10
|
* - `trackExtracurriculars` is the PRODUCT. Absent means on, which is right for
|
|
11
11
|
* staff: a school that has never touched the switch still gets the Activities
|
|
12
12
|
* area, its analytics and its Gatsby reporting.
|
|
13
|
-
* - `
|
|
13
|
+
* - `activityLoggingConfig` is the LAUNCH. It is what a school says to its students, and
|
|
14
14
|
* absent means nothing has been said. A feature that appears in a pupil's account
|
|
15
15
|
* unannounced gets used by nobody and asked about by everybody, so a group of
|
|
16
16
|
* students sees activity logging only once the school has launched it to them.
|
|
17
17
|
*
|
|
18
18
|
* Activity logging was the first thing a school launched, and for a while the only
|
|
19
19
|
* one; launching is now one shape for it and the two destinations tools alike, in
|
|
20
|
-
* ./
|
|
20
|
+
* ./studentGroups. What is left here is the product switch and the names the
|
|
21
21
|
* activity surfaces already know the launch by.
|
|
22
22
|
*/
|
|
23
23
|
/** Does the school have the Activities area at all? Absent means yes. */
|
|
24
24
|
const activityLoggingProductOn = (institute) => institute?.trackExtracurriculars !== false;
|
|
25
25
|
exports.activityLoggingProductOn = activityLoggingProductOn;
|
|
26
|
-
/**
|
|
27
|
-
* Does the stored launch still count today?
|
|
28
|
-
*
|
|
29
|
-
* @param {ActivityLoggingConfig} [config] the school's launch.
|
|
30
|
-
* @param {Date} [now] the date to judge it against.
|
|
31
|
-
* @return {boolean} whether the groups it names are live.
|
|
32
|
-
*/
|
|
33
|
-
const activityLaunchCurrent = (config, now = new Date()) => (0, studentAudiences_1.launchCurrent)(config, now);
|
|
34
|
-
exports.activityLaunchCurrent = activityLaunchCurrent;
|
|
35
|
-
/**
|
|
36
|
-
* The year groups activity logging is live for right now.
|
|
37
|
-
*
|
|
38
|
-
* Only the year group form of a launch, which is how every launch was made before
|
|
39
|
-
* groups existed and what the original `launchActivityLogging` callable still
|
|
40
|
-
* writes. A launch made of groups answers a different question — see
|
|
41
|
-
* `liveAudiences` — and is deliberately not flattened into year groups here, since
|
|
42
|
-
* "Year 10 pupil premium" is not Year 10.
|
|
43
|
-
*
|
|
44
|
-
* @param {InstituteData} [institute] the school.
|
|
45
|
-
* @param {Date} [now] the date to judge the launch against.
|
|
46
|
-
* @return {string[]} the year group tags, empty when none is live.
|
|
47
|
-
*/
|
|
48
|
-
const activityLoggingLiveYearGroups = (institute, now = new Date()) => {
|
|
49
|
-
if (!(0, exports.activityLoggingProductOn)(institute))
|
|
50
|
-
return [];
|
|
51
|
-
const config = institute?.activityLogging;
|
|
52
|
-
if (!(0, exports.activityLaunchCurrent)(config, now))
|
|
53
|
-
return [];
|
|
54
|
-
return Object.entries(config?.yearGroups || {}).filter(([, on]) => on).map(([yg]) => yg);
|
|
55
|
-
};
|
|
56
|
-
exports.activityLoggingLiveYearGroups = activityLoggingLiveYearGroups;
|
|
57
26
|
/**
|
|
58
27
|
* Can THIS student log activities, and may we email them about it?
|
|
59
28
|
*
|
|
@@ -62,14 +31,14 @@ exports.activityLoggingLiveYearGroups = activityLoggingLiveYearGroups;
|
|
|
62
31
|
* than being shown something their school hasn't announced.
|
|
63
32
|
*
|
|
64
33
|
* @param {InstituteData} [institute] their school.
|
|
65
|
-
* @param {
|
|
34
|
+
* @param {StudentGroupCandidate} [student] their record, with their uid as `id`.
|
|
66
35
|
* @param {Date} [now] the date to judge the launch against.
|
|
67
36
|
* @return {boolean} whether activity logging is live for them.
|
|
68
37
|
*/
|
|
69
38
|
const activityLoggingLive = (institute, student, now = new Date()) => {
|
|
70
39
|
if (!(0, exports.activityLoggingProductOn)(institute))
|
|
71
40
|
return false;
|
|
72
|
-
return (0,
|
|
41
|
+
return (0, studentGroups_1.studentLaunchLive)(institute, "activities", student, now);
|
|
73
42
|
};
|
|
74
43
|
exports.activityLoggingLive = activityLoggingLive;
|
|
75
44
|
/**
|
|
@@ -83,14 +52,14 @@ exports.activityLoggingLive = activityLoggingLive;
|
|
|
83
52
|
* @return {ActivityLoggingState} what is left to do.
|
|
84
53
|
*/
|
|
85
54
|
const activityLoggingState = (institute, now = new Date()) => {
|
|
86
|
-
const config = institute?.
|
|
55
|
+
const config = institute?.activityLoggingConfig;
|
|
87
56
|
// Never answered, or answered and launched to nobody — both leave a school with
|
|
88
57
|
// the questions still to answer.
|
|
89
|
-
if (!config?.setupCompletedAt || !(0,
|
|
58
|
+
if (!config?.setupCompletedAt || !(0, studentGroups_1.launchedGroups)(institute, "activities").length)
|
|
90
59
|
return "unconfigured";
|
|
91
60
|
if (!(0, exports.activityLoggingProductOn)(institute))
|
|
92
61
|
return "unconfigured";
|
|
93
|
-
return (0,
|
|
62
|
+
return (0, studentGroups_1.liveGroups)(institute, "activities", now).length ? "live" : "needsLaunch";
|
|
94
63
|
};
|
|
95
64
|
exports.activityLoggingState = activityLoggingState;
|
|
96
65
|
//# sourceMappingURL=activityLogging.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activityLogging.js","sourceRoot":"","sources":["../src/activityLogging.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"activityLogging.js","sourceRoot":"","sources":["../src/activityLogging.ts"],"names":[],"mappings":";;;AACA,mDAKyB;AAEzB;;;;;;;;;;;;;;;;;GAiBG;AAEH,yEAAyE;AAClE,MAAM,wBAAwB,GAAG,CAAC,SAAwD,EAAW,EAAE,CAC1G,SAAS,EAAE,qBAAqB,KAAK,KAAK,CAAC;AADlC,QAAA,wBAAwB,4BACU;AAE/C;;;;;;;;;;;GAWG;AACI,MAAM,mBAAmB,GAAG,CAC/B,SAAyB,EAAE,OAA+B,EAAE,GAAG,GAAG,IAAI,IAAI,EAAE,EACrE,EAAE;IACT,IAAI,CAAC,IAAA,gCAAwB,EAAC,SAAS,CAAC;QAAE,OAAO,KAAK,CAAC;IACvD,OAAO,IAAA,iCAAiB,EAAC,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;AACpE,CAAC,CAAC;AALW,QAAA,mBAAmB,uBAK9B;AAQF;;;;;;;;;GASG;AACI,MAAM,oBAAoB,GAAG,CAAC,SAAyB,EAAE,GAAG,GAAG,IAAI,IAAI,EAAE,EAAwB,EAAE;IACtG,MAAM,MAAM,GAAG,SAAS,EAAE,qBAAqB,CAAC;IAChD,gFAAgF;IAChF,iCAAiC;IACjC,IAAI,CAAC,MAAM,EAAE,gBAAgB,IAAI,CAAC,IAAA,8BAAc,EAAC,SAAS,EAAE,YAAY,CAAC,CAAC,MAAM;QAAE,OAAO,cAAc,CAAC;IACxG,IAAI,CAAC,IAAA,gCAAwB,EAAC,SAAS,CAAC;QAAE,OAAO,cAAc,CAAC;IAChE,OAAO,IAAA,0BAAU,EAAC,SAAS,EAAE,YAAY,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC;AACpF,CAAC,CAAC;AAPW,QAAA,oBAAoB,wBAO/B"}
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const activityLogging_1 = require("./activityLogging");
|
|
4
|
+
const studentGroups_1 = require("./studentGroups");
|
|
4
5
|
// 1 September is the academic-year boundary the whole platform uses, so a launch
|
|
5
6
|
// made in one year is spent the moment the next one starts.
|
|
6
7
|
const IN_2026_27 = new Date("2026-10-01T09:00:00Z");
|
|
7
8
|
const IN_2027_28 = new Date("2027-10-01T09:00:00Z");
|
|
8
|
-
// The August before 2026-27 starts: still the 2025-26 academic year.
|
|
9
|
-
const AUGUST_2026 = new Date("2026-08-20T09:00:00Z");
|
|
10
9
|
const school = (overrides = {}) => ({
|
|
11
10
|
name: "Calder Park Academy",
|
|
12
11
|
...overrides,
|
|
13
12
|
});
|
|
14
|
-
|
|
13
|
+
/** A year group, launched for 2026-27 unless a year is named. `null` means the
|
|
14
|
+
* group is stored but has no launch stamp — access taken away, definition kept. */
|
|
15
|
+
const stamped = (yearGroup, launchedYear = "2026-27") => ({
|
|
16
|
+
...(0, studentGroups_1.yearGroupStudentGroup)(yearGroup, "2026-09-02T10:00:00Z"),
|
|
17
|
+
...(launchedYear ? { launchedYear } : {}),
|
|
18
|
+
});
|
|
19
|
+
const launched = (groups, extra = {}) => school({ activityLoggingConfig: {
|
|
15
20
|
setupCompletedAt: "2026-09-02T10:00:00Z",
|
|
16
|
-
|
|
17
|
-
yearGroups,
|
|
21
|
+
groups,
|
|
18
22
|
...extra,
|
|
19
23
|
} });
|
|
20
24
|
describe("activityLoggingProductOn", () => {
|
|
@@ -28,77 +32,51 @@ describe("activityLoggingProductOn", () => {
|
|
|
28
32
|
expect((0, activityLogging_1.activityLoggingProductOn)(school({ trackExtracurriculars: false }))).toBe(false);
|
|
29
33
|
});
|
|
30
34
|
});
|
|
31
|
-
describe("activityLaunchCurrent", () => {
|
|
32
|
-
it("is false with nothing launched", () => {
|
|
33
|
-
expect((0, activityLogging_1.activityLaunchCurrent)(undefined, IN_2026_27)).toBe(false);
|
|
34
|
-
expect((0, activityLogging_1.activityLaunchCurrent)({ yearGroups: { "Year 12": true } }, IN_2026_27)).toBe(false);
|
|
35
|
-
});
|
|
36
|
-
it("holds within the year it was launched for", () => {
|
|
37
|
-
expect((0, activityLogging_1.activityLaunchCurrent)({ launchedYear: "2026-27" }, IN_2026_27)).toBe(true);
|
|
38
|
-
});
|
|
39
|
-
it("is spent by the next academic year", () => {
|
|
40
|
-
expect((0, activityLogging_1.activityLaunchCurrent)({ launchedYear: "2026-27" }, IN_2027_28)).toBe(false);
|
|
41
|
-
});
|
|
42
|
-
it("carries forward when the school asked it to", () => {
|
|
43
|
-
expect((0, activityLogging_1.activityLaunchCurrent)({ launchedYear: "2026-27", rollOver: true }, IN_2027_28)).toBe(true);
|
|
44
|
-
});
|
|
45
|
-
it("counts August as the year that is ending, not the one about to start", () => {
|
|
46
|
-
expect((0, activityLogging_1.activityLaunchCurrent)({ launchedYear: "2025-26" }, AUGUST_2026)).toBe(true);
|
|
47
|
-
expect((0, activityLogging_1.activityLaunchCurrent)({ launchedYear: "2026-27" }, AUGUST_2026)).toBe(false);
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
35
|
/** A pupil, as the gate reads one: their uid and whatever their record holds. */
|
|
51
36
|
const pupil = (year) => ({ id: "pupil-1", details: year ? { year } : {} });
|
|
52
37
|
describe("activityLoggingLive", () => {
|
|
53
38
|
it("is live for a launched year group", () => {
|
|
54
|
-
expect((0, activityLogging_1.activityLoggingLive)(launched(
|
|
39
|
+
expect((0, activityLogging_1.activityLoggingLive)(launched([stamped("Year 12")]), pupil("Year 12"), IN_2026_27)).toBe(true);
|
|
55
40
|
});
|
|
56
41
|
it("is not live for a year group left out of the launch", () => {
|
|
57
|
-
expect((0, activityLogging_1.activityLoggingLive)(launched(
|
|
42
|
+
expect((0, activityLogging_1.activityLoggingLive)(launched([stamped("Year 12")]), pupil("Year 9"), IN_2026_27)).toBe(false);
|
|
58
43
|
});
|
|
59
|
-
it("is not live for a
|
|
60
|
-
expect((0, activityLogging_1.activityLoggingLive)(launched(
|
|
44
|
+
it("is not live for a group whose launch stamp was cleared", () => {
|
|
45
|
+
expect((0, activityLogging_1.activityLoggingLive)(launched([stamped("Year 12", null)]), pupil("Year 12"), IN_2026_27)).toBe(false);
|
|
61
46
|
});
|
|
62
47
|
it("is not live for a student with no year group on their record", () => {
|
|
63
|
-
expect((0, activityLogging_1.activityLoggingLive)(launched(
|
|
48
|
+
expect((0, activityLogging_1.activityLoggingLive)(launched([stamped("Year 12")]), pupil(), IN_2026_27)).toBe(false);
|
|
64
49
|
});
|
|
65
50
|
it("stops at the new academic year unless the launch rolls over", () => {
|
|
66
|
-
expect((0, activityLogging_1.activityLoggingLive)(launched(
|
|
67
|
-
expect((0, activityLogging_1.activityLoggingLive)(launched(
|
|
51
|
+
expect((0, activityLogging_1.activityLoggingLive)(launched([stamped("Year 12")]), pupil("Year 12"), IN_2027_28)).toBe(false);
|
|
52
|
+
expect((0, activityLogging_1.activityLoggingLive)(launched([stamped("Year 12")], { rollOver: true }), pupil("Year 12"), IN_2027_28)).toBe(true);
|
|
68
53
|
});
|
|
69
54
|
it("is never live when the product itself is off, whatever the launch says", () => {
|
|
70
|
-
const off = launched(
|
|
55
|
+
const off = launched([stamped("Year 12")]);
|
|
71
56
|
off.trackExtracurriculars = false;
|
|
72
57
|
expect((0, activityLogging_1.activityLoggingLive)(off, pupil("Year 12"), IN_2026_27)).toBe(false);
|
|
73
58
|
});
|
|
74
59
|
it("matches the school's own year tag verbatim rather than normalising it", () => {
|
|
75
|
-
expect((0, activityLogging_1.activityLoggingLive)(launched(
|
|
76
|
-
expect((0, activityLogging_1.activityLoggingLive)(launched(
|
|
60
|
+
expect((0, activityLogging_1.activityLoggingLive)(launched([stamped("Yr 12 (KS5)")]), pupil("Yr 12 (KS5)"), IN_2026_27)).toBe(true);
|
|
61
|
+
expect((0, activityLogging_1.activityLoggingLive)(launched([stamped("Yr 12 (KS5)")]), pupil("Year 12"), IN_2026_27)).toBe(false);
|
|
77
62
|
});
|
|
78
63
|
it("is live for a pupil a launched group's filter matches, not just a year group", () => {
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
describe("activityLoggingLiveYearGroups", () => {
|
|
96
|
-
it("lists only the year groups switched on", () => {
|
|
97
|
-
expect((0, activityLogging_1.activityLoggingLiveYearGroups)(launched({ "Year 9": true, "Year 10": false, "Year 12": true }), IN_2026_27))
|
|
98
|
-
.toEqual(["Year 9", "Year 12"]);
|
|
99
|
-
});
|
|
100
|
-
it("is empty once the launch is spent", () => {
|
|
101
|
-
expect((0, activityLogging_1.activityLoggingLiveYearGroups)(launched({ "Year 9": true }), IN_2027_28)).toEqual([]);
|
|
64
|
+
const withPp = launched([{
|
|
65
|
+
id: "pp",
|
|
66
|
+
label: "Year 11 pupil premium",
|
|
67
|
+
filters: { allSelected: true, search: undefined, filters: [
|
|
68
|
+
{ k: "details.year", v: "Year 11" }, { k: "userGroup", v: "pupilPremium" },
|
|
69
|
+
] },
|
|
70
|
+
createdAt: "2026-09-02T10:00:00Z",
|
|
71
|
+
launchedYear: "2026-27",
|
|
72
|
+
}]);
|
|
73
|
+
expect((0, activityLogging_1.activityLoggingLive)(withPp, { id: "a", details: { year: "Year 11" }, userGroup: "pupilPremium" }, IN_2026_27)).toBe(true);
|
|
74
|
+
expect((0, activityLogging_1.activityLoggingLive)(withPp, { id: "b", details: { year: "Year 11" } }, IN_2026_27)).toBe(false);
|
|
75
|
+
});
|
|
76
|
+
it("judges each group's stamp on its own, so relaunching one year leaves the other spent", () => {
|
|
77
|
+
const mixed = launched([stamped("Year 9", "2027-28"), stamped("Year 10", "2026-27")]);
|
|
78
|
+
expect((0, activityLogging_1.activityLoggingLive)(mixed, pupil("Year 9"), IN_2027_28)).toBe(true);
|
|
79
|
+
expect((0, activityLogging_1.activityLoggingLive)(mixed, pupil("Year 10"), IN_2027_28)).toBe(false);
|
|
102
80
|
});
|
|
103
81
|
});
|
|
104
82
|
describe("activityLoggingState", () => {
|
|
@@ -106,16 +84,16 @@ describe("activityLoggingState", () => {
|
|
|
106
84
|
expect((0, activityLogging_1.activityLoggingState)(school(), IN_2026_27)).toBe("unconfigured");
|
|
107
85
|
});
|
|
108
86
|
it("is unconfigured when setup was answered but nobody was launched to", () => {
|
|
109
|
-
expect((0, activityLogging_1.activityLoggingState)(launched(
|
|
87
|
+
expect((0, activityLogging_1.activityLoggingState)(launched([stamped("Year 9", null)]), IN_2026_27)).toBe("unconfigured");
|
|
110
88
|
});
|
|
111
89
|
it("is live while a launch stands", () => {
|
|
112
|
-
expect((0, activityLogging_1.activityLoggingState)(launched(
|
|
90
|
+
expect((0, activityLogging_1.activityLoggingState)(launched([stamped("Year 9")]), IN_2026_27)).toBe("live");
|
|
113
91
|
});
|
|
114
92
|
it("asks for a new launch once the year has rolled over", () => {
|
|
115
|
-
expect((0, activityLogging_1.activityLoggingState)(launched(
|
|
93
|
+
expect((0, activityLogging_1.activityLoggingState)(launched([stamped("Year 9")]), IN_2027_28)).toBe("needsLaunch");
|
|
116
94
|
});
|
|
117
95
|
it("stays live across years when the school said it should", () => {
|
|
118
|
-
expect((0, activityLogging_1.activityLoggingState)(launched(
|
|
96
|
+
expect((0, activityLogging_1.activityLoggingState)(launched([stamped("Year 9")], { rollOver: true }), IN_2027_28)).toBe("live");
|
|
119
97
|
});
|
|
120
98
|
});
|
|
121
99
|
//# sourceMappingURL=activityLogging.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activityLogging.test.js","sourceRoot":"","sources":["../src/activityLogging.test.ts"],"names":[],"mappings":";;AACA,
|
|
1
|
+
{"version":3,"file":"activityLogging.test.js","sourceRoot":"","sources":["../src/activityLogging.test.ts"],"names":[],"mappings":";;AACA,uDAI2B;AAC3B,mDAAsD;AAEtD,iFAAiF;AACjF,4DAA4D;AAC5D,MAAM,UAAU,GAAG,IAAI,IAAI,CAAC,sBAAsB,CAAC,CAAC;AACpD,MAAM,UAAU,GAAG,I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,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC3G,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
package/lib/callables/index.d.ts
CHANGED
package/lib/callables/index.js
CHANGED
|
@@ -22,7 +22,6 @@ __exportStar(require("./events"), exports);
|
|
|
22
22
|
__exportStar(require("./jobRoles"), exports);
|
|
23
23
|
__exportStar(require("./apprenticeships"), exports);
|
|
24
24
|
__exportStar(require("./he"), exports);
|
|
25
|
-
__exportStar(require("./activityLogging"), exports);
|
|
26
25
|
__exportStar(require("./studentLaunches"), exports);
|
|
27
26
|
__exportStar(require("./billing"), exports);
|
|
28
27
|
__exportStar(require("./hubImpactReport"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/callables/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,6CAA2B;AAC3B,uDAAqC;AACrC,8CAA4B;AAC5B,2CAAyB;AACzB,6CAA2B;AAC3B,oDAAkC;AAClC,uCAAqB;AACrB,oDAAkC;AAClC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/callables/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,6CAA2B;AAC3B,uDAAqC;AACrC,8CAA4B;AAC5B,2CAAyB;AACzB,6CAA2B;AAC3B,oDAAkC;AAClC,uCAAqB;AACrB,oDAAkC;AAClC,4CAA0B;AAC1B,oDAAkC"}
|