placementt-core 1.20.211 → 11.10.151

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 (130) hide show
  1. package/.eslintrc.js +40 -40
  2. package/.gitattributes +2 -2
  3. package/lib/config.d.ts +0 -1
  4. package/lib/constants.d.ts +6 -2
  5. package/lib/constants.js +136 -136
  6. package/lib/constants.js.map +1 -1
  7. package/lib/features/analytics/useAnalytics.d.ts +0 -1
  8. package/lib/features/analytics/useAnalytics.js +3 -4
  9. package/lib/features/analytics/useAnalytics.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/contacts/contactsSlice.d.ts +5 -5
  15. package/lib/features/contacts/useContacts.js +1 -2
  16. package/lib/features/contacts/useContacts.js.map +1 -1
  17. package/lib/features/downtime/useDowntime.d.ts +11 -11
  18. package/lib/features/downtime/useDowntime.js +22 -22
  19. package/lib/features/dropdown/useDropdown.d.ts +2 -3
  20. package/lib/features/dropdown/useDropdown.js +1 -2
  21. package/lib/features/dropdown/useDropdown.js.map +1 -1
  22. package/lib/features/global/downtime/useDowntime.d.ts +0 -1
  23. package/lib/features/global/downtime/useDowntime.js +1 -2
  24. package/lib/features/global/downtime/useDowntime.js.map +1 -1
  25. package/lib/features/global/users/useUserFunctions.d.ts +0 -1
  26. package/lib/features/global/users/useUserFunctions.js +7 -8
  27. package/lib/features/global/users/useUserFunctions.js.map +1 -1
  28. package/lib/features/placements/studentPlacements/activePlacement.d.ts +1 -1
  29. package/lib/features/placements/studentPlacements/completedStudentPlacementsSlice.d.ts +2 -2
  30. package/lib/features/placements/studentPlacements/studentPlacementsSlice.d.ts +63 -63
  31. package/lib/features/placements/studentPlacements/studentPlacementsSlice.js +81 -81
  32. package/lib/features/placements/studentPlacements/upcomingStudentPlacementsSlice.d.ts +2 -2
  33. package/lib/features/placements/studentPlacements/useStudentPlacements.d.ts +0 -1
  34. package/lib/features/placements/studentPlacements/useStudentPlacements.js +1 -2
  35. package/lib/features/placements/studentPlacements/useStudentPlacements.js.map +1 -1
  36. package/lib/features/providerPlacements/providerPlacementsSlice.d.ts +19 -19
  37. package/lib/features/providerPlacements/providerPlacementsSlice.js +24 -24
  38. package/lib/features/referrals/useReferrals.d.ts +0 -1
  39. package/lib/features/referrals/useReferrals.js +1 -2
  40. package/lib/features/referrals/useReferrals.js.map +1 -1
  41. package/lib/features/studentPlacements/studentPlacementsSlice.d.ts +62 -62
  42. package/lib/features/studentPlacements/studentPlacementsSlice.js +87 -87
  43. package/lib/features/studentPlacements/useStudentPlacements.d.ts +6 -6
  44. package/lib/features/studentPlacements/useStudentPlacements.js +18 -18
  45. package/lib/features/updates/useUpdates.js +1 -2
  46. package/lib/features/updates/useUpdates.js.map +1 -1
  47. package/lib/features/userSlice.d.ts +26 -26
  48. package/lib/features/userSlice.js +23 -23
  49. package/lib/features/users/useUserFunctions.d.ts +25 -25
  50. package/lib/features/users/useUserFunctions.js +124 -124
  51. package/lib/features/users/userSlice.d.ts +46 -46
  52. package/lib/features/users/userSlice.js +48 -48
  53. package/lib/firebase/firebase.d.ts +3 -1
  54. package/lib/firebase/firebase.js +9 -3
  55. package/lib/firebase/firebase.js.map +1 -1
  56. package/lib/firebase/firebaseConfig.js +3 -0
  57. package/lib/firebase/firebaseConfig.js.map +1 -1
  58. package/lib/firebase/firebaseQuery.d.ts +3 -1
  59. package/lib/firebase/firebaseQuery.js +11 -1
  60. package/lib/firebase/firebaseQuery.js.map +1 -1
  61. package/lib/firebase/persistence.js +2 -2
  62. package/lib/firebase/persistence.js.map +1 -1
  63. package/lib/firebase/readDatabase.d.ts +8 -7
  64. package/lib/firebase/readDatabase.js +41 -8
  65. package/lib/firebase/readDatabase.js.map +1 -1
  66. package/lib/firebase/util.d.ts +3 -4
  67. package/lib/firebase/util.js +49 -4
  68. package/lib/firebase/util.js.map +1 -1
  69. package/lib/firebase/writeDatabase.d.ts +7 -3
  70. package/lib/firebase/writeDatabase.js +9 -2
  71. package/lib/firebase/writeDatabase.js.map +1 -1
  72. package/lib/hooks.d.ts +476 -20
  73. package/lib/hooks.js +1855 -237
  74. package/lib/hooks.js.map +1 -1
  75. package/lib/images/GatsbyBenchmarks.d.ts +0 -1
  76. package/lib/images/GatsbyBenchmarks.js +1 -1
  77. package/lib/images/GatsbyBenchmarks.js.map +1 -1
  78. package/lib/reduxHooks.d.ts +9 -2
  79. package/lib/reduxHooks.js +36 -9
  80. package/lib/reduxHooks.js.map +1 -1
  81. package/lib/tasksAndTips.d.ts +25 -5
  82. package/lib/tasksAndTips.js +517 -48
  83. package/lib/tasksAndTips.js.map +1 -1
  84. package/lib/typeDefinitions.d.ts +472 -55
  85. package/lib/util.d.ts +1 -0
  86. package/lib/util.js +85 -7
  87. package/lib/util.js.map +1 -1
  88. package/package.json +52 -49
  89. package/src/DatabaseDefinitions.ts +18 -18
  90. package/src/apiCalls.ts +128 -128
  91. package/src/config.ts +50 -50
  92. package/src/constants.ts +714 -707
  93. package/src/databaseTypes.ts +42 -42
  94. package/src/features/analytics/useAnalytics.tsx +64 -64
  95. package/src/features/contacts/contactsSlice.ts +147 -147
  96. package/src/features/contacts/useContacts.tsx +73 -73
  97. package/src/features/dropdown/useDropdown.tsx +52 -52
  98. package/src/features/global/downtime/useDowntime.tsx +23 -23
  99. package/src/features/global/users/useUserFunctions.tsx +132 -132
  100. package/src/features/jobs/jobsSlice.ts +65 -65
  101. package/src/features/placements/studentPlacements/activePlacement.ts +68 -68
  102. package/src/features/placements/studentPlacements/completedStudentPlacementsSlice.ts +97 -97
  103. package/src/features/placements/studentPlacements/upcomingStudentPlacementsSlice.ts +108 -108
  104. package/src/features/placements/studentPlacements/useStudentPlacements.tsx +9 -9
  105. package/src/features/placements/types.ts +10 -10
  106. package/src/features/referrals/useReferrals.tsx +56 -56
  107. package/src/features/updates/useUpdates.tsx +38 -38
  108. package/src/firebase/firebase.tsx +144 -138
  109. package/src/firebase/firebaseConfig.tsx +45 -42
  110. package/src/firebase/firebaseQuery.tsx +150 -140
  111. package/src/firebase/persistence.ts +84 -84
  112. package/src/firebase/readDatabase.tsx +235 -197
  113. package/src/firebase/util.tsx +352 -308
  114. package/src/firebase/writeDatabase.tsx +77 -68
  115. package/src/hooks.tsx +4029 -1928
  116. package/src/images/GatsbyBenchmarks.tsx +711 -711
  117. package/src/images/LogFuturePlacement.jsx +64 -64
  118. package/src/images/LogPreviousPlacement.jsx +228 -228
  119. package/src/images/gatsby_benchmarks.svg +466 -466
  120. package/src/images/log_future_placement.svg +114 -114
  121. package/src/images/log_previous_placement.svg +199 -199
  122. package/src/index.ts +34 -34
  123. package/src/readDatabase.tsx +3 -3
  124. package/src/reduxHooks.ts +231 -200
  125. package/src/tasksAndTips.ts +917 -410
  126. package/src/tutorialTips.ts +58 -58
  127. package/src/typeDefinitions.ts +893 -503
  128. package/src/util.ts +137 -47
  129. package/tsconfig.dev.json +5 -5
  130. package/tsconfig.json +21 -21
