@appcorp/fusion-storybook 0.4.39 → 0.4.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base-modules/bulk-operations/constants.d.ts +12 -0
- package/base-modules/bulk-operations/constants.js +20 -0
- package/base-modules/bulk-operations/context.d.ts +172 -0
- package/base-modules/bulk-operations/context.js +283 -0
- package/base-modules/bulk-operations/filter.d.ts +1 -0
- package/base-modules/bulk-operations/filter.js +31 -0
- package/base-modules/bulk-operations/page.d.ts +33 -0
- package/base-modules/bulk-operations/page.js +144 -0
- package/base-modules/bulk-operations/view.d.ts +1 -0
- package/base-modules/bulk-operations/view.js +35 -0
- package/constants.d.ts +4 -0
- package/constants.js +4 -0
- package/package.json +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/bulk-operations.d.ts +48 -0
- package/types/bulk-operations.js +8 -0
- package/types/index.d.ts +1 -0
- package/types/index.js +1 -0
- package/utils/resolve-rbac-permissions.js +10 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript Types — Bulk Operations
|
|
3
|
+
*
|
|
4
|
+
* Read-only view of the Redis-backed bulk job records written by the fusion-api
|
|
5
|
+
* enqueue routes (storeQueuedStatus) and fusion-worker (storeJobStatus) under
|
|
6
|
+
* the key `fw:bulk:job:{jobId}`.
|
|
7
|
+
*/
|
|
8
|
+
export type BulkJobStatus = "queued" | "running" | "completed" | "failed";
|
|
9
|
+
export interface BulkJobError {
|
|
10
|
+
row: number;
|
|
11
|
+
studentProfileId?: string;
|
|
12
|
+
error: string;
|
|
13
|
+
}
|
|
14
|
+
export interface BulkJobStudentFee {
|
|
15
|
+
id?: string;
|
|
16
|
+
studentProfileId: string;
|
|
17
|
+
feeStructureId?: string;
|
|
18
|
+
feeCode?: string;
|
|
19
|
+
dueDate?: string;
|
|
20
|
+
amount?: number;
|
|
21
|
+
}
|
|
22
|
+
export interface BulkJobResults {
|
|
23
|
+
total?: number;
|
|
24
|
+
created?: number;
|
|
25
|
+
updated?: number;
|
|
26
|
+
skipped?: number;
|
|
27
|
+
errors?: BulkJobError[];
|
|
28
|
+
studentFees?: BulkJobStudentFee[];
|
|
29
|
+
}
|
|
30
|
+
export interface BulkJobRecord {
|
|
31
|
+
jobId: string;
|
|
32
|
+
schoolId: string;
|
|
33
|
+
type: string;
|
|
34
|
+
status: BulkJobStatus;
|
|
35
|
+
webhookUrl: string | null;
|
|
36
|
+
total: number;
|
|
37
|
+
processed: number;
|
|
38
|
+
results: BulkJobResults | null;
|
|
39
|
+
createdAt: string;
|
|
40
|
+
updatedAt: string;
|
|
41
|
+
}
|
|
42
|
+
export interface BulkOperationsListResponse {
|
|
43
|
+
items: BulkJobRecord[];
|
|
44
|
+
count: number;
|
|
45
|
+
currentPage: number;
|
|
46
|
+
pageLimit: number;
|
|
47
|
+
types: string[];
|
|
48
|
+
}
|
package/types/index.d.ts
CHANGED
package/types/index.js
CHANGED
|
@@ -237,6 +237,16 @@ export function resolveRbacPermissions({ userRole, moduleName, }) {
|
|
|
237
237
|
[USER_ROLE.PARENT]: false,
|
|
238
238
|
}[userRole] || false);
|
|
239
239
|
}
|
|
240
|
+
if (moduleName === "Bulk Operations") {
|
|
241
|
+
return ({
|
|
242
|
+
[USER_ROLE.SUPER_ADMIN]: true,
|
|
243
|
+
[USER_ROLE.SCHOOL_ADMIN]: true,
|
|
244
|
+
[USER_ROLE.STAFF]: true,
|
|
245
|
+
[USER_ROLE.TEACHER]: false,
|
|
246
|
+
[USER_ROLE.STUDENT]: false,
|
|
247
|
+
[USER_ROLE.PARENT]: false,
|
|
248
|
+
}[userRole] || false);
|
|
249
|
+
}
|
|
240
250
|
if (moduleName === "Reports") {
|
|
241
251
|
return ({
|
|
242
252
|
[USER_ROLE.SUPER_ADMIN]: true,
|