placementt-core 1.20.231 → 1.300.4

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.
Files changed (101) hide show
  1. package/.eslintrc.js +40 -40
  2. package/.gitattributes +2 -2
  3. package/deploy-all.js +75 -0
  4. package/lib/config.d.ts +0 -13
  5. package/lib/config.js +1 -3
  6. package/lib/config.js.map +1 -1
  7. package/lib/constants.d.ts +1 -0
  8. package/lib/constants.js +48 -1
  9. package/lib/constants.js.map +1 -1
  10. package/lib/features/config.d.ts +133 -133
  11. package/lib/features/config.js +35 -35
  12. package/lib/features/contacts/contacts.d.ts +75 -75
  13. package/lib/features/contacts/contacts.js +105 -105
  14. package/lib/features/downtime/useDowntime.d.ts +11 -11
  15. package/lib/features/downtime/useDowntime.js +22 -22
  16. package/lib/features/placements/studentPlacements/activePlacement.js +1 -1
  17. package/lib/features/placements/studentPlacements/activePlacement.js.map +1 -1
  18. package/lib/features/placements/studentPlacements/studentPlacementsSlice.d.ts +63 -63
  19. package/lib/features/placements/studentPlacements/studentPlacementsSlice.js +81 -81
  20. package/lib/features/providerPlacements/providerPlacementsSlice.d.ts +19 -19
  21. package/lib/features/providerPlacements/providerPlacementsSlice.js +24 -24
  22. package/lib/features/studentPlacements/studentPlacementsSlice.d.ts +62 -62
  23. package/lib/features/studentPlacements/studentPlacementsSlice.js +87 -87
  24. package/lib/features/studentPlacements/useStudentPlacements.d.ts +6 -6
  25. package/lib/features/studentPlacements/useStudentPlacements.js +18 -18
  26. package/lib/features/userSlice.d.ts +26 -26
  27. package/lib/features/userSlice.js +23 -23
  28. package/lib/features/users/useUserFunctions.d.ts +25 -25
  29. package/lib/features/users/useUserFunctions.js +124 -124
  30. package/lib/features/users/userSlice.d.ts +46 -46
  31. package/lib/features/users/userSlice.js +48 -48
  32. package/lib/firebase/firebase.d.ts +1 -1
  33. package/lib/firebase/firebase.js +8 -3
  34. package/lib/firebase/firebase.js.map +1 -1
  35. package/lib/firebase/firebaseConfig.js +1 -0
  36. package/lib/firebase/firebaseConfig.js.map +1 -1
  37. package/lib/firebase/readDatabase.js +7 -7
  38. package/lib/firebase/readDatabase.js.map +1 -1
  39. package/lib/hooks.d.ts +85 -192
  40. package/lib/hooks.js +731 -671
  41. package/lib/hooks.js.map +1 -1
  42. package/lib/images/GatsbyBenchmarks.d.ts +1 -2
  43. package/lib/index.d.ts +0 -1
  44. package/lib/index.js +0 -1
  45. package/lib/index.js.map +1 -1
  46. package/lib/reduxHooks.d.ts +9 -56
  47. package/lib/reduxHooks.js +1 -45
  48. package/lib/reduxHooks.js.map +1 -1
  49. package/lib/tasksAndTips.js +368 -418
  50. package/lib/tasksAndTips.js.map +1 -1
  51. package/lib/typeDefinitions.d.ts +162 -83
  52. package/lib/util.d.ts +25 -1
  53. package/lib/util.js +329 -2
  54. package/lib/util.js.map +1 -1
  55. package/package.json +56 -56
  56. package/src/DatabaseDefinitions.ts +18 -18
  57. package/src/apiCalls.ts +128 -128
  58. package/src/config.ts +50 -53
  59. package/src/constants.ts +846 -796
  60. package/src/databaseTypes.ts +42 -42
  61. package/src/features/analytics/useAnalytics.tsx +63 -63
  62. package/src/features/contacts/contactsSlice.ts +147 -147
  63. package/src/features/contacts/useContacts.tsx +73 -73
  64. package/src/features/dropdown/useDropdown.tsx +52 -52
  65. package/src/features/global/downtime/useDowntime.tsx +23 -23
  66. package/src/features/global/users/useUserFunctions.tsx +132 -132
  67. package/src/features/jobs/jobsSlice.ts +71 -71
  68. package/src/features/placements/studentPlacements/activePlacement.ts +68 -68
  69. package/src/features/placements/studentPlacements/completedStudentPlacementsSlice.ts +97 -97
  70. package/src/features/placements/studentPlacements/upcomingStudentPlacementsSlice.ts +108 -108
  71. package/src/features/placements/studentPlacements/useStudentPlacements.tsx +9 -9
  72. package/src/features/placements/types.ts +10 -10
  73. package/src/features/referrals/useReferrals.tsx +56 -56
  74. package/src/features/updates/useUpdates.tsx +38 -38
  75. package/src/firebase/firebase.tsx +158 -153
  76. package/src/firebase/firebaseConfig.tsx +47 -45
  77. package/src/firebase/firebaseQuery.tsx +151 -151
  78. package/src/firebase/persistence.ts +84 -84
  79. package/src/firebase/readDatabase.tsx +236 -236
  80. package/src/firebase/util.tsx +352 -352
  81. package/src/firebase/writeDatabase.tsx +77 -77
  82. package/src/hooks.tsx +4476 -4463
  83. package/src/images/GatsbyBenchmarks.tsx +711 -711
  84. package/src/images/LogFuturePlacement.jsx +64 -64
  85. package/src/images/LogPreviousPlacement.jsx +228 -228
  86. package/src/images/gatsby_benchmarks.svg +466 -466
  87. package/src/images/log_future_placement.svg +114 -114
  88. package/src/images/log_previous_placement.svg +199 -199
  89. package/src/index.ts +34 -35
  90. package/src/readDatabase.tsx +3 -3
  91. package/src/reduxHooks.ts +295 -342
  92. package/src/tasksAndTips.ts +1267 -1267
  93. package/src/tutorialTips.ts +58 -58
  94. package/src/typeDefinitions.ts +1260 -1129
  95. package/src/util.ts +523 -177
  96. package/tsconfig.dev.json +5 -5
  97. package/tsconfig.json +21 -21
  98. package/lib/features/logs/logsSlice.d.ts +0 -93
  99. package/lib/features/logs/logsSlice.js +0 -146
  100. package/lib/features/logs/logsSlice.js.map +0 -1
  101. package/src/features/logs/logsSlice.ts +0 -208
