placementt-core 1.400.1138 → 1.400.1141

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/README.md CHANGED
@@ -18,10 +18,12 @@ yarn watch-local dev # or: yarn watch-local prod (or -d / -p)
18
18
 
19
19
  Keeps `tsc --watch` running against your current working tree (including uncommitted changes), swapping in dev/prod config for the whole session the same way `test-local` does. On every successful compile it runs `yalc push`, which republishes to the yalc store **and** pushes the update straight into any repo that's already linked this package — no need to re-run anything on the consumer side after the first link.
20
20
 
21
- Leave this running in its own terminal for as long as you're iterating. Stop it with Ctrl+C when you're done — it restores `package.json`, `src/firebase/firebaseConfig.tsx`, and `src/hooks.tsx` to their committed state and resets `lib/` via `git checkout`, so your working tree is left clean automatically.
21
+ Leave this running in its own terminal for as long as you're iterating. Stop it with Ctrl+C when you're done — it restores `package.json`, `src/firebase/firebaseConfig.tsx`, and `src/algoliaConfig.ts` to their committed state and resets `lib/` via `git checkout`, so your working tree is left clean automatically.
22
22
 
23
23
  **Important:** whichever flavor (`dev`/`prod`) this is running as is what gets pushed to *every* linked consumer, regardless of which flavor they originally linked with — yalc tracks link targets by package name only, not by version. Don't run this in `prod` if you're mid-session testing against dev data elsewhere.
24
24
 
25
+ **Do not `git commit`/`git push` while this is running.** The swap only lives in your working tree until the watcher exits and restores it — committing mid-session bakes the temporary dev config (dev Firebase project, dev Algolia app, the local emulator connection uncommented) straight into real history. This has actually happened and reached `origin/main` — if you need to commit something while iterating, stop the watcher first (Ctrl+C, which restores the files automatically), commit, then restart it.
26
+
25
27
  ### 2. Run the matching watcher in the consuming repo
26
28
 
27
29
  First time only, link the package (same command as the one-off flow below):
@@ -32,19 +34,19 @@ yarn core dev # or -d / -p — run in placementt-web or placementt-backend
32
34
 
33
35
  Then, instead of manually restarting after every change, use one of:
34
36
 
35
- **placementt-web — live reload, no restart (preferred)**
37
+ **placementt-web — restart-based (preferred)**
36
38
  ```
37
- yarn dev:core-live dev / yarn dev:core-live prod # or prod / -d / -p
39
+ yarn dev:core dev # or prod / -d / -p
38
40
  ```
