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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ schema = {
2
+ "applications": {
3
+ "participantId": "string",
4
+ "programName": "string",
5
+ "programId": "string",
6
+ "companyCode": "string",
7
+ "submittedAt": "string",
8
+ "beneficiaryName": "string",
9
+ "gender": "string",
10
+ "ageGroup": "string",
11
+ "province": "string",
12
+ "hub": "string",
13
+ "email": "string",
14
+ "motivation": "string",
15
+ "challenges": "string",
16
+ "facebook": "string",
17
+ "instagram": "string",
18
+ "linkedIn": "string",
19
+ "complianceScore": "number",
20
+ "complianceDocuments": "object",
21
+ "aiEvaluation": "object",
22
+ "growthPlanDocUrl": "string",
23
+ "interventions": "object",
24
+ "stage": "string",
25
+ "applicationStatus": "string",
26
+ "$aliases": {
27
+ "status": "applicationStatus",
28
+ "applicantId": "participantId",
29
+ "program": "programName",
30
+ "submissionDate": "submittedAt",
31
+ "name": "beneficiaryName",
32
+ "region": "province",
33
+ "location": "hub",
34
+ "documents": "complianceDocuments",
35
+ "evaluation": "aiEvaluation",
36
+ "currentStage": "stage",
37
+ },
38
+ },
39
+ "assignedInterventions": {
40
+ "id": "string",
41
+ "participantId": "string",
42
+ "beneficiaryName": "string",
43
+ "consultantId": "string",
44
+ "consultantName": "string",
45
+ "interventionId": "string",
46
+ "interventionTitle": "string",
47
+ "type": "string",
48
+ "targetType": "string",
49
+ "targetValue": "string",
50
+ "targetMetric": ["string", "object"],
51
+ "dueDate": "object",
52
+ "userStatus": "string",
53
+ "consultantStatus": "string",
54
+ "userCompletionStatus": "string",
55
+ "consultantCompletionStatus": "string",
56
+ "operationsCompletionStatus": "string",
57
+ "createdAt": "object",
58
+ "updatedAt": ["object", "string"],
59
+ "notes": "string",
60
+ "feedback": "object",
61
+ "resources": "object",
62
+ "timeSpent": "number",
63
+ "progress": "number",
64
+ "status": "string",
65
+ "rejectionReason": "string",
66
+ "$aliases": {
67
+ "state": "status",
68
+ "assignmentId": "id",
69
+ "userId": "participantId",
70
+ "clientName": "beneficiaryName",
71
+ "advisorId": "consultantId",
72
+ "advisorName": "consultantName",
73
+ "taskId": "interventionId",
74
+ "taskTitle": "interventionTitle",
75
+ "deadline": "dueDate",
76
+ "clientStatus": "userStatus",
77
+ "advisorStatus": "consultantStatus",
78
+ "completionStatus": "userCompletionStatus",
79
+ "advisorCompletionStatus": "consultantCompletionStatus",
80
+ "opsStatus": "operationsCompletionStatus",
81
+ "modifiedAt": "updatedAt",
82
+ "comments": "notes",
83
+ "duration": "timeSpent",
84
+ },
85
+ },
86
+ "branches": {
87
+ "name": "string",
88
+ "code": "string",
89
+ "companyCode": "string",
90
+ "location": "object",
91
+ "contact": "object",
92
+ "status": "string",
93
+ "capacity": "object",
94
+ "isActive": "boolean",
95
+ "createdBy": "string",
96
+ "createdAt": "object",
97
+ "updatedAt": "object",
98
+ "$aliases": {
99
+ "branchName": "name",
100
+ "branchCode": "code",
101
+ "orgCode": "companyCode",
102
+ "address": "location",
103
+ "contactInfo": "contact",
104
+ "active": "isActive",
105
+ "creator": "createdBy",
106
+ "establishedAt": "createdAt",
107
+ "modifiedAt": "updatedAt",
108
+ },
109
+ },
110
+ "consultants": {
111
+ "name": "string",
112
+ "email": "string",
113
+ "expertise": "object",
114
+ "rate": "string",
115
+ "assignmentsCount": "number",
116
+ "rating": "number",
117
+ "active": "boolean",
118
+ "authUid": "string",
119
+ "companyCode": "string",
120
+ "createdAt": "string",
121
+ "$aliases": {
122
+ "consultantName": "name",
123
+ "hourlyRate": "rate",
124
+ "tasksCount": "assignmentsCount",
125
+ "score": "rating",
126
+ "isActive": "active",
127
+ "userId": "authUid",
128
+ "orgCode": "companyCode",
129
+ "joinedAt": "createdAt",
130
+ "skills": "expertise",
131
+ },
132
+ },
133
+ "departments": {
134
+ "id": "string",
135
+ "name": "string",
136
+ "isMain": "boolean",
137
+ "companyCode": "string",
138
+ "createdAt": ["object", "string"],
139
+ "departmentId": "string",
140
+ "$aliases": {
141
+ "deptId": "id",
142
+ "deptName": "name",
143
+ "primary": "isMain",
144
+ "orgCode": "companyCode",
145
+ "establishedAt": "createdAt",
146
+ "internalId": "departmentId",
147
+ },
148
+ },
149
+ "events": {
150
+ "id": "string",
151
+ "title": "string",
152
+ "date": "string",
153
+ "time": ["string", "object"],
154
+ "type": "string",
155
+ "createdAt": "object",
156
+ "$aliases": {
157
+ "eventId": "id",
158
+ "name": "title",
159
+ "eventDate": "date",
160
+ "eventTime": "time",
161
+ "eventType": "type",
162
+ "scheduledAt": "createdAt",
163
+ },
164
+ },
165
+ "expenseTypes": {
166
+ "name": "string",
167
+ "budget": "number",
168
+ "companyCode": "string",
169
+ "createdAt": "string",
170
+ "$aliases": {
171
+ "expenseCategory": "name",
172
+ "allocatedAmount": "budget",
173
+ "orgCode": "companyCode",
174
+ "addedAt": "createdAt",
175
+ },
176
+ },
177
+ "feedbacks": {
178
+ "participantId": "string",
179
+ "smeName": "string",
180
+ "consultantId": "string",
181
+ "interventionTitle": "string",
182
+ "comment": "string",
183
+ "createdAt": "object",
184
+ "$aliases": {
185
+ "userId": "participantId",
186
+ "expertName": "smeName",
187
+ "advisorId": "consultantId",
188
+ "taskTitle": "interventionTitle",
189
+ "feedbackText": "comment",
190
+ "submittedAt": "createdAt",
191
+ },
192
+ },
193
+ "financial_statements": {
194
+ "statement_type": "string",
195
+ "start_date": "string",
196
+ "end_date": "string",
197
+ "report": "string",
198
+ "business_id": "string",
199
+ "created_at": "object",
200
+ "$aliases": {
201
+ "type": "statement_type",
202
+ "from_date": "start_date",
203
+ "to_date": "end_date",
204
+ "document": "report",
205
+ "company_id": "business_id",
206
+ "generated_at": "created_at",
207
+ },
208
+ },
209
+ "interventionRequests": {
210
+ "participantId": "string",
211
+ "areaOfSupport": "string",
212
+ "interventionTitle": "string",
213
+ "reason": "string",
214
+ "status": "string",
215
+ "createdAt": "object",
216
+ "$aliases": {
217
+ "state": "status",
218
+ "userId": "participantId",
219
+ "supportArea": "areaOfSupport",
220
+ "requestTitle": "interventionTitle",
221
+ "justification": "reason",
222
+ "requestedAt": "createdAt",
223
+ },
224
+ },
225
+ "interventions": {
226
+ "interventionTitle": "string",
227
+ "areaOfSupport": "string",
228
+ "id": "string",
229
+ "companyCode": "string",
230
+ "createdAt": "string",
231
+ "departmentName": "string",
232
+ "departmentId": "string",
233
+ "isCompulsory": "string",
234
+ "isRecurring": "string",
235
+ "$aliases": {
236
+ "title": "interventionTitle",
237
+ "supportType": "areaOfSupport",
238
+ "interventionId": "id",
239
+ "orgCode": "companyCode",
240
+ "addedAt": "createdAt",
241
+ "deptName": "departmentName",
242
+ "deptId": "departmentId",
243
+ "required": "isCompulsory",
244
+ "repeating": "isRecurring",
245
+ },
246
+ },
247
+ "interventionsDatabase": {
248
+ "programId": "string",
249
+ "companyCode": "string",
250
+ "interventionId": "string",
251
+ "interventionTitle": "string",
252
+ "areaOfSupport": "string",
253
+ "participantId": "string",
254
+ "beneficiaryName": "string",
255
+ "hub": "string",
256
+ "province": "string",
257
+ "quarter": "string",
258
+ "consultantId": ["string", "object"],
259
+ "consultantIds": "object",
260
+ "timeSpent": ["number", "object"],
261
+ "interventionType": "string",
262
+ "targetMetric": ["string", "object"],
263
+ "targetType": "string",
264
+ "targetValue": ["string", "number"],
265
+ "confirmedAt": "object",
266
+ "createdAt": "object",
267
+ "updatedAt": "object",
268
+ "interventionKey": "string",
269
+ "resources": "object",
270
+ "$aliases": {
271
+ "projectId": "programId",
272
+ "orgCode": "companyCode",
273
+ "taskId": "interventionId",
274
+ "title": "interventionTitle",
275
+ "supportArea": "areaOfSupport",
276
+ "userId": "participantId",
277
+ "clientName": "beneficiaryName",
278
+ "location": "hub",
279
+ "region": "province",
280
+ "period": "quarter",
281
+ "advisorId": "consultantId",
282
+ "advisorIds": "consultantIds",
283
+ "duration": "timeSpent",
284
+ "taskType": "interventionType",
285
+ "metric": "targetMetric",
286
+ "goalType": "targetType",
287
+ "goalValue": "targetValue",
288
+ "approvedAt": "confirmedAt",
289
+ "addedAt": "createdAt",
290
+ "modifiedAt": "updatedAt",
291
+ "uniqueKey": "interventionKey",
292
+ "materials": "resources",
293
+ },
294
+ },
295
+ "kpiDefinitions": {
296
+ "id": "string",
297
+ "department": "string",
298
+ "kpiLabel": "string",
299
+ "unit": "string",
300
+ "target": "number",
301
+ "manualTags": "object",
302
+ "metrics": "object",
303
+ "category": "string",
304
+ "createdAt": "object",
305
+ "active": "boolean",
306
+ "$aliases": {
307
+ "kpiId": "id",
308
+ "dept": "department",
309
+ "name": "kpiLabel",
310
+ "measurement": "unit",
311
+ "goal": "target",
312
+ "tags": "manualTags",
313
+ "dimensions": "metrics",
314
+ "type": "category",
315
+ "addedAt": "createdAt",
316
+ "isActive": "active",
317
+ },
318
+ },
319
+ "kpiEntries": {
320
+ "kpiId": "string",
321
+ "department": "string",
322
+ "reportMonth": "string",
323
+ "value": "number",
324
+ "unit": "string",
325
+ "kpiLabel": "string",
326
+ "tags": "object",
327
+ "createdAt": "object",
328
+ "submittedBy": "string",
329
+ "$aliases": {
330
+ "metricId": "kpiId",
331
+ "dept": "department",
332
+ "month": "reportMonth",
333
+ "amount": "value",
334
+ "measurement": "unit",
335
+ "name": "kpiLabel",
336
+ "categories": "tags",
337
+ "recordedAt": "createdAt",
338
+ "reporter": "submittedBy",
339
+ },
340
+ },
341
+ "programs": {
342
+ "name": "string",
343
+ "type": "string",
344
+ "cohortYear": "string",
345
+ "assignedAdmin": ["string", "object"],
346
+ "id": "string",
347
+ "companyCode": "string",
348
+ "onboardingQuestions": "object",
349
+ "registrationLink": "string",
350
+ "endDate": "object",
351
+ "maxCapacity": "number",
352
+ "startDate": "object",
353
+ "status": "string",
354
+ "eligibilityCriteria": "object",
355
+ "budget": "number",
356
+ "description": "string",
357
+ "$aliases": {
358
+ "state": "status",
359
+ "programName": "name",
360
+ "programType": "type",
361
+ "batchYear": "cohortYear",
362
+ "admin": "assignedAdmin",
363
+ "programId": "id",
364
+ "orgCode": "companyCode",
365
+ "questions": "onboardingQuestions",
366
+ "regLink": "registrationLink",
367
+ "completionDate": "endDate",
368
+ "capacity": "maxCapacity",
369
+ "launchDate": "startDate",
370
+ "requirements": "eligibilityCriteria",
371
+ "funding": "budget",
372
+ "overview": "description",
373
+ },
374
+ },
375
+ "logs": {
376
+ "id": "string",
377
+ "action": "string",
378
+ "actorId": "string",
379
+ "actorRole": "string",
380
+ "message": "string",
381
+ "collection": "string",
382
+ "docId": "string",
383
+ "timestamp": "object",
384
+ "$aliases": {
385
+ "logId": "id",
386
+ "operation": "action",
387
+ "userId": "actorId",
388
+ "userRole": "actorRole",
389
+ "logMessage": "message",
390
+ "table": "collection",
391
+ "documentId": "docId",
392
+ "createdAt": "timestamp",
393
+ "eventTime": "timestamp",
394
+ "recordedAt": "timestamp",
395
+ },
396
+ },
397
+ "notifications": {
398
+ "id": "string",
399
+ "participantId": "string",
400
+ "consultantId": "string",
401
+ "interventionId": "string",
402
+ "interventionTitle": "string",
403
+ "type": "string",
404
+ "recipientRoles": "object",
405
+ "message": "object",
406
+ "createdAt": "object",
407
+ "readBy": "object",
408
+ "$aliases": {
409
+ "notificationId": "id",
410
+ "userId": "participantId",
411
+ "advisorId": "consultantId",
412
+ "taskId": "interventionId",
413
+ "taskTitle": "interventionTitle",
414
+ "notificationType": "type",
415
+ "audience": "recipientRoles",
416
+ "content": "message",
417
+ "sentAt": "createdAt",
418
+ "readReceipts": "readBy",
419
+ "acknowledgedBy": "readBy",
420
+ },
421
+ },
422
+ "operationsStaff": {
423
+ "email": "string",
424
+ "name": "string",
425
+ "gender": "string",
426
+ "phone": "string",
427
+ "companyCode": "string",
428
+ "$aliases": {
429
+ "staffEmail": "email",
430
+ "staffName": "name",
431
+ "contactNumber": "phone",
432
+ "orgCode": "companyCode",
433
+ "sex": "gender",
434
+ "mobile": "phone",
435
+ "employeeName": "name",
436
+ },
437
+ },
438
+ "participants": {
439
+ "participantName": "string",
440
+ "email": "string",
441
+ "beneficiaryName": "string",
442
+ "gender": "string",
443
+ "idNumber": "string",
444
+ "phone": "string",
445
+ "sector": "string",
446
+ "natureOfBusiness": "string",
447
+ "beeLevel": "number",
448
+ "youthOwnedPercent": "number",
449
+ "femaleOwnedPercent": "number",
450
+ "blackOwnedPercent": "number",
451
+ "dateOfRegistration": "object",
452
+ "yearsOfTrading": "number",
453
+ "registrationNumber": "string",
454
+ "businessAddress": "string",
455
+ "city": "string",
456
+ "postalCode": "string",
457
+ "province": "string",
458
+ "hub": "string",
459
+ "location": "string",
460
+ "revenueHistory": "object",
461
+ "headcountHistory": "object",
462
+ "setup": "boolean",
463
+ "updatedAt": "object",
464
+ "logoUrl": "string",
465
+ "$aliases": {
466
+ "name": "participantName",
467
+ "contactEmail": "email",
468
+ "clientName": "beneficiaryName",
469
+ "sex": "gender",
470
+ "identification": "idNumber",
471
+ "mobile": "phone",
472
+ "industry": "sector",
473
+ "businessType": "natureOfBusiness",
474
+ "BEE": "beeLevel",
475
+ "youthOwnership": "youthOwnedPercent",
476
+ "femaleOwnership": "femaleOwnedPercent",
477
+ "blackOwnership": "blackOwnedPercent",
478
+ "regDate": "dateOfRegistration",
479
+ "experience": "yearsOfTrading",
480
+ "regNo": "registrationNumber",
481
+ "address": "businessAddress",
482
+ "town": "city",
483
+ "zipCode": "postalCode",
484
+ "region": "province",
485
+ "center": "hub",
486
+ "coordinates": "location",
487
+ "financials": "revenueHistory",
488
+ "staffing": "headcountHistory",
489
+ "isConfigured": "setup",
490
+ "modifiedAt": "updatedAt",
491
+ "logo": "logoUrl",
492
+ "avatar": "logoUrl",
493
+ },
494
+ },
495
+ "programExpenses": {
496
+ "programId": "string",
497
+ "expenseType": "string",
498
+ "amount": "number",
499
+ "createdAt": "string",
500
+ "$aliases": {
501
+ "projectId": "programId",
502
+ "category": "expenseType",
503
+ "cost": "amount",
504
+ "recordedAt": "createdAt",
505
+ "spentAt": "createdAt",
506
+ "value": "amount",
507
+ "expenseCategory": "expenseType",
508
+ },
509
+ },
510
+ "resourceAllocations": {
511
+ "id": "string",
512
+ "resourceId": "string",
513
+ "allocatedTo": "string",
514
+ "purpose": "string",
515
+ "startTime": "object",
516
+ "endTime": "object",
517
+ "quantity": "number",
518
+ "status": "string",
519
+ "$aliases": {
520
+ "allocationId": "id",
521
+ "assetId": "resourceId",
522
+ "assignedTo": "allocatedTo",
523
+ "reason": "purpose",
524
+ "begin": "startTime",
525
+ "finish": "endTime",
526
+ "amount": "quantity",
527
+ "state": "status",
528
+ "allocationStart": "startTime",
529
+ "allocationEnd": "endTime",
530
+ "qty": "quantity",
531
+ "currentStatus": "status",
532
+ },
533
+ },
534
+ "supportPrograms": {
535
+ "participantId": "string",
536
+ "programName": "string",
537
+ "programType": "string",
538
+ "startDate": "object",
539
+ "endDate": "object",
540
+ "description": "string",
541
+ "budget": "number",
542
+ "status": "string",
543
+ "outcomes": "object",
544
+ "createdBy": "string",
545
+ "createdAt": "object",
546
+ "$aliases": {
547
+ "state": "status",
548
+ "userId": "participantId",
549
+ "name": "programName",
550
+ "type": "programType",
551
+ "launchDate": "startDate",
552
+ "completionDate": "endDate",
553
+ "overview": "description",
554
+ "funding": "budget",
555
+ "results": "outcomes",
556
+ "initiator": "createdBy",
557
+ "establishedAt": "createdAt",
558
+ "clientId": "participantId",
559
+ "programBudget": "budget",
560
+ },
561
+ },
562
+ "tasks": {
563
+ "id": "string",
564
+ "title": "string",
565
+ "dueDate": "object",
566
+ "priority": "string",
567
+ "status": "string",
568
+ "createdAt": "object",
569
+ "assignedRole": "string",
570
+ "assignedTo": "string",
571
+ "department": "object",
572
+ "companyCode": "string",
573
+ "$aliases": {
574
+ "state": "status",
575
+ "taskId": "id",
576
+ "name": "title",
577
+ "deadline": "dueDate",
578
+ "importance": "priority",
579
+ "createdAt": "createdAt",
580
+ "role": "assignedRole",
581
+ "assignee": "assignedTo",
582
+ "dept": "department",
583
+ "orgCode": "companyCode",
584
+ "currentStatus": "status",
585
+ "targetDate": "dueDate",
586
+ "owner": "assignedTo",
587
+ },
588
+ },
589
+ "transactions": {
590
+ "Customer_name": "string",
591
+ "City": "string",
592
+ "Amount": "number",
593
+ "Type": "string",
594
+ "Date": "object",
595
+ "business_id": "string",
596
+ "Category_of_expense": "string",
597
+ "Description": "string",
598
+ "$aliases": {
599
+ "clientName": "Customer_name",
600
+ "location": "City",
601
+ "value": "Amount",
602
+ "transactionType": "Type",
603
+ "transactionDate": "Date",
604
+ "companyId": "business_id",
605
+ "expenseCategory": "Category_of_expense",
606
+ "details": "Description",
607
+ "customer": "Customer_name",
608
+ "town": "City",
609
+ "sum": "Amount",
610
+ "txnType": "Type",
611
+ "recordedAt": "Date",
612
+ "merchantId": "business_id",
613
+ "category": "Category_of_expense",
614
+ "notes": "Description",
615
+ },
616
+ },
617
+ "users": {
618
+ "uid": "string",
619
+ "name": "string",
620
+ "email": "string",
621
+ "role": "string",
622
+ "companyCode": "string",
623
+ "createdAt": "string",
624
+ "$aliases": {
625
+ "userId": "uid",
626
+ "username": "name",
627
+ "userEmail": "email",
628
+ "permissionLevel": "role",
629
+ "orgCode": "companyCode",
630
+ "registeredAt": "createdAt",
631
+ "displayName": "name",
632
+ "authId": "uid",
633
+ "accessLevel": "role",
634
+ "joinedAt": "createdAt",
635
+ },
636
+ },
637
+ }