package/lib/hooks.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- /// <reference types="react" />
2
1
  import { DocumentData, QueryConstraint, QueryDocumentSnapshot } from "firebase/firestore";
3
- import { ArrowObject, CohortData, InstituteData, PlacementListing, Products, QueryObject, StudentPlacementData, UserData, UserGroupData, WorkflowStage } from "./typeDefinitions";
2
+ import FirebaseQuery from "./firebase/firebaseQuery";
3
+ import { ApplicantStage, ApplicantWorkflow, Application, ArrowObject, CohortData, CustomFormSchema, FileItem, FlagCodes, InstituteData, OnboardingDocs, PlacementListing, Products, ProviderData, QueryObject, SavedPlacement, StudentPlacementData, UserData, UserGroupData, WorkflowStage } from "./typeDefinitions";
4
+ import { OrganisationAddress } from "placementt-core";
4
5
  type StudentPlacementListParams = {
5
6
  user: UserData;
6
7
  student?: UserData;
@@ -24,8 +25,9 @@ type InstitutePlacementParams = {
24
25
  cohort?: string;
25
26
  queryConstraint?: QueryConstraint[];
26
27
  ql?: number;
28
+ inProgress?: boolean;
27
29
  };
28
- export declare function useNewInstitutePlacementList({ id, user, cohort, queryConstraint, ql }: InstitutePlacementParams): {
30
+ export declare function useNewInstitutePlacementList({ id, user, cohort, queryConstraint, ql, inProgress }: InstitutePlacementParams): {
29
31
  placements: {
30
32
  [key: string]: StudentPlacementData & {
31
33
  student: UserData;
@@ -33,7 +35,7 @@ export declare function useNewInstitutePlacementList({ id, user, cohort, queryCo
33
35
  } | undefined;
34
36
  loadMoreIcon: boolean;
35
37
  loadMorePlacements: (fStartPlacementAfter?: [QueryDocumentSnapshot<DocumentData> | undefined, number] | undefined) => Promise<void>;
36
- setQuery: import("react").Dispatch<import("react").SetStateAction<string>>;
38
+ setQuery: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
37
39
  setInitialQueryLimit: import("react").Dispatch<import("react").SetStateAction<number>>;
38
40
  reset: () => void;
39
41
  changeQueryConstraints: (e: QueryConstraint[]) => void;
@@ -67,31 +69,38 @@ export declare function useFilterTablePaginator({ data }: {
67
69
  setFilters: import("react").Dispatch<import("react").SetStateAction<{
68
70
  [key: string]: unknown;
69
71
  } | undefined>>;
72
+ page: number[];
70
73
  };
71
74
  export declare function usePlacementListingPaginator({ data, user }: {
72
75
  data: QueryObject[];
73
76
  user: UserData;
74
77
  }): {
75
78
  tableData: {
76
- [key: string]: PlacementListing;
79
+ [key: string]: PlacementListing & {
80
+ savedPlacement: SavedPlacement;
81
+ };
77
82
  };
78
83
  setPage: import("react").Dispatch<import("react").SetStateAction<number[]>>;
79
84
  setFilters: import("react").Dispatch<import("react").SetStateAction<{
80
85
  [key: string]: unknown;
81
86
  } | undefined>>;
87
+ page: number[];
82
88
  };
83
89
  type UserPaginatorParams = {
84
90
  user: UserData;
85
91
  cohort?: string;
86
92
  data: QueryObject[];
93
+ search?: string;
94
+ userType: "Staff" | "Students";
87
95
  };
88
- export declare function useCohortUserPaginator({ user, cohort, data }: UserPaginatorParams): {
96
+ export declare function useCohortUserPaginator({ user, cohort, data, search, userType }: UserPaginatorParams): {
89
97
  tableData: {
90
98
  [key: string]: {
91
99
  [key: string]: unknown;
92
100
  };
93
101
  };
94
102
  setPage: import("react").Dispatch<import("react").SetStateAction<number[]>>;
103
+ page: number[];
95
104
  setFilters: import("react").Dispatch<import("react").SetStateAction<{
96
105
  [key: string]: unknown;
97
106
  } | undefined>>;
@@ -119,8 +128,11 @@ type LazyLoadQueryParams = {
119
128
  number: number;
120
129
  endResultsText?: string;
121
130
  noResultsText?: string;
131
+ onItemFetched?: (item: unknown) => Promise<{
132
+ [key: string]: unknown;
133
+ }>;
122
134
  };
123
- export declare function useLazyLoadQueryList({ path, constraints, number }: LazyLoadQueryParams): {
135
+ export declare function useLazyLoadQueryList({ path, constraints, number, onItemFetched }: LazyLoadQueryParams): {
124
136
  items: {
125
137
  [key: string]: {
126
138
  [key: string]: unknown;
@@ -130,6 +142,162 @@ export declare function useLazyLoadQueryList({ path, constraints, number }: Lazy
130
142
  loadMoreIcon: boolean;
131
143
  reset: () => void;
132
144
  };
145
+ type PublicPlacementListingLoaderParams = {
146
+ providerId?: string;
147
+ number: number;
148
+ };
149
+ export declare function usePublicPlacementListingLoader({ providerId, number }: PublicPlacementListingLoaderParams): {
150
+ items: {
151
+ [key: string]: {
152
+ [key: string]: unknown;
153
+ };
154
+ };
155
+ loadMore: () => Promise<void>;
156
+ loadMoreIcon: boolean;
157
+ reset: () => void;
158
+ };
159
+ export type ApplicationHookParams = {
160
+ successText: {
161
+ submitted: {
162
+ title: string;
163
+ desc: string;
164
+ };
165
+ draftSaved: {
166
+ title: string;
167
+ desc: string;
168
+ };
169
+ stageComplete: {
170
+ title: string;
171
+ desc: string;
172
+ };
173
+ outcome: {
174
+ title: string;
175
+ desc: string;
176
+ };
177
+ };
178
+ setSuccessPopup: import("react").Dispatch<import("react").SetStateAction<"submitted" | "draftSaved" | "stageComplete" | "outcome" | undefined>>;
179
+ openSuccessPopup: (type: "submitted" | "draftSaved" | "stageComplete" | "outcome") => void;
180
+ setFApplication: import("react").Dispatch<import("react").SetStateAction<Partial<Application>>>;
181
+ fApplication: Partial<Application>;
182
+ draftSaved: boolean;
183
+ profileUrl: string | undefined;
184
+ successPopup: "submitted" | "draftSaved" | "stageComplete" | "outcome" | undefined;
185
+ fApplicationId: string | undefined;
186
+ fListing: PlacementListing | false | undefined;
187
+ student: UserData | undefined;
188
+ fProvider: {
189
+ details?: ProviderData;
190
+ profile?: string;
191
+ id?: string;
192
+ } | undefined;
193
+ onFApply: (draft?: boolean) => Promise<void>;
194
+ setFormComplete: (formId: string, e: {
195
+ [key: string]: unknown;
196
+ }) => void;
197
+ viewFile: (file: string, onOpen: (url: string) => void) => void;
198
+ addFile: (files: string[], fileId: number) => void;
199
+ uploadedFiles?: {
200
+ [key: string]: FileItem;
201
+ };
202
+ getCurrentStage: (stage: number) => Promise<{
203
+ stage: ApplicantStage;
204
+ completedSections: {
205
+ submitted?: string | undefined;
206
+ filesViewed?: string[] | undefined;
207
+ formsCompleted?: {
208
+ [key: string]: unknown;
209
+ } | undefined;
210
+ filesUploaded?: {
211
+ [key: number]: string[];
212
+ } | undefined;
213
+ };
214
+ }>;
215
+ currentStageComplete?: boolean;
216
+ progressStage: (type: number | "accept" | "reject", e?: {
217
+ feedback?: string;
218
+ }) => Promise<void>;
219
+ };
220
+ export declare function useCreateApplicationRenderer({ user, listingId, listing, provider, application, applicationId, orgContext }: {
221
+ user: UserData;
222
+ listingId: string;
223
+ applicationId?: string;
224
+ listing?: PlacementListing;
225
+ application?: Partial<Application>;
226
+ orgContext?: {
227
+ details: ProviderData;
228
+ addresses: {
229
+ [key: string]: OrganisationAddress;
230
+ };
231
+ applicantWorkflows: {
232
+ [key: string]: ApplicantWorkflow;
233
+ };
234
+ };
235
+ provider?: {
236
+ details?: ProviderData;
237
+ profile?: string;
238
+ id?: string;
239
+ };
240
+ }): {
241
+ successText: {
242
+ submitted: {
243
+ title: string;
244
+ desc: string;
245
+ };
246
+ draftSaved: {
247
+ title: string;
248
+ desc: string;
249
+ };
250
+ stageComplete: {
251
+ title: string;
252
+ desc: string;
253
+ };
254
+ outcome: {
255
+ title: string;
256
+ desc: string;
257
+ };
258
+ };
259
+ onFApply: (draft?: boolean) => Promise<void>;
260
+ progressStage: (type: number | "accept" | "reject", e?: {
261
+ feedback?: string;
262
+ }) => Promise<void>;
263
+ currentStageComplete: boolean | undefined;
264
+ uploadedFiles: {
265
+ [key: string]: FileItem;
266
+ } | undefined;
267
+ getCurrentStage: (stage: number) => Promise<{
268
+ stage: ApplicantStage;
269
+ completedSections: {
270
+ submitted?: string | undefined;
271
+ filesViewed?: string[] | undefined;
272
+ formsCompleted?: {
273
+ [key: string]: unknown;
274
+ } | undefined;
275
+ filesUploaded?: {
276
+ [key: number]: string[];
277
+ } | undefined;
278
+ };
279
+ }>;
280
+ setFormComplete: (formId: string, e: {
281
+ [key: string]: unknown;
282
+ }) => void;
283
+ viewFile: (file: string, onOpen: (url: string) => void) => void;
284
+ addFile: (files: string[], fileId: number) => void;
285
+ setSuccessPopup: import("react").Dispatch<import("react").SetStateAction<"submitted" | "draftSaved" | "stageComplete" | "outcome" | undefined>>;
286
+ openSuccessPopup: (type: "submitted" | "draftSaved" | "stageComplete" | "outcome") => void;
287
+ setFApplication: import("react").Dispatch<import("react").SetStateAction<Partial<Application>>>;
288
+ fApplication: Partial<Application>;
289
+ draftSaved: boolean;
290
+ profileUrl: string | undefined;
291
+ successPopup: "submitted" | "draftSaved" | "stageComplete" | "outcome" | undefined;
292
+ fApplicationId: string | undefined;
293
+ fListing: false | PlacementListing | undefined;
294
+ student: UserData | undefined;
295
+ fProvider: {
296
+ details?: ProviderData;
297
+ profile?: string;
298
+ id?: string;
299
+ } | undefined;
300
+ };
133
301
  export declare function useProposePlacementRenderer({ user, orgContext, placement }: {
134
302
  user: UserData;
135
303
  orgContext?: {
@@ -187,12 +355,12 @@ type CreateCohortRendererParams = {
187
355
  product: Products;
188
356
  initialData?: CohortData;
189
357
  };
190
- export type CreateCohortStages = "name" | "placementType" | "students" | "workflow" | "review";
358
+ export type CreateCohortStages = "info" | "name" | "placementType" | "review";
191
359
  export declare function useCreateCohortRenderer({ oId, product, initialData }: CreateCohortRendererParams): {
192
360
  submitCohort: () => void;
193
361
  submitSection: (e?: {
194
362
  [key: string]: unknown;
195
- } | undefined) => void;
363
+ }) => void;
196
364
  back: () => void;
197
365
  setCohortData: import("react").Dispatch<import("react").SetStateAction<CohortData>>;
198
366
  deleteCohort: () => Promise<void>;
@@ -211,10 +379,10 @@ type UserUploadParams = {
211
379
  };
212
380
  export declare function useUserUploadHandler({ product, oId, userType, user, onComplete, userGroupId, cohortId }: UserUploadParams): {
213
381
  uploadUsers: (users: {
214
- [key: string]: unknown;
215
- email?: string | undefined;
216
- parentEmail?: string | undefined;
382
+ email?: string;
383
+ parentEmail?: string;
217
384
  year: number;
385
+ [key: string]: unknown;
218
386
  }[]) => Promise<void>;
219
387
  alert: {
220
388
  severity: "warning" | "error" | "success" | "info";
@@ -224,25 +392,29 @@ export declare function useUserUploadHandler({ product, oId, userType, user, onC
224
392
  };
225
393
  type WorkflowEditorParams = {
226
394
  user: UserData;
227
- initialData?: WorkflowStage[];
395
+ initialData?: WorkflowStage[] | ApplicantStage[];
228
396
  onSubmit: (e: {
229
397
  workflow: WorkflowStage[];
230
398
  includedFiles: string[];
231
399
  includedForms: string[];
232
400
  }) => void;
233
- cohortId: string;
234
- product?: "providers" | "institutes";
401
+ cohortId?: string;
402
+ product?: Products;
235
403
  oId?: string;
236
404
  };
237
- export declare function useWorkflowEditor({ user, initialData, onSubmit, cohortId, product, oId }: WorkflowEditorParams): {
405
+ export declare function useWorkflowEditor({ user, initialData, onSubmit, cohortId }: WorkflowEditorParams): {
238
406
  filePopupActive: boolean;
239
407
  files: {
240
408
  name: string;
241
409
  url: string;
242
410
  }[];
243
411
  uploadFile: (files: any[]) => Promise<void>;
244
- addNode: () => void;
245
- onDelete: (id: number) => void;
412
+ addNode: ({ userType, nextStage, prevStage }?: {
413
+ userType?: "Students" | "Staff" | "Provider" | "Parent";
414
+ nextStage?: number;
415
+ prevStage?: number;
416
+ }) => number;
417
+ onDelete: (id?: number) => Promise<void>;
246
418
  arrows: ArrowObject[];
247
419
  onChange: (path: (string | number)[], value: unknown) => void;
248
420
  error: string | undefined;
@@ -253,7 +425,7 @@ export declare function useWorkflowEditor({ user, initialData, onSubmit, cohortI
253
425
  setTutorialActive: import("react").Dispatch<import("react").SetStateAction<boolean>>;
254
426
  setFilePopupActive: import("react").Dispatch<import("react").SetStateAction<boolean>>;
255
427
  includedForms: string[];
256
- submitWorkflow: () => Promise<void>;
428
+ submitWorkflow: (workflow?: WorkflowStage[] | ApplicantStage[], callOnComplete?: boolean) => Promise<false | void>;
257
429
  openPopup: () => void;
258
430
  snackbar: string | undefined;
259
431
  setSnackbar: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
@@ -268,7 +440,55 @@ export declare function useWorkflowEditor({ user, initialData, onSubmit, cohortI
268
440
  containerRef: import("react").RefObject<HTMLFormElement>;
269
441
  setError: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
270
442
  setArrows: import("react").Dispatch<import("react").SetStateAction<ArrowObject[]>>;
271
- setWorkflowNodes: import("react").Dispatch<import("react").SetStateAction<WorkflowStage[]>>;
443
+ setWorkflowNodes: import("react").Dispatch<import("react").SetStateAction<ApplicantStage[] | WorkflowStage[]>>;
444
+ };
445
+ type ApplicantWorkflowEditorParams = {
446
+ user: UserData;
447
+ initialData?: ApplicantStage[];
448
+ onSubmit: (e: {
449
+ workflow: ApplicantStage[];
450
+ includedFiles: string[];
451
+ includedForms: string[];
452
+ }) => void;
453
+ workflowId?: string;
454
+ product?: Products;
455
+ oId?: string;
456
+ };
457
+ export declare function useApplicantWorkflowEditor({ user, initialData, onSubmit, workflowId }: ApplicantWorkflowEditorParams): {
458
+ filePopupActive: boolean;
459
+ uploadFile: (files: any[]) => Promise<void>;
460
+ addNode: ({ userType, nextStage, prevStage }?: {
461
+ userType?: "Students" | "Staff";
462
+ nextStage?: number;
463
+ prevStage?: number;
464
+ }) => number;
465
+ onDelete: (id?: number) => Promise<void>;
466
+ arrows: ArrowObject[];
467
+ onChange: (path: (string | number)[], value: unknown) => void;
468
+ error: string | undefined;
469
+ includedFiles: string[];
470
+ onMoveEnd: (id: number, currentRef?: HTMLDivElement) => void;
471
+ addEdgePoint: (id: number, existingEdgePoint: number) => void;
472
+ newEdgePoint: number | undefined;
473
+ setTutorialActive: import("react").Dispatch<import("react").SetStateAction<boolean>>;
474
+ setFilePopupActive: import("react").Dispatch<import("react").SetStateAction<boolean>>;
475
+ includedForms: string[];
476
+ submitWorkflow: (workflow?: ApplicantStage[], callOnComplete?: boolean) => Promise<false | void>;
477
+ openPopup: () => void;
478
+ snackbar: string | undefined;
479
+ setSnackbar: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
480
+ setMousePosFunc: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
481
+ mousePos: {
482
+ x: number;
483
+ y: number;
484
+ } | undefined;
485
+ tutorialActive: boolean;
486
+ onDeleteArrow: (data: ArrowObject) => void;
487
+ workflowNodes: ApplicantStage[];
488
+ containerRef: import("react").RefObject<HTMLFormElement>;
489
+ setError: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
490
+ setArrows: import("react").Dispatch<import("react").SetStateAction<ArrowObject[]>>;
491
+ setWorkflowNodes: import("react").Dispatch<import("react").SetStateAction<ApplicantStage[]>>;
272
492
  };
273
493
  type InstitutePlacementListingUploadParams = {
274
494
  user: UserData;
@@ -293,4 +513,240 @@ export declare function useInstitutePlacementListingHandler({ user }: InstituteP
293
513
  } | undefined;
294
514
  onChange: () => void;
295
515
  };
516
+ export declare function useGetIndividualPlacementForPlacementPage({ user, placementId, organisation }: {
517
+ user: UserData;
518
+ placementId: string;
519
+ organisation?: {
520
+ details: InstituteData | ProviderData;
521
+ cohorts: {
522
+ [key: string]: CohortData;
523
+ };
524
+ };
525
+ }): {
526
+ placement: StudentPlacementData | undefined;
527
+ wStage: WorkflowStage | undefined;
528
+ student: UserData | undefined;
529
+ workflow: WorkflowStage[] | undefined;
530
+ editable: boolean;
531
+ withdrawFromPlacementPopup: boolean;
532
+ addOnboardingDocsPopup: boolean;
533
+ setAddOnboardingDocsPopup: import("react").Dispatch<import("react").SetStateAction<boolean>>;
534
+ dismissOnboardingPopup: boolean;
535
+ setDismissOnboardingPopup: import("react").Dispatch<import("react").SetStateAction<boolean>>;
536
+ setWithdrawFromPlacementPopup: import("react").Dispatch<import("react").SetStateAction<boolean>>;
537
+ withdrawFromPlacement: () => Promise<void>;
538
+ onFlagClick: (e: FlagCodes, onClose?: boolean) => Promise<void>;
539
+ setUploadInsurance: import("react").Dispatch<import("react").SetStateAction<boolean>>;
540
+ setUploadProviderDocPopup: import("react").Dispatch<import("react").SetStateAction<"insurance" | "riskAssessment" | "DbsCheck" | undefined>>;
541
+ setUploadRA: import("react").Dispatch<import("react").SetStateAction<boolean>>;
542
+ setUploadDBS: import("react").Dispatch<import("react").SetStateAction<boolean>>;
543
+ onboardingStatus: "Add onboarding documents" | "Onboarding sent" | "Onboarding docs completed" | "Onboarding docs approved" | "Complete onboarding";
544
+ setSkipStagePopup: import("react").Dispatch<import("react").SetStateAction<boolean>>;
545
+ onboardingPopup: boolean;
546
+ setViewExternalLinkPopup: import("react").Dispatch<import("react").SetStateAction<boolean>>;
547
+ setOnboardingPopup: import("react").Dispatch<import("react").SetStateAction<boolean>>;
548
+ setRejectELIPopup: import("react").Dispatch<import("react").SetStateAction<boolean>>;
549
+ eliURL: string;
550
+ riskAssessmentURL: string;
551
+ dbsCheckURL: string;
552
+ setExternalLinkCopied: import("react").Dispatch<import("react").SetStateAction<boolean>>;
553
+ skipStagePopup: boolean;
554
+ snackbar: {
555
+ open: boolean;
556
+ message?: string;
557
+ };
558
+ setSnackbar: import("react").Dispatch<import("react").SetStateAction<{
559
+ open: boolean;
560
+ message?: string;
561
+ }>>;
562
+ cohort: CohortData | undefined;
563
+ disableEmail: {
564
+ parent: boolean;
565
+ provider: boolean;
566
+ };
567
+ rejectELIPopup: boolean;
568
+ eliPopupOpen: boolean;
569
+ rejectExternalDocPopup: false | "riskAssessment" | "dbsCheck";
570
+ externalDocPopupOpen: false | "riskAssessment" | "dbsCheck";
571
+ viewExternalLinkPopup: boolean;
572
+ externalLinkCopied: boolean;
573
+ uploadInsurance: boolean;
574
+ uploadRA: boolean;
575
+ uploadDBS: boolean;
576
+ editStage: (nextStageId: number) => Promise<void>;
577
+ sendEmail: (type: "provider" | "parent") => undefined;
578
+ canEdit: boolean;
579
+ approveELI: () => Promise<void>;
580
+ setEliPopupOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
581
+ uploadProviderDocPopup: "insurance" | "riskAssessment" | "DbsCheck" | undefined;
582
+ rejectELI: ({ reason }: {
583
+ reason: string;
584
+ }) => Promise<void>;
585
+ setRejectExternalDocPopup: import("react").Dispatch<import("react").SetStateAction<false | "riskAssessment" | "dbsCheck">>;
586
+ setExternalDocPopupOpen: import("react").Dispatch<import("react").SetStateAction<false | "riskAssessment" | "dbsCheck">>;
587
+ approveProviderDoc: (type: "riskAssessment" | "dbsCheck") => Promise<void>;
588
+ rejectProviderDoc: ({ reason }: {
589
+ reason: string;
590
+ }, type: "riskAssessment" | "dbsCheck") => Promise<void>;
591
+ manuallyConfigureProvider: () => Promise<void>;
592
+ institute: InstituteData | undefined;
593
+ };
594
+ export declare function useOnboardingPopup({ onboarding, providerId, placementId, user, onClose }: {
595
+ onboarding: (OnboardingDocs & {
596
+ completed: {
597
+ submitted: boolean;
598
+ submittedDate?: string;
599
+ accepted?: boolean;
600
+ filesViewed?: string[];
601
+ formsCompleted?: {
602
+ [key: string]: unknown;
603
+ };
604
+ filesUploaded?: {
605
+ [key: number]: string[];
606
+ };
607
+ };
608
+ });
609
+ placementId: string;
610
+ user: UserData;
611
+ providerId: string;
612
+ onClose: () => void;
613
+ }): {
614
+ addFile: (files: string[]) => void;
615
+ viewFile: (file: string, onOpen: (url: string) => void) => void;
616
+ uploadedFiles: {
617
+ [key: string]: FileItem;
618
+ };
619
+ setFormComplete: (e: {
620
+ [key: string]: unknown;
621
+ }, formId?: string) => void;
622
+ setRejectPopup: import("react").Dispatch<import("react").SetStateAction<boolean>>;
623
+ stagesCompleted: () => boolean;
624
+ setForm: import("react").Dispatch<import("react").SetStateAction<{
625
+ [key: string]: unknown;
626
+ id: string;
627
+ name: string;
628
+ } | undefined>>;
629
+ mOnboarding: OnboardingDocs & {
630
+ completed: {
631
+ submitted: boolean;
632
+ submittedDate?: string;
633
+ accepted?: boolean;
634
+ filesViewed?: string[];
635
+ formsCompleted?: {
636
+ [key: string]: unknown;
637
+ };
638
+ filesUploaded?: {
639
+ [key: number]: string[];
640
+ };
641
+ };
642
+ };
643
+ form: {
644
+ [key: string]: unknown;
645
+ id: string;
646
+ name: string;
647
+ } | undefined;
648
+ submit: () => Promise<void>;
649
+ acceptOnboarding: () => Promise<void>;
650
+ rejectOnboarding: ({ reason }: {
651
+ reason: string;
652
+ }) => Promise<void>;
653
+ rejectPopup: boolean;
654
+ completedSections: {
655
+ submitted: boolean;
656
+ submittedDate?: string;
657
+ filesViewed?: string[] | undefined;
658
+ formsCompleted?: {
659
+ [key: string]: unknown;
660
+ } | undefined;
661
+ filesUploaded?: {
662
+ [key: number]: string[];
663
+ } | undefined;
664
+ } | undefined;
665
+ fileUploadPopup: number | false;
666
+ setFileUploadPopup: import("react").Dispatch<import("react").SetStateAction<number | false>>;
667
+ viewableFiles: {
668
+ [key: string]: FileItem;
669
+ } | undefined;
670
+ formDetails: {
671
+ [key: string]: {
672
+ name: string;
673
+ id: string;
674
+ description?: string;
675
+ product: Products;
676
+ oId: string;
677
+ form: CustomFormSchema;
678
+ };
679
+ };
680
+ };
681
+ export declare function useLoadAddresses(user: UserData, limitItems?: number, queryConstraint?: QueryConstraint[]): {
682
+ addresses: {
683
+ [key: string]: OrganisationAddress;
684
+ };
685
+ onScrollBottom: () => void;
686
+ loading: boolean;
687
+ changeQueryConstraints: (e: QueryConstraint[]) => void;
688
+ };
689
+ export declare function useLoadListings(user: UserData, queryConstraint?: QueryConstraint[]): {
690
+ listings: [string, PlacementListing & {
691
+ applicants?: number;
692
+ scheduled?: number;
693
+ active?: number;
694
+ }][];
695
+ onScrollBottom: () => void;
696
+ loading: boolean;
697
+ changeQueryConstraints: (e: QueryConstraint[]) => void;
698
+ };
699
+ export declare function useLoadApplications({ user, applicationType, listingId, queryConstraint }: {
700
+ user: UserData;
701
+ applicationType?: "all" | "actionRequired" | "awaitingStudent" | "closed";
702
+ listingId?: string;
703
+ queryConstraint?: QueryConstraint[];
704
+ }): {
705
+ applications: [string, Application][];
706
+ type: "all" | "closed" | "actionRequired" | "awaitingStudent";
707
+ setType: import("react").Dispatch<import("react").SetStateAction<"all" | "closed" | "actionRequired" | "awaitingStudent">>;
708
+ onScrollBottom: () => void;
709
+ loading: boolean;
710
+ changeQueryConstraints: (e: QueryConstraint[]) => void;
711
+ };
712
+ type ViewType = 'list' | 'table';
713
+ export interface UseFirestoreQueryProps {
714
+ path?: string | string[];
715
+ constraints?: QueryConstraint[];
716
+ view: ViewType;
717
+ limit: number;
718
+ formatItems?: (key: string, item: any) => Promise<{
719
+ key: string;
720
+ item: any;
721
+ }> | {
722
+ key: string;
723
+ item: any;
724
+ };
725
+ snapshot?: boolean;
726
+ filters?: {
727
+ [key: string]: any;
728
+ };
729
+ search?: string;
730
+ onSearch?: (search: string, page: number, limit: number) => Promise<{
731
+ [key: string]: any;
732
+ }>;
733
+ data?: {
734
+ [key: string]: any;
735
+ };
736
+ }
737
+ export interface UseFirestoreQueryReturn {
738
+ data: {
739
+ [key: string]: any;
740
+ };
741
+ loading: boolean | 'loaded';
742
+ pageUp: () => void;
743
+ pageDown?: () => void;
744
+ setQueries: (newConstraints: QueryConstraint[]) => void;
745
+ reset: () => void;
746
+ setFilters: (newFilters: {
747
+ [key: string]: any;
748
+ }) => void;
749
+ setSearch: (search: string) => void;
750
+ }
751
+ export declare const useFirestoreQuery: (firebaseQuery: FirebaseQuery, props: UseFirestoreQueryProps) => UseFirestoreQueryReturn;
296
752
  export {};