placementt-core 1.400.1066 → 1.400.1068
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/registry.d.ts +0 -6
- package/lib/callables/surveys.d.ts +4 -6
- package/lib/callables/surveys.js +4 -4
- package/lib/callables/surveys.js.map +1 -1
- package/lib/surveys/schedule.d.ts +34 -7
- package/lib/surveys/schedule.js +43 -10
- package/lib/surveys/schedule.js.map +1 -1
- package/lib/surveys/types.d.ts +12 -0
- package/lib/surveys/types.js.map +1 -1
- package/package.json +1 -1
- package/src/callables/surveys.ts +4 -4
- package/src/surveys/schedule.ts +52 -19
- package/src/surveys/types.ts +12 -0
|
@@ -845,17 +845,14 @@ export declare const allCallables: {
|
|
|
845
845
|
response: z.ZodObject<{
|
|
846
846
|
created: z.ZodNumber;
|
|
847
847
|
academicYear: z.ZodString;
|
|
848
|
-
rolledForward: z.ZodBoolean;
|
|
849
848
|
removed: z.ZodOptional<z.ZodNumber>;
|
|
850
849
|
}, "strip", z.ZodTypeAny, {
|
|
851
850
|
created: number;
|
|
852
851
|
academicYear: string;
|
|
853
|
-
rolledForward: boolean;
|
|
854
852
|
removed?: number | undefined;
|
|
855
853
|
}, {
|
|
856
854
|
created: number;
|
|
857
855
|
academicYear: string;
|
|
858
|
-
rolledForward: boolean;
|
|
859
856
|
removed?: number | undefined;
|
|
860
857
|
}>;
|
|
861
858
|
};
|
|
@@ -1518,17 +1515,14 @@ export declare const callableGroups: {
|
|
|
1518
1515
|
response: z.ZodObject<{
|
|
1519
1516
|
created: z.ZodNumber;
|
|
1520
1517
|
academicYear: z.ZodString;
|
|
1521
|
-
rolledForward: z.ZodBoolean;
|
|
1522
1518
|
removed: z.ZodOptional<z.ZodNumber>;
|
|
1523
1519
|
}, "strip", z.ZodTypeAny, {
|
|
1524
1520
|
created: number;
|
|
1525
1521
|
academicYear: string;
|
|
1526
|
-
rolledForward: boolean;
|
|
1527
1522
|
removed?: number | undefined;
|
|
1528
1523
|
}, {
|
|
1529
1524
|
created: number;
|
|
1530
1525
|
academicYear: string;
|
|
1531
|
-
rolledForward: boolean;
|
|
1532
1526
|
removed?: number | undefined;
|
|
1533
1527
|
}>;
|
|
1534
1528
|
};
|
|
@@ -320,7 +320,10 @@ export declare const surveyCallables: {
|
|
|
320
320
|
oId: z.ZodString;
|
|
321
321
|
/** Omit for every programme the institute runs. */
|
|
322
322
|
scope: z.ZodOptional<z.ZodEnum<[string, ...string[]]>>;
|
|
323
|
-
/** Provision the upcoming academic year rather than the current one.
|
|
323
|
+
/** Provision the upcoming academic year rather than the current one.
|
|
324
|
+
* Provisioning never chooses the year ahead by itself: a school whose
|
|
325
|
+
* dates for this year have passed is told so, and next year is created
|
|
326
|
+
* only when staff ask for it here. */
|
|
324
327
|
nextYear: z.ZodOptional<z.ZodBoolean>;
|
|
325
328
|
/** Make the year MATCH the schedule rather than only adding to it: a
|
|
326
329
|
* survey whose date moved is moved, and one dropped from the schedule is
|
|
@@ -346,20 +349,15 @@ export declare const surveyCallables: {
|
|
|
346
349
|
response: z.ZodObject<{
|
|
347
350
|
created: z.ZodNumber;
|
|
348
351
|
academicYear: z.ZodString;
|
|
349
|
-
/** True when the current year had nothing left to create and the next
|
|
350
|
-
* academic year was provisioned instead. */
|
|
351
|
-
rolledForward: z.ZodBoolean;
|
|
352
352
|
/** Cycles moved or dropped to match the schedule (reconcile only). */
|
|
353
353
|
removed: z.ZodOptional<z.ZodNumber>;
|
|
354
354
|
}, "strip", z.ZodTypeAny, {
|
|
355
355
|
created: number;
|
|
356
356
|
academicYear: string;
|
|
357
|
-
rolledForward: boolean;
|
|
358
357
|
removed?: number | undefined;
|
|
359
358
|
}, {
|
|
360
359
|
created: number;
|
|
361
360
|
academicYear: string;
|
|
362
|
-
rolledForward: boolean;
|
|
363
361
|
removed?: number | undefined;
|
|
364
362
|
}>;
|
|
365
363
|
};
|
package/lib/callables/surveys.js
CHANGED
|
@@ -130,7 +130,10 @@ exports.surveyCallables = {
|
|
|
130
130
|
oId: zod_1.z.string(),
|
|
131
131
|
/** Omit for every programme the institute runs. */
|
|
132
132
|
scope: groupScope.optional(),
|
|
133
|
-
/** Provision the upcoming academic year rather than the current one.
|
|
133
|
+
/** Provision the upcoming academic year rather than the current one.
|
|
134
|
+
* Provisioning never chooses the year ahead by itself: a school whose
|
|
135
|
+
* dates for this year have passed is told so, and next year is created
|
|
136
|
+
* only when staff ask for it here. */
|
|
134
137
|
nextYear: zod_1.z.boolean().optional(),
|
|
135
138
|
/** Make the year MATCH the schedule rather than only adding to it: a
|
|
136
139
|
* survey whose date moved is moved, and one dropped from the schedule is
|
|
@@ -146,9 +149,6 @@ exports.surveyCallables = {
|
|
|
146
149
|
response: zod_1.z.object({
|
|
147
150
|
created: zod_1.z.number(),
|
|
148
151
|
academicYear: zod_1.z.string(),
|
|
149
|
-
/** True when the current year had nothing left to create and the next
|
|
150
|
-
* academic year was provisioned instead. */
|
|
151
|
-
rolledForward: zod_1.z.boolean(),
|
|
152
152
|
/** Cycles moved or dropped to match the schedule (reconcile only). */
|
|
153
153
|
removed: zod_1.z.number().optional(),
|
|
154
154
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surveys.js","sourceRoot":"","sources":["../../src/callables/surveys.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AAEtB,4CAAwE;AAExE;;;;;;;GAOG;AAEH,MAAM,UAAU,GAAG,OAAC,CAAC,IAAI,CAAC,yBAA0C,CAAC,CAAC;AACtE,MAAM,UAAU,GAAG,OAAC,CAAC,IAAI,CAAC,2BAA4C,CAAC,CAAC;AAExE,MAAM,MAAM,GAAG,OAAC,CAAC,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAChC,OAAO,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC/B,SAAS,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EA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,CAAC,CAAC,QAAQ,EAAE;YAC5F,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAC5B,KAAK,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,CAAC,CAAC,CAAC,QAAQ,EAAE;YAChF,QAAQ,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;SACnC,CAAC;QACF,QAAQ,EAAE,OAAC,CAAC,MAAM,CAAC,EAAC,OAAO,EAAE,OAAC,CAAC,OAAO,EAAE,EAAC,CAAC,CAAC,WAAW,EAAE;KAC3D;CACoB,CAAC"}
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
* A rule is year-agnostic; it resolves into a concrete date for a given academic
|
|
10
10
|
* year (each September) via surveyRuleToMMDD / surveyRuleToDate.
|
|
11
11
|
*
|
|
12
|
-
* It also answers
|
|
13
|
-
* foot of this file
|
|
14
|
-
*
|
|
12
|
+
* It also answers whether a programme has any send left in the academic year we are in
|
|
13
|
+
* (programmeStartYear, at the foot of this file), which is what the "nothing left to
|
|
14
|
+
* create, use next year" wording is read off.
|
|
15
15
|
*
|
|
16
16
|
* ── One academic-year boundary: 1 September ───────────────────────────────────
|
|
17
17
|
* Everything here derives the academic year the same way — currentAcademicStartYear,
|
|
@@ -96,6 +96,28 @@ export declare const slotMMDDForYear: (slot: SurveySlot, academicStartYear: numb
|
|
|
96
96
|
* survey on the timeline and send it by hand.
|
|
97
97
|
*/
|
|
98
98
|
export declare const resolveSlotsForYear: (slots: SurveySlot[] | undefined, academicStartYear: number) => ResolvedSurveySlot[];
|
|
99
|
+
/**
|
|
100
|
+
* Whether a shared schedule's slot is one this year group actually gets.
|
|
101
|
+
*
|
|
102
|
+
* A slot with no year groups named is the normal case: the schedule describes the
|
|
103
|
+
* programme, and the programme runs for every year group on it. Naming year groups
|
|
104
|
+
* narrows one slot to some of them, which is how "everybody has the October
|
|
105
|
+
* conversation, only Year 11 has the February one" is said without giving Year 11 a
|
|
106
|
+
* schedule of its own.
|
|
107
|
+
*
|
|
108
|
+
* @param {SurveySlot} slot the scheduled send.
|
|
109
|
+
* @param {string} yearGroup the year group the schedule is being laid out for.
|
|
110
|
+
* @return {boolean} true when this year group gets it.
|
|
111
|
+
*/
|
|
112
|
+
export declare const slotAppliesToYearGroup: (slot: Pick<SurveySlot, "yearGroups">, yearGroup: string) => boolean;
|
|
113
|
+
/**
|
|
114
|
+
* A shared schedule as one year group runs it.
|
|
115
|
+
*
|
|
116
|
+
* @param {SurveySlot[]} [slots] the shared schedule.
|
|
117
|
+
* @param {string} yearGroup the year group.
|
|
118
|
+
* @return {SurveySlot[]} the slots that year group gets, in the order given.
|
|
119
|
+
*/
|
|
120
|
+
export declare const slotsForYearGroup: <T extends Pick<SurveySlot, "yearGroups">>(slots: T[] | undefined, yearGroup: string) => T[];
|
|
99
121
|
/**
|
|
100
122
|
* Is this slot's send day the given date? Compares MM-DD, resolving any rule against
|
|
101
123
|
* the academic year `date` sits in, which is how the daily crons decide what to fire.
|
|
@@ -140,11 +162,16 @@ export type SurveyProgrammeConfig = Pick<InstituteData, "destinationsConfig" | "
|
|
|
140
162
|
*/
|
|
141
163
|
export declare const programmeSendDatesForYear: (institute: SurveyProgrammeConfig, scope: SurveyGroupScope, academicStartYear: number) => string[];
|
|
142
164
|
/**
|
|
143
|
-
* The academic year a programme
|
|
144
|
-
*
|
|
165
|
+
* The academic year a programme has work left in, as its start year: the current one
|
|
166
|
+
* while any of its sends is still to come, the next one once they have all gone by.
|
|
167
|
+
*
|
|
168
|
+
* NOT what provisioning lays out. Provisioning does the year we are in, and the year
|
|
169
|
+
* ahead only when staff ask for it, because creating an academic year hands a school a
|
|
170
|
+
* cohort it has not taught yet. This answers the question the wording asks: "is there
|
|
171
|
+
* anything left to create this year, or should we point them at next year's button?"
|
|
145
172
|
*
|
|
146
|
-
* A programme with nothing configured stays on the current year
|
|
147
|
-
*
|
|
173
|
+
* A programme with nothing configured stays on the current year: there is nothing to
|
|
174
|
+
* look forward to, and the current year is still the one staff are working in.
|
|
148
175
|
*
|
|
149
176
|
* @param {SurveyProgrammeConfig} institute the school's setup.
|
|
150
177
|
* @param {SurveyGroupScope} scope which programme.
|
package/lib/surveys/schedule.js
CHANGED
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
* A rule is year-agnostic; it resolves into a concrete date for a given academic
|
|
11
11
|
* year (each September) via surveyRuleToMMDD / surveyRuleToDate.
|
|
12
12
|
*
|
|
13
|
-
* It also answers
|
|
14
|
-
* foot of this file
|
|
15
|
-
*
|
|
13
|
+
* It also answers whether a programme has any send left in the academic year we are in
|
|
14
|
+
* (programmeStartYear, at the foot of this file), which is what the "nothing left to
|
|
15
|
+
* create, use next year" wording is read off.
|
|
16
16
|
*
|
|
17
17
|
* ── One academic-year boundary: 1 September ───────────────────────────────────
|
|
18
18
|
* Everything here derives the academic year the same way — currentAcademicStartYear,
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
* callers move onto the engine, so new writes agree with migrated ones.
|
|
31
31
|
*/
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.programmeAcademicYear = exports.programmeStartYear = exports.programmeSendDatesForYear = exports.resolveLeaverLegsForYearGroup = exports.isSlotDueOn = exports.resolveSlotsForYear = exports.slotMMDDForYear = exports.mmddToISO = exports.surveyRuleToMMDD = exports.surveyRuleToDate = exports.resolveNthWeekday = exports.normaliseAcademicYear = exports.academicYearSlashLabel = exports.academicYearOf = exports.academicYearLabel = exports.currentAcademicStartYear = exports.academicCalendarYear = exports.toMMDD = void 0;
|
|
33
|
+
exports.programmeAcademicYear = exports.programmeStartYear = exports.programmeSendDatesForYear = exports.resolveLeaverLegsForYearGroup = exports.isSlotDueOn = exports.slotsForYearGroup = exports.slotAppliesToYearGroup = exports.resolveSlotsForYear = exports.slotMMDDForYear = exports.mmddToISO = exports.surveyRuleToMMDD = exports.surveyRuleToDate = exports.resolveNthWeekday = exports.normaliseAcademicYear = exports.academicYearSlashLabel = exports.academicYearOf = exports.academicYearLabel = exports.currentAcademicStartYear = exports.academicCalendarYear = exports.toMMDD = void 0;
|
|
34
34
|
const pad2 = (n) => String(n).padStart(2, "0");
|
|
35
35
|
/** "MM-DD" for a date, in local time — the format survey slots are stored in. */
|
|
36
36
|
const toMMDD = (date = new Date()) => `${pad2(date.getMonth() + 1)}-${pad2(date.getDate())}`;
|
|
@@ -140,6 +140,30 @@ const resolveSlotsForYear = (slots, academicStartYear) => (slots || [])
|
|
|
140
140
|
.filter((slot) => Boolean(slot.sendISO))
|
|
141
141
|
.sort((a, b) => a.sendISO.localeCompare(b.sendISO));
|
|
142
142
|
exports.resolveSlotsForYear = resolveSlotsForYear;
|
|
143
|
+
/**
|
|
144
|
+
* Whether a shared schedule's slot is one this year group actually gets.
|
|
145
|
+
*
|
|
146
|
+
* A slot with no year groups named is the normal case: the schedule describes the
|
|
147
|
+
* programme, and the programme runs for every year group on it. Naming year groups
|
|
148
|
+
* narrows one slot to some of them, which is how "everybody has the October
|
|
149
|
+
* conversation, only Year 11 has the February one" is said without giving Year 11 a
|
|
150
|
+
* schedule of its own.
|
|
151
|
+
*
|
|
152
|
+
* @param {SurveySlot} slot the scheduled send.
|
|
153
|
+
* @param {string} yearGroup the year group the schedule is being laid out for.
|
|
154
|
+
* @return {boolean} true when this year group gets it.
|
|
155
|
+
*/
|
|
156
|
+
const slotAppliesToYearGroup = (slot, yearGroup) => !slot.yearGroups?.length || slot.yearGroups.map(String).includes(String(yearGroup));
|
|
157
|
+
exports.slotAppliesToYearGroup = slotAppliesToYearGroup;
|
|
158
|
+
/**
|
|
159
|
+
* A shared schedule as one year group runs it.
|
|
160
|
+
*
|
|
161
|
+
* @param {SurveySlot[]} [slots] the shared schedule.
|
|
162
|
+
* @param {string} yearGroup the year group.
|
|
163
|
+
* @return {SurveySlot[]} the slots that year group gets, in the order given.
|
|
164
|
+
*/
|
|
165
|
+
const slotsForYearGroup = (slots, yearGroup) => (slots ?? []).filter((slot) => (0, exports.slotAppliesToYearGroup)(slot, yearGroup));
|
|
166
|
+
exports.slotsForYearGroup = slotsForYearGroup;
|
|
143
167
|
/**
|
|
144
168
|
* Is this slot's send day the given date? Compares MM-DD, resolving any rule against
|
|
145
169
|
* the academic year `date` sits in, which is how the daily crons decide what to fire.
|
|
@@ -209,7 +233,10 @@ const programmeSendDatesForYear = (institute, scope, academicStartYear) => {
|
|
|
209
233
|
if (!cfg?.enabled || !cfg.yearGroups?.length)
|
|
210
234
|
return [];
|
|
211
235
|
for (const yearGroup of cfg.yearGroups) {
|
|
212
|
-
|
|
236
|
+
// A year group's own schedule is already about one year group; the shared
|
|
237
|
+
// one is narrowed to the slots this year group is actually on.
|
|
238
|
+
const slots = cfg.surveysByYearGroup?.[String(yearGroup)] ??
|
|
239
|
+
(0, exports.slotsForYearGroup)(cfg.surveys, String(yearGroup));
|
|
213
240
|
dates.push(...(0, exports.resolveSlotsForYear)(slots, academicStartYear).map((s) => s.sendISO));
|
|
214
241
|
}
|
|
215
242
|
}
|
|
@@ -237,7 +264,8 @@ const programmeSendDatesForYear = (institute, scope, academicStartYear) => {
|
|
|
237
264
|
if (!cfg?.enabled || !cfg.yearGroups?.length)
|
|
238
265
|
return [];
|
|
239
266
|
for (const yearGroup of cfg.yearGroups) {
|
|
240
|
-
const slots = cfg.slotsByYearGroup?.[String(yearGroup)] ??
|
|
267
|
+
const slots = cfg.slotsByYearGroup?.[String(yearGroup)] ??
|
|
268
|
+
(0, exports.slotsForYearGroup)(cfg.slots, String(yearGroup));
|
|
241
269
|
dates.push(...(0, exports.resolveSlotsForYear)(slots, academicStartYear).map((s) => s.sendISO));
|
|
242
270
|
}
|
|
243
271
|
// A named group's own slots count too: a cohort whose only 1:1 this year is
|
|
@@ -250,11 +278,16 @@ const programmeSendDatesForYear = (institute, scope, academicStartYear) => {
|
|
|
250
278
|
};
|
|
251
279
|
exports.programmeSendDatesForYear = programmeSendDatesForYear;
|
|
252
280
|
/**
|
|
253
|
-
* The academic year a programme
|
|
254
|
-
*
|
|
281
|
+
* The academic year a programme has work left in, as its start year: the current one
|
|
282
|
+
* while any of its sends is still to come, the next one once they have all gone by.
|
|
283
|
+
*
|
|
284
|
+
* NOT what provisioning lays out. Provisioning does the year we are in, and the year
|
|
285
|
+
* ahead only when staff ask for it, because creating an academic year hands a school a
|
|
286
|
+
* cohort it has not taught yet. This answers the question the wording asks: "is there
|
|
287
|
+
* anything left to create this year, or should we point them at next year's button?"
|
|
255
288
|
*
|
|
256
|
-
* A programme with nothing configured stays on the current year
|
|
257
|
-
*
|
|
289
|
+
* A programme with nothing configured stays on the current year: there is nothing to
|
|
290
|
+
* look forward to, and the current year is still the one staff are working in.
|
|
258
291
|
*
|
|
259
292
|
* @param {SurveyProgrammeConfig} institute the school's setup.
|
|
260
293
|
* @param {SurveyGroupScope} scope which programme.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule.js","sourceRoot":"","sources":["../../src/surveys/schedule.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;;;AAKH,MAAM,IAAI,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAEvD,iFAAiF;AAC1E,MAAM,MAAM,GAAG,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,EAAU,EAAE,CAChD,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;AAD9C,QAAA,MAAM,UACwC;AAE3D;;;;GAIG;AACI,MAAM,oBAAoB,GAAG,CAAC,KAAa,EAAE,iBAAyB,EAAU,EAAE,CACrF,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,iBAAi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E,EAAE,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC;AACjF,CAAC,CAAC;AAPW,QAAA,kBAAkB,sBAO7B;AAEF;;;;;;;;GAQG;AACI,MAAM,qBAAqB,GAAG,CACjC,SAAgC,EAAE,KAAuB,EAAE,GAAG,GAAG,IAAI,IAAI,EAAE,EACrE,EAAE,CAAC,IAAA,yBAAiB,EAAC,IAAA,0BAAkB,EAAC,SAAS,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;AAF7D,QAAA,qBAAqB,yBAEwC"}
|
package/lib/surveys/types.d.ts
CHANGED
|
@@ -55,6 +55,18 @@ export type SurveySlot = {
|
|
|
55
55
|
/** The per-survey auto-send switch. Absent = enabled; false means the cron
|
|
56
56
|
* provisions/keeps the cycle but never sends it without staff action. */
|
|
57
57
|
enabled?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Which of the programme's year groups this slot is for. Absent or empty means
|
|
60
|
+
* every year group the programme runs, which is what a schedule usually
|
|
61
|
+
* describes.
|
|
62
|
+
*
|
|
63
|
+
* Only meaningful on a SHARED schedule, where one list of slots is laid out for
|
|
64
|
+
* each year group in turn: it is how a school says "everybody gets the October
|
|
65
|
+
* one, but only Year 11 gets the February one" without giving those year groups
|
|
66
|
+
* a whole schedule of their own. A year group's own schedule is already about
|
|
67
|
+
* one year group, so the field is ignored there.
|
|
68
|
+
*/
|
|
69
|
+
yearGroups?: string[];
|
|
58
70
|
};
|
|
59
71
|
export type SurveyCycleStatus = "draft" | "scheduled" | "sending" | "active" | "closed";
|
|
60
72
|
export type SurveyRequestStatus = "pending" | "sent" | "completed" | "bounced";
|
package/lib/surveys/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/surveys/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;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package.json
CHANGED
package/src/callables/surveys.ts
CHANGED
|
@@ -132,7 +132,10 @@ export const surveyCallables = {
|
|
|
132
132
|
oId: z.string(),
|
|
133
133
|
/** Omit for every programme the institute runs. */
|
|
134
134
|
scope: groupScope.optional(),
|
|
135
|
-
/** Provision the upcoming academic year rather than the current one.
|
|
135
|
+
/** Provision the upcoming academic year rather than the current one.
|
|
136
|
+
* Provisioning never chooses the year ahead by itself: a school whose
|
|
137
|
+
* dates for this year have passed is told so, and next year is created
|
|
138
|
+
* only when staff ask for it here. */
|
|
136
139
|
nextYear: z.boolean().optional(),
|
|
137
140
|
/** Make the year MATCH the schedule rather than only adding to it: a
|
|
138
141
|
* survey whose date moved is moved, and one dropped from the schedule is
|
|
@@ -148,9 +151,6 @@ export const surveyCallables = {
|
|
|
148
151
|
response: z.object({
|
|
149
152
|
created: z.number(),
|
|
150
153
|
academicYear: z.string(),
|
|
151
|
-
/** True when the current year had nothing left to create and the next
|
|
152
|
-
* academic year was provisioned instead. */
|
|
153
|
-
rolledForward: z.boolean(),
|
|
154
154
|
/** Cycles moved or dropped to match the schedule (reconcile only). */
|
|
155
155
|
removed: z.number().optional(),
|
|
156
156
|
}),
|
package/src/surveys/schedule.ts
CHANGED
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
* A rule is year-agnostic; it resolves into a concrete date for a given academic
|
|
10
10
|
* year (each September) via surveyRuleToMMDD / surveyRuleToDate.
|
|
11
11
|
*
|
|
12
|
-
* It also answers
|
|
13
|
-
* foot of this file
|
|
14
|
-
*
|
|
12
|
+
* It also answers whether a programme has any send left in the academic year we are in
|
|
13
|
+
* (programmeStartYear, at the foot of this file), which is what the "nothing left to
|
|
14
|
+
* create, use next year" wording is read off.
|
|
15
15
|
*
|
|
16
16
|
* ── One academic-year boundary: 1 September ───────────────────────────────────
|
|
17
17
|
* Everything here derives the academic year the same way — currentAcademicStartYear,
|
|
@@ -161,6 +161,33 @@ export const resolveSlotsForYear = (
|
|
|
161
161
|
.filter((slot) => Boolean(slot.sendISO))
|
|
162
162
|
.sort((a, b) => a.sendISO.localeCompare(b.sendISO));
|
|
163
163
|
|
|
164
|
+
/**
|
|
165
|
+
* Whether a shared schedule's slot is one this year group actually gets.
|
|
166
|
+
*
|
|
167
|
+
* A slot with no year groups named is the normal case: the schedule describes the
|
|
168
|
+
* programme, and the programme runs for every year group on it. Naming year groups
|
|
169
|
+
* narrows one slot to some of them, which is how "everybody has the October
|
|
170
|
+
* conversation, only Year 11 has the February one" is said without giving Year 11 a
|
|
171
|
+
* schedule of its own.
|
|
172
|
+
*
|
|
173
|
+
* @param {SurveySlot} slot the scheduled send.
|
|
174
|
+
* @param {string} yearGroup the year group the schedule is being laid out for.
|
|
175
|
+
* @return {boolean} true when this year group gets it.
|
|
176
|
+
*/
|
|
177
|
+
export const slotAppliesToYearGroup = (slot: Pick<SurveySlot, "yearGroups">, yearGroup: string): boolean =>
|
|
178
|
+
!slot.yearGroups?.length || slot.yearGroups.map(String).includes(String(yearGroup));
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* A shared schedule as one year group runs it.
|
|
182
|
+
*
|
|
183
|
+
* @param {SurveySlot[]} [slots] the shared schedule.
|
|
184
|
+
* @param {string} yearGroup the year group.
|
|
185
|
+
* @return {SurveySlot[]} the slots that year group gets, in the order given.
|
|
186
|
+
*/
|
|
187
|
+
export const slotsForYearGroup = <T extends Pick<SurveySlot, "yearGroups">>(
|
|
188
|
+
slots: T[] | undefined, yearGroup: string,
|
|
189
|
+
): T[] => (slots ?? []).filter((slot) => slotAppliesToYearGroup(slot, yearGroup));
|
|
190
|
+
|
|
164
191
|
/**
|
|
165
192
|
* Is this slot's send day the given date? Compares MM-DD, resolving any rule against
|
|
166
193
|
* the academic year `date` sits in, which is how the daily crons decide what to fire.
|
|
@@ -232,18 +259,15 @@ export const resolveLeaverLegsForYearGroup = (
|
|
|
232
259
|
});
|
|
233
260
|
};
|
|
234
261
|
|
|
235
|
-
// ─── Which academic year a programme
|
|
262
|
+
// ─── Which academic year a programme still has work in ───────────────────────
|
|
236
263
|
//
|
|
237
|
-
// Provisioning
|
|
238
|
-
//
|
|
239
|
-
//
|
|
240
|
-
// rest of the year — leaving a school that set its programme up in the summer term
|
|
241
|
-
// staring at an empty tab for a year that was already over.
|
|
264
|
+
// Provisioning lays out the academic year we are in, and the one ahead only when it is
|
|
265
|
+
// asked for: a year of surveys is a real cohort's worth of work, so it is created on
|
|
266
|
+
// purpose rather than the moment a schedule runs out of dates.
|
|
242
267
|
//
|
|
243
|
-
//
|
|
244
|
-
//
|
|
245
|
-
//
|
|
246
|
-
// a school is on.
|
|
268
|
+
// What this answers is the narrower question the staff messaging needs: whether the
|
|
269
|
+
// programme has anything left to send this year, or whether everything it describes is
|
|
270
|
+
// already behind us and "create next year" is the only thing left to offer.
|
|
247
271
|
|
|
248
272
|
/** The parts of an institute that schedule surveys — all these helpers read. */
|
|
249
273
|
export type SurveyProgrammeConfig = Pick<InstituteData,
|
|
@@ -268,7 +292,10 @@ export const programmeSendDatesForYear = (
|
|
|
268
292
|
const cfg = institute.destinationsConfig?.aspirations;
|
|
269
293
|
if (!cfg?.enabled || !cfg.yearGroups?.length) return [];
|
|
270
294
|
for (const yearGroup of cfg.yearGroups) {
|
|
271
|
-
|
|
295
|
+
// A year group's own schedule is already about one year group; the shared
|
|
296
|
+
// one is narrowed to the slots this year group is actually on.
|
|
297
|
+
const slots = cfg.surveysByYearGroup?.[String(yearGroup)] ??
|
|
298
|
+
slotsForYearGroup(cfg.surveys, String(yearGroup));
|
|
272
299
|
dates.push(...resolveSlotsForYear(slots, academicStartYear).map((s) => s.sendISO));
|
|
273
300
|
}
|
|
274
301
|
}
|
|
@@ -295,7 +322,8 @@ export const programmeSendDatesForYear = (
|
|
|
295
322
|
const cfg = institute.guidanceConfig;
|
|
296
323
|
if (!cfg?.enabled || !cfg.yearGroups?.length) return [];
|
|
297
324
|
for (const yearGroup of cfg.yearGroups) {
|
|
298
|
-
const slots = cfg.slotsByYearGroup?.[String(yearGroup)] ??
|
|
325
|
+
const slots = cfg.slotsByYearGroup?.[String(yearGroup)] ??
|
|
326
|
+
slotsForYearGroup(cfg.slots, String(yearGroup));
|
|
299
327
|
dates.push(...resolveSlotsForYear(slots, academicStartYear).map((s) => s.sendISO));
|
|
300
328
|
}
|
|
301
329
|
// A named group's own slots count too: a cohort whose only 1:1 this year is
|
|
@@ -309,11 +337,16 @@ export const programmeSendDatesForYear = (
|
|
|
309
337
|
};
|
|
310
338
|
|
|
311
339
|
/**
|
|
312
|
-
* The academic year a programme
|
|
313
|
-
*
|
|
340
|
+
* The academic year a programme has work left in, as its start year: the current one
|
|
341
|
+
* while any of its sends is still to come, the next one once they have all gone by.
|
|
342
|
+
*
|
|
343
|
+
* NOT what provisioning lays out. Provisioning does the year we are in, and the year
|
|
344
|
+
* ahead only when staff ask for it, because creating an academic year hands a school a
|
|
345
|
+
* cohort it has not taught yet. This answers the question the wording asks: "is there
|
|
346
|
+
* anything left to create this year, or should we point them at next year's button?"
|
|
314
347
|
*
|
|
315
|
-
* A programme with nothing configured stays on the current year
|
|
316
|
-
*
|
|
348
|
+
* A programme with nothing configured stays on the current year: there is nothing to
|
|
349
|
+
* look forward to, and the current year is still the one staff are working in.
|
|
317
350
|
*
|
|
318
351
|
* @param {SurveyProgrammeConfig} institute the school's setup.
|
|
319
352
|
* @param {SurveyGroupScope} scope which programme.
|
package/src/surveys/types.ts
CHANGED
|
@@ -76,6 +76,18 @@ export type SurveySlot = {
|
|
|
76
76
|
/** The per-survey auto-send switch. Absent = enabled; false means the cron
|
|
77
77
|
* provisions/keeps the cycle but never sends it without staff action. */
|
|
78
78
|
enabled?: boolean,
|
|
79
|
+
/**
|
|
80
|
+
* Which of the programme's year groups this slot is for. Absent or empty means
|
|
81
|
+
* every year group the programme runs, which is what a schedule usually
|
|
82
|
+
* describes.
|
|
83
|
+
*
|
|
84
|
+
* Only meaningful on a SHARED schedule, where one list of slots is laid out for
|
|
85
|
+
* each year group in turn: it is how a school says "everybody gets the October
|
|
86
|
+
* one, but only Year 11 gets the February one" without giving those year groups
|
|
87
|
+
* a whole schedule of their own. A year group's own schedule is already about
|
|
88
|
+
* one year group, so the field is ignored there.
|
|
89
|
+
*/
|
|
90
|
+
yearGroups?: string[],
|
|
79
91
|
};
|
|
80
92
|
|
|
81
93
|
export type SurveyCycleStatus = "draft"|"scheduled"|"sending"|"active"|"closed";
|