@@ -1,1130 +1,1261 @@
1
- import {DocumentData, DocumentReference, Timestamp} from "firebase/firestore";
2
- import {Descendant} from "slate";
3
- import {emailTemplates} from "./constants";
4
-
5
- export type Products = "institutes"|"providers"|"students"|"admin";
6
-
7
- export type StudentPlacementData = {
8
- title: string,
9
- reqUserType: "Students" | "Staff" | "Provider" | "Parent",
10
- uid: string,
11
- startDate: string,
12
- endDate: string,
13
- providerId?: string,
14
- name: string,
15
- parentKey: string,
16
- parentEmail: string,
17
- providerKey: string,
18
- parentExpiry: string,
19
- providerExpiry: string,
20
- providerEmail: string,
21
- providerEmailed: Timestamp,
22
- parentEmailed: Timestamp,
23
- providerPhone: string,
24
- website?: string,
25
- id:string,
26
- providerCompleted: string[],
27
- oId: string,
28
- contactForename: string,
29
- contactSurname: string,
30
- status: number,
31
- nextStatus: number,
32
- ["address-line1"]: string,
33
- ["address-line2"]: string,
34
- locality: string,
35
- postal_code: string,
36
- what3Words?: string,
37
- country: string,
38
- cohort?: string,
39
- leadTimes: string[],
40
- flags?: FlagCodes[],
41
- mapConsent: true | "institute" | false,
42
- mapConsentDate?: string,
43
- placementId?: string,
44
- addressId?: string,
45
- geoHash?: string,
46
- statusType: "draft"|"submitted"|"active"|"completed"|"withdrawn"|"requested",
47
- questions: PlacementQuestions,
48
- staffRoles: string[],
49
- sector: string,
50
- subsector: string,
51
- importedProviderForms?: boolean,
52
- analytics: string[],
53
- units: string,
54
- schoolId?: string,
55
- active: boolean,
56
- completed: boolean,
57
- personalAnalytics?: string[],
58
- completedStages?: number[],
59
- contactId?: string
60
- created: string,
61
- inProgress: boolean,
62
- draft: boolean,
63
- activeDates: string[],
64
- insurance: boolean|"awaitingReview",
65
- insuranceSkippedReason?: string,
66
- riskAssessment?: boolean|"awaitingReview",
67
- riskAssessmentType?: "file"|"form"|"skipped",
68
- riskAssessmentData?: {[key:string]: unknown}[]|string,
69
- dbsCheck?: boolean|"awaitingReview",
70
- dbsCheckType?: "file"|"form"|"skipped",
71
- dbsCheckData?: {[key:string]: unknown}[]|string,
72
- contactType?: "email"|"website"|"phone"|"post",
73
- webpage?: string,
74
- providerLogs?: string[],
75
- studentsLogs?: string[],
76
- notes?: {
77
- providers?: Descendant[],
78
- institutes?: Descendant[],
79
- students?: Descendant[]
80
- }
81
- staffLogs?: [],
82
- feedback: {
83
- students: {
84
- completed: boolean,
85
- data?: {[key: string]: unknown}
86
- },
87
- provider: {
88
- completed: boolean,
89
- data?: {[key: string]: unknown}
90
- },
91
- staff: {
92
- completed: boolean,
93
- data?: {[key: string]: unknown}
94
- },
95
- },
96
- onboarding: (OnboardingDocs&{
97
- deadline?: string,
98
- completed: {
99
- submitted: boolean,
100
- submittedDate?: string,
101
- accepted?: boolean,
102
- filesViewed?: string[],
103
- formsCompleted?: {[key: string]: unknown},
104
- filesUploaded?: {[key: number]: string[]},
105
- }})|false|null,
106
- studentForename?: string,
107
- studentSurname?: string,
108
- studentEmail?: string,
109
- skillsTargetsValues?: {[key: string]: {
110
- provider: number[],
111
- student: number[],
112
- }}
113
- }
114
-
115
- export type PlacementQuestions = {
116
- title: string
117
- description: string
118
- dressCode: string
119
- dressCodeText?: string
120
- firstDayContact: string
121
- firstAider?: string
122
- equipment: string
123
- responsibilities: string
124
- experiencesGiven: string
125
- experienceDesired: string
126
- otherAdvice: string
127
- carParking: boolean
128
- bikeStorage: boolean
129
- wheelchairFriendly: boolean
130
- kitchen: boolean
131
- lunchArrangements?: string
132
- hours: any,
133
- studentLevel: "gcse"|"college"|"undergraduate"|"postgraduate"|"over18",
134
- studentSublevel: string[],
135
- desiredLength: number,
136
- desiredMinLength?: number,
137
- desiredMaxLength?: number,
138
- desiredLengthUnits: "days"|"weeks"|"months",
139
- maximumStudents: number,
140
- workingLocation: "inPerson"|"hybrid"|"remote",
141
- pay?: number,
142
- payFrequency: "total"|"hourly"|"daily"|"weekly"|"monthly"|"annually",
143
- }
144
-
145
- export type SavedPlacement = {
146
- placementId: string,
147
- savedByProduct: Products,
148
- savedByUserType: "Organisation"|"Student",
149
- savedById: string,
150
- schoolId?: string,
151
- status?: "Accepted" | "Blocked" | "providerReview";
152
- listed: boolean,
153
- concurrentPlacements?: number,
154
- id: string
155
- }
156
-
157
- export type PlacementListingStages = "basic"|"address"|"students"|"responsibilities"|"applications"|"onboarding"|"review"|"complete";
158
-
159
- export type PlacementListing = {
160
- title: string,
161
- uid: string,
162
- template?: string,
163
- providerId?: string,
164
- name: string,
165
- providerEmail: string,
166
- providerPhone: string,
167
- id:string,
168
- studentType: "secondary" | "higher" | "undergraduate" | "postgraduate"
169
- contactForename: string,
170
- contactSurname: string,
171
- ["address-line1"]: string,
172
- ["address-line2"]: string,
173
- locality: string,
174
- postal_code: string,
175
- country: string,
176
- what3Words?: string,
177
- addressId?: string,
178
- geoHash?: string,
179
- status: "listed"|"unlisted"|"deleted"|"draft",
180
- questions: PlacementQuestions,
181
- savedBy?: {[key:string]: {
182
- exists: true,
183
- providerConsent: boolean,
184
- providerConsentDate?: Timestamp,
185
- status: "uploaded"|"approved"|"rejected"|"blocked"}},
186
- mapConsent?: boolean,
187
- mapConsentData?: string,
188
- uploadedBy: "student"|"institute"|"provider",
189
- riskAssessmentType?: "file"|"form"|"skipped",
190
- riskAssessmentData?: {[key:string]: unknown}[]|string,
191
- dbsCheckType?: "file"|"form"|"skipped",
192
- dbsCheckData?: {[key:string]: unknown}[]|string,
193
- contactType?: "email"|"website"|"phone"|"post",
194
- webpage?: string,
195
- stage: PlacementListingStages,
196
- placementDateType?: "any"|"range"|"defined",
197
- placementDates?: {start: string, end: string}[],
198
- applicationType?: "simple"|"complex",
199
- applicantWorkflowId?: string,
200
- applicantWorkflow?: ApplicantStage[],
201
- onboarding: (OnboardingDocs&{deadline: number})|false,
202
- maxApplicants?: number,
203
- maxStudents?: number,
204
- primaryContactId: string,
205
- }
206
-
207
- export type OnboardingDocs = {
208
- message?: string,
209
- forms?: string[],
210
- files?: string[],
211
- requiredFiles?: {fileName: string, fileType: string}[]
212
- }
213
-
214
- export type PlacementTemplate = PlacementListing&{templateName: string};
215
-
216
- export type OrganisationAddressStages = "address"|"contacts"|"misc"|"review"|"complete";
217
-
218
- export type OrganisationAddress = Address & {
219
- name?: string,
220
- savedBy?: string[],
221
- product: Products,
222
- oId: string,
223
- stage: OrganisationAddressStages,
224
- additionalQuestions?: {
225
- bikeStorage?: boolean,
226
- kitchen?: boolean,
227
- parking?: boolean,
228
- disabledAccess?: boolean,
229
- },
230
- contacts?: {
231
- firstAid?: {
232
- name?: string,
233
- phone?: string,
234
- email?: string,
235
- location?: string
236
- }[],
237
- security?: {
238
- name?: string,
239
- phone?: string,
240
- email?: string,
241
- location?: string
242
- }[],
243
- reception?: {
244
- name?: string,
245
- phone?: string,
246
- email?: string,
247
- location?: string
248
- }[],
249
- },
250
- primaryContactId?: string,
251
- default?: boolean,
252
- flags?: ("addressMissing" | "noPrimaryContact")[],
253
- color?: string;
254
- image?: string|false;
255
- };
256
-
257
- export type Address = {
258
- id?: string,
259
- ["address-line1"]: string,
260
- ["address-line2"]: string,
261
- locality: string,
262
- postal_code: string,
263
- country: string,
264
- geoHash?: string,
265
- what3Words?: string
266
- };
267
-
268
- export type FlagCodes =
269
- "inactive" |
270
- "noParentEmailWarning" |
271
- "noParentEmailError" |
272
- "overdue" |
273
- "noInsurance" |
274
- "providerRejection" |
275
- "nearingStart"|
276
- "awaitingInsurance"|
277
- "noRiskAssessment"|
278
- "awaitingRiskAssessment"|
279
- "parentEmailFailed"|
280
- "providerEmailFailed"|
281
- "userEmailFailed"|
282
- "noDbsCheck"|
283
- "awaitingDbsCheck"|
284
- "completeOnboarding"|
285
- "reviewOnboarding"|
286
- "requestedVisibleAddresses"|
287
- "requestedVisiblePlacementListings"|
288
- "addOnboarding"|
289
- "studentNotAccepted"|
290
- "reminder"
291
-
292
-
293
- export type UserData = {
294
- details: {
295
- forename: string,
296
- surname: string,
297
- pronouns?: string,
298
- parentEmail?: string,
299
- year?: string
300
- },
301
- renewalMonth: number,
302
- placementCharged?: boolean,
303
- algoliaKey: string,
304
- email: string,
305
- phone?: string,
306
- status: "active" | "inactive" | "unclaimed",
307
- favGuidance?: string[];
308
- oId: string,
309
- id: string,
310
- resetExpiry?: {seconds: number},
311
- product: Products,
312
- userGroup?: string,
313
- userType: "Staff"|"Students",
314
- created: string,
315
- activated: string,
316
- groupData?: UserGroupData,
317
- staffRoles: string[],
318
- flags?: FlagCodes[],
319
- cohortRequests: {[oId: string]: string[]},
320
- cohorts: {[oId: string]: string[]},
321
- analytics?: AnalyticsItem,
322
- units?: string,
323
- activationCode: number,
324
- cohort?: string,
325
- schoolId?: string,
326
- cohortData?: CohortData,
327
- dismissedTasks?: string[],
328
- dismissedTutorials?: string[],
329
- dismissedTips?: string[],
330
- dismissedUpdateDate?: string, // A specific date from which all previous updates have been seen.
331
- viewCohorts?: "all"|"some"|"none",
332
- viewStudents?: "all"|"some"|"none",
333
- studentFilterValues?: string[], // comma delimited list of values, such as "a, b, c, d"
334
- studentFilter?: string // Field on which students can be filtered
335
- visibleCohorts?: string[], // comma delimited list of values
336
- readUpdates?: string[],
337
- contactProviderConsent?: boolean,
338
- contactProviderConsentDate?: boolean
339
- referrals?: number,
340
- shareNameWithReferralLeaderboardConsent?: boolean,
341
- shareNameWithReferralLeaderboardConsentDate?: boolean,
342
- referralCode?: string,
343
- notificationFrequency?: "daily"|"weekly"|"fortnightly"|"never",
344
- monthAdded?: number,
345
- placementsCharged?: boolean,
346
- visibleAddresses?: string[],
347
- visibleSchools?: string[],
348
- visibleListings?: string[],
349
- requestedVisibleAddresses?: string[],
350
- requestedVisibleListings?: string[],
351
- packageData?: BillingPackage,
352
- viewAddresses?: "all"|"request"|"none"|"some",
353
- viewSchools?: "all"|"request"|"none"|"some",
354
- viewPlacementListings?: "all"|"request"|"none",
355
- viewPlacementGroups?: "all"|"request"|"none",
356
- skillsTargets?: string[],
357
- skillsTargetsValues?: {[key: string]: {
358
- provider: number[],
359
- student: number[],
360
- }},
361
- alumniConversationUid?: string
362
- };
363
-
364
- export type AnalyticsItem = {
365
- units?: "placements"|"weeks"|"days"|"hours",
366
- name?: string
367
- total?: number,
368
- completion?: {
369
- total?: number,
370
- completed?: number
371
- },
372
- time?: {[key: string]: {date?:string, total?: number, completion?: {total?: number, completed?:number}}},
373
- year?: {[key: string]: {year?: number, total?: number, completion?: {total?: number, completed?:number}}},
374
- subtypes?: {[key:string]: AnalyticsItem}
375
- }
376
-
377
- export type UserGroupData = {
378
- id: string,
379
- default?: boolean,
380
- name: string,
381
- template: "Staff"|"Students",
382
- oId: string,
383
- product: Products,
384
- viewStudents: "all"|"filter"|"none",
385
- filterUsersBy?: string,
386
- filterUsersValue?: string,
387
- }&ProviderUserPermissions
388
-
389
- export type StaffUserGroup = UserGroupData & StaffUserPermissions
390
- export type ProviderUserGroup = UserGroupData & ProviderUserPermissions
391
-
392
- export type StaffUserPermissions =
393
- UserGroupData & {
394
- viewStaff: boolean,
395
- addStaff?: boolean,
396
- activateStaff?: boolean,
397
- editStaff?: boolean,
398
- deleteStaff?: boolean,
399
- addStaffGroups?: boolean,
400
- editStaffGroups?: boolean,
401
- deleteStaffGroups?: boolean,
402
- addStudents?: boolean,
403
- activateStudents?: boolean,
404
- editStudents?: boolean,
405
- deleteStudents?: boolean,
406
- viewSetup?: boolean,
407
- editInstitute?: boolean,
408
- addForms?: boolean,
409
- editForms?: boolean,
410
- deleteForms?: boolean,
411
- addFiles?: boolean,
412
- deleteFiles?: boolean,
413
- viewBilling?: boolean,
414
- manageBilling?: boolean,
415
- proposePlacements?: boolean,
416
- createCohorts?: boolean,
417
- viewPlacements?: boolean,
418
- viewPlacementTasks?: boolean,
419
- signOffPlacements?: boolean,
420
- editPlacements?: boolean,
421
- addPlacements?: boolean,
422
- deletePlacements?: boolean,
423
- verifyInsurance?: boolean,
424
- verifyListings?: boolean
425
- viewDatabase?: boolean,
426
- addListings?: boolean,
427
- deleteListings?: boolean,
428
- verifyRiskAssessments?: boolean,
429
- verifyDbsChecks?: boolean,
430
- addCohorts?: boolean,
431
- editCohorts?: boolean,
432
- deleteCohorts?: boolean,
433
- editRequests?: boolean,
434
- deleteRequests?: boolean,
435
- addEmailTemplates?: boolean,
436
- editEmailTemplates?: boolean,
437
- deleteEmailTemplates?: boolean,
438
- addActivity?: boolean,
439
- editActivity?: boolean,
440
- deleteActivity?: boolean,
441
- }
442
-
443
- export type ProviderUserPermissions = {
444
- viewStaff: boolean,
445
- addStaff?: boolean,
446
- activateStaff?: boolean,
447
- editStaff?: boolean,
448
- deleteStaff?: boolean,
449
- addUserGroups?: boolean,
450
- editUserGroups?: boolean,
451
- deleteUserGroups?: boolean,
452
- addStudents?: boolean,
453
- addForms?: boolean,
454
- editForms?: boolean,
455
- deleteForms?: boolean,
456
- addFiles?: boolean,
457
- deleteFiles?: boolean,
458
- viewBilling?: boolean,
459
- manageBilling?: boolean,
460
- createPlacementListing?: "any"|"template"|"none",
461
- createPlacementTemplate?: boolean,
462
- viewPlacementListings?: "all"|"request"|"none",
463
- viewPlacementGroups?: "all"|"request"|"none",
464
- viewAddresses?: "all"|"request"|"none",
465
- processApplicants?: boolean,
466
- addSchools?: boolean,
467
- editSchools?: boolean,
468
- deleteSchools?: boolean,
469
- addAddresses?: boolean,
470
- editAddresses?: boolean,
471
- deleteAddresses?: boolean,
472
- addApplicantWorkflows?: boolean,
473
- editApplicantWorkflows?: boolean,
474
- deleteApplicantWorkflows?: boolean,
475
- editRequests?: boolean,
476
- deleteRequests?: boolean,
477
- manageAccessRequests?: boolean,
478
- manageRegistrationRequests?: boolean,
479
- }
480
-
481
- export type RegistrationRequest = {
482
- forename: string,
483
- surname: string,
484
- email: string,
485
- message: string,
486
- created: string,
487
- oId: string,
488
- product: "providers"|"institutes"
489
- }
490
-
491
- export type WorkflowStage = {
492
- id: number,
493
- name: string,
494
- permanent?: boolean,
495
- checkpoint?: boolean,
496
- buttons?: {id: number, name: string|false, required: boolean}[],
497
- pos?: { x: number, y: number },
498
- userType?: "Students" | "Staff" | "Provider" | "Parent",
499
- forms?: string[],
500
- files?: string[],
501
- deadline?: string,
502
- deadlineType?: "date"|"days"
503
- formDetails?: [{name: string}],
504
- eli?: boolean,
505
- riskAssessment?: boolean,
506
- dbsCheck?: boolean,
507
- defaultForms?: {
508
- name: string,
509
- description: string,
510
- time: "during"|"post",
511
- user: "staff"|"students"|"provider",
512
- details: CustomFormSchema
513
- }[],
514
- requiredFiles?: {fileName: string, fileType: string}[]
515
- };
516
-
517
- export type ProviderPlacementData = {
518
- title: string,
519
- name: string,
520
- providerPhone: string,
521
- providerEmail: string,
522
- contactForename: string,
523
- contactSurname: string,
524
- providerId: string,
525
- addressId: string,
526
- sector: string,
527
- subsector: string,
528
- id?: string
529
- };
530
-
531
-
532
- export type ProviderData = {
533
- staff: number,
534
- staffFields: string[],
535
- staffActive: number,
536
- admin: string,
537
- name: string,
538
- insurance: boolean|"awaitingReview",
539
- insuranceSkippedReason?: string,
540
- regNumber?: string,
541
- insuranceExpiry: string,
542
- mapConsent?: boolean|"unlisted",
543
- mapConsentDate?: string,
544
- staffGuidance?: {[key:number]: string},
545
- about?: string,
546
- sector: string,
547
- defAddress: string,
548
- subsector: string,
549
- website?: string,
550
- savedBy?: {[key:string]: {
551
- exists: true,
552
- providerConsent: boolean,
553
- providerConsentDate?: Timestamp,
554
- status: "uploaded"|"approved"|"blocked"}},
555
- onboarding?: {
556
- hasStaff?: boolean,
557
- multipleAddresses?: boolean,
558
- }
559
- registrationRequests?: boolean|string,
560
- registrationRequestsDate?: string,
561
- information: {
562
- description?: string,
563
- staff?: string,
564
- locations?: number,
565
- },
566
- discount?: string,
567
- package: string,
568
- splitBilling?: boolean,
569
- adminBillingContactId: string,
570
- addOnPackages?: string[],
571
- }
572
-
573
- export type InstituteData = {
574
- students: number,
575
- staff: number,
576
- studentsFields: string[],
577
- staffFields: string[],
578
- studentsActive: number,
579
- staffActive: number,
580
- admin: string,
581
- name: string,
582
- monthAdded: number,
583
- platformFee: number,
584
- color?: string,
585
- verifiedProviders?: string[],
586
- awaitingProviderInsurance?: string[],
587
- verifiedRiskAssessments?: string[],
588
- awaitingPlacementRiskAssessments?: string[],
589
- verifiedDbsChecks?: string[],
590
- awaitingPlacementDbsChecks?: string[],
591
- staffGuidance?: {[key:number]: string}
592
- studentsGuidance?: {[key:number]: string},
593
- cohortRequests: {[oId: string]: {[cohortId: string]: string[]}},
594
- externalProviderUploads?: boolean,
595
- discount?: string,
596
- package: string,
597
- splitBilling?: boolean,
598
- adminBillingContactId?: string,
599
- addOnPackages?: string[],
600
- authorisedMISSystem?: {
601
- name: "arbor",
602
- data: {
603
- url: string
604
- }
605
- },
606
- acceptingAlumni?: boolean,
607
- approveAlumni?: boolean,
608
- shareAlumni?: boolean
609
- approveAlumniMessages?: boolean,
610
- anonymiseAlumniConvoStudents?: boolean,
611
- alumniConversations?: boolean
612
- }&Address;
613
-
614
- export type ExternalActivity = {
615
- title?: string,
616
- description: string,
617
- position?: number,
618
- image?: string,
619
- color: string,
620
- public?: boolean,
621
- oId?: string,
622
- alumni?: boolean,
623
- provider?: boolean,
624
- }
625
-
626
- export type NotificationObject = {
627
- buttonURL: string,
628
- created: Timestamp,
629
- description: string,
630
- title: string,
631
- viewableBy: string[],
632
- viewedBy: string[],
633
- docPath: DocumentReference<DocumentData>
634
- }
635
-
636
- export type CustomFormSchemaField = {
637
- id: number,
638
- label: string,
639
- required: boolean,
640
- type: "short"|"long"|"number"|"date"|"dropdown"|"checkbox"|"rating" // If Microsoft forms has more, make a note and I'll add them
641
- width: number, // 1-12 default 12
642
- subtitle?: string,
643
- extra: {
644
- default?: boolean /* type: checkbox */ | string /* type: short, long, dropdown (inputted option) */ | number /* type:number */,
645
- min?: number /* type: number */
646
- max?: number /* type: number */
647
- minRows?: number /* type: long */
648
- options?: string[] // from dropdown only
649
- levels?: number // For ratings, number of stars.
650
- }
651
- }
652
-
653
- export type CustomFormSchemaSection =
654
- {
655
- id: number // random
656
- title?: string,
657
- description?: string,
658
- fields: CustomFormSchemaField[]
659
- }
660
-
661
-
662
- export type CustomFormSchema = {
663
- name?: string,
664
- description?: string,
665
- updated?: string,
666
- id?: string,
667
- form?: CustomFormSchemaSection[]}
668
-
669
- export type StaffRoles = {
670
- name: string,
671
- filters: {
672
- students: string[],
673
- fields: {[key:string]: unknown},
674
- },
675
- staff: string[]
676
- };
677
-
678
- export type QueryObjectConstraint = [string, "=="|"<"|"<="|">="|">"|"!="|"array-contains"|"array-contains-any"|"in"|"not-in", string|boolean][]
679
-
680
- export type QueryObject = {
681
- path: string[],
682
- where?: QueryObjectConstraint,
683
- orderBy?: string
684
- };
685
-
686
- export type Note = {
687
- title?: string,
688
- body?: {
689
- type: string;
690
- children: {
691
- text: string;
692
- }[];
693
- }[],
694
- created: string,
695
- updated: string
696
- }
697
-
698
- export type Referral = {
699
- signUps: number,
700
- volume: number,
701
- product: Products,
702
- expiry: Timestamp,
703
- name: string
704
- }
705
-
706
- export type Contact = {
707
- id: string,
708
- contactForename: string,
709
- contactSurname: string,
710
- name: string,
711
- providerEmail: string,
712
- providerPhone: number,
713
- "address-line1": string,
714
- "address-line2": string,
715
- locality: string,
716
- what3Words?: string,
717
- postal_code: string,
718
- country: string,
719
- created: string,
720
- docPath: unknown
721
- }
722
-
723
-
724
- export type CohortData = {
725
- id?: string,
726
- name: string,
727
- placementType: "defined"|"continuous",
728
- forms?: string[],
729
- files?: string[],
730
- startSubmission: string,
731
- endSubmission: string,
732
- startPlacements: string,
733
- endPlacements: string,
734
- stage: "info"|"name"|"placementType"|"students"|"workflow"|"review"|"created"|"archived",
735
- workflow: WorkflowStage[]
736
- customWorkflow?: boolean,
737
- oId: string,
738
- product: Products,
739
- schoolId?: string,
740
- designatedStaff?: string,
741
- logType?: "basic"|"custom",
742
- logs?: {
743
- students?: string,
744
- staff?: string,
745
- provider?: string,
746
- }
747
- feedback?: {
748
- students?: string,
749
- staff?: string,
750
- provider?: string,
751
- },
752
- feedbackText?: {
753
- students?: Descendant[],
754
- staff?: Descendant[],
755
- provider?: Descendant[],
756
- },
757
- providerFeedbackSent?: Timestamp,
758
- studentsFeedbackSent?: Timestamp,
759
- emailTemplates?: {[key in keyof typeof emailTemplates]: string},
760
- skillsTargets?: string[]
761
- }
762
-
763
- export type ArrowObject = {
764
- start: number|string,
765
- end: number|string,
766
- name: string|false,
767
- required?: boolean,
768
- screenX?: number,
769
- }
770
-
771
-
772
- export type PlacementReviewDetails = {
773
- activeDates: string[],
774
- studentForename: string,
775
- studentSurname: string,
776
- instituteName: string,
777
- title: string,
778
- product: string,
779
- name: string,
780
- startDate: string,
781
- endDate: string,
782
- providerEmail: string,
783
- providerPhone: string,
784
- contactForename: string,
785
- contactSurname: string,
786
- cohort: string,
787
- cohortData?: CohortData,
788
- providerKey: string,
789
- status: number,
790
- ["address-line1"]: string,
791
- ["address-line2"]: string,
792
- locality: string,
793
- postal_code: string,
794
- what3Words?: string,
795
- country: string,
796
- key: string,
797
- oId: string,
798
- providerCompleted: string[],
799
- providerId: string,
800
- questions: PlacementQuestions,
801
- mapConsent: boolean | "institute",
802
- userType: string,
803
- id: string,
804
- uid: string,
805
- leadTimes: string[],
806
- requiredSections: string[],
807
- existingPlacements?: {
808
- [key: string]: {
809
- mapConsent: boolean,
810
- jobTitle: string,
811
- questions: PlacementQuestions,
812
- riskAssessment: boolean|"awaitingReview",
813
- riskAssessmentType: "form"|"file",
814
- riskAssessmentData?: {[key: string]: unknown}|string,
815
- dbsCheck: boolean|"awaitingReview",
816
- dbsCheckType: "form"|"file",
817
- dbsCheckData?: {[key: string]: unknown}|string,
818
- }
819
- },
820
- requireELI?: boolean,
821
- requireRA?: boolean,
822
- requireDBS?: boolean,
823
- importedProviderForms: boolean,
824
- currentStage: WorkflowStage&{files: {[fileId: string]: {name: string, url: string}}},
825
- placementId?: string,
826
- incompleteItems: {[key: number]: string[]},
827
- riskAssessmentData?: {[key: string]: unknown}[]|string,
828
- dbsCheckData?: {[key: string]: unknown}[]|string,
829
- feedbackText?: Descendant[],
830
- feedback: CustomFormSchema,
831
- providerFeedback?: {[key: string]: unknown},
832
- primaryColor?: string,
833
- primaryImage?: string
834
- }
835
-
836
- export type BlogCategories = "students"|"providers"|"institutes"|"placementt"
837
-
838
- export type Blog = {
839
- title?: string,
840
- summary?: string,
841
- body?: Descendant[],
842
- uploaded?: string,
843
- category?: BlogCategories,
844
- author?: string,
845
- tags?: string
846
- }
847
-
848
- export type PlacementExportObject = {
849
- cohortId: string,
850
- startDate?: string,
851
- endDate?: string,
852
- allTime?: boolean,
853
- includeStudentData?: boolean,
854
- activePlacements?: boolean,
855
- completedPlacements?: boolean,
856
- }
857
-
858
-
859
-
860
- export type ApplicantWorkflow = {
861
- id?: string,
862
- name: string,
863
- forms?: string[],
864
- files?: string[],
865
- workflow: ApplicantStage[]
866
- customWorkflow?: boolean,
867
- oId: string,
868
- product: Products,
869
- type: "simple"|"complex"
870
- }
871
-
872
- export type ApplicantStage = {
873
- id: number,
874
- name: string,
875
- message?: string,
876
- userType?: "Students" | "Staff",
877
- permanent?: boolean,
878
- checkpoint?: boolean,
879
- buttons?: {id: number, name: string|false, required: boolean}[],
880
- pos?: { x: number, y: number },
881
- forms?: string[],
882
- files?: string[],
883
- deadline?: string,
884
- deadlineType?: "date"|"days"
885
- formDetails?: {[key: string]: {
886
- name: string,
887
- id: string,
888
- description?: string,
889
- product: Products,
890
- oId: string,
891
- form: CustomFormSchema
892
- }},
893
- requiredFiles?: {fileName: string, fileType: string}[]
894
- portfolio?: boolean,
895
- viewableFiles?: {[key: string]: FileItem},
896
- };
897
-
898
- export type Application = {
899
- id?: string,
900
- uid: string,
901
- applicantWorkflowId: string,
902
- listingId: string,
903
- addressId: string,
904
- providerId: string,
905
- reqUserType: "Students"|"Staff",
906
- completedSections: {[stage: number]: {
907
- submitted?: string,
908
- filesViewed?: string[],
909
- formsCompleted?: {[key: string]: unknown},
910
- filesUploaded?: {[key: number]: string[]},
911
- }},
912
- created: string,
913
- submitted: string,
914
- startDate: string,
915
- endDate: string,
916
- leadTimes?: string[],
917
- stage: number, // This is what stage of the custom workflow.
918
- outcomeMessage?: string,
919
- status: "draft"|"submitted"|"approved"|"declined",
920
- placementId?: string,
921
- }
922
-
923
- export type Report = {
924
- added: string,
925
- id: string,
926
- oId: string,
927
- product: Products,
928
- pId: string,
929
- reason: string,
930
- uid: string,
931
- status: "open"|"closed"
932
- }
933
-
934
-
935
- export type FileItem = {
936
- product: Products,
937
- oId: string,
938
- added: string,
939
- name: string,
940
- fileName: string,
941
- url?: string
942
- }
943
-
944
- export type Event = {
945
- collection: "users"|"placements"|"placementListings",
946
- documentId: string,
947
- product: Products,
948
- oId: string,
949
- created: Timestamp,
950
- title: string,
951
- description?: string,
952
- severity: string,
953
- button?: {title: string, url: string}
954
- }
955
-
956
- export type BillingPackage = {
957
- name: string,
958
- staffUnitCost: number,
959
- platformFee: number,
960
- platformFeeFrequency: "yearly"|"monthly",
961
- studentUnitCost: number,
962
- placementUnitCost: number,
963
- product: Products,
964
- priority: number,
965
- features: {[key: string]: number|boolean|string},
966
- description: string
967
- }
968
-
969
- export type EmailTemplate = {
970
- name: string,
971
- created: Timestamp,
972
- subject: string,
973
- emailTemplate: string,
974
- bodyText: Descendant[],
975
- color?: string,
976
- product: Products,
977
- oId: string,
978
- public?: boolean,
979
- }
980
-
981
-
982
- export type EmailTemplateConfig = {
983
- description: string,
984
- params: string[],
985
- button?: {text: string, link: string},
986
- type: "workflow"|"feedback"
987
- }
988
-
989
-
990
- export type Reminder = {
991
- collection: "users"|"placements"|"placementListings",
992
- documentId: string,
993
- product: Products,
994
- oId: string,
995
- created: Timestamp,
996
- title: string,
997
- description?: string,
998
- dueDate: string,
999
- status: "upcoming"|"dismissed"
1000
- }
1001
-
1002
- export type Sorts = {[label: string]: {
1003
- value: string
1004
- direction: "asc"|"desc"
1005
- }}|undefined
1006
-
1007
- export type SchoolData = OrganisationAddress&{
1008
- billingEmail?: string,
1009
- billingContactId?: string,
1010
- authorisedMISSystem?: {
1011
- name: "arbor",
1012
- data: {
1013
- url: string
1014
- }
1015
- },
1016
- monthAdded: number,
1017
- acceptingAlumni?: boolean,
1018
- approveAlumni?: boolean,
1019
- shareAlumni?: boolean
1020
- approveAlumniMessages?: boolean,
1021
- anonymiseAlumniConvoStudents?: boolean,
1022
- alumniConversations?: boolean
1023
- }
1024
-
1025
-
1026
- export type ExternalEvent = {
1027
- name: string,
1028
- description: string,
1029
- created: string,
1030
- activityId?: string,
1031
- oId: string,
1032
- submissionClose: string,
1033
- schoolId?: string,
1034
- startDate?: string,
1035
- endDate?: string,
1036
- startTime?: string,
1037
- endTime?: string,
1038
- allDay?: boolean,
1039
- recurring?: boolean,
1040
- recurringFrequency: "daily"|"weekly"|"fortnightly"|"monthlyOnDate",
1041
- recurringUntil?: string,
1042
- students?: number,
1043
- maxExternalAttendees?: number,
1044
- stage: "basicDetails"|"date"|"invites"|"review"|"created",
1045
- alumni: {
1046
- shareable?: boolean,
1047
- filters: {[key: string]: unknown}
1048
- }
1049
- employers: {
1050
- shareable?: boolean,
1051
- filters: {[key: string]: unknown}
1052
- }
1053
- }&Address
1054
-
1055
-
1056
- export type Alumni = {
1057
- forename: string,
1058
- surname: string,
1059
- email: string,
1060
- startYear: string,
1061
- endYear: string,
1062
- activities: string[],
1063
- oId: string,
1064
- schoolId?: string,
1065
- dateAdded?: string,
1066
- currentEnrolment: "university"|"apprenticeship"|"employment",
1067
- status: "inactive"|"awaitingStaff"|"active"
1068
- sector: string,
1069
- subsector: string,
1070
- enrolmentHistory: {}[],
1071
- visibleToStudents?: boolean,
1072
- enableConversations?: boolean,
1073
- linkCode: string,
1074
- linkCodeExpiry: string
1075
- }
1076
-
1077
- export type ExternalStudentAccount = {
1078
- oId: string,
1079
- schoolId?: string,
1080
- forename?: string,
1081
- surname?: string,
1082
- email: string,
1083
- created?: string
1084
- }
1085
-
1086
- export type AlumniConversation = {
1087
- alumniId: string,
1088
- externalStudentId: string,
1089
- alumniSharable?: boolean,
1090
- oId: string,
1091
- schoolId?: string,
1092
- studentSharable?: boolean,
1093
- messages: {[key: string]: {
1094
- sentBy: "alumni"|"student",
1095
- sentAt: string,
1096
- message: string,
1097
- delivered: "blocked"|"pending"|true,
1098
- }},
1099
- open: boolean,
1100
- reported?: boolean,
1101
- delivered: "blocked"|"pending"|true,
1102
- report?: {
1103
- reportedBy: "alumni"|"student"
1104
- message: string,
1105
- createdDateTime: string,
1106
- resolvedDateTime: string,
1107
- }
1108
- }
1109
-
1110
- export type AlumniConvoUser = {
1111
- forename: string,
1112
- surname: string,
1113
- email: string,
1114
- dateAdded: string,
1115
- oId: string,
1116
- schoolId?: string,
1117
- linkCode: string,
1118
- linkCodeExpiry: string
1119
- }
1120
-
1121
- export type Update = {
1122
- title: string,
1123
- description: Descendant[],
1124
- userType: "Staff"|"Students",
1125
- product: Products,
1126
- buttonText?: string,
1127
- buttonLink?: string,
1128
- date: string,
1129
- imageData?: boolean
1
+ import {DocumentData, DocumentReference, Timestamp} from "firebase/firestore";
2
+ import {Descendant} from "slate";
3
+ import {emailTemplates} from "./constants";
4
+ import {FilterObject} from "./hooks";
5
+
6
+ export type Products = "institutes"|"providers"|"students"|"admin";
7
+
8
+ export type StudentPlacementData = {
9
+ title: string,
10
+ reqUserType: "Students" | "Staff" | "Provider" | "Parent",
11
+ uid: string,
12
+ startDate: string,
13
+ endDate: string,
14
+ providerId?: string,
15
+ name: string,
16
+ parentKey: string,
17
+ parentEmail: string,
18
+ providerKey: string,
19
+ parentExpiry: string,
20
+ providerExpiry: string,
21
+ providerEmail: string,
22
+ providerEmailed: Timestamp,
23
+ parentEmailed: Timestamp,
24
+ providerPhone: string,
25
+ studentDescription?: string,
26
+ website?: string,
27
+ id:string,
28
+ providerCompleted: string[],
29
+ oId: string,
30
+ contactForename: string,
31
+ contactSurname: string,
32
+ status: number,
33
+ nextStatus: number,
34
+ ["address-line1"]: string,
35
+ ["address-line2"]: string,
36
+ locality: string,
37
+ postal_code: string,
38
+ what3Words?: string,
39
+ country: string,
40
+ cohort?: string,
41
+ leadTimes: string[],
42
+ flags?: FlagCodes[],
43
+ mapConsent: true | false,
44
+ mapConsentDate?: string,
45
+ eventsConsent: true | false,
46
+ eventsConsentDate?: string,
47
+ placementId?: string,
48
+ providerContactId?: string,
49
+ geoHash?: string,
50
+ statusType: "draft"|"submitted"|"active"|"completed"|"withdrawn"|"requested",
51
+ questions: PlacementQuestions,
52
+ staffRoles: string[],
53
+ sector: string,
54
+ subsector: string,
55
+ importedProviderForms?: boolean,
56
+ analytics: string[],
57
+ units: string,
58
+ schoolId?: string,
59
+ active: boolean,
60
+ completed: boolean,
61
+ personalAnalytics?: string[],
62
+ completedStages?: number[],
63
+ contactId?: string
64
+ created: string,
65
+ inProgress: boolean,
66
+ draft: boolean,
67
+ activeDates: string[],
68
+ insurance: boolean|"awaitingReview",
69
+ insuranceSkippedReason?: string,
70
+ riskAssessment?: boolean|"awaitingReview",
71
+ riskAssessmentType?: "file"|"form"|"skipped",
72
+ riskAssessmentData?: {[key:string]: unknown}[]|string,
73
+ dbsCheck?: boolean|"awaitingReview",
74
+ dbsCheckType?: "file"|"form"|"skipped",
75
+ dbsCheckData?: {[key:string]: unknown}[]|string,
76
+ contactType?: "email"|"website"|"phone"|"post",
77
+ webpage?: string,
78
+ providerLogs?: string[],
79
+ studentsLogs?: string[],
80
+ notes?: {
81
+ providers?: Descendant[],
82
+ institutes?: Descendant[],
83
+ students?: Descendant[]
84
+ }
85
+ staffLogs?: [],
86
+ feedback: {
87
+ students: {
88
+ completed: boolean,
89
+ data?: {[key: string]: unknown}
90
+ },
91
+ provider: {
92
+ completed: boolean,
93
+ data?: {[key: string]: unknown}
94
+ },
95
+ staff: {
96
+ completed: boolean,
97
+ data?: {[key: string]: unknown}
98
+ },
99
+ },
100
+ onboarding: (OnboardingDocs&{
101
+ deadline?: string,
102
+ completed: {
103
+ submitted: boolean,
104
+ submittedDate?: string,
105
+ accepted?: boolean,
106
+ filesViewed?: string[],
107
+ formsCompleted?: {[key: string]: unknown},
108
+ filesUploaded?: {[key: number]: string[]},
109
+ }})|false|null,
110
+ studentForename?: string,
111
+ studentSurname?: string,
112
+ studentEmail?: string,
113
+ skillsTargetsValues?: {[key: string]: {
114
+ provider: number[],
115
+ student: number[],
116
+ }}
117
+ }
118
+
119
+ export type PlacementQuestions = {
120
+ title: string
121
+ description: string
122
+ dressCode: string
123
+ dressCodeText?: string
124
+ firstDayContact: string
125
+ firstAider?: string
126
+ equipment: string
127
+ responsibilities: string
128
+ experiencesGiven: string
129
+ experienceDesired: string
130
+ otherAdvice: string
131
+ carParking: boolean
132
+ bikeStorage: boolean
133
+ wheelchairFriendly: boolean
134
+ kitchen: boolean
135
+ lunchArrangements?: string
136
+ hours: any,
137
+ studentLevel: "gcse"|"college"|"undergraduate"|"postgraduate"|"over18",
138
+ studentSublevel: string[],
139
+ desiredLength: number,
140
+ desiredMinLength?: number,
141
+ desiredMaxLength?: number,
142
+ desiredLengthUnits: "days"|"weeks"|"months",
143
+ maximumStudents: number,
144
+ workingLocation: "inPerson"|"hybrid"|"remote",
145
+ pay?: number,
146
+ payFrequency: "total"|"hourly"|"daily"|"weekly"|"monthly"|"annually",
147
+ }
148
+
149
+ export type SavedPlacement = {
150
+ placementId: string,
151
+ savedByProduct: Products,
152
+ savedByUserType: "Organisation"|"Student",
153
+ savedById: string,
154
+ schoolId?: string,
155
+ status?: "Accepted" | "Blocked" | "providerReview";
156
+ listed: boolean,
157
+ concurrentPlacements?: number,
158
+ id: string
159
+ }
160
+
161
+ // export type PlacementListingStages = "basic"|"address"|"students"|"responsibilities"|"applications"|"onboarding"|"review"|"complete";
162
+
163
+ export type PlacementListing = {
164
+ title: string,
165
+ // uid: string,
166
+ // template?: string,
167
+ providerId: string,
168
+ providerContactId: string,
169
+ name: string,
170
+ providerEmail: string,
171
+ providerPhone: string,
172
+ id?:string,
173
+ created?: string,
174
+ // studentType: "secondary" | "higher" | "undergraduate" | "postgraduate"
175
+ contactForename: string,
176
+ contactSurname: string,
177
+ ["address-line1"]: string,
178
+ ["address-line2"]: string,
179
+ locality: string,
180
+ postal_code: string,
181
+ country: string,
182
+ what3Words?: string,
183
+ geoHash?: string,
184
+ // status: "listed"|"unlisted"|"deleted"|"draft",
185
+ questions: PlacementQuestions,
186
+ savedBy?: {[key:string]: { // LIST OF SCHOOLS THAT HAVE SAVED THIS
187
+ MATschools?: string[],
188
+ exists: true,
189
+ cohorts?: {[key: string]: {
190
+ exists: boolean,
191
+ listed: boolean
192
+ }},
193
+ eventsConsent?: boolean,
194
+ eventsConsentDate?: string,
195
+ providerConsent?: boolean, // Actually consent to placemnts.
196
+ providerConsentDate?: string,
197
+ savedByUserType: "Organisation"|"Student",
198
+ status: "uploaded"|"approved"|"rejected"|"providerReviewed"|"blocked"}},
199
+ mapConsent?: boolean,
200
+ mapConsentDate?: string,
201
+ uploadedBy: "student"|"institute"|"provider",
202
+ riskAssessmentType?: "file"|"form"|"skipped",
203
+ concurrentPlacements?: number,
204
+ riskAssessmentData?: {[key:string]: unknown}[]|string,
205
+ dbsCheckType?: "file"|"form"|"skipped",
206
+ dbsCheckData?: {[key:string]: unknown}[]|string,
207
+ contactType?: "email"|"website"|"phone"|"post",
208
+ webpage?: string,
209
+ sector?: string,
210
+ subsector?: string,
211
+ // stage: PlacementListingStages,
212
+ // placementDateType?: "any"|"range"|"defined",
213
+ // placementDates?: {start: string, end: string}[],
214
+ // applicationType?: "simple"|"complex",
215
+ // applicantWorkflowId?: string,
216
+ // applicantWorkflow?: ApplicantStage[],
217
+ // onboarding: (OnboardingDocs&{deadline: number})|false,
218
+ // maxApplicants?: number,
219
+ // maxStudents?: number,
220
+ // primaryContactId: string,
221
+ }
222
+
223
+ export type OnboardingDocs = {
224
+ message?: string,
225
+ forms?: string[],
226
+ files?: string[],
227
+ requiredFiles?: {fileName: string, fileType: string}[]
228
+ }
229
+
230
+ // export type PlacementTemplate = PlacementListing&{templateName: string};
231
+
232
+ export type OrganisationAddressStages = "address"|"contacts"|"misc"|"review"|"complete";
233
+
234
+ export type OrganisationAddress = Address & {
235
+ name?: string,
236
+ savedBy?: string[],
237
+ product: Products,
238
+ oId: string,
239
+ stage: OrganisationAddressStages,
240
+ additionalQuestions?: {
241
+ bikeStorage?: boolean,
242
+ kitchen?: boolean,
243
+ parking?: boolean,
244
+ disabledAccess?: boolean,
245
+ },
246
+ contacts?: {
247
+ firstAid?: {
248
+ name?: string,
249
+ phone?: string,
250
+ email?: string,
251
+ location?: string
252
+ }[],
253
+ security?: {
254
+ name?: string,
255
+ phone?: string,
256
+ email?: string,
257
+ location?: string
258
+ }[],
259
+ reception?: {
260
+ name?: string,
261
+ phone?: string,
262
+ email?: string,
263
+ location?: string
264
+ }[],
265
+ },
266
+ primaryContactId?: string,
267
+ default?: boolean,
268
+ flags?: ("addressMissing" | "noPrimaryContact")[],
269
+ color?: string;
270
+ image?: string|false;
271
+ };
272
+
273
+ export type Address = {
274
+ id?: string,
275
+ ["address-line1"]: string,
276
+ ["address-line2"]: string,
277
+ locality: string,
278
+ postal_code: string,
279
+ country: string,
280
+ geoHash?: string,
281
+ what3Words?: string
282
+ };
283
+
284
+ export type FlagCodes =
285
+ "inactive" |
286
+ "noParentEmailWarning" |
287
+ "noParentEmailError" |
288
+ "overdue" |
289
+ "noInsurance" |
290
+ "providerRejection" |
291
+ "nearingStart"|
292
+ "awaitingInsurance"|
293
+ "noRiskAssessment"|
294
+ "awaitingRiskAssessment"|
295
+ "parentEmailFailed"|
296
+ "providerEmailFailed"|
297
+ "userEmailFailed"|
298
+ "noDbsCheck"|
299
+ "awaitingDbsCheck"|
300
+ "completeOnboarding"|
301
+ "reviewOnboarding"|
302
+ "requestedVisibleAddresses"|
303
+ "requestedVisiblePlacementListings"|
304
+ "addOnboarding"|
305
+ "studentNotAccepted"|
306
+ "reminder"
307
+
308
+
309
+ export type UserData = {
310
+ details: {
311
+ forename: string,
312
+ surname: string,
313
+ pronouns?: string,
314
+ parentEmail?: string,
315
+ year?: string
316
+ },
317
+ renewalMonth: number,
318
+ placementCharged?: boolean,
319
+ algoliaKey: string,
320
+ email: string,
321
+ phone?: string,
322
+ status: "active" | "inactive" | "unclaimed",
323
+ passwordless?: boolean,
324
+ accessKey?: string,
325
+ accessKeyExpiry?: string,
326
+ events?: string[],
327
+ favGuidance?: string[];
328
+ oId: string,
329
+ id: string,
330
+ resetExpiry?: {seconds: number},
331
+ product: Products,
332
+ userGroup?: string,
333
+ userType: "Staff"|"Students",
334
+ created: string,
335
+ activated: string,
336
+ groupData?: UserGroupData,
337
+ staffRoles: string[],
338
+ flags?: FlagCodes[],
339
+ cohortRequests: {[oId: string]: string[]},
340
+ cohorts: {[oId: string]: string[]},
341
+ analytics?: AnalyticsItem,
342
+ units?: string,
343
+ activationCode: number,
344
+ cohort?: string,
345
+ schoolId?: string,
346
+ cohortData?: CohortData,
347
+ dismissedTasks?: string[],
348
+ dismissedTutorials?: string[],
349
+ dismissedTips?: string[],
350
+ dismissedUpdateDate?: string, // A specific date from which all previous updates have been seen.
351
+ viewCohorts?: "all"|"some"|"none",
352
+ viewStudents?: "all"|"some"|"none",
353
+ studentFilterValues?: string[], // comma delimited list of values, such as "a, b, c, d"
354
+ studentFilter?: string // Field on which students can be filtered
355
+ visibleCohorts?: string[], // comma delimited list of values
356
+ readUpdates?: string[],
357
+ contactProviderConsent?: boolean,
358
+ contactProviderConsentDate?: boolean
359
+ referrals?: number,
360
+ shareNameWithReferralLeaderboardConsent?: boolean,
361
+ shareNameWithReferralLeaderboardConsentDate?: boolean,
362
+ referralCode?: string,
363
+ notificationFrequency?: "daily"|"weekly"|"fortnightly"|"never",
364
+ monthAdded?: number,
365
+ placementsCharged?: boolean,
366
+ visibleAddresses?: string[],
367
+ visibleSchools?: string[],
368
+ visibleListings?: string[],
369
+ requestedVisibleAddresses?: string[],
370
+ requestedVisibleListings?: string[],
371
+ packageData?: BillingPackage,
372
+ viewAddresses?: "all"|"request"|"none"|"some",
373
+ viewSchools?: "all"|"request"|"none"|"some",
374
+ viewPlacementListings?: "all"|"request"|"none",
375
+ viewPlacementGroups?: "all"|"request"|"none",
376
+ skillsTargets?: string[],
377
+ skillsTargetsValues?: {[key: string]: {
378
+ provider: number[],
379
+ student: number[],
380
+ }},
381
+ alumniConversationUid?: string,
382
+ savedDataViewerFilters?: {
383
+ [cohortId: string]: {
384
+ [key in "cohortPlacements"|"cohortStudents"]: {
385
+ [viewKey: string]: DataViewerFilterView
386
+ }
387
+ }
388
+ }
389
+ };
390
+
391
+ export type DataViewerFilterView = {
392
+ title: string,
393
+ search?: string,
394
+ sort?: string,
395
+ filters?: FilterObject,
396
+ permanent?: boolean,
397
+ }
398
+
399
+ export type AnalyticsItem = {
400
+ units?: "placements"|"weeks"|"days"|"hours",
401
+ name?: string
402
+ total?: number,
403
+ completion?: {
404
+ total?: number,
405
+ completed?: number
406
+ },
407
+ time?: {[key: string]: {date?:string, total?: number, completion?: {total?: number, completed?:number}}},
408
+ year?: {[key: string]: {year?: number, total?: number, completion?: {total?: number, completed?:number}}},
409
+ subtypes?: {[key:string]: AnalyticsItem}
410
+ }
411
+
412
+ export type UserGroupData = {
413
+ id: string,
414
+ default?: boolean,
415
+ name: string,
416
+ template: "Staff"|"Students",
417
+ oId: string,
418
+ product: Products,
419
+ viewStudents: "all"|"filter"|"none",
420
+ filterUsersBy?: string,
421
+ filterUsersValue?: string,
422
+ }&ProviderUserPermissions
423
+
424
+ export type StaffUserGroup = UserGroupData & StaffUserPermissions
425
+ export type ProviderUserGroup = UserGroupData & ProviderUserPermissions
426
+
427
+ export type StaffUserPermissions =
428
+ UserGroupData & {
429
+ viewStaff: boolean,
430
+ addStaff?: boolean,
431
+ activateStaff?: boolean,
432
+ editStaff?: boolean,
433
+ deleteStaff?: boolean,
434
+ addStaffGroups?: boolean,
435
+ editStaffGroups?: boolean,
436
+ deleteStaffGroups?: boolean,
437
+ addStudents?: boolean,
438
+ activateStudents?: boolean,
439
+ editStudents?: boolean,
440
+ deleteStudents?: boolean,
441
+ viewSetup?: boolean,
442
+ editInstitute?: boolean,
443
+ addForms?: boolean,
444
+ editForms?: boolean,
445
+ deleteForms?: boolean,
446
+ addFiles?: boolean,
447
+ deleteFiles?: boolean,
448
+ viewBilling?: boolean,
449
+ manageBilling?: boolean,
450
+ proposePlacements?: boolean,
451
+ createCohorts?: boolean,
452
+ viewPlacements?: boolean,
453
+ viewPlacementTasks?: boolean,
454
+ signOffPlacements?: boolean,
455
+ editPlacements?: boolean,
456
+ addPlacements?: boolean,
457
+ deletePlacements?: boolean,
458
+ verifyInsurance?: boolean,
459
+ verifyListings?: boolean
460
+ viewDatabase?: boolean,
461
+ addListings?: boolean,
462
+ deleteListings?: boolean,
463
+ verifyRiskAssessments?: boolean,
464
+ verifyDbsChecks?: boolean,
465
+ addCohorts?: boolean,
466
+ editCohorts?: boolean,
467
+ deleteCohorts?: boolean,
468
+ editRequests?: boolean,
469
+ deleteRequests?: boolean,
470
+ addEmailTemplates?: boolean,
471
+ editEmailTemplates?: boolean,
472
+ deleteEmailTemplates?: boolean,
473
+ addActivity?: boolean,
474
+ editActivity?: boolean,
475
+ deleteActivity?: boolean,
476
+ }
477
+
478
+ export type ProviderUserPermissions = {
479
+ viewStaff: boolean,
480
+ addStaff?: boolean,
481
+ activateStaff?: boolean,
482
+ editStaff?: boolean,
483
+ deleteStaff?: boolean,
484
+ addUserGroups?: boolean,
485
+ editUserGroups?: boolean,
486
+ deleteUserGroups?: boolean,
487
+ addStudents?: boolean,
488
+ addForms?: boolean,
489
+ editForms?: boolean,
490
+ deleteForms?: boolean,
491
+ addFiles?: boolean,
492
+ deleteFiles?: boolean,
493
+ viewBilling?: boolean,
494
+ manageBilling?: boolean,
495
+ createPlacementListing?: "any"|"template"|"none",
496
+ createPlacementTemplate?: boolean,
497
+ viewPlacementListings?: "all"|"request"|"none",
498
+ viewPlacementGroups?: "all"|"request"|"none",
499
+ viewAddresses?: "all"|"request"|"none",
500
+ processApplicants?: boolean,
501
+ addSchools?: boolean,
502
+ editSchools?: boolean,
503
+ deleteSchools?: boolean,
504
+ addAddresses?: boolean,
505
+ editAddresses?: boolean,
506
+ deleteAddresses?: boolean,
507
+ addApplicantWorkflows?: boolean,
508
+ editApplicantWorkflows?: boolean,
509
+ deleteApplicantWorkflows?: boolean,
510
+ editRequests?: boolean,
511
+ deleteRequests?: boolean,
512
+ manageAccessRequests?: boolean,
513
+ manageRegistrationRequests?: boolean,
514
+ }
515
+
516
+ export type RegistrationRequest = {
517
+ forename: string,
518
+ surname: string,
519
+ email: string,
520
+ message: string,
521
+ created: string,
522
+ oId: string,
523
+ product: "providers"|"institutes"
524
+ }
525
+
526
+ export type WorkflowStage = {
527
+ id: number,
528
+ name: string,
529
+ permanent?: boolean,
530
+ checkpoint?: boolean,
531
+ buttons?: {id: number, name: string|false, required: boolean}[],
532
+ pos?: { x: number, y: number },
533
+ userType?: "Students" | "Staff" | "Provider" | "Parent",
534
+ forms?: string[],
535
+ files?: string[],
536
+ deadline?: string,
537
+ deadlineType?: "date"|"days"
538
+ formDetails?: [{name: string}],
539
+ eli?: boolean,
540
+ riskAssessment?: boolean,
541
+ dbsCheck?: boolean,
542
+ defaultForms?: {
543
+ name: string,
544
+ description: string,
545
+ time: "during"|"post",
546
+ user: "staff"|"students"|"provider",
547
+ details: CustomFormSchema
548
+ }[],
549
+ requiredFiles?: {fileName: string, fileType: string}[]
550
+ };
551
+
552
+ export type ProviderPlacementData = {
553
+ title: string,
554
+ name: string,
555
+ providerPhone: string,
556
+ providerEmail: string,
557
+ contactForename: string,
558
+ contactSurname: string,
559
+ providerId: string,
560
+ addressId: string,
561
+ sector: string,
562
+ subsector: string,
563
+ id?: string
564
+ };
565
+
566
+
567
+ export type ProviderData = {
568
+ // staff: number,
569
+ // staffFields: string[],
570
+ // staffActive: number,
571
+ // admin: string,
572
+ name: string,
573
+ // insurance: boolean|"awaitingReview",
574
+ // insuranceSkippedReason?: string,
575
+ regNumber?: string,
576
+ // insuranceExpiry: string,
577
+ // mapConsent?: boolean|"unlisted",
578
+ // mapConsentDate?: string,
579
+ // staffGuidance?: {[key:number]: string},
580
+ // about?: string,
581
+ sector: string,
582
+ // defAddress: string,
583
+ subsector: string,
584
+ website?: string,
585
+ created?: string
586
+ uploadedBy?: "institute"|"provider"|"student"
587
+ // onboarding?: {
588
+ // hasStaff?: boolean,
589
+ // multipleAddresses?: boolean,
590
+ // }
591
+ // registrationRequests?: boolean|string,
592
+ // registrationRequestsDate?: string,
593
+ // information: {
594
+ // description?: string,
595
+ // staff?: string,
596
+ // locations?: number,
597
+ // },
598
+ // discount?: string,
599
+ // package: string,
600
+ // splitBilling?: boolean,
601
+ // adminBillingContactId: string,
602
+ // addOnPackages?: string[],
603
+ }&Address
604
+
605
+ export type ProviderContactData = {
606
+ sector: string,
607
+ name: string,
608
+ subsector: string,
609
+ providerPhone?: string,
610
+ providerEmail: string,
611
+ contactForename: string,
612
+ contactSurname: string,
613
+ website?: string,
614
+ created: string,
615
+ providerId: string,
616
+ insurance: boolean|"awaitingReview",
617
+ insuranceSkippedReason?: string,
618
+ insuranceExpiry?: string,
619
+ savedBy?: {[key:string]: {
620
+ exists: true,
621
+ activities?: null|string[], // IDs of consented activities.
622
+ eventsConsent?: boolean,
623
+ eventsConsentDate?: string,
624
+ providerConsent?: boolean, // Actually consent to placemnts.
625
+ providerConsentDate?: string,
626
+ MATschools?: string[],
627
+ status: "uploaded"|"approved"|"rejected"|"providerReviewed"|"blocked"}},
628
+ }&Address
629
+
630
+ export type InstituteData = {
631
+ students: number,
632
+ staff: number,
633
+ studentsFields: string[],
634
+ staffFields: string[],
635
+ studentsActive: number,
636
+ staffActive: number,
637
+ admin: string,
638
+ name: string,
639
+ monthAdded: number,
640
+ platformFee: number,
641
+ color?: string,
642
+ verifiedProviders?: string[],
643
+ awaitingProviderInsurance?: string[],
644
+ verifiedRiskAssessments?: string[],
645
+ awaitingPlacementRiskAssessments?: string[],
646
+ verifiedDbsChecks?: string[],
647
+ awaitingPlacementDbsChecks?: string[],
648
+ staffGuidance?: {[key:number]: string}
649
+ studentsGuidance?: {[key:number]: string},
650
+ cohortRequests: {[oId: string]: {[cohortId: string]: string[]}},
651
+ externalProviderUploads?: boolean,
652
+ discount?: string,
653
+ package: string,
654
+ splitBilling?: boolean,
655
+ adminBillingContactId?: string,
656
+ addOnPackages?: string[],
657
+ authorisedMISSystem?: {
658
+ name: "arbor",
659
+ data: {
660
+ url: string
661
+ }
662
+ },
663
+ acceptingAlumni?: boolean,
664
+ approveAlumni?: boolean,
665
+ shareAlumni?: boolean
666
+ approveAlumniMessages?: boolean,
667
+ anonymiseAlumniConvoStudents?: boolean,
668
+ alumniConversations?: boolean,
669
+ activityInvitesSent?: string
670
+ }&Address;
671
+
672
+ export type ExternalActivity = {
673
+ title?: string,
674
+ description: string,
675
+ position?: number,
676
+ image?: string,
677
+ color: string,
678
+ public?: boolean,
679
+ oId?: string,
680
+ alumni?: boolean,
681
+ provider?: boolean,
682
+ permanent?: boolean,
683
+ activityType: "workExperience"|"workplaceVisits"|"mentoring"|"mockInterviews"|"other"
684
+ }
685
+
686
+ export type NotificationObject = {
687
+ buttonURL: string,
688
+ created: Timestamp,
689
+ description: string,
690
+ title: string,
691
+ viewableBy: string[],
692
+ viewedBy: string[],
693
+ docPath: DocumentReference<DocumentData>
694
+ }
695
+
696
+ export type CustomFormSchemaField = {
697
+ id: number,
698
+ label: string,
699
+ required: boolean,
700
+ type: "short"|"long"|"number"|"date"|"dropdown"|"checkbox"|"rating" // If Microsoft forms has more, make a note and I'll add them
701
+ width: number, // 1-12 default 12
702
+ subtitle?: string,
703
+ extra: {
704
+ default?: boolean /* type: checkbox */ | string /* type: short, long, dropdown (inputted option) */ | number /* type:number */,
705
+ min?: number /* type: number */
706
+ max?: number /* type: number */
707
+ minRows?: number /* type: long */
708
+ options?: string[] // from dropdown only
709
+ levels?: number // For ratings, number of stars.
710
+ }
711
+ }
712
+
713
+ export type CustomFormSchemaSection =
714
+ {
715
+ id: number // random
716
+ title?: string,
717
+ description?: string,
718
+ fields: CustomFormSchemaField[]
719
+ }
720
+
721
+
722
+ export type CustomFormSchema = {
723
+ name?: string,
724
+ description?: string,
725
+ updated?: string,
726
+ id?: string,
727
+ form?: CustomFormSchemaSection[]}
728
+
729
+ export type StaffRoles = {
730
+ name: string,
731
+ filters: {
732
+ students: string[],
733
+ fields: {[key:string]: unknown},
734
+ },
735
+ staff: string[]
736
+ };
737
+
738
+ export type QueryObjectConstraint = [string, "=="|"<"|"<="|">="|">"|"!="|"array-contains"|"array-contains-any"|"in"|"not-in", string|boolean|string[]][]
739
+
740
+ export type QueryObject = {
741
+ path: string[],
742
+ where?: QueryObjectConstraint,
743
+ orderBy?: string
744
+ };
745
+
746
+ export type Note = {
747
+ title?: string,
748
+ body?: {
749
+ type: string;
750
+ children: {
751
+ text: string;
752
+ }[];
753
+ }[],
754
+ created: string,
755
+ updated: string
756
+ }
757
+
758
+ export type Referral = {
759
+ signUps: number,
760
+ volume: number,
761
+ product: Products,
762
+ expiry: Timestamp,
763
+ name: string
764
+ }
765
+
766
+ export type Contact = {
767
+ id: string,
768
+ contactForename: string,
769
+ contactSurname: string,
770
+ name: string,
771
+ providerEmail: string,
772
+ providerPhone: number,
773
+ "address-line1": string,
774
+ "address-line2": string,
775
+ locality: string,
776
+ what3Words?: string,
777
+ postal_code: string,
778
+ country: string,
779
+ created: string,
780
+ docPath: unknown
781
+ }
782
+
783
+
784
+ export type CohortData = {
785
+ id?: string,
786
+ name: string,
787
+ placementType: "defined"|"continuous",
788
+ forms?: string[],
789
+ files?: string[],
790
+ startSubmission: string,
791
+ endSubmission: string,
792
+ startPlacements: string,
793
+ endPlacements: string,
794
+ stage: "info"|"name"|"placementType"|"students"|"workflow"|"review"|"created"|"archived"|"database",
795
+ workflow: WorkflowStage[]
796
+ customWorkflow?: boolean,
797
+ oId: string,
798
+ product: Products,
799
+ schoolId?: string,
800
+ designatedStaff?: string,
801
+ autoArchiveDate?: string,
802
+ logType?: "basic"|"custom",
803
+ listingReleaseDate?: string,
804
+ enableListings?: boolean,
805
+ logs?: {
806
+ students?: string,
807
+ staff?: string,
808
+ provider?: string,
809
+ }
810
+ feedback?: {
811
+ students?: string,
812
+ staff?: string,
813
+ provider?: string,
814
+ },
815
+ feedbackText?: {
816
+ students?: Descendant[],
817
+ staff?: Descendant[],
818
+ provider?: Descendant[],
819
+ },
820
+ providerFeedbackSent?: Timestamp,
821
+ studentsFeedbackSent?: Timestamp,
822
+ emailTemplates?: {[key in keyof typeof emailTemplates]: string},
823
+ skillsTargets?: string[],
824
+ recurringEmails?: {
825
+ sendType?: "all"|"lastWeek",
826
+ frequency?: "oneTime"|"weeklyMonday"|"fortnightlyMonday"
827
+ },
828
+ savedDataViewerFilters?: {
829
+ [key in "cohortPlacements"|"cohortStudents"]: {
830
+ [key: string]: DataViewerFilterView
831
+ }
832
+ }
833
+ }
834
+
835
+ export type ArrowObject = {
836
+ start: number|string,
837
+ end: number|string,
838
+ name: string|false,
839
+ required?: boolean,
840
+ screenX?: number,
841
+ }
842
+
843
+
844
+ export type PlacementReviewDetails = {
845
+ activeDates: string[],
846
+ studentForename: string,
847
+ studentSurname: string,
848
+ instituteName: string,
849
+ title: string,
850
+ product: string,
851
+ name: string,
852
+ startDate: string,
853
+ endDate: string,
854
+ providerEmail: string,
855
+ providerPhone: string,
856
+ contactForename: string,
857
+ contactSurname: string,
858
+ cohort: string,
859
+ cohortData?: CohortData,
860
+ providerKey: string,
861
+ status: number,
862
+ ["address-line1"]: string,
863
+ ["address-line2"]: string,
864
+ locality: string,
865
+ postal_code: string,
866
+ what3Words?: string,
867
+ country: string,
868
+ key: string,
869
+ oId: string,
870
+ providerCompleted: string[],
871
+ providerId: string,
872
+ questions: PlacementQuestions,
873
+ userType: string,
874
+ id: string,
875
+ uid: string,
876
+ leadTimes: string[],
877
+ requiredSections: string[],
878
+ existingPlacements?: {
879
+ [key: string]: {
880
+ mapConsent: boolean,
881
+ jobTitle: string,
882
+ questions: PlacementQuestions,
883
+ riskAssessment: boolean|"awaitingReview",
884
+ riskAssessmentType: "form"|"file",
885
+ riskAssessmentData?: {[key: string]: unknown}|string,
886
+ dbsCheck: boolean|"awaitingReview",
887
+ dbsCheckType: "form"|"file",
888
+ dbsCheckData?: {[key: string]: unknown}|string,
889
+ }
890
+ },
891
+ requireELI?: boolean,
892
+ requireRA?: boolean,
893
+ requireDBS?: boolean,
894
+ importedProviderForms: boolean,
895
+ currentStage: WorkflowStage&{files: {[fileId: string]: {name: string, url: string}}},
896
+ placementId?: string,
897
+ providerContactId: string,
898
+ incompleteItems: {[key: number]: string[]},
899
+ riskAssessmentData?: {[key: string]: unknown}[]|string,
900
+ dbsCheckData?: {[key: string]: unknown}[]|string,
901
+ feedbackText?: Descendant[],
902
+ feedback: CustomFormSchema,
903
+ providerFeedback?: {[key: string]: unknown},
904
+ primaryColor?: string,
905
+ primaryImage?: string,
906
+ mapConsent?: boolean,
907
+ eventsConsent?: boolean,
908
+ consentedActivities?: string[],
909
+ instituteActivities?: {[key: string]: ExternalActivity}
910
+ }
911
+
912
+ export type BlogCategories = "students"|"providers"|"institutes"|"placementt"
913
+
914
+ export type Blog = {
915
+ title?: string,
916
+ summary?: string,
917
+ body?: Descendant[],
918
+ uploaded?: string,
919
+ category?: BlogCategories,
920
+ author?: string,
921
+ tags?: string
922
+ }
923
+
924
+ export type PlacementExportObject = {
925
+ cohortId: string,
926
+ startDate?: string,
927
+ endDate?: string,
928
+ allTime?: boolean,
929
+ includeStudentData?: boolean,
930
+ activePlacements?: boolean,
931
+ completedPlacements?: boolean,
932
+ }
933
+
934
+
935
+
936
+ export type ApplicantWorkflow = {
937
+ id?: string,
938
+ name: string,
939
+ forms?: string[],
940
+ files?: string[],
941
+ workflow: ApplicantStage[]
942
+ customWorkflow?: boolean,
943
+ oId: string,
944
+ product: Products,
945
+ type: "simple"|"complex"
946
+ }
947
+
948
+ export type ApplicantStage = {
949
+ id: number,
950
+ name: string,
951
+ message?: string,
952
+ userType?: "Students" | "Staff",
953
+ permanent?: boolean,
954
+ checkpoint?: boolean,
955
+ buttons?: {id: number, name: string|false, required: boolean}[],
956
+ pos?: { x: number, y: number },
957
+ forms?: string[],
958
+ files?: string[],
959
+ deadline?: string,
960
+ deadlineType?: "date"|"days"
961
+ formDetails?: {[key: string]: {
962
+ name: string,
963
+ id: string,
964
+ description?: string,
965
+ product: Products,
966
+ oId: string,
967
+ form: CustomFormSchema
968
+ }},
969
+ requiredFiles?: {fileName: string, fileType: string}[]
970
+ portfolio?: boolean,
971
+ viewableFiles?: {[key: string]: FileItem},
972
+ };
973
+
974
+ export type Application = {
975
+ id?: string,
976
+ uid: string,
977
+ applicantWorkflowId: string,
978
+ listingId: string,
979
+ addressId: string,
980
+ providerId: string,
981
+ reqUserType: "Students"|"Staff",
982
+ completedSections: {[stage: number]: {
983
+ submitted?: string,
984
+ filesViewed?: string[],
985
+ formsCompleted?: {[key: string]: unknown},
986
+ filesUploaded?: {[key: number]: string[]},
987
+ }},
988
+ created: string,
989
+ submitted: string,
990
+ startDate: string,
991
+ endDate: string,
992
+ leadTimes?: string[],
993
+ stage: number, // This is what stage of the custom workflow.
994
+ outcomeMessage?: string,
995
+ status: "draft"|"submitted"|"approved"|"declined",
996
+ placementId?: string,
997
+ }
998
+
999
+ export type Report = {
1000
+ added: string,
1001
+ id: string,
1002
+ oId: string,
1003
+ product: Products,
1004
+ pId: string,
1005
+ reason: string,
1006
+ uid: string,
1007
+ status: "open"|"closed"
1008
+ }
1009
+
1010
+
1011
+ export type FileItem = {
1012
+ product: Products,
1013
+ oId: string,
1014
+ added: string,
1015
+ name: string,
1016
+ fileName: string,
1017
+ url?: string
1018
+ }
1019
+
1020
+ export type Event = {
1021
+ collection: "users"|"placements"|"placementListings",
1022
+ documentId: string,
1023
+ product: Products,
1024
+ oId: string,
1025
+ created: Timestamp,
1026
+ title: string,
1027
+ description?: string,
1028
+ severity: string,
1029
+ button?: {title: string, url: string}
1030
+ }
1031
+
1032
+ export type BillingPackage = {
1033
+ name: string,
1034
+ staffUnitCost: number,
1035
+ platformFee: number,
1036
+ platformFeeFrequency: "yearly"|"monthly",
1037
+ studentUnitCost: number,
1038
+ placementUnitCost: number,
1039
+ product: Products,
1040
+ priority: number,
1041
+ features: {[key: string]: number|boolean|string},
1042
+ description: string
1043
+ }
1044
+
1045
+ export type EmailTemplate = {
1046
+ name: string,
1047
+ created: Timestamp,
1048
+ subject: string,
1049
+ emailTemplate: string,
1050
+ bodyText: Descendant[],
1051
+ color?: string,
1052
+ product: Products,
1053
+ oId: string,
1054
+ public?: boolean,
1055
+ }
1056
+
1057
+
1058
+ export type EmailTemplateConfig = {
1059
+ description: string,
1060
+ params: string[],
1061
+ button?: {text: string, link: string},
1062
+ type: "workflow"|"feedback"|"event"
1063
+ }
1064
+
1065
+
1066
+ export type Reminder = {
1067
+ collection: "users"|"placements"|"placementListings",
1068
+ documentId: string,
1069
+ product: Products,
1070
+ oId: string,
1071
+ created: Timestamp,
1072
+ title: string,
1073
+ description?: string,
1074
+ dueDate: string,
1075
+ status: "upcoming"|"dismissed"
1076
+ }
1077
+
1078
+ export type Sorts = {[label: string]: {
1079
+ value: string
1080
+ direction: "asc"|"desc"
1081
+ }}|undefined
1082
+
1083
+ export type SchoolData = OrganisationAddress&{
1084
+ billingEmail?: string,
1085
+ billingContactId?: string,
1086
+ authorisedMISSystem?: {
1087
+ name: "arbor",
1088
+ data: {
1089
+ url: string
1090
+ }
1091
+ },
1092
+ monthAdded: number,
1093
+ acceptingAlumni?: boolean,
1094
+ approveAlumni?: boolean,
1095
+ shareAlumni?: boolean
1096
+ approveAlumniMessages?: boolean,
1097
+ anonymiseAlumniConvoStudents?: boolean,
1098
+ alumniConversations?: boolean
1099
+ }
1100
+
1101
+
1102
+ export type ExternalEvent = {
1103
+ name: string,
1104
+ description: string,
1105
+ staffInformation?: string,
1106
+ studentInformation?: string,
1107
+ employerInformation?: string
1108
+ designatedStaff: string,
1109
+ created: string,
1110
+ activityId?: string,
1111
+ gatsbyBenchmarks?: string, // String array
1112
+ oId: string,
1113
+ submissionClose: string,
1114
+ acceptingEmployers?: boolean,
1115
+ acceptingStudents?: boolean,
1116
+ schoolId?: string,
1117
+ startDate?: string,
1118
+ endDate?: string,
1119
+ startTime?: string,
1120
+ endTime?: string,
1121
+ allDay?: boolean,
1122
+ recurring?: boolean,
1123
+ recurringFrequency: "daily"|"weekly"|"fortnightly"|"monthlyOnDate",
1124
+ recurringUntil?: string,
1125
+ students?: number,
1126
+ maxExternalAttendees?: number,
1127
+ stage: "basicDetails"|"date"|"invites"|"students"|"inviteConfirmation"|"review"|"created",
1128
+ inviteEmailTemplate: string,
1129
+ alumni: {
1130
+ completed?: boolean,
1131
+ shareable?: boolean,
1132
+ filters: "all"|(string|{[key: string]: unknown})[]
1133
+ }
1134
+ employers: {
1135
+ completed?: boolean,
1136
+ shareable?: boolean,
1137
+ filters: "all"|(string|{[key: string]: unknown})[]
1138
+ },
1139
+ employerInvites: {
1140
+ completed?: boolean
1141
+ files: string[],
1142
+ forms: string[],
1143
+ requiredFiles: {
1144
+ fileName: string,
1145
+ fileType: string
1146
+ }[],
1147
+ },
1148
+ employerFeedback: {
1149
+ files: string[],
1150
+ forms: string[],
1151
+ requiredFiles: {
1152
+ fileName: string,
1153
+ fileType: string
1154
+ }[],
1155
+ },
1156
+ studentFeedback: {
1157
+ files: string[],
1158
+ forms: string[],
1159
+ requiredFiles: {
1160
+ fileName: string,
1161
+ fileType: string
1162
+ }[],
1163
+ }
1164
+ completedStages: ("basicDetails"|"employerInvites"|"studentInvites"|"employerSelection"|"feedback")[]
1165
+ }&Address
1166
+
1167
+
1168
+ export type Alumni = {
1169
+ forename: string,
1170
+ surname: string,
1171
+ email: string,
1172
+ startYear: string,
1173
+ endYear: string,
1174
+ activities: string[],
1175
+ oId: string,
1176
+ schoolId?: string,
1177
+ dateAdded?: string,
1178
+ currentEnrolment: "university"|"apprenticeship"|"employment",
1179
+ status: "inactive"|"awaitingStaff"|"active"
1180
+ sector: string,
1181
+ subsector: string,
1182
+ enrolmentHistory: {}[],
1183
+ visibleToStudents?: boolean,
1184
+ enableConversations?: boolean,
1185
+ linkCode: string,
1186
+ linkCodeExpiry: string
1187
+ }
1188
+
1189
+
1190
+ export type AlumniConversation = {
1191
+ alumniId: string,
1192
+ externalStudentId: string,
1193
+ alumniSharable?: boolean,
1194
+ oId: string,
1195
+ schoolId?: string,
1196
+ studentSharable?: boolean,
1197
+ messages: {[key: string]: {
1198
+ sentBy: "alumni"|"student",
1199
+ sentAt: string,
1200
+ message: string,
1201
+ delivered: "blocked"|"pending"|true,
1202
+ }},
1203
+ open: boolean,
1204
+ reported?: boolean,
1205
+ delivered: "blocked"|"pending"|true,
1206
+ report?: {
1207
+ reportedBy: "alumni"|"student"
1208
+ message: string,
1209
+ createdDateTime: string,
1210
+ resolvedDateTime: string,
1211
+ }
1212
+ }
1213
+
1214
+ export type AlumniConvoUser = {
1215
+ forename: string,
1216
+ surname: string,
1217
+ email: string,
1218
+ dateAdded: string,
1219
+ oId: string,
1220
+ schoolId?: string,
1221
+ linkCode: string,
1222
+ linkCodeExpiry: string
1223
+ }
1224
+
1225
+ export type Update = {
1226
+ title: string,
1227
+ description: Descendant[],
1228
+ userType: "Staff"|"Students",
1229
+ product: Products,
1230
+ buttonText?: string,
1231
+ buttonLink?: string,
1232
+ date: string,
1233
+ imageData?: boolean
1234
+ }
1235
+
1236
+
1237
+
1238
+ export type ExternalEventAttendee = {
1239
+ oId: string,
1240
+ schoolId?: string,
1241
+ eventId: string,
1242
+ providerContactId: string,
1243
+ status: "pendingInvite"|"invited"|"providerAvailable"|"finalConfirmationSent"|"providerConfirmed"|"feedbackSent"
1244
+ emails: {
1245
+ [k in "invited"|"finalConfirmationSent"|"feedbackSent"]: {
1246
+ sent: number, // If below 3, keep sending reminders.
1247
+ reconciled: string|boolean, // When did the step get finished, such as employers responding to invites
1248
+ log: {
1249
+ [k: string]: string // emailNumber_dateTimeString : eventType
1250
+ }
1251
+ }
1252
+ }
1253
+ initialJobId?: string,
1254
+ emailTemplates?: {
1255
+ invited?: string,
1256
+ finalConfirmationSent?: string,
1257
+ feedbackSent?: string,
1258
+ }
1259
+ attended?: boolean,
1260
+ feedback: {[key: string]: unknown}
1130
1261
  }