placementt-core 1.400.1184 → 1.400.1185
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/events.d.ts +159 -0
- package/lib/callables/events.js +70 -2
- package/lib/callables/events.js.map +1 -1
- package/lib/callables/registry.d.ts +326 -8
- package/lib/callables/wonde.d.ts +4 -4
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/nonUserSchools.d.ts +13 -0
- package/lib/nonUserSchools.js +23 -0
- package/lib/nonUserSchools.js.map +1 -0
- package/lib/nonUserSchools.test.d.ts +1 -0
- package/lib/nonUserSchools.test.js +29 -0
- package/lib/nonUserSchools.test.js.map +1 -0
- package/lib/typeDefinitions.d.ts +13 -1
- package/lib/typeDefinitions.js.map +1 -1
- package/package.json +1 -1
- package/src/callables/events.ts +70 -2
- package/src/index.ts +1 -0
- package/src/nonUserSchools.test.ts +31 -0
- package/src/nonUserSchools.ts +25 -0
- package/src/typeDefinitions.ts +17 -1
|
@@ -91,6 +91,165 @@ export declare const eventsCallables: {
|
|
|
91
91
|
code: "booked";
|
|
92
92
|
}>;
|
|
93
93
|
};
|
|
94
|
+
"events-inviteNonUserSchools": {
|
|
95
|
+
request: z.ZodObject<{
|
|
96
|
+
eventId: z.ZodString;
|
|
97
|
+
schools: z.ZodArray<z.ZodObject<{
|
|
98
|
+
email: z.ZodString;
|
|
99
|
+
schoolName: z.ZodOptional<z.ZodString>;
|
|
100
|
+
}, "strip", z.ZodTypeAny, {
|
|
101
|
+
email: string;
|
|
102
|
+
schoolName?: string | undefined;
|
|
103
|
+
}, {
|
|
104
|
+
email: string;
|
|
105
|
+
schoolName?: string | undefined;
|
|
106
|
+
}>, "many">;
|
|
107
|
+
}, "strip", z.ZodTypeAny, {
|
|
108
|
+
schools: {
|
|
109
|
+
email: string;
|
|
110
|
+
schoolName?: string | undefined;
|
|
111
|
+
}[];
|
|
112
|
+
eventId: string;
|
|
113
|
+
}, {
|
|
114
|
+
schools: {
|
|
115
|
+
email: string;
|
|
116
|
+
schoolName?: string | undefined;
|
|
117
|
+
}[];
|
|
118
|
+
eventId: string;
|
|
119
|
+
}>;
|
|
120
|
+
response: z.ZodObject<{
|
|
121
|
+
invited: z.ZodNumber;
|
|
122
|
+
skipped: z.ZodNumber;
|
|
123
|
+
remaining: z.ZodNumber;
|
|
124
|
+
}, "strip", z.ZodTypeAny, {
|
|
125
|
+
skipped: number;
|
|
126
|
+
invited: number;
|
|
127
|
+
remaining: number;
|
|
128
|
+
}, {
|
|
129
|
+
skipped: number;
|
|
130
|
+
invited: number;
|
|
131
|
+
remaining: number;
|
|
132
|
+
}>;
|
|
133
|
+
};
|
|
134
|
+
"events-getNonUserSchoolInvite": {
|
|
135
|
+
request: z.ZodObject<{
|
|
136
|
+
eventId: z.ZodString;
|
|
137
|
+
eventSchoolId: z.ZodString;
|
|
138
|
+
}, "strip", z.ZodTypeAny, {
|
|
139
|
+
eventId: string;
|
|
140
|
+
eventSchoolId: string;
|
|
141
|
+
}, {
|
|
142
|
+
eventId: string;
|
|
143
|
+
eventSchoolId: string;
|
|
144
|
+
}>;
|
|
145
|
+
response: z.ZodObject<{
|
|
146
|
+
code: z.ZodEnum<["found", "notFound"]>;
|
|
147
|
+
details: z.ZodOptional<z.ZodAny>;
|
|
148
|
+
}, "strip", z.ZodTypeAny, {
|
|
149
|
+
code: "notFound" | "found";
|
|
150
|
+
details?: any;
|
|
151
|
+
}, {
|
|
152
|
+
code: "notFound" | "found";
|
|
153
|
+
details?: any;
|
|
154
|
+
}>;
|
|
155
|
+
};
|
|
156
|
+
"events-updateNonUserSchoolInvite": {
|
|
157
|
+
request: z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
|
|
158
|
+
action: z.ZodLiteral<"details">;
|
|
159
|
+
eventSchoolId: z.ZodString;
|
|
160
|
+
staffName: z.ZodString;
|
|
161
|
+
schoolName: z.ZodString;
|
|
162
|
+
}, "strip", z.ZodTypeAny, {
|
|
163
|
+
action: "details";
|
|
164
|
+
eventSchoolId: string;
|
|
165
|
+
schoolName: string;
|
|
166
|
+
staffName: string;
|
|
167
|
+
}, {
|
|
168
|
+
action: "details";
|
|
169
|
+
eventSchoolId: string;
|
|
170
|
+
schoolName: string;
|
|
171
|
+
staffName: string;
|
|
172
|
+
}>, z.ZodObject<{
|
|
173
|
+
action: z.ZodLiteral<"accept">;
|
|
174
|
+
eventSchoolId: z.ZodString;
|
|
175
|
+
staffName: z.ZodString;
|
|
176
|
+
schoolName: z.ZodString;
|
|
177
|
+
}, "strip", z.ZodTypeAny, {
|
|
178
|
+
action: "accept";
|
|
179
|
+
eventSchoolId: string;
|
|
180
|
+
schoolName: string;
|
|
181
|
+
staffName: string;
|
|
182
|
+
}, {
|
|
183
|
+
action: "accept";
|
|
184
|
+
eventSchoolId: string;
|
|
185
|
+
schoolName: string;
|
|
186
|
+
staffName: string;
|
|
187
|
+
}>, z.ZodObject<{
|
|
188
|
+
action: z.ZodLiteral<"decline">;
|
|
189
|
+
eventSchoolId: z.ZodString;
|
|
190
|
+
}, "strip", z.ZodTypeAny, {
|
|
191
|
+
action: "decline";
|
|
192
|
+
eventSchoolId: string;
|
|
193
|
+
}, {
|
|
194
|
+
action: "decline";
|
|
195
|
+
eventSchoolId: string;
|
|
196
|
+
}>, z.ZodObject<{
|
|
197
|
+
action: z.ZodLiteral<"matchEmployers">;
|
|
198
|
+
eventSchoolId: z.ZodString;
|
|
199
|
+
attendeeIds: z.ZodArray<z.ZodString, "many">;
|
|
200
|
+
students: z.ZodNumber;
|
|
201
|
+
}, "strip", z.ZodTypeAny, {
|
|
202
|
+
action: "matchEmployers";
|
|
203
|
+
students: number;
|
|
204
|
+
eventSchoolId: string;
|
|
205
|
+
attendeeIds: string[];
|
|
206
|
+
}, {
|
|
207
|
+
action: "matchEmployers";
|
|
208
|
+
students: number;
|
|
209
|
+
eventSchoolId: string;
|
|
210
|
+
attendeeIds: string[];
|
|
211
|
+
}>, z.ZodObject<{
|
|
212
|
+
action: z.ZodLiteral<"selectDates">;
|
|
213
|
+
eventSchoolId: z.ZodString;
|
|
214
|
+
attendeeId: z.ZodString;
|
|
215
|
+
dates: z.ZodArray<z.ZodObject<{
|
|
216
|
+
startDate: z.ZodString;
|
|
217
|
+
endDate: z.ZodOptional<z.ZodString>;
|
|
218
|
+
}, "strip", z.ZodTypeAny, {
|
|
219
|
+
startDate: string;
|
|
220
|
+
endDate?: string | undefined;
|
|
221
|
+
}, {
|
|
222
|
+
startDate: string;
|
|
223
|
+
endDate?: string | undefined;
|
|
224
|
+
}>, "many">;
|
|
225
|
+
students: z.ZodOptional<z.ZodNumber>;
|
|
226
|
+
}, "strip", z.ZodTypeAny, {
|
|
227
|
+
action: "selectDates";
|
|
228
|
+
attendeeId: string;
|
|
229
|
+
eventSchoolId: string;
|
|
230
|
+
dates: {
|
|
231
|
+
startDate: string;
|
|
232
|
+
endDate?: string | undefined;
|
|
233
|
+
}[];
|
|
234
|
+
students?: number | undefined;
|
|
235
|
+
}, {
|
|
236
|
+
action: "selectDates";
|
|
237
|
+
attendeeId: string;
|
|
238
|
+
eventSchoolId: string;
|
|
239
|
+
dates: {
|
|
240
|
+
startDate: string;
|
|
241
|
+
endDate?: string | undefined;
|
|
242
|
+
}[];
|
|
243
|
+
students?: number | undefined;
|
|
244
|
+
}>]>;
|
|
245
|
+
response: z.ZodObject<{
|
|
246
|
+
code: z.ZodEnum<["updated"]>;
|
|
247
|
+
}, "strip", z.ZodTypeAny, {
|
|
248
|
+
code: "updated";
|
|
249
|
+
}, {
|
|
250
|
+
code: "updated";
|
|
251
|
+
}>;
|
|
252
|
+
};
|
|
94
253
|
"events-removeEventSlotBooking": {
|
|
95
254
|
request: z.ZodObject<{
|
|
96
255
|
eventSchoolId: z.ZodString;
|
package/lib/callables/events.js
CHANGED
|
@@ -38,8 +38,9 @@ exports.eventsCallables = {
|
|
|
38
38
|
},
|
|
39
39
|
// Books timed slots for a school (see ExternalEvent.timeSlots). The school's own
|
|
40
40
|
// staff can make one booking while sign-ups are open; hub staff can book or
|
|
41
|
-
// replace a school's slots at any time.
|
|
42
|
-
//
|
|
41
|
+
// replace a school's slots at any time. A school invited by email books without
|
|
42
|
+
// signing in, using its externalEventSchools id as the credential. students is
|
|
43
|
+
// ignored when the event counts schools.
|
|
43
44
|
"events-bookEventSlots": {
|
|
44
45
|
request: zod_1.z.object({
|
|
45
46
|
eventSchoolId: zod_1.z.string().min(1),
|
|
@@ -52,6 +53,73 @@ exports.eventsCallables = {
|
|
|
52
53
|
code: zod_1.z.enum(["booked"]),
|
|
53
54
|
}),
|
|
54
55
|
},
|
|
56
|
+
// Hub staff only. Invites schools that aren't on the platform by email alone. Each event this is
|
|
57
|
+
// used on counts once per academic year against InstituteData.hubNonUserSchoolEvents.
|
|
58
|
+
"events-inviteNonUserSchools": {
|
|
59
|
+
request: zod_1.z.object({
|
|
60
|
+
eventId: zod_1.z.string().min(1),
|
|
61
|
+
schools: zod_1.z.array(zod_1.z.object({
|
|
62
|
+
email: zod_1.z.string().trim().email(),
|
|
63
|
+
schoolName: zod_1.z.string().trim().optional(),
|
|
64
|
+
})).min(1),
|
|
65
|
+
}),
|
|
66
|
+
response: zod_1.z.object({
|
|
67
|
+
invited: zod_1.z.number(),
|
|
68
|
+
skipped: zod_1.z.number(),
|
|
69
|
+
remaining: zod_1.z.number(),
|
|
70
|
+
}),
|
|
71
|
+
},
|
|
72
|
+
// Public: the externalEventSchools id in the invite link is the credential, as for employers.
|
|
73
|
+
// Only works for a school invited by email (ExternalEventCareersSchool.nonUserSchool).
|
|
74
|
+
"events-getNonUserSchoolInvite": {
|
|
75
|
+
request: zod_1.z.object({
|
|
76
|
+
eventId: zod_1.z.string().min(1),
|
|
77
|
+
eventSchoolId: zod_1.z.string().min(1),
|
|
78
|
+
}),
|
|
79
|
+
response: zod_1.z.object({
|
|
80
|
+
code: zod_1.z.enum(["found", "notFound"]),
|
|
81
|
+
details: zod_1.z.any().optional(),
|
|
82
|
+
}),
|
|
83
|
+
},
|
|
84
|
+
// Public, same credential as above. The changes an email-only school makes on its invite page.
|
|
85
|
+
// Slot bookings go through events-bookEventSlots and tasks through the same callables employers
|
|
86
|
+
// use (events-submitExternalForm, events-updateFileView, events-uploadRequiredFile).
|
|
87
|
+
"events-updateNonUserSchoolInvite": {
|
|
88
|
+
request: zod_1.z.discriminatedUnion("action", [
|
|
89
|
+
zod_1.z.object({
|
|
90
|
+
action: zod_1.z.literal("details"),
|
|
91
|
+
eventSchoolId: zod_1.z.string().min(1),
|
|
92
|
+
staffName: zod_1.z.string().trim().min(1),
|
|
93
|
+
schoolName: zod_1.z.string().trim().min(1),
|
|
94
|
+
}),
|
|
95
|
+
zod_1.z.object({
|
|
96
|
+
action: zod_1.z.literal("accept"),
|
|
97
|
+
eventSchoolId: zod_1.z.string().min(1),
|
|
98
|
+
staffName: zod_1.z.string().trim().min(1),
|
|
99
|
+
schoolName: zod_1.z.string().trim().min(1),
|
|
100
|
+
}),
|
|
101
|
+
zod_1.z.object({
|
|
102
|
+
action: zod_1.z.literal("decline"),
|
|
103
|
+
eventSchoolId: zod_1.z.string().min(1),
|
|
104
|
+
}),
|
|
105
|
+
zod_1.z.object({
|
|
106
|
+
action: zod_1.z.literal("matchEmployers"),
|
|
107
|
+
eventSchoolId: zod_1.z.string().min(1),
|
|
108
|
+
attendeeIds: zod_1.z.array(zod_1.z.string().min(1)).min(1),
|
|
109
|
+
students: zod_1.z.number().int().min(1),
|
|
110
|
+
}),
|
|
111
|
+
zod_1.z.object({
|
|
112
|
+
action: zod_1.z.literal("selectDates"),
|
|
113
|
+
eventSchoolId: zod_1.z.string().min(1),
|
|
114
|
+
attendeeId: zod_1.z.string().min(1),
|
|
115
|
+
dates: zod_1.z.array(zod_1.z.object({ startDate: zod_1.z.string(), endDate: zod_1.z.string().optional() })).min(1),
|
|
116
|
+
students: zod_1.z.number().int().min(1).optional(),
|
|
117
|
+
}),
|
|
118
|
+
]),
|
|
119
|
+
response: zod_1.z.object({
|
|
120
|
+
code: zod_1.z.enum(["updated"]),
|
|
121
|
+
}),
|
|
122
|
+
},
|
|
55
123
|
// Hub staff only. Frees the school's places in one slot.
|
|
56
124
|
"events-removeEventSlotBooking": {
|
|
57
125
|
request: zod_1.z.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/callables/events.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AAGtB;;;GAGG;AACU,QAAA,eAAe,GAAG;IAC3B,qBAAqB,EAAE;QACnB,OAAO,EAAE,OAAC,CAAC,MAAM,CAAC;YACd,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;YACf,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;SACpB,CAAC;QACF,qEAAqE;QACrE,QAAQ,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,CAAC;YACvB,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;YACd,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAC3B,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAC9B,eAAe,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YACtC,eAAe,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YACtC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAClC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAC/B,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;SACjC,CAAC,CAAC;KACN;IACD,uEAAuE;IACvE,2EAA2E;IAC3E,6BAA6B,EAAE;QAC3B,OAAO,EAAE,OAAC,CAAC,MAAM,CAAC;YACd,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;YACtB,O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;gBACL,MAAM,EAAE,OAAC,CAAC,OAAO,CAAC,aAAa,CAAC;gBAChC,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;gBAChC,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;gBAC7B,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,CAAC,EAAC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;gBACxF,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;aAC/C,CAAC;SACL,CAAC;QACF,QAAQ,EAAE,OAAC,CAAC,MAAM,CAAC;YACf,IAAI,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC;SAC5B,CAAC;KACL;IACD,yDAAyD;IACzD,+BAA+B,EAAE;QAC7B,OAAO,EAAE,OAAC,CAAC,MAAM,CAAC;YACd,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;YAChC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;SAC5B,CAAC;QACF,QAAQ,EAAE,OAAC,CAAC,MAAM,CAAC;YACf,IAAI,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC;SAC5B,CAAC;KACL;CACoB,CAAC"}
|
|
@@ -936,10 +936,10 @@ export declare const allCallables: {
|
|
|
936
936
|
}, "strip", z.ZodTypeAny, {
|
|
937
937
|
year: string | null;
|
|
938
938
|
oId: string;
|
|
939
|
+
schoolName: string;
|
|
939
940
|
forename: string;
|
|
940
941
|
surname: string;
|
|
941
942
|
dateOfBirth: string | null;
|
|
942
|
-
schoolName: string;
|
|
943
943
|
wondeId: string;
|
|
944
944
|
formGroup: string | null;
|
|
945
945
|
enrolmentStatus: string;
|
|
@@ -947,10 +947,10 @@ export declare const allCallables: {
|
|
|
947
947
|
}, {
|
|
948
948
|
year: string | null;
|
|
949
949
|
oId: string;
|
|
950
|
+
schoolName: string;
|
|
950
951
|
forename: string;
|
|
951
952
|
surname: string;
|
|
952
953
|
dateOfBirth: string | null;
|
|
953
|
-
schoolName: string;
|
|
954
954
|
wondeId: string;
|
|
955
955
|
formGroup: string | null;
|
|
956
956
|
enrolmentStatus: string;
|
|
@@ -993,10 +993,10 @@ export declare const allCallables: {
|
|
|
993
993
|
dualStatus: {
|
|
994
994
|
year: string | null;
|
|
995
995
|
oId: string;
|
|
996
|
+
schoolName: string;
|
|
996
997
|
forename: string;
|
|
997
998
|
surname: string;
|
|
998
999
|
dateOfBirth: string | null;
|
|
999
|
-
schoolName: string;
|
|
1000
1000
|
wondeId: string;
|
|
1001
1001
|
formGroup: string | null;
|
|
1002
1002
|
enrolmentStatus: string;
|
|
@@ -1039,10 +1039,10 @@ export declare const allCallables: {
|
|
|
1039
1039
|
dualStatus: {
|
|
1040
1040
|
year: string | null;
|
|
1041
1041
|
oId: string;
|
|
1042
|
+
schoolName: string;
|
|
1042
1043
|
forename: string;
|
|
1043
1044
|
surname: string;
|
|
1044
1045
|
dateOfBirth: string | null;
|
|
1045
|
-
schoolName: string;
|
|
1046
1046
|
wondeId: string;
|
|
1047
1047
|
formGroup: string | null;
|
|
1048
1048
|
enrolmentStatus: string;
|
|
@@ -2428,6 +2428,165 @@ export declare const allCallables: {
|
|
|
2428
2428
|
code: "booked";
|
|
2429
2429
|
}>;
|
|
2430
2430
|
};
|
|
2431
|
+
"events-inviteNonUserSchools": {
|
|
2432
|
+
request: z.ZodObject<{
|
|
2433
|
+
eventId: z.ZodString;
|
|
2434
|
+
schools: z.ZodArray<z.ZodObject<{
|
|
2435
|
+
email: z.ZodString;
|
|
2436
|
+
schoolName: z.ZodOptional<z.ZodString>;
|
|
2437
|
+
}, "strip", z.ZodTypeAny, {
|
|
2438
|
+
email: string;
|
|
2439
|
+
schoolName?: string | undefined;
|
|
2440
|
+
}, {
|
|
2441
|
+
email: string;
|
|
2442
|
+
schoolName?: string | undefined;
|
|
2443
|
+
}>, "many">;
|
|
2444
|
+
}, "strip", z.ZodTypeAny, {
|
|
2445
|
+
schools: {
|
|
2446
|
+
email: string;
|
|
2447
|
+
schoolName?: string | undefined;
|
|
2448
|
+
}[];
|
|
2449
|
+
eventId: string;
|
|
2450
|
+
}, {
|
|
2451
|
+
schools: {
|
|
2452
|
+
email: string;
|
|
2453
|
+
schoolName?: string | undefined;
|
|
2454
|
+
}[];
|
|
2455
|
+
eventId: string;
|
|
2456
|
+
}>;
|
|
2457
|
+
response: z.ZodObject<{
|
|
2458
|
+
invited: z.ZodNumber;
|
|
2459
|
+
skipped: z.ZodNumber;
|
|
2460
|
+
remaining: z.ZodNumber;
|
|
2461
|
+
}, "strip", z.ZodTypeAny, {
|
|
2462
|
+
skipped: number;
|
|
2463
|
+
invited: number;
|
|
2464
|
+
remaining: number;
|
|
2465
|
+
}, {
|
|
2466
|
+
skipped: number;
|
|
2467
|
+
invited: number;
|
|
2468
|
+
remaining: number;
|
|
2469
|
+
}>;
|
|
2470
|
+
};
|
|
2471
|
+
"events-getNonUserSchoolInvite": {
|
|
2472
|
+
request: z.ZodObject<{
|
|
2473
|
+
eventId: z.ZodString;
|
|
2474
|
+
eventSchoolId: z.ZodString;
|
|
2475
|
+
}, "strip", z.ZodTypeAny, {
|
|
2476
|
+
eventId: string;
|
|
2477
|
+
eventSchoolId: string;
|
|
2478
|
+
}, {
|
|
2479
|
+
eventId: string;
|
|
2480
|
+
eventSchoolId: string;
|
|
2481
|
+
}>;
|
|
2482
|
+
response: z.ZodObject<{
|
|
2483
|
+
code: z.ZodEnum<["found", "notFound"]>;
|
|
2484
|
+
details: z.ZodOptional<z.ZodAny>;
|
|
2485
|
+
}, "strip", z.ZodTypeAny, {
|
|
2486
|
+
code: "notFound" | "found";
|
|
2487
|
+
details?: any;
|
|
2488
|
+
}, {
|
|
2489
|
+
code: "notFound" | "found";
|
|
2490
|
+
details?: any;
|
|
2491
|
+
}>;
|
|
2492
|
+
};
|
|
2493
|
+
"events-updateNonUserSchoolInvite": {
|
|
2494
|
+
request: z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
|
|
2495
|
+
action: z.ZodLiteral<"details">;
|
|
2496
|
+
eventSchoolId: z.ZodString;
|
|
2497
|
+
staffName: z.ZodString;
|
|
2498
|
+
schoolName: z.ZodString;
|
|
2499
|
+
}, "strip", z.ZodTypeAny, {
|
|
2500
|
+
action: "details";
|
|
2501
|
+
eventSchoolId: string;
|
|
2502
|
+
schoolName: string;
|
|
2503
|
+
staffName: string;
|
|
2504
|
+
}, {
|
|
2505
|
+
action: "details";
|
|
2506
|
+
eventSchoolId: string;
|
|
2507
|
+
schoolName: string;
|
|
2508
|
+
staffName: string;
|
|
2509
|
+
}>, z.ZodObject<{
|
|
2510
|
+
action: z.ZodLiteral<"accept">;
|
|
2511
|
+
eventSchoolId: z.ZodString;
|
|
2512
|
+
staffName: z.ZodString;
|
|
2513
|
+
schoolName: z.ZodString;
|
|
2514
|
+
}, "strip", z.ZodTypeAny, {
|
|
2515
|
+
action: "accept";
|
|
2516
|
+
eventSchoolId: string;
|
|
2517
|
+
schoolName: string;
|
|
2518
|
+
staffName: string;
|
|
2519
|
+
}, {
|
|
2520
|
+
action: "accept";
|
|
2521
|
+
eventSchoolId: string;
|
|
2522
|
+
schoolName: string;
|
|
2523
|
+
staffName: string;
|
|
2524
|
+
}>, z.ZodObject<{
|
|
2525
|
+
action: z.ZodLiteral<"decline">;
|
|
2526
|
+
eventSchoolId: z.ZodString;
|
|
2527
|
+
}, "strip", z.ZodTypeAny, {
|
|
2528
|
+
action: "decline";
|
|
2529
|
+
eventSchoolId: string;
|
|
2530
|
+
}, {
|
|
2531
|
+
action: "decline";
|
|
2532
|
+
eventSchoolId: string;
|
|
2533
|
+
}>, z.ZodObject<{
|
|
2534
|
+
action: z.ZodLiteral<"matchEmployers">;
|
|
2535
|
+
eventSchoolId: z.ZodString;
|
|
2536
|
+
attendeeIds: z.ZodArray<z.ZodString, "many">;
|
|
2537
|
+
students: z.ZodNumber;
|
|
2538
|
+
}, "strip", z.ZodTypeAny, {
|
|
2539
|
+
action: "matchEmployers";
|
|
2540
|
+
students: number;
|
|
2541
|
+
eventSchoolId: string;
|
|
2542
|
+
attendeeIds: string[];
|
|
2543
|
+
}, {
|
|
2544
|
+
action: "matchEmployers";
|
|
2545
|
+
students: number;
|
|
2546
|
+
eventSchoolId: string;
|
|
2547
|
+
attendeeIds: string[];
|
|
2548
|
+
}>, z.ZodObject<{
|
|
2549
|
+
action: z.ZodLiteral<"selectDates">;
|
|
2550
|
+
eventSchoolId: z.ZodString;
|
|
2551
|
+
attendeeId: z.ZodString;
|
|
2552
|
+
dates: z.ZodArray<z.ZodObject<{
|
|
2553
|
+
startDate: z.ZodString;
|
|
2554
|
+
endDate: z.ZodOptional<z.ZodString>;
|
|
2555
|
+
}, "strip", z.ZodTypeAny, {
|
|
2556
|
+
startDate: string;
|
|
2557
|
+
endDate?: string | undefined;
|
|
2558
|
+
}, {
|
|
2559
|
+
startDate: string;
|
|
2560
|
+
endDate?: string | undefined;
|
|
2561
|
+
}>, "many">;
|
|
2562
|
+
students: z.ZodOptional<z.ZodNumber>;
|
|
2563
|
+
}, "strip", z.ZodTypeAny, {
|
|
2564
|
+
action: "selectDates";
|
|
2565
|
+
attendeeId: string;
|
|
2566
|
+
eventSchoolId: string;
|
|
2567
|
+
dates: {
|
|
2568
|
+
startDate: string;
|
|
2569
|
+
endDate?: string | undefined;
|
|
2570
|
+
}[];
|
|
2571
|
+
students?: number | undefined;
|
|
2572
|
+
}, {
|
|
2573
|
+
action: "selectDates";
|
|
2574
|
+
attendeeId: string;
|
|
2575
|
+
eventSchoolId: string;
|
|
2576
|
+
dates: {
|
|
2577
|
+
startDate: string;
|
|
2578
|
+
endDate?: string | undefined;
|
|
2579
|
+
}[];
|
|
2580
|
+
students?: number | undefined;
|
|
2581
|
+
}>]>;
|
|
2582
|
+
response: z.ZodObject<{
|
|
2583
|
+
code: z.ZodEnum<["updated"]>;
|
|
2584
|
+
}, "strip", z.ZodTypeAny, {
|
|
2585
|
+
code: "updated";
|
|
2586
|
+
}, {
|
|
2587
|
+
code: "updated";
|
|
2588
|
+
}>;
|
|
2589
|
+
};
|
|
2431
2590
|
"events-removeEventSlotBooking": {
|
|
2432
2591
|
request: z.ZodObject<{
|
|
2433
2592
|
eventSchoolId: z.ZodString;
|
|
@@ -2649,6 +2808,165 @@ export declare const callableGroups: {
|
|
|
2649
2808
|
code: "booked";
|
|
2650
2809
|
}>;
|
|
2651
2810
|
};
|
|
2811
|
+
"events-inviteNonUserSchools": {
|
|
2812
|
+
request: z.ZodObject<{
|
|
2813
|
+
eventId: z.ZodString;
|
|
2814
|
+
schools: z.ZodArray<z.ZodObject<{
|
|
2815
|
+
email: z.ZodString;
|
|
2816
|
+
schoolName: z.ZodOptional<z.ZodString>;
|
|
2817
|
+
}, "strip", z.ZodTypeAny, {
|
|
2818
|
+
email: string;
|
|
2819
|
+
schoolName?: string | undefined;
|
|
2820
|
+
}, {
|
|
2821
|
+
email: string;
|
|
2822
|
+
schoolName?: string | undefined;
|
|
2823
|
+
}>, "many">;
|
|
2824
|
+
}, "strip", z.ZodTypeAny, {
|
|
2825
|
+
schools: {
|
|
2826
|
+
email: string;
|
|
2827
|
+
schoolName?: string | undefined;
|
|
2828
|
+
}[];
|
|
2829
|
+
eventId: string;
|
|
2830
|
+
}, {
|
|
2831
|
+
schools: {
|
|
2832
|
+
email: string;
|
|
2833
|
+
schoolName?: string | undefined;
|
|
2834
|
+
}[];
|
|
2835
|
+
eventId: string;
|
|
2836
|
+
}>;
|
|
2837
|
+
response: z.ZodObject<{
|
|
2838
|
+
invited: z.ZodNumber;
|
|
2839
|
+
skipped: z.ZodNumber;
|
|
2840
|
+
remaining: z.ZodNumber;
|
|
2841
|
+
}, "strip", z.ZodTypeAny, {
|
|
2842
|
+
skipped: number;
|
|
2843
|
+
invited: number;
|
|
2844
|
+
remaining: number;
|
|
2845
|
+
}, {
|
|
2846
|
+
skipped: number;
|
|
2847
|
+
invited: number;
|
|
2848
|
+
remaining: number;
|
|
2849
|
+
}>;
|
|
2850
|
+
};
|
|
2851
|
+
"events-getNonUserSchoolInvite": {
|
|
2852
|
+
request: z.ZodObject<{
|
|
2853
|
+
eventId: z.ZodString;
|
|
2854
|
+
eventSchoolId: z.ZodString;
|
|
2855
|
+
}, "strip", z.ZodTypeAny, {
|
|
2856
|
+
eventId: string;
|
|
2857
|
+
eventSchoolId: string;
|
|
2858
|
+
}, {
|
|
2859
|
+
eventId: string;
|
|
2860
|
+
eventSchoolId: string;
|
|
2861
|
+
}>;
|
|
2862
|
+
response: z.ZodObject<{
|
|
2863
|
+
code: z.ZodEnum<["found", "notFound"]>;
|
|
2864
|
+
details: z.ZodOptional<z.ZodAny>;
|
|
2865
|
+
}, "strip", z.ZodTypeAny, {
|
|
2866
|
+
code: "notFound" | "found";
|
|
2867
|
+
details?: any;
|
|
2868
|
+
}, {
|
|
2869
|
+
code: "notFound" | "found";
|
|
2870
|
+
details?: any;
|
|
2871
|
+
}>;
|
|
2872
|
+
};
|
|
2873
|
+
"events-updateNonUserSchoolInvite": {
|
|
2874
|
+
request: z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
|
|
2875
|
+
action: z.ZodLiteral<"details">;
|
|
2876
|
+
eventSchoolId: z.ZodString;
|
|
2877
|
+
staffName: z.ZodString;
|
|
2878
|
+
schoolName: z.ZodString;
|
|
2879
|
+
}, "strip", z.ZodTypeAny, {
|
|
2880
|
+
action: "details";
|
|
2881
|
+
eventSchoolId: string;
|
|
2882
|
+
schoolName: string;
|
|
2883
|
+
staffName: string;
|
|
2884
|
+
}, {
|
|
2885
|
+
action: "details";
|
|
2886
|
+
eventSchoolId: string;
|
|
2887
|
+
schoolName: string;
|
|
2888
|
+
staffName: string;
|
|
2889
|
+
}>, z.ZodObject<{
|
|
2890
|
+
action: z.ZodLiteral<"accept">;
|
|
2891
|
+
eventSchoolId: z.ZodString;
|
|
2892
|
+
staffName: z.ZodString;
|
|
2893
|
+
schoolName: z.ZodString;
|
|
2894
|
+
}, "strip", z.ZodTypeAny, {
|
|
2895
|
+
action: "accept";
|
|
2896
|
+
eventSchoolId: string;
|
|
2897
|
+
schoolName: string;
|
|
2898
|
+
staffName: string;
|
|
2899
|
+
}, {
|
|
2900
|
+
action: "accept";
|
|
2901
|
+
eventSchoolId: string;
|
|
2902
|
+
schoolName: string;
|
|
2903
|
+
staffName: string;
|
|
2904
|
+
}>, z.ZodObject<{
|
|
2905
|
+
action: z.ZodLiteral<"decline">;
|
|
2906
|
+
eventSchoolId: z.ZodString;
|
|
2907
|
+
}, "strip", z.ZodTypeAny, {
|
|
2908
|
+
action: "decline";
|
|
2909
|
+
eventSchoolId: string;
|
|
2910
|
+
}, {
|
|
2911
|
+
action: "decline";
|
|
2912
|
+
eventSchoolId: string;
|
|
2913
|
+
}>, z.ZodObject<{
|
|
2914
|
+
action: z.ZodLiteral<"matchEmployers">;
|
|
2915
|
+
eventSchoolId: z.ZodString;
|
|
2916
|
+
attendeeIds: z.ZodArray<z.ZodString, "many">;
|
|
2917
|
+
students: z.ZodNumber;
|
|
2918
|
+
}, "strip", z.ZodTypeAny, {
|
|
2919
|
+
action: "matchEmployers";
|
|
2920
|
+
students: number;
|
|
2921
|
+
eventSchoolId: string;
|
|
2922
|
+
attendeeIds: string[];
|
|
2923
|
+
}, {
|
|
2924
|
+
action: "matchEmployers";
|
|
2925
|
+
students: number;
|
|
2926
|
+
eventSchoolId: string;
|
|
2927
|
+
attendeeIds: string[];
|
|
2928
|
+
}>, z.ZodObject<{
|
|
2929
|
+
action: z.ZodLiteral<"selectDates">;
|
|
2930
|
+
eventSchoolId: z.ZodString;
|
|
2931
|
+
attendeeId: z.ZodString;
|
|
2932
|
+
dates: z.ZodArray<z.ZodObject<{
|
|
2933
|
+
startDate: z.ZodString;
|
|
2934
|
+
endDate: z.ZodOptional<z.ZodString>;
|
|
2935
|
+
}, "strip", z.ZodTypeAny, {
|
|
2936
|
+
startDate: string;
|
|
2937
|
+
endDate?: string | undefined;
|
|
2938
|
+
}, {
|
|
2939
|
+
startDate: string;
|
|
2940
|
+
endDate?: string | undefined;
|
|
2941
|
+
}>, "many">;
|
|
2942
|
+
students: z.ZodOptional<z.ZodNumber>;
|
|
2943
|
+
}, "strip", z.ZodTypeAny, {
|
|
2944
|
+
action: "selectDates";
|
|
2945
|
+
attendeeId: string;
|
|
2946
|
+
eventSchoolId: string;
|
|
2947
|
+
dates: {
|
|
2948
|
+
startDate: string;
|
|
2949
|
+
endDate?: string | undefined;
|
|
2950
|
+
}[];
|
|
2951
|
+
students?: number | undefined;
|
|
2952
|
+
}, {
|
|
2953
|
+
action: "selectDates";
|
|
2954
|
+
attendeeId: string;
|
|
2955
|
+
eventSchoolId: string;
|
|
2956
|
+
dates: {
|
|
2957
|
+
startDate: string;
|
|
2958
|
+
endDate?: string | undefined;
|
|
2959
|
+
}[];
|
|
2960
|
+
students?: number | undefined;
|
|
2961
|
+
}>]>;
|
|
2962
|
+
response: z.ZodObject<{
|
|
2963
|
+
code: z.ZodEnum<["updated"]>;
|
|
2964
|
+
}, "strip", z.ZodTypeAny, {
|
|
2965
|
+
code: "updated";
|
|
2966
|
+
}, {
|
|
2967
|
+
code: "updated";
|
|
2968
|
+
}>;
|
|
2969
|
+
};
|
|
2652
2970
|
"events-removeEventSlotBooking": {
|
|
2653
2971
|
request: z.ZodObject<{
|
|
2654
2972
|
eventSchoolId: z.ZodString;
|
|
@@ -4135,10 +4453,10 @@ export declare const callableGroups: {
|
|
|
4135
4453
|
}, "strip", z.ZodTypeAny, {
|
|
4136
4454
|
year: string | null;
|
|
4137
4455
|
oId: string;
|
|
4456
|
+
schoolName: string;
|
|
4138
4457
|
forename: string;
|
|
4139
4458
|
surname: string;
|
|
4140
4459
|
dateOfBirth: string | null;
|
|
4141
|
-
schoolName: string;
|
|
4142
4460
|
wondeId: string;
|
|
4143
4461
|
formGroup: string | null;
|
|
4144
4462
|
enrolmentStatus: string;
|
|
@@ -4146,10 +4464,10 @@ export declare const callableGroups: {
|
|
|
4146
4464
|
}, {
|
|
4147
4465
|
year: string | null;
|
|
4148
4466
|
oId: string;
|
|
4467
|
+
schoolName: string;
|
|
4149
4468
|
forename: string;
|
|
4150
4469
|
surname: string;
|
|
4151
4470
|
dateOfBirth: string | null;
|
|
4152
|
-
schoolName: string;
|
|
4153
4471
|
wondeId: string;
|
|
4154
4472
|
formGroup: string | null;
|
|
4155
4473
|
enrolmentStatus: string;
|
|
@@ -4192,10 +4510,10 @@ export declare const callableGroups: {
|
|
|
4192
4510
|
dualStatus: {
|
|
4193
4511
|
year: string | null;
|
|
4194
4512
|
oId: string;
|
|
4513
|
+
schoolName: string;
|
|
4195
4514
|
forename: string;
|
|
4196
4515
|
surname: string;
|
|
4197
4516
|
dateOfBirth: string | null;
|
|
4198
|
-
schoolName: string;
|
|
4199
4517
|
wondeId: string;
|
|
4200
4518
|
formGroup: string | null;
|
|
4201
4519
|
enrolmentStatus: string;
|
|
@@ -4238,10 +4556,10 @@ export declare const callableGroups: {
|
|
|
4238
4556
|
dualStatus: {
|
|
4239
4557
|
year: string | null;
|
|
4240
4558
|
oId: string;
|
|
4559
|
+
schoolName: string;
|
|
4241
4560
|
forename: string;
|
|
4242
4561
|
surname: string;
|
|
4243
4562
|
dateOfBirth: string | null;
|
|
4244
|
-
schoolName: string;
|
|
4245
4563
|
wondeId: string;
|
|
4246
4564
|
formGroup: string | null;
|
|
4247
4565
|
enrolmentStatus: string;
|
package/lib/callables/wonde.d.ts
CHANGED
|
@@ -180,10 +180,10 @@ export declare const wondeCallables: {
|
|
|
180
180
|
}, "strip", z.ZodTypeAny, {
|
|
181
181
|
year: string | null;
|
|
182
182
|
oId: string;
|
|
183
|
+
schoolName: string;
|
|
183
184
|
forename: string;
|
|
184
185
|
surname: string;
|
|
185
186
|
dateOfBirth: string | null;
|
|
186
|
-
schoolName: string;
|
|
187
187
|
wondeId: string;
|
|
188
188
|
formGroup: string | null;
|
|
189
189
|
enrolmentStatus: string;
|
|
@@ -191,10 +191,10 @@ export declare const wondeCallables: {
|
|
|
191
191
|
}, {
|
|
192
192
|
year: string | null;
|
|
193
193
|
oId: string;
|
|
194
|
+
schoolName: string;
|
|
194
195
|
forename: string;
|
|
195
196
|
surname: string;
|
|
196
197
|
dateOfBirth: string | null;
|
|
197
|
-
schoolName: string;
|
|
198
198
|
wondeId: string;
|
|
199
199
|
formGroup: string | null;
|
|
200
200
|
enrolmentStatus: string;
|
|
@@ -237,10 +237,10 @@ export declare const wondeCallables: {
|
|
|
237
237
|
dualStatus: {
|
|
238
238
|
year: string | null;
|
|
239
239
|
oId: string;
|
|
240
|
+
schoolName: string;
|
|
240
241
|
forename: string;
|
|
241
242
|
surname: string;
|
|
242
243
|
dateOfBirth: string | null;
|
|
243
|
-
schoolName: string;
|
|
244
244
|
wondeId: string;
|
|
245
245
|
formGroup: string | null;
|
|
246
246
|
enrolmentStatus: string;
|
|
@@ -283,10 +283,10 @@ export declare const wondeCallables: {
|
|
|
283
283
|
dualStatus: {
|
|
284
284
|
year: string | null;
|
|
285
285
|
oId: string;
|
|
286
|
+
schoolName: string;
|
|
286
287
|
forename: string;
|
|
287
288
|
surname: string;
|
|
288
289
|
dateOfBirth: string | null;
|
|
289
|
-
schoolName: string;
|
|
290
290
|
wondeId: string;
|
|
291
291
|
formGroup: string | null;
|
|
292
292
|
enrolmentStatus: string;
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -94,4 +94,5 @@ __exportStar(require("./leavers"), exports);
|
|
|
94
94
|
var genericEmailDomains_1 = require("./genericEmailDomains");
|
|
95
95
|
Object.defineProperty(exports, "genericEmailDomains", { enumerable: true, get: function () { return __importDefault(genericEmailDomains_1).default; } });
|
|
96
96
|
__exportStar(require("./eventTimeSlots"), exports);
|
|
97
|
+
__exportStar(require("./nonUserSchools"), exports);
|
|
97
98
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AACA,sDAAoC;AACpC,gEAA8C;AAC9C,0DAAwC;AACxC,2DAAyC;AACzC,kDAAgC;AAChC,uDAAqC;AACrC,4DAA0C;AAC1C,2DAAyC;AAEzC,oDAAkC;AAClC,8CAA4B;AAC5B,kDAAgC;AAChC,kDAAgC;AAChC,qDAAmC;AACnC,mDAAiC;AACjC,qDAAmC;AACnC,qDAAmC;AACnC,sDAAoC;AACpC,kDAAgC;AAChC,mDAAiC;AACjC,+CAA6B;AAC7B,oDAAkC;AAClC,iDAA+B;AAC/B,qDAAmC;AACnC,uDAAqC;AACrC,gDAA8B;AAC9B,4CAA0B;AAC1B,wCAAsB;AACtB,kDAAgC;AAChC,6CAA2B;AAC3B,8CAA4B;AAC5B,oDAAkC;AAClC,4CAA0B;AAC1B,8CAA4B;AAC5B,2CAAyB;AACzB,wDAAsC;AACtC,kDAAgC;AAChC,uDAAqC;AACrC,oDAAkC;AAClC,kDAAgC;AAChC,0DAAwC;AACxC,iDAA+B;AAC/B,2DAAyC;AACzC,uDAAqC;AACrC,uDAAqC;AACrC,iDAA+B;AAC/B,8CAA4B;AAC5B,4CAA0B;AAC1B,qDAAmC;AACnC,0CAAwB;AACxB,kDAAgC;AAChC,yCAAuB;AACvB,4DAA0C;AAC1C,kDAAgC;AAChC,iDAA+B;AAC/B,2CAAyB;AACzB,4DAA0C;AAC1C,oEAAiD;AACjD,yEAAuD;AACvD,kEAAgD;AAChD,kEAAgD;AAChD,oEAAkD;AAClD,yGAAuF;AACvF,0GAAwF;A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F;AACxF,+FAA6E;AAC7E,4DAA0C;AAC1C,oEAAkD;AAClD,iEAA+C;AAC/C,gEAA8C;AAC9C,2EAAyD;AACzD,6CAA2B;AAC3B,+CAA6B;AAC7B,8CAA4B;AAC5B,4CAA0B;AAC1B,6DAAuE;AAA9D,2IAAA,OAAO,OAAuB;AACvC,mDAAiC;AACjC,mDAAiC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ExternalEvent, ExternalEventCareersSchool, InstituteData } from "./typeDefinitions";
|
|
2
|
+
export declare const NON_USER_SCHOOL_EVENTS_PER_YEAR = 2;
|
|
3
|
+
/** The academic year the allowance is counted in, e.g. "2026/27". */
|
|
4
|
+
export declare const nonUserSchoolEventsYear: (date?: Date) => string;
|
|
5
|
+
/**
|
|
6
|
+
* Whether inviting schools by email to this event will use up one of the hub's events for the year.
|
|
7
|
+
* An event already counted this year is free to invite more schools to.
|
|
8
|
+
*/
|
|
9
|
+
export declare const nonUserSchoolInviteUsesAllowance: (event: Pick<ExternalEvent, "nonUserSchoolInvitesYear">, date?: Date) => boolean;
|
|
10
|
+
/** Events the hub can still invite email-only schools to this academic year. */
|
|
11
|
+
export declare const nonUserSchoolEventsRemaining: (hub: Pick<InstituteData, "hubNonUserSchoolEvents"> | undefined, date?: Date) => number;
|
|
12
|
+
/** The school's display name, whether it's on the platform or was invited by email. */
|
|
13
|
+
export declare const eventSchoolName: (eventSchool: Pick<ExternalEventCareersSchool, "nonUserSchool">, institute?: Pick<InstituteData, "name">) => string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.eventSchoolName = exports.nonUserSchoolEventsRemaining = exports.nonUserSchoolInviteUsesAllowance = exports.nonUserSchoolEventsYear = exports.NON_USER_SCHOOL_EVENTS_PER_YEAR = void 0;
|
|
4
|
+
const schedule_1 = require("./surveys/schedule");
|
|
5
|
+
// How many events a careers hub can invite schools to by email alone, per academic year.
|
|
6
|
+
// Kept low so hubs still bring schools onto the platform.
|
|
7
|
+
exports.NON_USER_SCHOOL_EVENTS_PER_YEAR = 2;
|
|
8
|
+
/** The academic year the allowance is counted in, e.g. "2026/27". */
|
|
9
|
+
const nonUserSchoolEventsYear = (date = new Date()) => (0, schedule_1.academicYearSlashLabel)((0, schedule_1.currentAcademicStartYear)(date));
|
|
10
|
+
exports.nonUserSchoolEventsYear = nonUserSchoolEventsYear;
|
|
11
|
+
/**
|
|
12
|
+
* Whether inviting schools by email to this event will use up one of the hub's events for the year.
|
|
13
|
+
* An event already counted this year is free to invite more schools to.
|
|
14
|
+
*/
|
|
15
|
+
const nonUserSchoolInviteUsesAllowance = (event, date = new Date()) => event.nonUserSchoolInvitesYear !== (0, exports.nonUserSchoolEventsYear)(date);
|
|
16
|
+
exports.nonUserSchoolInviteUsesAllowance = nonUserSchoolInviteUsesAllowance;
|
|
17
|
+
/** Events the hub can still invite email-only schools to this academic year. */
|
|
18
|
+
const nonUserSchoolEventsRemaining = (hub, date = new Date()) => Math.max(0, exports.NON_USER_SCHOOL_EVENTS_PER_YEAR - (hub?.hubNonUserSchoolEvents?.[(0, exports.nonUserSchoolEventsYear)(date)] || 0));
|
|
19
|
+
exports.nonUserSchoolEventsRemaining = nonUserSchoolEventsRemaining;
|
|
20
|
+
/** The school's display name, whether it's on the platform or was invited by email. */
|
|
21
|
+
const eventSchoolName = (eventSchool, institute) => institute?.name || eventSchool.nonUserSchool?.schoolName || eventSchool.nonUserSchool?.email || "Unknown school";
|
|
22
|
+
exports.eventSchoolName = eventSchoolName;
|
|
23
|
+
//# sourceMappingURL=nonUserSchools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nonUserSchools.js","sourceRoot":"","sources":["../src/nonUserSchools.ts"],"names":[],"mappings":";;;AAAA,iDAAoF;AAGpF,yFAAyF;AACzF,0DAA0D;AAC7C,QAAA,+BAA+B,GAAG,CAAC,CAAC;AAEjD,qEAAqE;AAC9D,MAAM,uBAAuB,GAAG,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,EAAU,EAAE,CACjE,IAAA,iCAAsB,EAAC,IAAA,mCAAwB,EAAC,IAAI,CAAC,CAAC,CAAC;AAD9C,QAAA,uBAAuB,2BACuB;AAE3D;;;GAGG;AACI,MAAM,gCAAgC,GAAG,CAAC,KAAsD,EAAE,IAAI,GAAG,IAAI,IAAI,EAAE,EAAW,EAAE,CACnI,KAAK,CAAC,wBAAwB,KAAK,IAAA,+BAAuB,EAAC,IAAI,CAAC,CAAC;AADxD,QAAA,gCAAgC,oCACwB;AAErE,gFAAgF;AACzE,MAAM,4BAA4B,GAAG,CAAC,GAA4D,EAAE,IAAI,GAAG,IAAI,IAAI,EAAE,EAAU,EAAE,CACpI,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,uCAA+B,GAAG,CAAC,GAAG,EAAE,sBAAsB,EAAE,CAAC,IAAA,+BAAuB,EAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAD1G,QAAA,4BAA4B,gCAC8E;AAEvH,uFAAuF;AAChF,MAAM,eAAe,GAAG,CAAC,WAA8D,EAAE,SAAuC,EAAU,EAAE,CAC/I,SAAS,EAAE,IAAI,IAAI,WAAW,CAAC,aAAa,EAAE,UAAU,IAAI,WAAW,CAAC,aAAa,EAAE,KAAK,IAAI,gBAAgB,CAAC;AADxG,QAAA,eAAe,mBACyF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const nonUserSchools_1 = require("./nonUserSchools");
|
|
4
|
+
describe("nonUserSchools", () => {
|
|
5
|
+
const october = new Date("2026-10-07T12:00:00Z");
|
|
6
|
+
const august = new Date("2027-08-20T12:00:00Z");
|
|
7
|
+
it("labels the academic year with a slash, rolling over in September", () => {
|
|
8
|
+
expect((0, nonUserSchools_1.nonUserSchoolEventsYear)(october)).toBe("2026/27");
|
|
9
|
+
expect((0, nonUserSchools_1.nonUserSchoolEventsYear)(august)).toBe("2026/27");
|
|
10
|
+
expect((0, nonUserSchools_1.nonUserSchoolEventsYear)(new Date("2027-09-01T12:00:00Z"))).toBe("2027/28");
|
|
11
|
+
});
|
|
12
|
+
it("counts remaining events for the current year only", () => {
|
|
13
|
+
expect((0, nonUserSchools_1.nonUserSchoolEventsRemaining)(undefined, october)).toBe(nonUserSchools_1.NON_USER_SCHOOL_EVENTS_PER_YEAR);
|
|
14
|
+
expect((0, nonUserSchools_1.nonUserSchoolEventsRemaining)({ hubNonUserSchoolEvents: { "2026/27": 1 } }, october)).toBe(1);
|
|
15
|
+
expect((0, nonUserSchools_1.nonUserSchoolEventsRemaining)({ hubNonUserSchoolEvents: { "2026/27": 5 } }, october)).toBe(0);
|
|
16
|
+
expect((0, nonUserSchools_1.nonUserSchoolEventsRemaining)({ hubNonUserSchoolEvents: { "2025/26": 2 } }, october)).toBe(2);
|
|
17
|
+
});
|
|
18
|
+
it("only charges an event once per academic year", () => {
|
|
19
|
+
expect((0, nonUserSchools_1.nonUserSchoolInviteUsesAllowance)({}, october)).toBe(true);
|
|
20
|
+
expect((0, nonUserSchools_1.nonUserSchoolInviteUsesAllowance)({ nonUserSchoolInvitesYear: "2026/27" }, october)).toBe(false);
|
|
21
|
+
expect((0, nonUserSchools_1.nonUserSchoolInviteUsesAllowance)({ nonUserSchoolInvitesYear: "2025/26" }, october)).toBe(true);
|
|
22
|
+
});
|
|
23
|
+
it("names the school from its institute, then the invite", () => {
|
|
24
|
+
expect((0, nonUserSchools_1.eventSchoolName)({}, { name: "Hilltop" })).toBe("Hilltop");
|
|
25
|
+
expect((0, nonUserSchools_1.eventSchoolName)({ nonUserSchool: { email: "a@b.com", schoolName: "Valley" } })).toBe("Valley");
|
|
26
|
+
expect((0, nonUserSchools_1.eventSchoolName)({ nonUserSchool: { email: "a@b.com" } })).toBe("a@b.com");
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=nonUserSchools.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nonUserSchools.test.js","sourceRoot":"","sources":["../src/nonUserSchools.test.ts"],"names":[],"mappings":";;AAAA,qDAA2K;AAE3K,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC5B,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC,sBAAsB,CAAC,CAAC;IACjD,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,sBAAsB,CAAC,CAAC;IAEhD,EAAE,CAAC,kEAAkE,EAAE,GAAG,EAAE;QACxE,MAAM,CAAC,IAAA,wCAAuB,EAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACzD,MAAM,CAAC,IAAA,wCAAuB,EAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACxD,MAAM,CAAC,IAAA,wCAAuB,EAAC,IAAI,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACtF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QACzD,MAAM,CAAC,IAAA,6CAA4B,EAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,gDAA+B,CAAC,CAAC;QAC/F,MAAM,CAAC,IAAA,6CAA4B,EAAC,EAAC,sBAAsB,EAAE,EAAC,SAAS,EAAE,CAAC,EAAC,EAAC,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAChG,MAAM,CAAC,IAAA,6CAA4B,EAAC,EAAC,sBAAsB,EAAE,EAAC,SAAS,EAAE,CAAC,EAAC,EAAC,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAChG,MAAM,C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
|
send?: boolean;
|
|
1140
1140
|
marketingEmails: string[];
|
|
1141
|
+
/** Careers hubs only. Events per academic year ("YYYY/YY") that have invited schools by email
|
|
1142
|
+
* alone (schools not on the platform). Capped at NON_USER_SCHOOL_EVENTS_PER_YEAR. Counted the
|
|
1143
|
+
* first time an event uses it in a year and never decremented, so deleting an event doesn't free one. */
|
|
1144
|
+
hubNonUserSchoolEvents?: {
|
|
1145
|
+
[academicYear: string]: number;
|
|
1146
|
+
};
|
|
1141
1147
|
careersHubLinks?: {
|
|
1142
1148
|
[oId: string]: {
|
|
1143
1149
|
exists: boolean;
|
|
@@ -2406,6 +2412,7 @@ export type ExternalEvent = {
|
|
|
2406
2412
|
slotBookings?: {
|
|
2407
2413
|
[slotId: string]: number;
|
|
2408
2414
|
};
|
|
2415
|
+
nonUserSchoolInvitesYear?: string;
|
|
2409
2416
|
studentJoinCode: number;
|
|
2410
2417
|
stage: "basicDetails" | "eventConfig" | "selectEmployers" | "employerInviteForms" | "sendEmployerInvites" | "setupStudentInvites" | "preEvent" | "created";
|
|
2411
2418
|
draft: boolean;
|
|
@@ -3397,6 +3404,11 @@ export type EventTimeSlotSetting = {
|
|
|
3397
3404
|
export type ExternalEventCareersSchool = {
|
|
3398
3405
|
oId: string;
|
|
3399
3406
|
instituteId: string;
|
|
3407
|
+
nonUserSchool?: {
|
|
3408
|
+
email: string;
|
|
3409
|
+
schoolName?: string;
|
|
3410
|
+
staffName?: string;
|
|
3411
|
+
};
|
|
3400
3412
|
eventId: string;
|
|
3401
3413
|
status: "invited" | "available" | "finalConfirmationSent" | "confirmed" | "feedbackSent" | "declined" | "visibleTo" | "creator";
|
|
3402
3414
|
slots?: {
|
|
@@ -3722,7 +3734,7 @@ export type YearScoreData = {
|
|
|
3722
3734
|
campaignsClicked?: number;
|
|
3723
3735
|
campaignsFailed?: number;
|
|
3724
3736
|
};
|
|
3725
|
-
type MessageTypes = "hubOrTrustInviteSchool" | "sendPlacementActionRequired" | "sendPlacementAdditionalInformationRequired" | "sendFeedbackReminder" | "sendProviderContactInvite" | "sendProviderContactActivityInvite" | "sendActivateUserAccount" | "shareEmployerEventRequest" | "employerEventInvite" | "schoolEventInvite" | "reuploadPlacementDocument" | "requestEventDates" | "taskReminder" | "eventDatesReminder" | "parentDatabase" | "aspirationInvite" | "leaverInvite" | "leaverReminder" | "leaverResultsInvite" | "leaverResultsReminder" | "leaverChristmasInvite" | "leaverChristmasReminder" | "scheduledCheckUpcoming" | "scheduledCheckDue" | "scheduledCheckLate" | "alumniCheckInInvite" | // annual "where are you now" check-in — reminder chain falls back to the trusted contact
|
|
3737
|
+
type MessageTypes = "hubOrTrustInviteSchool" | "sendPlacementActionRequired" | "sendPlacementAdditionalInformationRequired" | "sendFeedbackReminder" | "sendProviderContactInvite" | "sendProviderContactActivityInvite" | "sendActivateUserAccount" | "shareEmployerEventRequest" | "employerEventInvite" | "schoolEventInvite" | "nonUserSchoolEventInvite" | "reuploadPlacementDocument" | "requestEventDates" | "taskReminder" | "eventDatesReminder" | "parentDatabase" | "aspirationInvite" | "leaverInvite" | "leaverReminder" | "leaverResultsInvite" | "leaverResultsReminder" | "leaverChristmasInvite" | "leaverChristmasReminder" | "scheduledCheckUpcoming" | "scheduledCheckDue" | "scheduledCheckLate" | "alumniCheckInInvite" | // annual "where are you now" check-in — reminder chain falls back to the trusted contact
|
|
3726
3738
|
"alumniCheckInTrustedContact" | // parent/trusted-contact fallback invite — has its own reminder chain
|
|
3727
3739
|
SurveyMessageType;
|
|
3728
3740
|
/** Every message type the survey engine sends, derived from the registry so the two
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeDefinitions.js","sourceRoot":"","sources":["../src/typeDefinitions.ts"],"names":[],"mappings":";;;AA+
|
|
1
|
+
{"version":3,"file":"typeDefinitions.js","sourceRoot":"","sources":["../src/typeDefinitions.ts"],"names":[],"mappings":";;;AA+qIA,sDASC;AAeD,oDAKC;AAaD,0CAEC;AA9pED;;;;;kFAKkF;AACrE,QA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timed slots for a school (see ExternalEvent.timeSlots). The school's own
|
|
39
39
|
// staff can make one booking while sign-ups are open; hub staff can book or
|
|
40
|
-
// replace a school's slots at any time.
|
|
41
|
-
//
|
|
40
|
+
// replace a school's slots at any time. A school invited by email books without
|
|
41
|
+
// signing in, using its externalEventSchools id as the credential. students is
|
|
42
|
+
// ignored when the event counts schools.
|
|
42
43
|
"events-bookEventSlots": {
|
|
43
44
|
request: z.object({
|
|
44
45
|
eventSchoolId: z.string().min(1),
|
|
@@ -51,6 +52,73 @@ export const eventsCallables = {
|
|
|
51
52
|
code: z.enum(["booked"]),
|
|
52
53
|
}),
|
|
53
54
|
},
|
|
55
|
+
// Hub staff only. Invites schools that aren't on the platform by email alone. Each event this is
|
|
56
|
+
// used on counts once per academic year against InstituteData.hubNonUserSchoolEvents.
|
|
57
|
+
"events-inviteNonUserSchools": {
|
|
58
|
+
request: z.object({
|
|
59
|
+
eventId: z.string().min(1),
|
|
60
|
+
schools: z.array(z.object({
|
|
61
|
+
email: z.string().trim().email(),
|
|
62
|
+
schoolName: z.string().trim().optional(),
|
|
63
|
+
})).min(1),
|
|
64
|
+
}),
|
|
65
|
+
response: z.object({
|
|
66
|
+
invited: z.number(),
|
|
67
|
+
skipped: z.number(),
|
|
68
|
+
remaining: z.number(),
|
|
69
|
+
}),
|
|
70
|
+
},
|
|
71
|
+
// Public: the externalEventSchools id in the invite link is the credential, as for employers.
|
|
72
|
+
// Only works for a school invited by email (ExternalEventCareersSchool.nonUserSchool).
|
|
73
|
+
"events-getNonUserSchoolInvite": {
|
|
74
|
+
request: z.object({
|
|
75
|
+
eventId: z.string().min(1),
|
|
76
|
+
eventSchoolId: z.string().min(1),
|
|
77
|
+
}),
|
|
78
|
+
response: z.object({
|
|
79
|
+
code: z.enum(["found", "notFound"]),
|
|
80
|
+
details: z.any().optional(),
|
|
81
|
+
}),
|
|
82
|
+
},
|
|
83
|
+
// Public, same credential as above. The changes an email-only school makes on its invite page.
|
|
84
|
+
// Slot bookings go through events-bookEventSlots and tasks through the same callables employers
|
|
85
|
+
// use (events-submitExternalForm, events-updateFileView, events-uploadRequiredFile).
|
|
86
|
+
"events-updateNonUserSchoolInvite": {
|
|
87
|
+
request: z.discriminatedUnion("action", [
|
|
88
|
+
z.object({
|
|
89
|
+
action: z.literal("details"),
|
|
90
|
+
eventSchoolId: z.string().min(1),
|
|
91
|
+
staffName: z.string().trim().min(1),
|
|
92
|
+
schoolName: z.string().trim().min(1),
|
|
93
|
+
}),
|
|
94
|
+
z.object({
|
|
95
|
+
action: z.literal("accept"),
|
|
96
|
+
eventSchoolId: z.string().min(1),
|
|
97
|
+
staffName: z.string().trim().min(1),
|
|
98
|
+
schoolName: z.string().trim().min(1),
|
|
99
|
+
}),
|
|
100
|
+
z.object({
|
|
101
|
+
action: z.literal("decline"),
|
|
102
|
+
eventSchoolId: z.string().min(1),
|
|
103
|
+
}),
|
|
104
|
+
z.object({
|
|
105
|
+
action: z.literal("matchEmployers"),
|
|
106
|
+
eventSchoolId: z.string().min(1),
|
|
107
|
+
attendeeIds: z.array(z.string().min(1)).min(1),
|
|
108
|
+
students: z.number().int().min(1),
|
|
109
|
+
}),
|
|
110
|
+
z.object({
|
|
111
|
+
action: z.literal("selectDates"),
|
|
112
|
+
eventSchoolId: z.string().min(1),
|
|
113
|
+
attendeeId: z.string().min(1),
|
|
114
|
+
dates: z.array(z.object({startDate: z.string(), endDate: z.string().optional()})).min(1),
|
|
115
|
+
students: z.number().int().min(1).optional(),
|
|
116
|
+
}),
|
|
117
|
+
]),
|
|
118
|
+
response: z.object({
|
|
119
|
+
code: z.enum(["updated"]),
|
|
120
|
+
}),
|
|
121
|
+
},
|
|
54
122
|
// Hub staff only. Frees the school's places in one slot.
|
|
55
123
|
"events-removeEventSlotBooking": {
|
|
56
124
|
request: z.object({
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {eventSchoolName, NON_USER_SCHOOL_EVENTS_PER_YEAR, nonUserSchoolEventsRemaining, nonUserSchoolEventsYear, nonUserSchoolInviteUsesAllowance} from "./nonUserSchools";
|
|
2
|
+
|
|
3
|
+
describe("nonUserSchools", () => {
|
|
4
|
+
const october = new Date("2026-10-07T12:00:00Z");
|
|
5
|
+
const august = new Date("2027-08-20T12:00:00Z");
|
|
6
|
+
|
|
7
|
+
it("labels the academic year with a slash, rolling over in September", () => {
|
|
8
|
+
expect(nonUserSchoolEventsYear(october)).toBe("2026/27");
|
|
9
|
+
expect(nonUserSchoolEventsYear(august)).toBe("2026/27");
|
|
10
|
+
expect(nonUserSchoolEventsYear(new Date("2027-09-01T12:00:00Z"))).toBe("2027/28");
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it("counts remaining events for the current year only", () => {
|
|
14
|
+
expect(nonUserSchoolEventsRemaining(undefined, october)).toBe(NON_USER_SCHOOL_EVENTS_PER_YEAR);
|
|
15
|
+
expect(nonUserSchoolEventsRemaining({hubNonUserSchoolEvents: {"2026/27": 1}}, october)).toBe(1);
|
|
16
|
+
expect(nonUserSchoolEventsRemaining({hubNonUserSchoolEvents: {"2026/27": 5}}, october)).toBe(0);
|
|
17
|
+
expect(nonUserSchoolEventsRemaining({hubNonUserSchoolEvents: {"2025/26": 2}}, october)).toBe(2);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it("only charges an event once per academic year", () => {
|
|
21
|
+
expect(nonUserSchoolInviteUsesAllowance({}, october)).toBe(true);
|
|
22
|
+
expect(nonUserSchoolInviteUsesAllowance({nonUserSchoolInvitesYear: "2026/27"}, october)).toBe(false);
|
|
23
|
+
expect(nonUserSchoolInviteUsesAllowance({nonUserSchoolInvitesYear: "2025/26"}, october)).toBe(true);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("names the school from its institute, then the invite", () => {
|
|
27
|
+
expect(eventSchoolName({}, {name: "Hilltop"})).toBe("Hilltop");
|
|
28
|
+
expect(eventSchoolName({nonUserSchool: {email: "a@b.com", schoolName: "Valley"}})).toBe("Valley");
|
|
29
|
+
expect(eventSchoolName({nonUserSchool: {email: "a@b.com"}})).toBe("a@b.com");
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {academicYearSlashLabel, currentAcademicStartYear} from "./surveys/schedule";
|
|
2
|
+
import {ExternalEvent, ExternalEventCareersSchool, InstituteData} from "./typeDefinitions";
|
|
3
|
+
|
|
4
|
+
// How many events a careers hub can invite schools to by email alone, per academic year.
|
|
5
|
+
// Kept low so hubs still bring schools onto the platform.
|
|
6
|
+
export const NON_USER_SCHOOL_EVENTS_PER_YEAR = 2;
|
|
7
|
+
|
|
8
|
+
/** The academic year the allowance is counted in, e.g. "2026/27". */
|
|
9
|
+
export const nonUserSchoolEventsYear = (date = new Date()): string =>
|
|
10
|
+
academicYearSlashLabel(currentAcademicStartYear(date));
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Whether inviting schools by email to this event will use up one of the hub's events for the year.
|
|
14
|
+
* An event already counted this year is free to invite more schools to.
|
|
15
|
+
*/
|
|
16
|
+
export const nonUserSchoolInviteUsesAllowance = (event: Pick<ExternalEvent, "nonUserSchoolInvitesYear">, date = new Date()): boolean =>
|
|
17
|
+
event.nonUserSchoolInvitesYear !== nonUserSchoolEventsYear(date);
|
|
18
|
+
|
|
19
|
+
/** Events the hub can still invite email-only schools to this academic year. */
|
|
20
|
+
export const nonUserSchoolEventsRemaining = (hub: Pick<InstituteData, "hubNonUserSchoolEvents">|undefined, date = new Date()): number =>
|
|
21
|
+
Math.max(0, NON_USER_SCHOOL_EVENTS_PER_YEAR - (hub?.hubNonUserSchoolEvents?.[nonUserSchoolEventsYear(date)] || 0));
|
|
22
|
+
|
|
23
|
+
/** The school's display name, whether it's on the platform or was invited by email. */
|
|
24
|
+
export const eventSchoolName = (eventSchool: Pick<ExternalEventCareersSchool, "nonUserSchool">, institute?: Pick<InstituteData, "name">): string =>
|
|
25
|
+
institute?.name || eventSchool.nonUserSchool?.schoolName || eventSchool.nonUserSchool?.email || "Unknown school";
|
package/src/typeDefinitions.ts
CHANGED
|
@@ -1174,6 +1174,10 @@ export type InstituteData = {
|
|
|
1174
1174
|
package: string,
|
|
1175
1175
|
send?: boolean,
|
|
1176
1176
|
marketingEmails: string[],
|
|
1177
|
+
/** Careers hubs only. Events per academic year ("YYYY/YY") that have invited schools by email
|
|
1178
|
+
* alone (schools not on the platform). Capped at NON_USER_SCHOOL_EVENTS_PER_YEAR. Counted the
|
|
1179
|
+
* first time an event uses it in a year and never decremented, so deleting an event doesn't free one. */
|
|
1180
|
+
hubNonUserSchoolEvents?: {[academicYear: string]: number},
|
|
1177
1181
|
careersHubLinks?: {[oId: string]: {
|
|
1178
1182
|
exists: boolean,
|
|
1179
1183
|
invited: string,
|
|
@@ -2416,6 +2420,9 @@ export type ExternalEvent = {
|
|
|
2416
2420
|
days?: {[date: string]: EventTimeSlotSetting[]}, // keyed "YYYY-MM-DD"
|
|
2417
2421
|
},
|
|
2418
2422
|
slotBookings?: {[slotId: string]: number}, // places used per slot
|
|
2423
|
+
// Academic year ("YYYY/YY") this event was counted against the hub's hubNonUserSchoolEvents
|
|
2424
|
+
// allowance. Inviting more schools by email in the same year doesn't count it again.
|
|
2425
|
+
nonUserSchoolInvitesYear?: string,
|
|
2419
2426
|
studentJoinCode: number,
|
|
2420
2427
|
stage: "basicDetails"|"eventConfig"|"selectEmployers"|"employerInviteForms"|"sendEmployerInvites"|"setupStudentInvites"|"preEvent"|"created",
|
|
2421
2428
|
draft: boolean,
|
|
@@ -3384,7 +3391,15 @@ export type EventTimeSlotSetting = {
|
|
|
3384
3391
|
|
|
3385
3392
|
export type ExternalEventCareersSchool = {
|
|
3386
3393
|
oId: string,
|
|
3387
|
-
instituteId: string,
|
|
3394
|
+
instituteId: string, // Empty for a school invited by email that isn't on the platform (see nonUserSchool)
|
|
3395
|
+
// Set for a school invited by email alone. It has no institute or users, so the doc id is the
|
|
3396
|
+
// credential for its public invite page (/event/schools/:oId/:eventId/:eventSchoolId) and every
|
|
3397
|
+
// email goes to nonUserSchool.email.
|
|
3398
|
+
nonUserSchool?: {
|
|
3399
|
+
email: string,
|
|
3400
|
+
schoolName?: string,
|
|
3401
|
+
staffName?: string,
|
|
3402
|
+
},
|
|
3388
3403
|
eventId: string,
|
|
3389
3404
|
status: "invited"|"available"|"finalConfirmationSent"|"confirmed"|"feedbackSent"|"declined"|"visibleTo"|"creator",
|
|
3390
3405
|
slots?: {[slotId: string]: number}, // Timed slot bookings, with students per slot (1 when the event counts schools)
|
|
@@ -3671,6 +3686,7 @@ type MessageTypes =
|
|
|
3671
3686
|
"shareEmployerEventRequest" |
|
|
3672
3687
|
"employerEventInvite" |
|
|
3673
3688
|
"schoolEventInvite" |
|
|
3689
|
+
"nonUserSchoolEventInvite" |
|
|
3674
3690
|
"reuploadPlacementDocument" |
|
|
3675
3691
|
"requestEventDates" |
|
|
3676
3692
|
"taskReminder" |
|