39
- Runs the dev server through [craco](https://github.com/dilanx/craco) (`craco.config.js`) instead of plain `react-scripts`, which tells webpack to actually watch `node_modules/placementt-core` and force a rebuild via `compiler.watching.invalidate()` whenever it changes — so changes show up through normal Fast Refresh with no server restart. It clears `node_modules/.cache` once, right before boot — skip that and the very first boot can silently serve whatever was last cached by an ordinary `yarn start` (this is what caused the app to boot on the wrong Firebase project despite the `dev` flag).
40
-
41
- Caveat: since there's no server restart, if `watch-local`'s flavor changes *while* `dev:core-live` is open in the browser, the page can end up in a mixed state — the old Firebase Auth session from one project, new code pointing at the other. Do a hard refresh after switching flavors mid-session.
41
+ Watches `node_modules/placementt-core` and, on every change, kills whatever's on port 3000, clears `node_modules/.cache`, and restarts `yarn start`. Slower (a full recompile every time, several seconds) but reliable. The cache clear isn't optional — webpack treats `node_modules` packages as version-pinned/immutable for caching purposes, and since the local yalc build always publishes under the same constant sentinel version, a restart alone does *not* pick up the change (confirmed — a stale build kept getting served without it). The cache clear itself lives in the consuming repo's `prestart`/`prebuild` hook (`clear-local-core-cache.js`), not in this watcher, so a plain `yarn start` also gets it for free.
42
42
 
43
- **placementt-web — restart-based (fallback)**
43
+ **placementt-web — live reload, no restart (use with caution)**
44
44
  ```
45
- yarn dev:core dev # or prod / -d / -p
45
+ yarn dev:core-live dev # or prod / -d / -p
46
46
  ```
47
- Watches `node_modules/placementt-core` and, on every change, kills whatever's on port 3000, clears `node_modules/.cache`, and restarts `yarn start`. Slower (a full recompile every time, several seconds) but simple. The cache clear isn't optional — webpack treats `node_modules` packages as version-pinned/immutable for caching purposes, and since the local yalc build always publishes under the same constant sentinel version, a restart alone does *not* pick up the change (confirmed — a stale build kept getting served without it). Use this if `dev:core-live` ever misbehaves.
47
+ Runs the dev server through [craco](https://github.com/dilanx/craco) (`craco.config.js`), which tells webpack to actually watch `node_modules/placementt-core` and force a rebuild via `compiler.watching.invalidate()` whenever it changes — so changes show up through normal Fast Refresh with no server restart.
48
+
49
+ **Known to cause real breakage:** since this package's own Firebase SDK client gets hot-swapped into an already-running page, the Firestore SDK can end up with a corrupted in-memory client — surfaces as `FIRESTORE INTERNAL ASSERTION FAILED: Unexpected state` and keeps happening until you close the tab (not just reload) and open a fresh one. This got bad enough in practice that `dev:core` (restart-based, above) is now the recommended default instead — only reach for this if you specifically need faster iteration and are prepared to close/reopen tabs when Firestore errors start appearing. Also, since there's no server restart, if `watch-local`'s flavor changes *while* this is open in the browser, the page can end up in a mixed state — the old Firebase Auth session from one project, new code pointing at the other.
48
50
 
49
51
  **placementt-backend**
50
52
  ```
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const registry_1 = require("../registry");
4
+ const schema = registry_1.allCallables["activities-bulkAdd"].request;
5
+ const activity = {
6
+ type: "extracurricular",
7
+ activityType: "volunteering",
8
+ title: "Food bank",
9
+ description: "Sorting donations",
10
+ };
11
+ describe("activities-bulkAdd request", () => {
12
+ it("accepts a filter selection", () => {
13
+ const parsed = schema.safeParse({ oId: "school", activity,
14
+ students: { allSelected: true, filters: [{ k: "details.year", e: "==", v: "10" }] } });
15
+ expect(parsed.success).toBe(true);
16
+ });
17
+ it("accepts a list of uids", () => {
18
+ expect(schema.safeParse({ oId: "school", activity, students: ["a", "b"] }).success).toBe(true);
19
+ });
20
+ it("drops fields the server owns", () => {
21
+ const parsed = schema.parse({ oId: "school", students: ["a"],
22
+ activity: { ...activity, uid: "someoneElse", verificationStatus: "schoolVerified", createdBy: "student" } });
23
+ expect(parsed.activity).not.toHaveProperty("uid");
24
+ expect(parsed.activity).not.toHaveProperty("verificationStatus");
25
+ expect(parsed.activity).not.toHaveProperty("createdBy");
26
+ });
27
+ it("rejects an activity with no title or category", () => {
28
+ expect(schema.safeParse({ oId: "school", students: ["a"], activity: { ...activity, title: "" } }).success).toBe(false);
29
+ expect(schema.safeParse({ oId: "school", students: ["a"], activity: { ...activity, type: "other" } }).success).toBe(false);
30
+ });
31
+ });
32
+ //# sourceMappingURL=activities.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activities.test.js","sourceRoot":"","sources":["../../../src/callables/__tests__/activities.test.ts"],"names":[],"mappings":";;AAAA,0CAAyC;AAEzC,MAAM,MAAM,GAAG,uBAAY,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC;AAE1D,MAAM,QAAQ,GAAG;IACb,IAAI,EAAE,iBAAiB;IACvB,YAAY,EAAE,cAAc;IAC5B,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,mBAAmB;CACnC,CAAC;AAEF,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,4BAA4B,EAAE,GAAG,EAAE;QAClC,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,EAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ;YACpD,QAAQ,EAAE,EAAC,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAC,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAC,CAAC,EAAC,EAAC,CAAC,CAAC;QACtF,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wBAAwB,EAAE,GAAG,EAAE;QAC9B,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,EAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjG,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;QACpC,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,EAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC;YACvD,QAAQ,EAAE,EAAC,GAAG,QAAQ,EAAE,GAAG,EAAE,aAAa,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,SAAS,EAAE,SAAS,EAAC,EAAC,CAAC,CAAC;QAC9G,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAClD,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC;QACjE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACrD,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,EAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,EAAC,GAAG,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAC,EAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnH,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,EAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,EAAC,GAAG,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAC,EAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3H,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -0,0 +1,224 @@
1
+ import { z } from "zod";
2
+ /** What staff fill in on the activity builder. Everything the server owns (who
3
+ * it belongs to, who made it, how it is verified, when) is set there, never sent. */
4
+ declare const staffActivity: z.ZodObject<{
5
+ type: z.ZodEnum<["extracurricular", "supercurricular", "curricular"]>;
6
+ activityType: z.ZodString;
7
+ title: z.ZodString;
8
+ description: z.ZodString;
9
+ organisationName: z.ZodOptional<z.ZodString>;
10
+ typeDetails: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
11
+ locationType: z.ZodOptional<z.ZodEnum<["inPerson", "online", "hybrid"]>>;
12
+ startDate: z.ZodOptional<z.ZodString>;
13
+ endDate: z.ZodOptional<z.ZodString>;
14
+ isOngoing: z.ZodOptional<z.ZodBoolean>;
15
+ isRecurring: z.ZodOptional<z.ZodBoolean>;
16
+ timeCommitment: z.ZodOptional<z.ZodEnum<["1to2Hours", "halfDay", "fullDay", "multipleDays"]>>;
17
+ recurringFrequency: z.ZodOptional<z.ZodEnum<["daily", "weekly", "fortnightly", "monthly"]>>;
18
+ hoursPerSession: z.ZodOptional<z.ZodNumber>;
19
+ daysOfWeek: z.ZodOptional<z.ZodArray<z.ZodEnum<["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"]>, "many">>;
20
+ skillsDeveloped: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
21
+ }, "strip", z.ZodTypeAny, {
22
+ type: "extracurricular" | "supercurricular" | "curricular";
23
+ title: string;
24
+ description: string;
25
+ activityType: string;
26
+ organisationName?: string | undefined;
27
+ typeDetails?: Record<string, unknown> | undefined;
28
+ locationType?: "hybrid" | "online" | "inPerson" | undefined;
29
+ startDate?: string | undefined;
30
+ endDate?: string | undefined;
31
+ isOngoing?: boolean | undefined;
32
+ isRecurring?: boolean | undefined;
33
+ timeCommitment?: "1to2Hours" | "halfDay" | "fullDay" | "multipleDays" | undefined;
34
+ recurringFrequency?: "daily" | "weekly" | "monthly" | "fortnightly" | undefined;
35
+ daysOfWeek?: ("monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday")[] | undefined;
36
+ hoursPerSession?: number | undefined;
37
+ skillsDeveloped?: string[] | undefined;
38
+ }, {
39
+ type: "extracurricular" | "supercurricular" | "curricular";
40
+ title: string;
41
+ description: string;
42
+ activityType: string;
43
+ organisationName?: string | undefined;
44
+ typeDetails?: Record<string, unknown> | undefined;
45
+ locationType?: "hybrid" | "online" | "inPerson" | undefined;
46
+ startDate?: string | undefined;
47
+ endDate?: string | undefined;
48
+ isOngoing?: boolean | undefined;
49
+ isRecurring?: boolean | undefined;
50
+ timeCommitment?: "1to2Hours" | "halfDay" | "fullDay" | "multipleDays" | undefined;
51
+ recurringFrequency?: "daily" | "weekly" | "monthly" | "fortnightly" | undefined;
52
+ daysOfWeek?: ("monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday")[] | undefined;
53
+ hoursPerSession?: number | undefined;
54
+ skillsDeveloped?: string[] | undefined;
55
+ }>;
56
+ export type StaffActivityInput = z.infer<typeof staffActivity>;
57
+ export declare const activitiesCallables: {
58
+ /**
59
+ * Adds one activity to every selected student, as a staff-reported activity.
60
+ * Students outside the caller's student visibility are skipped. Reflection and
61
+ * skill ratings are left for each student to add.
62
+ */
63
+ "activities-bulkAdd": {
64
+ request: z.ZodObject<{
65
+ /** The school the students belong to. */
66
+ oId: z.ZodString;
67
+ students: z.ZodUnion<[z.ZodObject<{
68
+ allSelected: z.ZodBoolean;
69
+ search: z.ZodOptional<z.ZodString>;
70
+ filters: z.ZodOptional<z.ZodArray<z.ZodObject<{
71
+ k: z.ZodString;
72
+ e: z.ZodOptional<z.ZodString>;
73
+ v: z.ZodUnknown;
74
+ }, "strip", z.ZodTypeAny, {
75
+ k: string;
76
+ v?: unknown;
77
+ e?: string | undefined;
78
+ }, {
79
+ k: string;
80
+ v?: unknown;
81
+ e?: string | undefined;
82
+ }>, "many">>;
83
+ }, "strip", z.ZodTypeAny, {
84
+ allSelected: boolean;
85
+ search?: string | undefined;
86
+ filters?: {
87
+ k: string;
88
+ v?: unknown;
89
+ e?: string | undefined;
90
+ }[] | undefined;
91
+ }, {
92
+ allSelected: boolean;
93
+ search?: string | undefined;
94
+ filters?: {
95
+ k: string;
96
+ v?: unknown;
97
+ e?: string | undefined;
98
+ }[] | undefined;
99
+ }>, z.ZodArray<z.ZodString, "many">]>;
100
+ activity: z.ZodObject<{
101
+ type: z.ZodEnum<["extracurricular", "supercurricular", "curricular"]>;
102
+ activityType: z.ZodString;
103
+ title: z.ZodString;
104
+ description: z.ZodString;
105
+ organisationName: z.ZodOptional<z.ZodString>;
106
+ typeDetails: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
107
+ locationType: z.ZodOptional<z.ZodEnum<["inPerson", "online", "hybrid"]>>;
108
+ startDate: z.ZodOptional<z.ZodString>;
109
+ endDate: z.ZodOptional<z.ZodString>;
110
+ isOngoing: z.ZodOptional<z.ZodBoolean>;
111
+ isRecurring: z.ZodOptional<z.ZodBoolean>;
112
+ timeCommitment: z.ZodOptional<z.ZodEnum<["1to2Hours", "halfDay", "fullDay", "multipleDays"]>>;
113
+ recurringFrequency: z.ZodOptional<z.ZodEnum<["daily", "weekly", "fortnightly", "monthly"]>>;
114
+ hoursPerSession: z.ZodOptional<z.ZodNumber>;
115
+ daysOfWeek: z.ZodOptional<z.ZodArray<z.ZodEnum<["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"]>, "many">>;
116
+ skillsDeveloped: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
117
+ }, "strip", z.ZodTypeAny, {
118
+ type: "extracurricular" | "supercurricular" | "curricular";
119
+ title: string;
120
+ description: string;
121
+ activityType: string;
122
+ organisationName?: string | undefined;
123
+ typeDetails?: Record<string, unknown> | undefined;
124
+ locationType?: "hybrid" | "online" | "inPerson" | undefined;
125
+ startDate?: string | undefined;
126
+ endDate?: string | undefined;
127
+ isOngoing?: boolean | undefined;
128
+ isRecurring?: boolean | undefined;
129
+ timeCommitment?: "1to2Hours" | "halfDay" | "fullDay" | "multipleDays" | undefined;
130
+ recurringFrequency?: "daily" | "weekly" | "monthly" | "fortnightly" | undefined;
131
+ daysOfWeek?: ("monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday")[] | undefined;
132
+ hoursPerSession?: number | undefined;
133
+ skillsDeveloped?: string[] | undefined;
134
+ }, {
135
+ type: "extracurricular" | "supercurricular" | "curricular";
136
+ title: string;
137
+ description: string;
138
+ activityType: string;
139
+ organisationName?: string | undefined;
140
+ typeDetails?: Record<string, unknown> | undefined;
141
+ locationType?: "hybrid" | "online" | "inPerson" | undefined;
142
+ startDate?: string | undefined;
143
+ endDate?: string | undefined;
144
+ isOngoing?: boolean | undefined;
145
+ isRecurring?: boolean | undefined;
146
+ timeCommitment?: "1to2Hours" | "halfDay" | "fullDay" | "multipleDays" | undefined;
147
+ recurringFrequency?: "daily" | "weekly" | "monthly" | "fortnightly" | undefined;
148
+ daysOfWeek?: ("monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday")[] | undefined;
149
+ hoursPerSession?: number | undefined;
150
+ skillsDeveloped?: string[] | undefined;
151
+ }>;
152
+ /** Set by `useExecuteCallableJob`. */
153
+ jobId: z.ZodOptional<z.ZodString>;
154
+ }, "strip", z.ZodTypeAny, {
155
+ oId: string;
156
+ students: string[] | {
157
+ allSelected: boolean;
158
+ search?: string | undefined;
159
+ filters?: {
160
+ k: string;
161
+ v?: unknown;
162
+ e?: string | undefined;
163
+ }[] | undefined;
164
+ };
165
+ activity: {
166
+ type: "extracurricular" | "supercurricular" | "curricular";
167
+ title: string;
168
+ description: string;
169
+ activityType: string;
170
+ organisationName?: string | undefined;
171
+ typeDetails?: Record<string, unknown> | undefined;
172
+ locationType?: "hybrid" | "online" | "inPerson" | undefined;
173
+ startDate?: string | undefined;
174
+ endDate?: string | undefined;
175
+ isOngoing?: boolean | undefined;
176
+ isRecurring?: boolean | undefined;
177
+ timeCommitment?: "1to2Hours" | "halfDay" | "fullDay" | "multipleDays" | undefined;
178
+ recurringFrequency?: "daily" | "weekly" | "monthly" | "fortnightly" | undefined;
179
+ daysOfWeek?: ("monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday")[] | undefined;
180
+ hoursPerSession?: number | undefined;
181
+ skillsDeveloped?: string[] | undefined;
182
+ };
183
+ jobId?: string | undefined;
184
+ }, {
185
+ oId: string;
186
+ students: string[] | {
187
+ allSelected: boolean;
188
+ search?: string | undefined;
189
+ filters?: {
190
+ k: string;
191
+ v?: unknown;
192
+ e?: string | undefined;
193
+ }[] | undefined;
194
+ };
195
+ activity: {
196
+ type: "extracurricular" | "supercurricular" | "curricular";
197
+ title: string;
198
+ description: string;
199
+ activityType: string;
200
+ organisationName?: string | undefined;
201
+ typeDetails?: Record<string, unknown> | undefined;
202
+ locationType?: "hybrid" | "online" | "inPerson" | undefined;
203
+ startDate?: string | undefined;
204
+ endDate?: string | undefined;
205
+ isOngoing?: boolean | undefined;
206
+ isRecurring?: boolean | undefined;
207
+ timeCommitment?: "1to2Hours" | "halfDay" | "fullDay" | "multipleDays" | undefined;
208
+ recurringFrequency?: "daily" | "weekly" | "monthly" | "fortnightly" | undefined;
209
+ daysOfWeek?: ("monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday")[] | undefined;
210
+ hoursPerSession?: number | undefined;
211
+ skillsDeveloped?: string[] | undefined;
212
+ };
213
+ jobId?: string | undefined;
214
+ }>;
215
+ response: z.ZodObject<{
216
+ added: z.ZodNumber;
217
+ }, "strip", z.ZodTypeAny, {
218
+ added: number;
219
+ }, {
220
+ added: number;
221
+ }>;
222
+ };
223
+ };
224
+ export {};
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.activitiesCallables = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * Contracts for staff adding student activities
7
+ * (`Placementt-Backend/functions/src/activities.ts`).
8
+ */
9
+ /** The students picked in the student table, as DataViewerSelectionBackend:
10
+ * a filter (with an optional search), or a list of uids. */
11
+ const studentSelection = zod_1.z.union([
12
+ zod_1.z.object({
13
+ allSelected: zod_1.z.boolean(),
14
+ search: zod_1.z.string().optional(),
15
+ filters: zod_1.z.array(zod_1.z.object({
16
+ k: zod_1.z.string(),
17
+ e: zod_1.z.string().optional(),
18
+ v: zod_1.z.unknown(),
19
+ })).optional(),
20
+ }),
21
+ zod_1.z.array(zod_1.z.string().min(1).max(128)).max(5000),
22
+ ]);
23
+ /** What staff fill in on the activity builder. Everything the server owns (who
24
+ * it belongs to, who made it, how it is verified, when) is set there, never sent. */
25
+ const staffActivity = zod_1.z.object({
26
+ type: zod_1.z.enum(["extracurricular", "supercurricular", "curricular"]),
27
+ activityType: zod_1.z.string().min(1),
28
+ title: zod_1.z.string().min(1),
29
+ description: zod_1.z.string(),
30
+ organisationName: zod_1.z.string().optional(),
31
+ typeDetails: zod_1.z.record(zod_1.z.unknown()).optional(),
32
+ locationType: zod_1.z.enum(["inPerson", "online", "hybrid"]).optional(),
33
+ startDate: zod_1.z.string().optional(),
34
+ endDate: zod_1.z.string().optional(),
35
+ isOngoing: zod_1.z.boolean().optional(),
36
+ isRecurring: zod_1.z.boolean().optional(),
37
+ timeCommitment: zod_1.z.enum(["1to2Hours", "halfDay", "fullDay", "multipleDays"]).optional(),
38
+ recurringFrequency: zod_1.z.enum(["daily", "weekly", "fortnightly", "monthly"]).optional(),
39
+ hoursPerSession: zod_1.z.number().optional(),
40
+ daysOfWeek: zod_1.z.array(zod_1.z.enum(["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"])).optional(),
41
+ skillsDeveloped: zod_1.z.array(zod_1.z.string()).optional(),
42
+ });
43
+ exports.activitiesCallables = {
44
+ /**
45
+ * Adds one activity to every selected student, as a staff-reported activity.
46
+ * Students outside the caller's student visibility are skipped. Reflection and
47
+ * skill ratings are left for each student to add.
48
+ */
49
+ "activities-bulkAdd": {
50
+ request: zod_1.z.object({
51
+ /** The school the students belong to. */
52
+ oId: zod_1.z.string().min(1).max(128),
53
+ students: studentSelection,
54
+ activity: staffActivity,
55
+ /** Set by `useExecuteCallableJob`. */
56
+ jobId: zod_1.z.string().optional(),
57
+ }),
58
+ response: zod_1.z.object({
59
+ added: zod_1.z.number(),
60
+ }),
61
+ },
62
+ };
63
+ //# sourceMappingURL=activities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activities.js","sourceRoot":"","sources":["../../src/callables/activities.ts"],"names":[],"mappings":"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"}
@@ -15,3 +15,4 @@ export * from "./misSync";
15
15
  export * from "./userManagement";
16
16
  export * from "./outreach";
17
17
  export * from "./formImport";
18
+ export * from "./activities";
@@ -31,4 +31,5 @@ __exportStar(require("./misSync"), exports);
31
31
  __exportStar(require("./userManagement"), exports);
32
32
  __exportStar(require("./outreach"), exports);
33
33
  __exportStar(require("./formImport"), exports);
34
+ __exportStar(require("./activities"), exports);
34
35
  //# sourceMappingURL=index.js.map
@@ -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,4CAA0B;AAC1B,oDAAkC;AAClC,wCAAsB;AACtB,0CAAwB;AACxB,4CAA0B;AAC1B,mDAAiC;AACjC,6CAA2B;AAC3B,+CAA6B"}
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;AAClC,wCAAsB;AACtB,0CAAwB;AACxB,4CAA0B;AAC1B,mDAAiC;AACjC,6CAA2B;AAC3B,+CAA6B;AAC7B,+CAA6B"}