placementt-core 1.20.217 → 11.0.803

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 (86) hide show
  1. package/.eslintrc.js +40 -40
  2. package/.gitattributes +2 -2
  3. package/lib/constants.js +10 -1
  4. package/lib/constants.js.map +1 -1
  5. package/lib/features/config.d.ts +133 -133
  6. package/lib/features/config.js +35 -35
  7. package/lib/features/contacts/contacts.d.ts +75 -75
  8. package/lib/features/contacts/contacts.js +105 -105
  9. package/lib/features/downtime/useDowntime.d.ts +11 -11
  10. package/lib/features/downtime/useDowntime.js +22 -22
  11. package/lib/features/placements/studentPlacements/studentPlacementsSlice.d.ts +63 -63
  12. package/lib/features/placements/studentPlacements/studentPlacementsSlice.js +81 -81
  13. package/lib/features/providerPlacements/providerPlacementsSlice.d.ts +19 -19
  14. package/lib/features/providerPlacements/providerPlacementsSlice.js +24 -24
  15. package/lib/features/studentPlacements/studentPlacementsSlice.d.ts +62 -62
  16. package/lib/features/studentPlacements/studentPlacementsSlice.js +87 -87
  17. package/lib/features/studentPlacements/useStudentPlacements.d.ts +6 -6
  18. package/lib/features/studentPlacements/useStudentPlacements.js +18 -18
  19. package/lib/features/userSlice.d.ts +26 -26
  20. package/lib/features/userSlice.js +23 -23
  21. package/lib/features/users/useUserFunctions.d.ts +25 -25
  22. package/lib/features/users/useUserFunctions.js +124 -124
  23. package/lib/features/users/userSlice.d.ts +46 -46
  24. package/lib/features/users/userSlice.js +48 -48
  25. package/lib/firebase/firebase.d.ts +1 -1
  26. package/lib/firebase/firebase.js +6 -2
  27. package/lib/firebase/firebase.js.map +1 -1
  28. package/lib/firebase/readDatabase.js +3 -1
  29. package/lib/firebase/readDatabase.js.map +1 -1
  30. package/lib/hooks.d.ts +33 -5
  31. package/lib/hooks.js +143 -107
  32. package/lib/hooks.js.map +1 -1
  33. package/lib/images/GatsbyBenchmarks.d.ts +1 -2
  34. package/lib/reduxHooks.d.ts +1 -66
  35. package/lib/reduxHooks.js +9 -69
  36. package/lib/reduxHooks.js.map +1 -1
  37. package/lib/tasksAndTips.d.ts +2 -2
  38. package/lib/tasksAndTips.js +37 -6
  39. package/lib/tasksAndTips.js.map +1 -1
  40. package/lib/typeDefinitions.d.ts +50 -5
  41. package/lib/util.d.ts +1 -1
  42. package/lib/util.js +12 -1
  43. package/lib/util.js.map +1 -1
  44. package/package.json +52 -56
  45. package/src/DatabaseDefinitions.ts +18 -18
  46. package/src/apiCalls.ts +128 -128
  47. package/src/config.ts +50 -50
  48. package/src/constants.ts +796 -787
  49. package/src/databaseTypes.ts +42 -42
  50. package/src/features/analytics/useAnalytics.tsx +63 -63
  51. package/src/features/contacts/contactsSlice.ts +147 -147
  52. package/src/features/contacts/useContacts.tsx +73 -73
  53. package/src/features/dropdown/useDropdown.tsx +52 -52
  54. package/src/features/global/downtime/useDowntime.tsx +23 -23
  55. package/src/features/global/users/useUserFunctions.tsx +132 -132
  56. package/src/features/jobs/jobsSlice.ts +71 -71
  57. package/src/features/placements/studentPlacements/activePlacement.ts +68 -68
  58. package/src/features/placements/studentPlacements/completedStudentPlacementsSlice.ts +97 -97
  59. package/src/features/placements/studentPlacements/upcomingStudentPlacementsSlice.ts +108 -108
  60. package/src/features/placements/studentPlacements/useStudentPlacements.tsx +9 -9
  61. package/src/features/placements/types.ts +10 -10
  62. package/src/features/referrals/useReferrals.tsx +56 -56
  63. package/src/features/updates/useUpdates.tsx +38 -38
  64. package/src/firebase/firebase.tsx +149 -145
  65. package/src/firebase/firebaseConfig.tsx +45 -45
  66. package/src/firebase/firebaseQuery.tsx +151 -151
  67. package/src/firebase/persistence.ts +84 -84
  68. package/src/firebase/readDatabase.tsx +236 -235
  69. package/src/firebase/util.tsx +352 -352
  70. package/src/firebase/writeDatabase.tsx +77 -77
  71. package/src/hooks.tsx +4353 -4323
  72. package/src/images/GatsbyBenchmarks.tsx +711 -711
  73. package/src/images/LogFuturePlacement.jsx +64 -64
  74. package/src/images/LogPreviousPlacement.jsx +228 -228
  75. package/src/images/gatsby_benchmarks.svg +466 -466
  76. package/src/images/log_future_placement.svg +114 -114
  77. package/src/images/log_previous_placement.svg +199 -199
  78. package/src/index.ts +34 -34
  79. package/src/readDatabase.tsx +3 -3
  80. package/src/reduxHooks.ts +232 -297
  81. package/src/tasksAndTips.ts +1209 -1177
  82. package/src/tutorialTips.ts +58 -58
  83. package/src/typeDefinitions.ts +1003 -958
  84. package/src/util.ts +160 -150
  85. package/tsconfig.dev.json +5 -5
  86. package/tsconfig.json +21 -22
@@ -1,959 +1,1004 @@
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
- active: boolean,
55
- completed: boolean,
56
- personalAnalytics?: string[],
57
- completedStages?: number[],
58
- contactId?: string
59
- created: string,
60
- inProgress: boolean,
61
- draft: boolean,
62
- activeDates: string[],
63
- insurance: boolean|"awaitingReview",
64
- riskAssessment?: boolean|"awaitingReview",
65
- riskAssessmentType?: "file"|"form",
66
- riskAssessmentData?: {[key:string]: unknown}[],
67
- dbsCheck?: boolean|"awaitingReview",
68
- dbsCheckType?: "file"|"form",
69
- dbsCheckData?: {[key:string]: unknown}[],
70
- contactType?: "email"|"website"|"phone"|"post",
71
- webpage?: string,
72
- providerLogs?: string[],
73
- studentsLogs?: string[],
74
- notes?: {
75
- providers?: Descendant[],
76
- institutes?: Descendant[],
77
- students?: Descendant[]
78
- }
79
- staffLogs?: [],
80
- feedback: {
81
- students: {
82
- completed: boolean,
83
- data?: {[key: string]: unknown}
84
- },
85
- provider: {
86
- completed: boolean,
87
- data?: {[key: string]: unknown}
88
- },
89
- staff: {
90
- completed: boolean,
91
- data?: {[key: string]: unknown}
92
- },
93
- },
94
- onboarding: (OnboardingDocs&{
95
- deadline?: string,
96
- completed: {
97
- submitted: boolean,
98
- submittedDate?: string,
99
- accepted?: boolean,
100
- filesViewed?: string[],
101
- formsCompleted?: {[key: string]: unknown},
102
- filesUploaded?: {[key: number]: string[]},
103
- }})|false|null,
104
- studentForename?: string, // Used if provider created student placement.
105
- studentSurname?: string, // Used if provider created student placement.
106
- studentEmail?: string, // Used if provider created student placement.
107
- skillsTargetsValues?: {[key: string]: {
108
- provider: number[],
109
- student: number[],
110
- }}
111
- }
112
-
113
- export type PlacementQuestions = {
114
- title: string
115
- description: string
116
- dressCode: string
117
- dressCodeText?: string
118
- firstDayContact: string
119
- firstAider?: string
120
- equipment: string
121
- responsibilities: string
122
- experiencesGiven: string
123
- experienceDesired: string
124
- otherAdvice: string
125
- carParking: boolean
126
- bikeStorage: boolean
127
- wheelchairFriendly: boolean
128
- kitchen: boolean
129
- lunchArrangements?: string
130
- hours: any,
131
- studentLevel: "gcse"|"college"|"undergraduate"|"postgraduate"|"over18",
132
- studentSublevel: string[],
133
- desiredLength: number,
134
- desiredMinLength?: number,
135
- desiredMaxLength?: number,
136
- desiredLengthUnits: "days"|"weeks"|"months",
137
- maximumStudents: number,
138
- workingLocation: "inPerson"|"hybrid"|"remote",
139
- pay?: number,
140
- payFrequency: "total"|"hourly"|"daily"|"weekly"|"monthly"|"annually",
141
- }
142
-
143
- export type SavedPlacement = {
144
- placementId: string,
145
- savedByProduct: Products,
146
- savedByUserType: "Organisation"|"Student",
147
- savedById: string,
148
- status?: "Accepted" | "Blocked" | "providerReview";
149
- listed: boolean,
150
- concurrentPlacements?: number,
151
- id: string
152
- }
153
-
154
- export type PlacementListingStages = "basic"|"address"|"students"|"responsibilities"|"applications"|"onboarding"|"review"|"complete";
155
-
156
- export type PlacementListing = {
157
- title: string,
158
- uid: string,
159
- template?: string,
160
- providerId?: string,
161
- name: string,
162
- providerEmail: string,
163
- providerPhone: string,
164
- id:string,
165
- studentType: "secondary" | "higher" | "undergraduate" | "postgraduate"
166
- contactForename: string,
167
- contactSurname: string,
168
- ["address-line1"]: string,
169
- ["address-line2"]: string,
170
- locality: string,
171
- postal_code: string,
172
- country: string,
173
- what3Words?: string,
174
- addressId?: string,
175
- geoHash?: string,
176
- status: "listed"|"unlisted"|"deleted"|"draft",
177
- questions: PlacementQuestions,
178
- savedBy?: {[key:string]: {
179
- exists: true,
180
- providerConsent: boolean,
181
- providerConsentDate?: Timestamp,
182
- status: "uploaded"|"approved"|"rejected"|"blocked"}},
183
- mapConsent?: boolean,
184
- mapConsentData?: string,
185
- uploadedBy: "student"|"institute"|"provider",
186
- riskAssessmentType?: "file"|"form",
187
- riskAssessmentData?: {[key:string]: unknown}[],
188
- dbsCheckType?: "file"|"form",
189
- dbsCheckData?: {[key:string]: unknown}[],
190
- contactType?: "email"|"website"|"phone"|"post",
191
- webpage?: string,
192
- stage: PlacementListingStages,
193
- placementDateType?: "any"|"range"|"defined",
194
- placementDates?: {start: string, end: string}[],
195
- applicationType?: "simple"|"complex",
196
- applicantWorkflowId?: string,
197
- applicantWorkflow?: ApplicantStage[],
198
- onboarding: (OnboardingDocs&{deadline: number})|false,
199
- maxApplicants?: number,
200
- maxStudents?: number,
201
- primaryContactId: string,
202
- }
203
-
204
- export type OnboardingDocs = {
205
- message?: string,
206
- forms?: string[],
207
- files?: string[],
208
- requiredFiles?: {fileName: string, fileType: string}[]
209
- }
210
-
211
- export type PlacementTemplate = PlacementListing&{templateName: string};
212
-
213
- export type OrganisationAddressStages = "address"|"contacts"|"misc"|"review"|"complete";
214
-
215
- export type OrganisationAddress = Address & {
216
- name?: string,
217
- savedBy?: string[],
218
- product: Products,
219
- oId: string,
220
- stage: OrganisationAddressStages,
221
- additionalQuestions?: {
222
- bikeStorage?: boolean,
223
- kitchen?: boolean,
224
- parking?: boolean,
225
- disabledAccess?: boolean,
226
- },
227
- contacts?: {
228
- firstAid?: {
229
- name?: string,
230
- phone?: string,
231
- email?: string,
232
- location?: string
233
- }[],
234
- security?: {
235
- name?: string,
236
- phone?: string,
237
- email?: string,
238
- location?: string
239
- }[],
240
- reception?: {
241
- name?: string,
242
- phone?: string,
243
- email?: string,
244
- location?: string
245
- }[],
246
- },
247
- primaryContactId?: string,
248
- default?: boolean,
249
- flags?: ("addressMissing" | "noPrimaryContact")[]
250
- };
251
-
252
- export type Address = {
253
- id?: string,
254
- ["address-line1"]: string,
255
- ["address-line2"]: string,
256
- locality: string,
257
- postal_code: string,
258
- country: string,
259
- geoHash?: string,
260
- what3Words?: string
261
- };
262
-
263
- export type FlagCodes =
264
- "inactive" |
265
- "noParentEmailWarning" |
266
- "noParentEmailError" |
267
- "overdue" |
268
- "noInsurance" |
269
- "providerRejection" |
270
- "nearingStart"|
271
- "awaitingInsurance"|
272
- "noRiskAssessment"|
273
- "awaitingRiskAssessment"|
274
- "parentEmailFailed"|
275
- "providerEmailFailed"|
276
- "userEmailFailed"|
277
- "noDbsCheck"|
278
- "awaitingDbsCheck"|
279
- "completeOnboarding"|
280
- "reviewOnboarding"|
281
- "requestedVisibleAddresses"|
282
- "requestedVisiblePlacementListings"|
283
- "addOnboarding"|
284
- "studentNotAccepted"
285
-
286
-
287
- export type UserData = {
288
- details: {
289
- forename: string,
290
- surname: string,
291
- pronouns?: string,
292
- parentEmail?: string,
293
- year?: string
294
- },
295
- renewalMonth: number,
296
- placementCharged?: boolean,
297
- algoliaKey: string,
298
- email: string,
299
- phone?: string,
300
- status: "active" | "inactive" | "unclaimed",
301
- favGuidance?: string[];
302
- oId: string,
303
- id: string,
304
- resetExpiry?: {seconds: number},
305
- product: Products,
306
- userGroup?: string,
307
- userType: "Staff"|"Students",
308
- created: string,
309
- activated: string,
310
- groupData?: UserGroupData,
311
- staffRoles: string[],
312
- flags?: FlagCodes[],
313
- cohortRequests: {[oId: string]: string[]},
314
- cohorts: {[oId: string]: string[]},
315
- analytics?: AnalyticsItem,
316
- units?: string,
317
- activationCode: number,
318
- cohort?: string,
319
- cohortData?: CohortData,
320
- dismissedTasks?: string[],
321
- dismissedTutorials?: string[],
322
- dismissedTips?: string[],
323
- viewCohorts?: "all"|"some"|"none",
324
- viewStudents?: "all"|"some"|"none",
325
- studentFilterValues?: string[], // comma delimited list of values, such as "a, b, c, d"
326
- studentFilter?: string // Field on which students can be filtered
327
- visibleCohorts?: string[], // comma delimited list of values
328
- readUpdates?: string[],
329
- contactProviderConsent?: boolean,
330
- contactProviderConsentDate?: boolean
331
- referrals?: number,
332
- shareNameWithReferralLeaderboardConsent?: boolean,
333
- shareNameWithReferralLeaderboardConsentDate?: boolean,
334
- referralCode?: string,
335
- notificationFrequency?: "daily"|"weekly"|"fortnightly"|"never",
336
- monthAdded?: number,
337
- placementsCharged?: boolean,
338
- visibleAddresses?: string[],
339
- visibleListings?: string[],
340
- requestedVisibleAddresses?: string[],
341
- requestedVisibleListings?: string[],
342
- packageData?: BillingPackage,
343
- viewAddresses?: "all"|"request"|"none"|"some",
344
- viewPlacementListings?: "all"|"request"|"none",
345
- viewPlacementGroups?: "all"|"request"|"none",
346
- skillsTargets?: string[],
347
- skillsTargetsValues?: {[key: string]: {
348
- provider: number[],
349
- student: number[],
350
- }}
351
- };
352
-
353
- export type AnalyticsItem = {
354
- units?: "placements"|"weeks"|"days"|"hours",
355
- name?: string
356
- total?: number,
357
- completion?: {
358
- total?: number,
359
- completed?: number
360
- },
361
- time?: {[key: string]: {date?:string, total?: number, completion?: {total?: number, completed?:number}}},
362
- year?: {[key: string]: {year?: number, total?: number, completion?: {total?: number, completed?:number}}},
363
- subtypes?: {[key:string]: AnalyticsItem}
364
- }
365
-
366
- export type UserGroupData = {
367
- id: string,
368
- default?: boolean,
369
- name: string,
370
- template: "Staff"|"Students",
371
- oId: string,
372
- product: Products,
373
- viewStudents: "all"|"filter"|"none",
374
- filterUsersBy?: string,
375
- filterUsersValue?: string,
376
- }&ProviderUserPermissions
377
-
378
- export type StaffUserGroup = UserGroupData & StaffUserPermissions
379
- export type ProviderUserGroup = UserGroupData & ProviderUserPermissions
380
-
381
- export type StaffUserPermissions =
382
- UserGroupData & {
383
- viewStaff: boolean,
384
- addStaff?: boolean,
385
- activateStaff?: boolean,
386
- editStaff?: boolean,
387
- deleteStaff?: boolean,
388
- addStaffGroups?: boolean,
389
- editStaffGroups?: boolean,
390
- deleteStaffGroups?: boolean,
391
- addStudents?: boolean,
392
- activateStudents?: boolean,
393
- editStudents?: boolean,
394
- deleteStudents?: boolean,
395
- viewSetup?: boolean,
396
- editInstitute?: boolean,
397
- addForms?: boolean,
398
- editForms?: boolean,
399
- deleteForms?: boolean,
400
- addFiles?: boolean,
401
- deleteFiles?: boolean,
402
- viewBilling?: boolean,
403
- manageBilling?: boolean,
404
- proposePlacements?: boolean,
405
- createCohorts?: boolean,
406
- viewPlacements?: boolean,
407
- viewPlacementTasks?: boolean,
408
- signOffPlacements?: boolean,
409
- editPlacements?: boolean,
410
- addPlacements?: boolean,
411
- deletePlacements?: boolean,
412
- verifyInsurance?: boolean,
413
- verifyListings?: boolean
414
- viewDatabase?: boolean,
415
- addListings?: boolean,
416
- deleteListings?: boolean,
417
- verifyRiskAssessments?: boolean,
418
- verifyDbsChecks?: boolean,
419
- addCohorts?: boolean,
420
- editCohorts?: boolean,
421
- deleteCohorts?: boolean,
422
- editRequests?: boolean,
423
- deleteRequests?: boolean,
424
- addEmailTemplates?: boolean,
425
- editEmailTemplates?: boolean,
426
- deleteEmailTemplates?: boolean,
427
- }
428
-
429
- export type ProviderUserPermissions = {
430
- viewStaff: boolean,
431
- addStaff?: boolean,
432
- activateStaff?: boolean,
433
- editStaff?: boolean,
434
- deleteStaff?: boolean,
435
- addUserGroups?: boolean,
436
- editUserGroups?: boolean,
437
- deleteUserGroups?: boolean,
438
- addStudents?: boolean,
439
- addForms?: boolean,
440
- editForms?: boolean,
441
- deleteForms?: boolean,
442
- addFiles?: boolean,
443
- deleteFiles?: boolean,
444
- viewBilling?: boolean,
445
- manageBilling?: boolean,
446
- createPlacementListing?: "any"|"template"|"none",
447
- createPlacementTemplate?: boolean,
448
- viewPlacementListings?: "all"|"request"|"none",
449
- viewPlacementGroups?: "all"|"request"|"none",
450
- viewAddresses?: "all"|"request"|"none",
451
- processApplicants?: boolean,
452
- addAddresses?: boolean,
453
- editAddresses?: boolean,
454
- deleteAddresses?: boolean,
455
- addApplicantWorkflows?: boolean,
456
- editApplicantWorkflows?: boolean,
457
- deleteApplicantWorkflows?: boolean,
458
- editRequests?: boolean,
459
- deleteRequests?: boolean,
460
- manageAccessRequests?: boolean,
461
- manageRegistrationRequests?: boolean,
462
- }
463
-
464
- export type RegistrationRequest = {
465
- forename: string,
466
- surname: string,
467
- email: string,
468
- message: string,
469
- created: string,
470
- oId: string,
471
- product: "providers"|"institutes"
472
- }
473
-
474
- export type WorkflowStage = {
475
- id: number,
476
- name: string,
477
- permanent?: boolean,
478
- checkpoint?: boolean,
479
- buttons?: {id: number, name: string|false, required: boolean}[],
480
- pos?: { x: number, y: number },
481
- userType?: "Students" | "Staff" | "Provider" | "Parent",
482
- forms?: string[],
483
- files?: string[],
484
- deadline?: string,
485
- deadlineType?: "date"|"days"
486
- formDetails?: [{name: string}],
487
- eli?: boolean,
488
- riskAssessment?: boolean,
489
- dbsCheck?: boolean,
490
- defaultForms?: {
491
- name: string,
492
- description: string,
493
- time: "during"|"post",
494
- user: "staff"|"students"|"provider",
495
- details: CustomFormSchema
496
- }[],
497
- requiredFiles?: {fileName: string, fileType: string}[]
498
- };
499
-
500
- export type ProviderPlacementData = {
501
- title: string,
502
- name: string,
503
- providerPhone: string,
504
- providerEmail: string,
505
- contactForename: string,
506
- contactSurname: string,
507
- providerId: string,
508
- addressId: string,
509
- sector: string,
510
- subsector: string,
511
- id?: string
512
- };
513
-
514
-
515
- export type ProviderData = {
516
- staff: number,
517
- staffFields: string[],
518
- staffActive: number,
519
- admin: string,
520
- name: string,
521
- insurance: boolean|"awaitingReview",
522
- regNumber?: string,
523
- insuranceExpiry: string,
524
- mapConsent?: boolean|"unlisted",
525
- mapConsentDate?: string,
526
- staffGuidance?: {[key:number]: string},
527
- about?: string,
528
- sector: string,
529
- defAddress: string,
530
- subsector: string,
531
- website?: string,
532
- savedBy?: {[key:string]: {
533
- exists: true,
534
- providerConsent: boolean,
535
- providerConsentDate?: Timestamp,
536
- status: "uploaded"|"approved"|"blocked"}},
537
- onboarding?: {
538
- hasStaff?: boolean,
539
- multipleAddresses?: boolean,
540
- }
541
- registrationRequests?: boolean|string,
542
- registrationRequestsDate?: string,
543
- information: {
544
- description?: string,
545
- staff?: string,
546
- locations?: number,
547
- },
548
- discount?: string,
549
- package: string,
550
- splitBilling?: boolean,
551
- adminBillingContactId: string,
552
- addOnPackages?: string[],
553
- }
554
-
555
- export type InstituteData = {
556
- students: number,
557
- staff: number,
558
- studentsFields: string[],
559
- staffFields: string[],
560
- studentsActive: number,
561
- staffActive: number,
562
- admin: string,
563
- name: string
564
- verifiedProviders?: string[],
565
- awaitingProviderInsurance?: string[],
566
- verifiedRiskAssessments?: string[],
567
- awaitingPlacementRiskAssessments?: string[],
568
- verifiedDbsChecks?: string[],
569
- awaitingPlacementDbsChecks?: string[],
570
- staffGuidance?: {[key:number]: string}
571
- studentsGuidance?: {[key:number]: string},
572
- cohortRequests: {[oId: string]: {[cohortId: string]: string[]}},
573
- externalProviderUploads?: boolean,
574
- discount?: string,
575
- package: string,
576
- splitBilling?: boolean,
577
- adminBillingContactId?: string,
578
- addOnPackages?: string[],
579
- authorisedMISSystem?: {
580
- name: "arbor",
581
- data: {
582
- url: string
583
- }
584
- }
585
- }&Address;
586
-
587
- export type NotificationObject = {
588
- buttonURL: string,
589
- created: Timestamp,
590
- description: string,
591
- title: string,
592
- viewableBy: string[],
593
- viewedBy: string[],
594
- docPath: DocumentReference<DocumentData>
595
- }
596
-
597
- export type CustomFormSchemaField = {
598
- id: number,
599
- label: string,
600
- required: boolean,
601
- type: "short"|"long"|"number"|"date"|"dropdown"|"checkbox"|"rating" // If Microsoft forms has more, make a note and I'll add them
602
- width: number, // 1-12 default 12
603
- subtitle?: string,
604
- extra: {
605
- default?: boolean /* type: checkbox */ | string /* type: short, long, dropdown (inputted option) */ | number /* type:number */,
606
- min?: number /* type: number */
607
- max?: number /* type: number */
608
- minRows?: number /* type: long */
609
- options?: string[] // from dropdown only
610
- levels?: number // For ratings, number of stars.
611
- }
612
- }
613
-
614
- export type CustomFormSchemaSection =
615
- {
616
- id: number // random
617
- title?: string,
618
- description?: string,
619
- fields: CustomFormSchemaField[]
620
- }
621
-
622
-
623
- export type CustomFormSchema = {
624
- name?: string,
625
- description?: string,
626
- updated?: string,
627
- id?: string,
628
- form?: CustomFormSchemaSection[]}
629
-
630
- export type StaffRoles = {
631
- name: string,
632
- filters: {
633
- students: string[],
634
- fields: {[key:string]: unknown},
635
- },
636
- staff: string[]
637
- };
638
-
639
- export type QueryObjectConstraint = [string, "=="|"<"|"<="|">="|">"|"!="|"array-contains"|"array-contains-any"|"in"|"not-in", string|boolean][]
640
-
641
- export type QueryObject = {
642
- path: string[],
643
- where?: QueryObjectConstraint,
644
- orderBy?: string
645
- };
646
-
647
- export type Note = {
648
- title?: string,
649
- body?: {
650
- type: string;
651
- children: {
652
- text: string;
653
- }[];
654
- }[],
655
- created: string,
656
- updated: string
657
- }
658
-
659
- export type Referral = {
660
- signUps: number,
661
- volume: number,
662
- product: Products,
663
- expiry: Timestamp,
664
- name: string
665
- }
666
-
667
- export type Contact = {
668
- id: string,
669
- contactForename: string,
670
- contactSurname: string,
671
- name: string,
672
- providerEmail: string,
673
- providerPhone: number,
674
- "address-line1": string,
675
- "address-line2": string,
676
- locality: string,
677
- what3Words?: string,
678
- postal_code: string,
679
- country: string,
680
- created: string,
681
- docPath: unknown
682
- }
683
-
684
-
685
- export type CohortData = {
686
- id?: string,
687
- name: string,
688
- placementType: "defined"|"continuous",
689
- forms?: string[],
690
- files?: string[],
691
- startSubmission: string,
692
- endSubmission: string,
693
- startPlacements: string,
694
- endPlacements: string,
695
- stage: "info"|"name"|"placementType"|"students"|"workflow"|"review"|"created"|"archived",
696
- workflow: WorkflowStage[]
697
- customWorkflow?: boolean,
698
- oId: string,
699
- product: Products,
700
- addressId?: string,
701
- designatedStaff?: string,
702
- logType?: "basic"|"custom",
703
- logs?: {
704
- students?: string,
705
- staff?: string,
706
- provider?: string,
707
- }
708
- feedback?: {
709
- students?: string,
710
- staff?: string,
711
- provider?: string,
712
- },
713
- feedbackText?: {
714
- students?: Descendant[],
715
- staff?: Descendant[],
716
- provider?: Descendant[],
717
- },
718
- providerFeedbackSent?: Timestamp,
719
- studentsFeedbackSent?: Timestamp,
720
- billingEmail?: string,
721
- billingContactId?: string,
722
- emailTemplates?: {[key in keyof typeof emailTemplates]: string},
723
- skillsTargets?: string[]
724
- }
725
-
726
- export type ArrowObject = {
727
- start: number|string,
728
- end: number|string,
729
- name: string|false,
730
- required?: boolean,
731
- screenX?: number,
732
- }
733
-
734
-
735
- export type PlacementReviewDetails = {
736
- activeDates: string[],
737
- studentForename: string,
738
- studentSurname: string,
739
- instituteName: string,
740
- title: string,
741
- product: string,
742
- name: string,
743
- startDate: string,
744
- endDate: string,
745
- providerEmail: string,
746
- providerPhone: string,
747
- contactForename: string,
748
- contactSurname: string,
749
- cohort: string,
750
- cohortData?: CohortData,
751
- providerKey: string,
752
- status: number,
753
- ["address-line1"]: string,
754
- ["address-line2"]: string,
755
- locality: string,
756
- postal_code: string,
757
- what3Words?: string,
758
- country: string,
759
- key: string,
760
- oId: string,
761
- providerCompleted: string[],
762
- providerId: string,
763
- questions: PlacementQuestions,
764
- mapConsent: boolean | "institute",
765
- userType: string,
766
- id: string,
767
- uid: string,
768
- leadTimes: string[],
769
- requiredSections: string[],
770
- existingPlacements?: {
771
- [key: string]: {
772
- mapConsent: boolean,
773
- jobTitle: string,
774
- questions: PlacementQuestions,
775
- riskAssessment: boolean|"awaitingReview",
776
- riskAssessmentType: "form"|"file",
777
- riskAssessmentData?: {[key: string]: unknown},
778
- dbsCheck: boolean|"awaitingReview",
779
- dbsCheckType: "form"|"file",
780
- dbsCheckData?: {[key: string]: unknown},
781
- }
782
- },
783
- requireELI?: boolean,
784
- requireRA?: boolean,
785
- requireDBS?: boolean,
786
- importedProviderForms: boolean,
787
- currentStage: WorkflowStage&{files: {[fileId: string]: {name: string, url: string}}},
788
- placementId?: string,
789
- incompleteItems: {[key: number]: string[]},
790
- riskAssessmentData?: {[key: string]: unknown}[],
791
- dbsCheckData?: {[key: string]: unknown}[],
792
- feedbackText?: Descendant[],
793
- feedback: CustomFormSchema,
794
- providerFeedback?: {[key: string]: unknown}
795
- }
796
-
797
- export type BlogCategories = "students"|"providers"|"institutes"|"placementt"
798
-
799
- export type Blog = {
800
- title?: string,
801
- summary?: string,
802
- body?: Descendant[],
803
- uploaded?: string,
804
- category?: BlogCategories,
805
- author?: string,
806
- tags?: string
807
- }
808
-
809
- export type PlacementExportObject = {
810
- cohortId: string,
811
- startDate?: string,
812
- endDate?: string,
813
- allTime?: boolean,
814
- includeStudentData?: boolean,
815
- activePlacements?: boolean,
816
- completedPlacements?: boolean,
817
- }
818
-
819
-
820
-
821
- export type ApplicantWorkflow = {
822
- id?: string,
823
- name: string,
824
- forms?: string[],
825
- files?: string[],
826
- workflow: ApplicantStage[]
827
- customWorkflow?: boolean,
828
- oId: string,
829
- product: Products,
830
- type: "simple"|"complex"
831
- }
832
-
833
- export type ApplicantStage = {
834
- id: number,
835
- name: string,
836
- message?: string,
837
- userType?: "Students" | "Staff",
838
- permanent?: boolean,
839
- checkpoint?: boolean,
840
- buttons?: {id: number, name: string|false, required: boolean}[],
841
- pos?: { x: number, y: number },
842
- forms?: string[],
843
- files?: string[],
844
- deadline?: string,
845
- deadlineType?: "date"|"days"
846
- formDetails?: {[key: string]: {
847
- name: string,
848
- id: string,
849
- description?: string,
850
- product: Products,
851
- oId: string,
852
- form: CustomFormSchema
853
- }},
854
- requiredFiles?: {fileName: string, fileType: string}[]
855
- portfolio?: boolean,
856
- viewableFiles?: {[key: string]: FileItem},
857
- };
858
-
859
- export type Application = {
860
- id?: string,
861
- uid: string,
862
- applicantWorkflowId: string,
863
- listingId: string,
864
- addressId: string,
865
- providerId: string,
866
- reqUserType: "Students"|"Staff",
867
- completedSections: {[stage: number]: {
868
- submitted?: string,
869
- filesViewed?: string[],
870
- formsCompleted?: {[key: string]: unknown},
871
- filesUploaded?: {[key: number]: string[]},
872
- }},
873
- created: string,
874
- submitted: string,
875
- startDate: string,
876
- endDate: string,
877
- leadTimes?: string[],
878
- stage: number, // This is what stage of the custom workflow.
879
- outcomeMessage?: string,
880
- status: "draft"|"submitted"|"approved"|"declined",
881
- placementId?: string,
882
- }
883
-
884
- export type Report = {
885
- added: string,
886
- id: string,
887
- oId: string,
888
- product: Products,
889
- pId: string,
890
- reason: string,
891
- uid: string,
892
- status: "open"|"closed"
893
- }
894
-
895
-
896
- export type FileItem = {
897
- product: Products,
898
- oId: string,
899
- added: string,
900
- name: string,
901
- fileName: string,
902
- url?: string
903
- }
904
-
905
- export type Event = {
906
- collection: "users"|"placements"|"placementListings",
907
- documentId: string,
908
- product: Products,
909
- oId: string,
910
- created: Timestamp,
911
- title: string,
912
- description?: string,
913
- severity: string,
914
- button?: {title: string, url: string}
915
- }
916
-
917
- export type BillingPackage = {
918
- name: string,
919
- staffUnitCost: number,
920
- studentUnitCost: number,
921
- placementUnitCost: number,
922
- product: Products,
923
- priority: number,
924
- features: {[key: string]: number|boolean|string},
925
- description: string
926
- }
927
-
928
- export type EmailTemplate = {
929
- name: string,
930
- created: Timestamp,
931
- subject: string,
932
- emailTemplate: string,
933
- bodyText: Descendant[],
934
- color?: string,
935
- product: Products,
936
- oId: string,
937
- public?: boolean,
938
- }
939
-
940
-
941
- export type EmailTemplateConfig = {
942
- description: string,
943
- params: string[],
944
- button?: {text: string, link: string},
945
- type: "workflow"|"feedback"
946
- }
947
-
948
-
949
- export type Reminder = {
950
- collection: "users"|"placements"|"placementListings",
951
- documentId: string,
952
- product: Products,
953
- oId: string,
954
- created: Timestamp,
955
- title: string,
956
- description?: string,
957
- dueDate: string,
958
- status: "upcoming"|"due"|"dismissed"
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
+ active: boolean,
55
+ completed: boolean,
56
+ personalAnalytics?: string[],
57
+ completedStages?: number[],
58
+ contactId?: string
59
+ created: string,
60
+ inProgress: boolean,
61
+ draft: boolean,
62
+ activeDates: string[],
63
+ insurance: boolean|"awaitingReview",
64
+ riskAssessment?: boolean|"awaitingReview",
65
+ riskAssessmentType?: "file"|"form",
66
+ riskAssessmentData?: {[key:string]: unknown}[],
67
+ dbsCheck?: boolean|"awaitingReview",
68
+ dbsCheckType?: "file"|"form",
69
+ dbsCheckData?: {[key:string]: unknown}[],
70
+ contactType?: "email"|"website"|"phone"|"post",
71
+ webpage?: string,
72
+ providerLogs?: string[],
73
+ studentsLogs?: string[],
74
+ notes?: {
75
+ providers?: Descendant[],
76
+ institutes?: Descendant[],
77
+ students?: Descendant[]
78
+ }
79
+ staffLogs?: [],
80
+ feedback: {
81
+ students: {
82
+ completed: boolean,
83
+ data?: {[key: string]: unknown}
84
+ },
85
+ provider: {
86
+ completed: boolean,
87
+ data?: {[key: string]: unknown}
88
+ },
89
+ staff: {
90
+ completed: boolean,
91
+ data?: {[key: string]: unknown}
92
+ },
93
+ },
94
+ onboarding: (OnboardingDocs&{
95
+ deadline?: string,
96
+ completed: {
97
+ submitted: boolean,
98
+ submittedDate?: string,
99
+ accepted?: boolean,
100
+ filesViewed?: string[],
101
+ formsCompleted?: {[key: string]: unknown},
102
+ filesUploaded?: {[key: number]: string[]},
103
+ }})|false|null,
104
+ studentForename?: string,
105
+ studentSurname?: string,
106
+ studentEmail?: string,
107
+ skillsTargetsValues?: {[key: string]: {
108
+ provider: number[],
109
+ student: number[],
110
+ }}
111
+ }
112
+
113
+ export type PlacementQuestions = {
114
+ title: string
115
+ description: string
116
+ dressCode: string
117
+ dressCodeText?: string
118
+ firstDayContact: string
119
+ firstAider?: string
120
+ equipment: string
121
+ responsibilities: string
122
+ experiencesGiven: string
123
+ experienceDesired: string
124
+ otherAdvice: string
125
+ carParking: boolean
126
+ bikeStorage: boolean
127
+ wheelchairFriendly: boolean
128
+ kitchen: boolean
129
+ lunchArrangements?: string
130
+ hours: any,
131
+ studentLevel: "gcse"|"college"|"undergraduate"|"postgraduate"|"over18",
132
+ studentSublevel: string[],
133
+ desiredLength: number,
134
+ desiredMinLength?: number,
135
+ desiredMaxLength?: number,
136
+ desiredLengthUnits: "days"|"weeks"|"months",
137
+ maximumStudents: number,
138
+ workingLocation: "inPerson"|"hybrid"|"remote",
139
+ pay?: number,
140
+ payFrequency: "total"|"hourly"|"daily"|"weekly"|"monthly"|"annually",
141
+ }
142
+
143
+ export type SavedPlacement = {
144
+ placementId: string,
145
+ savedByProduct: Products,
146
+ savedByUserType: "Organisation"|"Student",
147
+ savedById: string,
148
+ status?: "Accepted" | "Blocked" | "providerReview";
149
+ listed: boolean,
150
+ concurrentPlacements?: number,
151
+ id: string
152
+ }
153
+
154
+ export type PlacementListingStages = "basic"|"address"|"students"|"responsibilities"|"applications"|"onboarding"|"review"|"complete";
155
+
156
+ export type PlacementListing = {
157
+ title: string,
158
+ uid: string,
159
+ template?: string,
160
+ providerId?: string,
161
+ name: string,
162
+ providerEmail: string,
163
+ providerPhone: string,
164
+ id:string,
165
+ studentType: "secondary" | "higher" | "undergraduate" | "postgraduate"
166
+ contactForename: string,
167
+ contactSurname: string,
168
+ ["address-line1"]: string,
169
+ ["address-line2"]: string,
170
+ locality: string,
171
+ postal_code: string,
172
+ country: string,
173
+ what3Words?: string,
174
+ addressId?: string,
175
+ geoHash?: string,
176
+ status: "listed"|"unlisted"|"deleted"|"draft",
177
+ questions: PlacementQuestions,
178
+ savedBy?: {[key:string]: {
179
+ exists: true,
180
+ providerConsent: boolean,
181
+ providerConsentDate?: Timestamp,
182
+ status: "uploaded"|"approved"|"rejected"|"blocked"}},
183
+ mapConsent?: boolean,
184
+ mapConsentData?: string,
185
+ uploadedBy: "student"|"institute"|"provider",
186
+ riskAssessmentType?: "file"|"form",
187
+ riskAssessmentData?: {[key:string]: unknown}[],
188
+ dbsCheckType?: "file"|"form",
189
+ dbsCheckData?: {[key:string]: unknown}[],
190
+ contactType?: "email"|"website"|"phone"|"post",
191
+ webpage?: string,
192
+ stage: PlacementListingStages,
193
+ placementDateType?: "any"|"range"|"defined",
194
+ placementDates?: {start: string, end: string}[],
195
+ applicationType?: "simple"|"complex",
196
+ applicantWorkflowId?: string,
197
+ applicantWorkflow?: ApplicantStage[],
198
+ onboarding: (OnboardingDocs&{deadline: number})|false,
199
+ maxApplicants?: number,
200
+ maxStudents?: number,
201
+ primaryContactId: string,
202
+ }
203
+
204
+ export type OnboardingDocs = {
205
+ message?: string,
206
+ forms?: string[],
207
+ files?: string[],
208
+ requiredFiles?: {fileName: string, fileType: string}[]
209
+ }
210
+
211
+ export type PlacementTemplate = PlacementListing&{templateName: string};
212
+
213
+ export type OrganisationAddressStages = "address"|"contacts"|"misc"|"review"|"complete";
214
+
215
+ export type OrganisationAddress = Address & {
216
+ name?: string,
217
+ savedBy?: string[],
218
+ product: Products,
219
+ oId: string,
220
+ stage: OrganisationAddressStages,
221
+ additionalQuestions?: {
222
+ bikeStorage?: boolean,
223
+ kitchen?: boolean,
224
+ parking?: boolean,
225
+ disabledAccess?: boolean,
226
+ },
227
+ contacts?: {
228
+ firstAid?: {
229
+ name?: string,
230
+ phone?: string,
231
+ email?: string,
232
+ location?: string
233
+ }[],
234
+ security?: {
235
+ name?: string,
236
+ phone?: string,
237
+ email?: string,
238
+ location?: string
239
+ }[],
240
+ reception?: {
241
+ name?: string,
242
+ phone?: string,
243
+ email?: string,
244
+ location?: string
245
+ }[],
246
+ },
247
+ primaryContactId?: string,
248
+ default?: boolean,
249
+ flags?: ("addressMissing" | "noPrimaryContact")[],
250
+ color?: string;
251
+ image?: string|false;
252
+ };
253
+
254
+ export type Address = {
255
+ id?: string,
256
+ ["address-line1"]: string,
257
+ ["address-line2"]: string,
258
+ locality: string,
259
+ postal_code: string,
260
+ country: string,
261
+ geoHash?: string,
262
+ what3Words?: string
263
+ };
264
+
265
+ export type FlagCodes =
266
+ "inactive" |
267
+ "noParentEmailWarning" |
268
+ "noParentEmailError" |
269
+ "overdue" |
270
+ "noInsurance" |
271
+ "providerRejection" |
272
+ "nearingStart"|
273
+ "awaitingInsurance"|
274
+ "noRiskAssessment"|
275
+ "awaitingRiskAssessment"|
276
+ "parentEmailFailed"|
277
+ "providerEmailFailed"|
278
+ "userEmailFailed"|
279
+ "noDbsCheck"|
280
+ "awaitingDbsCheck"|
281
+ "completeOnboarding"|
282
+ "reviewOnboarding"|
283
+ "requestedVisibleAddresses"|
284
+ "requestedVisiblePlacementListings"|
285
+ "addOnboarding"|
286
+ "studentNotAccepted"|
287
+ "reminder"
288
+
289
+
290
+ export type UserData = {
291
+ details: {
292
+ forename: string,
293
+ surname: string,
294
+ pronouns?: string,
295
+ parentEmail?: string,
296
+ year?: string
297
+ },
298
+ renewalMonth: number,
299
+ placementCharged?: boolean,
300
+ algoliaKey: string,
301
+ email: string,
302
+ phone?: string,
303
+ status: "active" | "inactive" | "unclaimed",
304
+ favGuidance?: string[];
305
+ oId: string,
306
+ id: string,
307
+ resetExpiry?: {seconds: number},
308
+ product: Products,
309
+ userGroup?: string,
310
+ userType: "Staff"|"Students",
311
+ created: string,
312
+ activated: string,
313
+ groupData?: UserGroupData,
314
+ staffRoles: string[],
315
+ flags?: FlagCodes[],
316
+ cohortRequests: {[oId: string]: string[]},
317
+ cohorts: {[oId: string]: string[]},
318
+ analytics?: AnalyticsItem,
319
+ units?: string,
320
+ activationCode: number,
321
+ cohort?: string,
322
+ cohortData?: CohortData,
323
+ dismissedTasks?: string[],
324
+ dismissedTutorials?: string[],
325
+ dismissedTips?: string[],
326
+ viewCohorts?: "all"|"some"|"none",
327
+ viewStudents?: "all"|"some"|"none",
328
+ studentFilterValues?: string[], // comma delimited list of values, such as "a, b, c, d"
329
+ studentFilter?: string // Field on which students can be filtered
330
+ visibleCohorts?: string[], // comma delimited list of values
331
+ readUpdates?: string[],
332
+ contactProviderConsent?: boolean,
333
+ contactProviderConsentDate?: boolean
334
+ referrals?: number,
335
+ shareNameWithReferralLeaderboardConsent?: boolean,
336
+ shareNameWithReferralLeaderboardConsentDate?: boolean,
337
+ referralCode?: string,
338
+ notificationFrequency?: "daily"|"weekly"|"fortnightly"|"never",
339
+ monthAdded?: number,
340
+ placementsCharged?: boolean,
341
+ visibleAddresses?: string[],
342
+ visibleSchools?: string[],
343
+ visibleListings?: string[],
344
+ requestedVisibleAddresses?: string[],
345
+ requestedVisibleListings?: string[],
346
+ packageData?: BillingPackage,
347
+ viewAddresses?: "all"|"request"|"none"|"some",
348
+ viewSchools?: "all"|"request"|"none"|"some",
349
+ viewPlacementListings?: "all"|"request"|"none",
350
+ viewPlacementGroups?: "all"|"request"|"none",
351
+ skillsTargets?: string[],
352
+ skillsTargetsValues?: {[key: string]: {
353
+ provider: number[],
354
+ student: number[],
355
+ }}
356
+ };
357
+
358
+ export type AnalyticsItem = {
359
+ units?: "placements"|"weeks"|"days"|"hours",
360
+ name?: string
361
+ total?: number,
362
+ completion?: {
363
+ total?: number,
364
+ completed?: number
365
+ },
366
+ time?: {[key: string]: {date?:string, total?: number, completion?: {total?: number, completed?:number}}},
367
+ year?: {[key: string]: {year?: number, total?: number, completion?: {total?: number, completed?:number}}},
368
+ subtypes?: {[key:string]: AnalyticsItem}
369
+ }
370
+
371
+ export type UserGroupData = {
372
+ id: string,
373
+ default?: boolean,
374
+ name: string,
375
+ template: "Staff"|"Students",
376
+ oId: string,
377
+ product: Products,
378
+ viewStudents: "all"|"filter"|"none",
379
+ filterUsersBy?: string,
380
+ filterUsersValue?: string,
381
+ }&ProviderUserPermissions
382
+
383
+ export type StaffUserGroup = UserGroupData & StaffUserPermissions
384
+ export type ProviderUserGroup = UserGroupData & ProviderUserPermissions
385
+
386
+ export type StaffUserPermissions =
387
+ UserGroupData & {
388
+ viewStaff: boolean,
389
+ addStaff?: boolean,
390
+ activateStaff?: boolean,
391
+ editStaff?: boolean,
392
+ deleteStaff?: boolean,
393
+ addStaffGroups?: boolean,
394
+ editStaffGroups?: boolean,
395
+ deleteStaffGroups?: boolean,
396
+ addStudents?: boolean,
397
+ activateStudents?: boolean,
398
+ editStudents?: boolean,
399
+ deleteStudents?: boolean,
400
+ viewSetup?: boolean,
401
+ editInstitute?: boolean,
402
+ addForms?: boolean,
403
+ editForms?: boolean,
404
+ deleteForms?: boolean,
405
+ addFiles?: boolean,
406
+ deleteFiles?: boolean,
407
+ viewBilling?: boolean,
408
+ manageBilling?: boolean,
409
+ proposePlacements?: boolean,
410
+ createCohorts?: boolean,
411
+ viewPlacements?: boolean,
412
+ viewPlacementTasks?: boolean,
413
+ signOffPlacements?: boolean,
414
+ editPlacements?: boolean,
415
+ addPlacements?: boolean,
416
+ deletePlacements?: boolean,
417
+ verifyInsurance?: boolean,
418
+ verifyListings?: boolean
419
+ viewDatabase?: boolean,
420
+ addListings?: boolean,
421
+ deleteListings?: boolean,
422
+ verifyRiskAssessments?: boolean,
423
+ verifyDbsChecks?: boolean,
424
+ addCohorts?: boolean,
425
+ editCohorts?: boolean,
426
+ deleteCohorts?: boolean,
427
+ editRequests?: boolean,
428
+ deleteRequests?: boolean,
429
+ addEmailTemplates?: boolean,
430
+ editEmailTemplates?: boolean,
431
+ deleteEmailTemplates?: boolean,
432
+ addActivity?: boolean,
433
+ editActivity?: boolean,
434
+ deleteActivity?: boolean,
435
+ }
436
+
437
+ export type ProviderUserPermissions = {
438
+ viewStaff: boolean,
439
+ addStaff?: boolean,
440
+ activateStaff?: boolean,
441
+ editStaff?: boolean,
442
+ deleteStaff?: boolean,
443
+ addUserGroups?: boolean,
444
+ editUserGroups?: boolean,
445
+ deleteUserGroups?: boolean,
446
+ addStudents?: boolean,
447
+ addForms?: boolean,
448
+ editForms?: boolean,
449
+ deleteForms?: boolean,
450
+ addFiles?: boolean,
451
+ deleteFiles?: boolean,
452
+ viewBilling?: boolean,
453
+ manageBilling?: boolean,
454
+ createPlacementListing?: "any"|"template"|"none",
455
+ createPlacementTemplate?: boolean,
456
+ viewPlacementListings?: "all"|"request"|"none",
457
+ viewPlacementGroups?: "all"|"request"|"none",
458
+ viewAddresses?: "all"|"request"|"none",
459
+ processApplicants?: boolean,
460
+ addSchools?: boolean,
461
+ editSchools?: boolean,
462
+ deleteSchools?: boolean,
463
+ addAddresses?: boolean,
464
+ editAddresses?: boolean,
465
+ deleteAddresses?: boolean,
466
+ addApplicantWorkflows?: boolean,
467
+ editApplicantWorkflows?: boolean,
468
+ deleteApplicantWorkflows?: boolean,
469
+ editRequests?: boolean,
470
+ deleteRequests?: boolean,
471
+ manageAccessRequests?: boolean,
472
+ manageRegistrationRequests?: boolean,
473
+ }
474
+
475
+ export type RegistrationRequest = {
476
+ forename: string,
477
+ surname: string,
478
+ email: string,
479
+ message: string,
480
+ created: string,
481
+ oId: string,
482
+ product: "providers"|"institutes"
483
+ }
484
+
485
+ export type WorkflowStage = {
486
+ id: number,
487
+ name: string,
488
+ permanent?: boolean,
489
+ checkpoint?: boolean,
490
+ buttons?: {id: number, name: string|false, required: boolean}[],
491
+ pos?: { x: number, y: number },
492
+ userType?: "Students" | "Staff" | "Provider" | "Parent",
493
+ forms?: string[],
494
+ files?: string[],
495
+ deadline?: string,
496
+ deadlineType?: "date"|"days"
497
+ formDetails?: [{name: string}],
498
+ eli?: boolean,
499
+ riskAssessment?: boolean,
500
+ dbsCheck?: boolean,
501
+ defaultForms?: {
502
+ name: string,
503
+ description: string,
504
+ time: "during"|"post",
505
+ user: "staff"|"students"|"provider",
506
+ details: CustomFormSchema
507
+ }[],
508
+ requiredFiles?: {fileName: string, fileType: string}[]
509
+ };
510
+
511
+ export type ProviderPlacementData = {
512
+ title: string,
513
+ name: string,
514
+ providerPhone: string,
515
+ providerEmail: string,
516
+ contactForename: string,
517
+ contactSurname: string,
518
+ providerId: string,
519
+ addressId: string,
520
+ sector: string,
521
+ subsector: string,
522
+ id?: string
523
+ };
524
+
525
+
526
+ export type ProviderData = {
527
+ staff: number,
528
+ staffFields: string[],
529
+ staffActive: number,
530
+ admin: string,
531
+ name: string,
532
+ insurance: boolean|"awaitingReview",
533
+ regNumber?: string,
534
+ insuranceExpiry: string,
535
+ mapConsent?: boolean|"unlisted",
536
+ mapConsentDate?: string,
537
+ staffGuidance?: {[key:number]: string},
538
+ about?: string,
539
+ sector: string,
540
+ defAddress: string,
541
+ subsector: string,
542
+ website?: string,
543
+ savedBy?: {[key:string]: {
544
+ exists: true,
545
+ providerConsent: boolean,
546
+ providerConsentDate?: Timestamp,
547
+ status: "uploaded"|"approved"|"blocked"}},
548
+ onboarding?: {
549
+ hasStaff?: boolean,
550
+ multipleAddresses?: boolean,
551
+ }
552
+ registrationRequests?: boolean|string,
553
+ registrationRequestsDate?: string,
554
+ information: {
555
+ description?: string,
556
+ staff?: string,
557
+ locations?: number,
558
+ },
559
+ discount?: string,
560
+ package: string,
561
+ splitBilling?: boolean,
562
+ adminBillingContactId: string,
563
+ addOnPackages?: string[],
564
+ }
565
+
566
+ export type InstituteData = {
567
+ students: number,
568
+ staff: number,
569
+ studentsFields: string[],
570
+ staffFields: string[],
571
+ studentsActive: number,
572
+ staffActive: number,
573
+ admin: string,
574
+ name: string,
575
+ monthAdded: number,
576
+ platformFee: number,
577
+ color?: string,
578
+ verifiedProviders?: string[],
579
+ awaitingProviderInsurance?: string[],
580
+ verifiedRiskAssessments?: string[],
581
+ awaitingPlacementRiskAssessments?: string[],
582
+ verifiedDbsChecks?: string[],
583
+ awaitingPlacementDbsChecks?: string[],
584
+ staffGuidance?: {[key:number]: string}
585
+ studentsGuidance?: {[key:number]: string},
586
+ cohortRequests: {[oId: string]: {[cohortId: string]: string[]}},
587
+ externalProviderUploads?: boolean,
588
+ discount?: string,
589
+ package: string,
590
+ splitBilling?: boolean,
591
+ adminBillingContactId?: string,
592
+ addOnPackages?: string[],
593
+ authorisedMISSystem?: {
594
+ name: "arbor",
595
+ data: {
596
+ url: string
597
+ }
598
+ },
599
+ providerActivities?: {[key: string]: ProviderActivity}
600
+ }&Address;
601
+
602
+ export type ProviderActivity = {
603
+ title?: string,
604
+ description: string,
605
+ position?: number,
606
+ image?: string,
607
+ color: string,
608
+ public?: boolean,
609
+ oId?: string
610
+ }
611
+
612
+ export type NotificationObject = {
613
+ buttonURL: string,
614
+ created: Timestamp,
615
+ description: string,
616
+ title: string,
617
+ viewableBy: string[],
618
+ viewedBy: string[],
619
+ docPath: DocumentReference<DocumentData>
620
+ }
621
+
622
+ export type CustomFormSchemaField = {
623
+ id: number,
624
+ label: string,
625
+ required: boolean,
626
+ type: "short"|"long"|"number"|"date"|"dropdown"|"checkbox"|"rating" // If Microsoft forms has more, make a note and I'll add them
627
+ width: number, // 1-12 default 12
628
+ subtitle?: string,
629
+ extra: {
630
+ default?: boolean /* type: checkbox */ | string /* type: short, long, dropdown (inputted option) */ | number /* type:number */,
631
+ min?: number /* type: number */
632
+ max?: number /* type: number */
633
+ minRows?: number /* type: long */
634
+ options?: string[] // from dropdown only
635
+ levels?: number // For ratings, number of stars.
636
+ }
637
+ }
638
+
639
+ export type CustomFormSchemaSection =
640
+ {
641
+ id: number // random
642
+ title?: string,
643
+ description?: string,
644
+ fields: CustomFormSchemaField[]
645
+ }
646
+
647
+
648
+ export type CustomFormSchema = {
649
+ name?: string,
650
+ description?: string,
651
+ updated?: string,
652
+ id?: string,
653
+ form?: CustomFormSchemaSection[]}
654
+
655
+ export type StaffRoles = {
656
+ name: string,
657
+ filters: {
658
+ students: string[],
659
+ fields: {[key:string]: unknown},
660
+ },
661
+ staff: string[]
662
+ };
663
+
664
+ export type QueryObjectConstraint = [string, "=="|"<"|"<="|">="|">"|"!="|"array-contains"|"array-contains-any"|"in"|"not-in", string|boolean][]
665
+
666
+ export type QueryObject = {
667
+ path: string[],
668
+ where?: QueryObjectConstraint,
669
+ orderBy?: string
670
+ };
671
+
672
+ export type Note = {
673
+ title?: string,
674
+ body?: {
675
+ type: string;
676
+ children: {
677
+ text: string;
678
+ }[];
679
+ }[],
680
+ created: string,
681
+ updated: string
682
+ }
683
+
684
+ export type Referral = {
685
+ signUps: number,
686
+ volume: number,
687
+ product: Products,
688
+ expiry: Timestamp,
689
+ name: string
690
+ }
691
+
692
+ export type Contact = {
693
+ id: string,
694
+ contactForename: string,
695
+ contactSurname: string,
696
+ name: string,
697
+ providerEmail: string,
698
+ providerPhone: number,
699
+ "address-line1": string,
700
+ "address-line2": string,
701
+ locality: string,
702
+ what3Words?: string,
703
+ postal_code: string,
704
+ country: string,
705
+ created: string,
706
+ docPath: unknown
707
+ }
708
+
709
+
710
+ export type CohortData = {
711
+ id?: string,
712
+ name: string,
713
+ placementType: "defined"|"continuous",
714
+ forms?: string[],
715
+ files?: string[],
716
+ startSubmission: string,
717
+ endSubmission: string,
718
+ startPlacements: string,
719
+ endPlacements: string,
720
+ stage: "info"|"name"|"placementType"|"students"|"workflow"|"review"|"created"|"archived",
721
+ workflow: WorkflowStage[]
722
+ customWorkflow?: boolean,
723
+ oId: string,
724
+ product: Products,
725
+ schoolId?: string,
726
+ designatedStaff?: string,
727
+ logType?: "basic"|"custom",
728
+ logs?: {
729
+ students?: string,
730
+ staff?: string,
731
+ provider?: string,
732
+ }
733
+ feedback?: {
734
+ students?: string,
735
+ staff?: string,
736
+ provider?: string,
737
+ },
738
+ feedbackText?: {
739
+ students?: Descendant[],
740
+ staff?: Descendant[],
741
+ provider?: Descendant[],
742
+ },
743
+ providerFeedbackSent?: Timestamp,
744
+ studentsFeedbackSent?: Timestamp,
745
+ emailTemplates?: {[key in keyof typeof emailTemplates]: string},
746
+ skillsTargets?: string[]
747
+ }
748
+
749
+ export type ArrowObject = {
750
+ start: number|string,
751
+ end: number|string,
752
+ name: string|false,
753
+ required?: boolean,
754
+ screenX?: number,
755
+ }
756
+
757
+
758
+ export type PlacementReviewDetails = {
759
+ activeDates: string[],
760
+ studentForename: string,
761
+ studentSurname: string,
762
+ instituteName: string,
763
+ title: string,
764
+ product: string,
765
+ name: string,
766
+ startDate: string,
767
+ endDate: string,
768
+ providerEmail: string,
769
+ providerPhone: string,
770
+ contactForename: string,
771
+ contactSurname: string,
772
+ cohort: string,
773
+ cohortData?: CohortData,
774
+ providerKey: string,
775
+ status: number,
776
+ ["address-line1"]: string,
777
+ ["address-line2"]: string,
778
+ locality: string,
779
+ postal_code: string,
780
+ what3Words?: string,
781
+ country: string,
782
+ key: string,
783
+ oId: string,
784
+ providerCompleted: string[],
785
+ providerId: string,
786
+ questions: PlacementQuestions,
787
+ mapConsent: boolean | "institute",
788
+ userType: string,
789
+ id: string,
790
+ uid: string,
791
+ leadTimes: string[],
792
+ requiredSections: string[],
793
+ existingPlacements?: {
794
+ [key: string]: {
795
+ mapConsent: boolean,
796
+ jobTitle: string,
797
+ questions: PlacementQuestions,
798
+ riskAssessment: boolean|"awaitingReview",
799
+ riskAssessmentType: "form"|"file",
800
+ riskAssessmentData?: {[key: string]: unknown},
801
+ dbsCheck: boolean|"awaitingReview",
802
+ dbsCheckType: "form"|"file",
803
+ dbsCheckData?: {[key: string]: unknown},
804
+ }
805
+ },
806
+ requireELI?: boolean,
807
+ requireRA?: boolean,
808
+ requireDBS?: boolean,
809
+ importedProviderForms: boolean,
810
+ currentStage: WorkflowStage&{files: {[fileId: string]: {name: string, url: string}}},
811
+ placementId?: string,
812
+ incompleteItems: {[key: number]: string[]},
813
+ riskAssessmentData?: {[key: string]: unknown}[],
814
+ dbsCheckData?: {[key: string]: unknown}[],
815
+ feedbackText?: Descendant[],
816
+ feedback: CustomFormSchema,
817
+ providerFeedback?: {[key: string]: unknown},
818
+ primaryColor?: string,
819
+ primaryImage?: string
820
+ }
821
+
822
+ export type BlogCategories = "students"|"providers"|"institutes"|"placementt"
823
+
824
+ export type Blog = {
825
+ title?: string,
826
+ summary?: string,
827
+ body?: Descendant[],
828
+ uploaded?: string,
829
+ category?: BlogCategories,
830
+ author?: string,
831
+ tags?: string
832
+ }
833
+
834
+ export type PlacementExportObject = {
835
+ cohortId: string,
836
+ startDate?: string,
837
+ endDate?: string,
838
+ allTime?: boolean,
839
+ includeStudentData?: boolean,
840
+ activePlacements?: boolean,
841
+ completedPlacements?: boolean,
842
+ }
843
+
844
+
845
+
846
+ export type ApplicantWorkflow = {
847
+ id?: string,
848
+ name: string,
849
+ forms?: string[],
850
+ files?: string[],
851
+ workflow: ApplicantStage[]
852
+ customWorkflow?: boolean,
853
+ oId: string,
854
+ product: Products,
855
+ type: "simple"|"complex"
856
+ }
857
+
858
+ export type ApplicantStage = {
859
+ id: number,
860
+ name: string,
861
+ message?: string,
862
+ userType?: "Students" | "Staff",
863
+ permanent?: boolean,
864
+ checkpoint?: boolean,
865
+ buttons?: {id: number, name: string|false, required: boolean}[],
866
+ pos?: { x: number, y: number },
867
+ forms?: string[],
868
+ files?: string[],
869
+ deadline?: string,
870
+ deadlineType?: "date"|"days"
871
+ formDetails?: {[key: string]: {
872
+ name: string,
873
+ id: string,
874
+ description?: string,
875
+ product: Products,
876
+ oId: string,
877
+ form: CustomFormSchema
878
+ }},
879
+ requiredFiles?: {fileName: string, fileType: string}[]
880
+ portfolio?: boolean,
881
+ viewableFiles?: {[key: string]: FileItem},
882
+ };
883
+
884
+ export type Application = {
885
+ id?: string,
886
+ uid: string,
887
+ applicantWorkflowId: string,
888
+ listingId: string,
889
+ addressId: string,
890
+ providerId: string,
891
+ reqUserType: "Students"|"Staff",
892
+ completedSections: {[stage: number]: {
893
+ submitted?: string,
894
+ filesViewed?: string[],
895
+ formsCompleted?: {[key: string]: unknown},
896
+ filesUploaded?: {[key: number]: string[]},
897
+ }},
898
+ created: string,
899
+ submitted: string,
900
+ startDate: string,
901
+ endDate: string,
902
+ leadTimes?: string[],
903
+ stage: number, // This is what stage of the custom workflow.
904
+ outcomeMessage?: string,
905
+ status: "draft"|"submitted"|"approved"|"declined",
906
+ placementId?: string,
907
+ }
908
+
909
+ export type Report = {
910
+ added: string,
911
+ id: string,
912
+ oId: string,
913
+ product: Products,
914
+ pId: string,
915
+ reason: string,
916
+ uid: string,
917
+ status: "open"|"closed"
918
+ }
919
+
920
+
921
+ export type FileItem = {
922
+ product: Products,
923
+ oId: string,
924
+ added: string,
925
+ name: string,
926
+ fileName: string,
927
+ url?: string
928
+ }
929
+
930
+ export type Event = {
931
+ collection: "users"|"placements"|"placementListings",
932
+ documentId: string,
933
+ product: Products,
934
+ oId: string,
935
+ created: Timestamp,
936
+ title: string,
937
+ description?: string,
938
+ severity: string,
939
+ button?: {title: string, url: string}
940
+ }
941
+
942
+ export type BillingPackage = {
943
+ name: string,
944
+ staffUnitCost: number,
945
+ platformFee: number,
946
+ platformFeeFrequency: "yearly"|"monthly",
947
+ studentUnitCost: number,
948
+ placementUnitCost: number,
949
+ product: Products,
950
+ priority: number,
951
+ features: {[key: string]: number|boolean|string},
952
+ description: string
953
+ }
954
+
955
+ export type EmailTemplate = {
956
+ name: string,
957
+ created: Timestamp,
958
+ subject: string,
959
+ emailTemplate: string,
960
+ bodyText: Descendant[],
961
+ color?: string,
962
+ product: Products,
963
+ oId: string,
964
+ public?: boolean,
965
+ }
966
+
967
+
968
+ export type EmailTemplateConfig = {
969
+ description: string,
970
+ params: string[],
971
+ button?: {text: string, link: string},
972
+ type: "workflow"|"feedback"
973
+ }
974
+
975
+
976
+ export type Reminder = {
977
+ collection: "users"|"placements"|"placementListings",
978
+ documentId: string,
979
+ product: Products,
980
+ oId: string,
981
+ created: Timestamp,
982
+ title: string,
983
+ description?: string,
984
+ dueDate: string,
985
+ status: "upcoming"|"dismissed"
986
+ }
987
+
988
+ export type Sorts = {[label: string]: {
989
+ value: string
990
+ direction: "asc"|"desc"
991
+ }}|undefined
992
+
993
+ export type SchoolData = OrganisationAddress&{
994
+ billingEmail?: string,
995
+ billingContactId?: string,
996
+ authorisedMISSystem?: {
997
+ name: "arbor",
998
+ data: {
999
+ url: string
1000
+ }
1001
+ },
1002
+ monthAdded: number,
1003
+ acceptingAlumni?: boolean
959
1004
  }