@appcorp/fusion-storybook 0.2.81 → 0.2.82

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.
@@ -1,5 +1,255 @@
1
1
  "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { downloadFromUrl } from "@react-pakistan/util-functions";
4
+ import { showErrorToast, showSuccessToast, showInfoToast, } from "@appcorp/shadcn/lib/toast-utils";
5
+ import { getCachedWorkspaceSync } from "../workspace/cache";
6
+ import converter from "json-2-csv";
7
+ import { Timeline } from "../../components/timeline";
8
+ import { useTranslations } from "next-intl";
9
+ import { pageLimit } from "./constants";
10
+ import { FAMILY_API_ROUTES } from "../../constants";
11
+ import { FAMILY_ACTION_TYPES, useFamilyContext } from "./context";
12
+ import { useRef, useEffect, useCallback } from "react";
13
+ const workspace = getCachedWorkspaceSync();
14
+ const POLL_INTERVAL_MS = 2000;
15
+ const POLL_TIMEOUT_MS = 300000;
16
+ const handleGetAllRecords = async (schoolId, pageLimit) => {
17
+ const response = await fetch(`${FAMILY_API_ROUTES.UNIT}?pageLimit=${pageLimit}&currentPage=1&schoolId=${schoolId}`);
18
+ const result = await response.json();
19
+ const csv = await converter.json2csv(result.items || [], {});
20
+ const blob = new Blob([csv], { type: "text/csv;charset=utf-8;" });
21
+ await downloadFromUrl(blob, "family.csv");
22
+ };
23
+ async function submitBulkJob(csvData, method, signal) {
24
+ var _a;
25
+ const schoolId = ((_a = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _a === void 0 ? void 0 : _a.id) || "";
26
+ if (!schoolId)
27
+ throw new Error("School ID not found");
28
+ const res = await fetch(FAMILY_API_ROUTES.BULK, {
29
+ method,
30
+ headers: {
31
+ "Content-Type": "application/json",
32
+ },
33
+ body: JSON.stringify({ schoolId, csvData }),
34
+ signal,
35
+ });
36
+ if (!res.ok) {
37
+ const errorData = (await res.json().catch(() => ({})));
38
+ throw new Error(errorData.error || `Bulk operation failed with status ${res.status}`);
39
+ }
40
+ const data = (await res.json());
41
+ return data.jobId;
42
+ }
43
+ async function pollBulkJob(jobId, signal, onProgress) {
44
+ const startTime = Date.now();
45
+ let lastProgressToast = 0;
46
+ while (true) {
47
+ if (signal.aborted)
48
+ throw new Error("Polling cancelled");
49
+ if (Date.now() - startTime > POLL_TIMEOUT_MS) {
50
+ throw new Error("Bulk operation timed out");
51
+ }
52
+ await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL_MS));
53
+ if (signal.aborted)
54
+ throw new Error("Polling cancelled");
55
+ const res = await fetch(FAMILY_API_ROUTES.BULK_STATUS(jobId), {
56
+ signal,
57
+ });
58
+ if (!res.ok)
59
+ continue;
60
+ const data = (await res.json());
61
+ if (data.status === "completed" || data.status === "failed") {
62
+ return data;
63
+ }
64
+ if (data.status === "running" && Date.now() - lastProgressToast > 10000) {
65
+ lastProgressToast = Date.now();
66
+ onProgress === null || onProgress === void 0 ? void 0 : onProgress(data.processed, data.total);
67
+ }
68
+ }
69
+ }
70
+ function formatErrorSummary(t, errors) {
71
+ if (!(errors === null || errors === void 0 ? void 0 : errors.length))
72
+ return "";
73
+ const lines = errors
74
+ .slice(0, 5)
75
+ .map((e) => t("messagesBulkRowError", { row: e.row, error: e.error }));
76
+ const remaining = errors.length - 5;
77
+ if (remaining > 0)
78
+ lines.push(t("messagesBulkMoreRows", { count: remaining }));
79
+ return lines.join("\n");
80
+ }
3
81
  export const FamilyMoreActions = () => {
4
- return _jsx("div", { className: "space-y-4", children: "More actions for families" });
82
+ const t = useTranslations("family");
83
+ const { dispatch } = useFamilyContext();
84
+ const abortRef = useRef(null);
85
+ useEffect(() => {
86
+ return () => {
87
+ var _a;
88
+ (_a = abortRef.current) === null || _a === void 0 ? void 0 : _a.abort();
89
+ };
90
+ }, []);
91
+ const handleBulkFlow = useCallback(async (files, method) => {
92
+ var _a, _b, _c, _d, _e, _f;
93
+ const closeDrawer = () => {
94
+ dispatch({
95
+ type: FAMILY_ACTION_TYPES.SET_DRAWER,
96
+ payload: { drawer: null },
97
+ });
98
+ };
99
+ (_a = abortRef.current) === null || _a === void 0 ? void 0 : _a.abort();
100
+ const controller = new AbortController();
101
+ abortRef.current = controller;
102
+ const { signal } = controller;
103
+ const label = method === "POST" ? "create" : "update";
104
+ const file = files[0];
105
+ const text = await file.text();
106
+ const records = converter.csv2json(text);
107
+ if (!Array.isArray(records) || records.length === 0) {
108
+ showErrorToast(t("messagesBulkCsvEmpty"));
109
+ return;
110
+ }
111
+ const validationErrors = [];
112
+ for (let i = 0; i < records.length; i++) {
113
+ const row = records[i];
114
+ const msgs = [];
115
+ if (method === "POST") {
116
+ if (!((_b = row.familyCode) === null || _b === void 0 ? void 0 : _b.trim()))
117
+ msgs.push(t("validationRequiredFamilyCode"));
118
+ }
119
+ else {
120
+ if (!((_c = row.id) === null || _c === void 0 ? void 0 : _c.trim()))
121
+ msgs.push(t("validationRequiredIdForUpdate"));
122
+ }
123
+ if (msgs.length > 0) {
124
+ validationErrors.push({ row: i + 1, messages: msgs });
125
+ }
126
+ }
127
+ if (validationErrors.length > 0) {
128
+ const summary = validationErrors
129
+ .slice(0, 5)
130
+ .map((e) => t("messagesBulkRowError", {
131
+ row: e.row,
132
+ error: e.messages.join("; "),
133
+ }))
134
+ .join("\n");
135
+ showErrorToast(t("messagesBulkValidationFailed", {
136
+ count: validationErrors.length,
137
+ errors: summary,
138
+ }));
139
+ return;
140
+ }
141
+ try {
142
+ showInfoToast(t("messagesBulkJobQueued", { action: label, count: records.length }));
143
+ let jobId;
144
+ try {
145
+ jobId = await submitBulkJob(text, method, signal);
146
+ }
147
+ catch (submitError) {
148
+ showErrorToast(t("messagesBulkJobSubmitFailed", {
149
+ action: label,
150
+ error: submitError instanceof Error
151
+ ? submitError.message
152
+ : t("unknownError"),
153
+ }));
154
+ return;
155
+ }
156
+ const status = await pollBulkJob(jobId, signal, (processed, total) => {
157
+ showInfoToast(t("messagesBulkProgress", { processed, total }));
158
+ });
159
+ if (signal.aborted)
160
+ return;
161
+ if (status.status === "completed") {
162
+ const r = status.results;
163
+ if (r && ((_d = r.errors) === null || _d === void 0 ? void 0 : _d.length) > 0) {
164
+ const summary = formatErrorSummary(t, r.errors);
165
+ showSuccessToast(t("messagesBulkResults", {
166
+ created: r.created,
167
+ updated: r.updated,
168
+ skipped: r.skipped,
169
+ }) +
170
+ "\n" +
171
+ summary);
172
+ }
173
+ else if (r) {
174
+ showSuccessToast(t("messagesBulkResults", {
175
+ created: r.created,
176
+ updated: r.updated,
177
+ skipped: r.skipped,
178
+ }));
179
+ }
180
+ else {
181
+ showSuccessToast(t("messagesBulkSuccess"));
182
+ }
183
+ const schoolId = ((_e = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _e === void 0 ? void 0 : _e.id) || "";
184
+ fetch(`${FAMILY_API_ROUTES.UNIT}?currentPage=1&pageLimit=${pageLimit}&schoolId=${schoolId}`, {
185
+ headers: {
186
+ "Content-Type": "application/json",
187
+ },
188
+ })
189
+ .then(async (res) => {
190
+ var _a, _b;
191
+ if (!res.ok)
192
+ return;
193
+ const data = await res.json();
194
+ dispatch({
195
+ type: FAMILY_ACTION_TYPES.SET_ITEMS,
196
+ payload: {
197
+ items: (_a = data.items) !== null && _a !== void 0 ? _a : [],
198
+ count: (_b = data.count) !== null && _b !== void 0 ? _b : 0,
199
+ },
200
+ });
201
+ })
202
+ .catch(() => { });
203
+ closeDrawer();
204
+ }
205
+ else {
206
+ const r = status.results;
207
+ const detail = ((_f = r === null || r === void 0 ? void 0 : r.errors) === null || _f === void 0 ? void 0 : _f.length)
208
+ ? formatErrorSummary(t, r.errors)
209
+ : t("unknownError");
210
+ showErrorToast(t("messagesBulkFailed", { action: label }) + "\n" + detail);
211
+ }
212
+ }
213
+ catch (error) {
214
+ if (error.message === "Polling cancelled")
215
+ return;
216
+ showErrorToast(t("messagesBulkFailedDetail", {
217
+ action: label,
218
+ error: error instanceof Error ? error.message : t("unknownError"),
219
+ }));
220
+ }
221
+ }, [dispatch, t]);
222
+ const handleBulkCreate = useCallback((files) => handleBulkFlow(files, "POST"), [handleBulkFlow]);
223
+ const handleBulkUpdate = useCallback((files) => handleBulkFlow(files, "PUT"), [handleBulkFlow]);
224
+ const create = [
225
+ {
226
+ id: "1",
227
+ title: t("downloadEmptyCsvTemplate"),
228
+ handleOnClick: async () => {
229
+ var _a;
230
+ await handleGetAllRecords(((_a = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _a === void 0 ? void 0 : _a.id) || "", 1);
231
+ },
232
+ },
233
+ { id: "2", title: t("addYourDataToTheCsv") },
234
+ {
235
+ id: "3",
236
+ title: t("uploadTheCompletedCsvToTheSystem"),
237
+ },
238
+ ];
239
+ const update = [
240
+ {
241
+ id: "1",
242
+ title: t("downloadPopulatedCsvTemplate"),
243
+ handleOnClick: async () => {
244
+ var _a;
245
+ await handleGetAllRecords(((_a = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _a === void 0 ? void 0 : _a.id) || "", 1000);
246
+ },
247
+ },
248
+ { id: "2", title: t("updateYourDataInTheCsv") },
249
+ {
250
+ id: "3",
251
+ title: t("uploadTheCompletedCsvToTheSystem"),
252
+ },
253
+ ];
254
+ return (_jsxs("div", { className: "space-y-4", children: [_jsx(Timeline, { events: create, heading: t("bulkCreate"), handleOnBulkCreate: handleBulkCreate }), _jsx(Timeline, { events: update, heading: t("bulkUpdate"), handleOnBulkCreate: handleBulkUpdate })] }));
5
255
  };
@@ -1,5 +1,261 @@
1
1
  "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { downloadFromUrl } from "@react-pakistan/util-functions";
4
+ import { showErrorToast, showSuccessToast, showInfoToast, } from "@appcorp/shadcn/lib/toast-utils";
5
+ import { getCachedWorkspaceSync } from "../workspace/cache";
6
+ import converter from "json-2-csv";
7
+ import { Timeline } from "../../components/timeline";
8
+ import { useTranslations } from "next-intl";
9
+ import { pageLimit } from "./constants";
10
+ import { FAMILY_MEMBER_API_ROUTES } from "../../constants";
11
+ import { FAMILY_MEMBER_ACTION_TYPES, useFamilyMemberContext, } from "./context";
12
+ import { useRef, useEffect, useCallback } from "react";
13
+ const workspace = getCachedWorkspaceSync();
14
+ const POLL_INTERVAL_MS = 2000;
15
+ const POLL_TIMEOUT_MS = 300000;
16
+ const handleGetAllRecords = async (schoolId, pageLimit) => {
17
+ const response = await fetch(`${FAMILY_MEMBER_API_ROUTES.UNIT}?pageLimit=${pageLimit}&currentPage=1&schoolId=${schoolId}`);
18
+ const result = await response.json();
19
+ const csv = await converter.json2csv(result.items || [], {});
20
+ const blob = new Blob([csv], { type: "text/csv;charset=utf-8;" });
21
+ await downloadFromUrl(blob, "family-member.csv");
22
+ };
23
+ async function submitBulkJob(csvData, method, signal) {
24
+ var _a;
25
+ const schoolId = ((_a = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _a === void 0 ? void 0 : _a.id) || "";
26
+ if (!schoolId)
27
+ throw new Error("School ID not found");
28
+ const res = await fetch(FAMILY_MEMBER_API_ROUTES.BULK, {
29
+ method,
30
+ headers: {
31
+ "Content-Type": "application/json",
32
+ },
33
+ body: JSON.stringify({ schoolId, csvData }),
34
+ signal,
35
+ });
36
+ if (!res.ok) {
37
+ const errorData = (await res.json().catch(() => ({})));
38
+ throw new Error(errorData.error || `Bulk operation failed with status ${res.status}`);
39
+ }
40
+ const data = (await res.json());
41
+ return data.jobId;
42
+ }
43
+ async function pollBulkJob(jobId, signal, onProgress) {
44
+ const startTime = Date.now();
45
+ let lastProgressToast = 0;
46
+ while (true) {
47
+ if (signal.aborted)
48
+ throw new Error("Polling cancelled");
49
+ if (Date.now() - startTime > POLL_TIMEOUT_MS) {
50
+ throw new Error("Bulk operation timed out");
51
+ }
52
+ await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL_MS));
53
+ if (signal.aborted)
54
+ throw new Error("Polling cancelled");
55
+ const res = await fetch(FAMILY_MEMBER_API_ROUTES.BULK_STATUS(jobId), {
56
+ signal,
57
+ });
58
+ if (!res.ok)
59
+ continue;
60
+ const data = (await res.json());
61
+ if (data.status === "completed" || data.status === "failed") {
62
+ return data;
63
+ }
64
+ if (data.status === "running" && Date.now() - lastProgressToast > 10000) {
65
+ lastProgressToast = Date.now();
66
+ onProgress === null || onProgress === void 0 ? void 0 : onProgress(data.processed, data.total);
67
+ }
68
+ }
69
+ }
70
+ function formatErrorSummary(t, errors) {
71
+ if (!(errors === null || errors === void 0 ? void 0 : errors.length))
72
+ return "";
73
+ const lines = errors
74
+ .slice(0, 5)
75
+ .map((e) => t("messagesBulkRowError", { row: e.row, error: e.error }));
76
+ const remaining = errors.length - 5;
77
+ if (remaining > 0)
78
+ lines.push(t("messagesBulkMoreRows", { count: remaining }));
79
+ return lines.join("\n");
80
+ }
3
81
  export const FamilyMemberMoreActions = () => {
4
- return _jsx("div", { className: "space-y-4", children: "More actions for family members" });
82
+ const t = useTranslations("familyMember");
83
+ const { dispatch } = useFamilyMemberContext();
84
+ const abortRef = useRef(null);
85
+ useEffect(() => {
86
+ return () => {
87
+ var _a;
88
+ (_a = abortRef.current) === null || _a === void 0 ? void 0 : _a.abort();
89
+ };
90
+ }, []);
91
+ const handleBulkFlow = useCallback(async (files, method) => {
92
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
93
+ const closeDrawer = () => {
94
+ dispatch({
95
+ type: FAMILY_MEMBER_ACTION_TYPES.SET_DRAWER,
96
+ payload: { drawer: null },
97
+ });
98
+ };
99
+ (_a = abortRef.current) === null || _a === void 0 ? void 0 : _a.abort();
100
+ const controller = new AbortController();
101
+ abortRef.current = controller;
102
+ const { signal } = controller;
103
+ const label = method === "POST" ? "create" : "update";
104
+ const file = files[0];
105
+ const text = await file.text();
106
+ const records = converter.csv2json(text);
107
+ if (!Array.isArray(records) || records.length === 0) {
108
+ showErrorToast(t("messagesBulkCsvEmpty"));
109
+ return;
110
+ }
111
+ const validationErrors = [];
112
+ for (let i = 0; i < records.length; i++) {
113
+ const row = records[i];
114
+ const msgs = [];
115
+ if (method === "POST") {
116
+ if (!((_b = row.familyId) === null || _b === void 0 ? void 0 : _b.trim()))
117
+ msgs.push(t("validationRequiredFamilyId"));
118
+ if (!((_c = row.firstName) === null || _c === void 0 ? void 0 : _c.trim()))
119
+ msgs.push(t("validationRequiredFirstName"));
120
+ if (!((_d = row.lastName) === null || _d === void 0 ? void 0 : _d.trim()))
121
+ msgs.push(t("validationRequiredLastName"));
122
+ if (!((_e = row.role) === null || _e === void 0 ? void 0 : _e.trim()))
123
+ msgs.push(t("validationRequiredRole"));
124
+ }
125
+ else {
126
+ if (!((_f = row.id) === null || _f === void 0 ? void 0 : _f.trim()))
127
+ msgs.push(t("validationRequiredIdForUpdate"));
128
+ }
129
+ if (msgs.length > 0) {
130
+ validationErrors.push({ row: i + 1, messages: msgs });
131
+ }
132
+ }
133
+ if (validationErrors.length > 0) {
134
+ const summary = validationErrors
135
+ .slice(0, 5)
136
+ .map((e) => t("messagesBulkRowError", {
137
+ row: e.row,
138
+ error: e.messages.join("; "),
139
+ }))
140
+ .join("\n");
141
+ showErrorToast(t("messagesBulkValidationFailed", {
142
+ count: validationErrors.length,
143
+ errors: summary,
144
+ }));
145
+ return;
146
+ }
147
+ try {
148
+ showInfoToast(t("messagesBulkJobQueued", { action: label, count: records.length }));
149
+ let jobId;
150
+ try {
151
+ jobId = await submitBulkJob(text, method, signal);
152
+ }
153
+ catch (submitError) {
154
+ showErrorToast(t("messagesBulkJobSubmitFailed", {
155
+ action: label,
156
+ error: submitError instanceof Error
157
+ ? submitError.message
158
+ : t("unknownError"),
159
+ }));
160
+ return;
161
+ }
162
+ const status = await pollBulkJob(jobId, signal, (processed, total) => {
163
+ showInfoToast(t("messagesBulkProgress", { processed, total }));
164
+ });
165
+ if (signal.aborted)
166
+ return;
167
+ if (status.status === "completed") {
168
+ const r = status.results;
169
+ if (r && ((_g = r.errors) === null || _g === void 0 ? void 0 : _g.length) > 0) {
170
+ const summary = formatErrorSummary(t, r.errors);
171
+ showSuccessToast(t("messagesBulkResults", {
172
+ created: r.created,
173
+ updated: r.updated,
174
+ skipped: r.skipped,
175
+ }) +
176
+ "\n" +
177
+ summary);
178
+ }
179
+ else if (r) {
180
+ showSuccessToast(t("messagesBulkResults", {
181
+ created: r.created,
182
+ updated: r.updated,
183
+ skipped: r.skipped,
184
+ }));
185
+ }
186
+ else {
187
+ showSuccessToast(t("messagesBulkSuccess"));
188
+ }
189
+ const schoolId = ((_h = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _h === void 0 ? void 0 : _h.id) || "";
190
+ fetch(`${FAMILY_MEMBER_API_ROUTES.UNIT}?currentPage=1&pageLimit=${pageLimit}&schoolId=${schoolId}`, {
191
+ headers: {
192
+ "Content-Type": "application/json",
193
+ },
194
+ })
195
+ .then(async (res) => {
196
+ var _a, _b;
197
+ if (!res.ok)
198
+ return;
199
+ const data = await res.json();
200
+ dispatch({
201
+ type: FAMILY_MEMBER_ACTION_TYPES.SET_ITEMS,
202
+ payload: {
203
+ items: (_a = data.items) !== null && _a !== void 0 ? _a : [],
204
+ count: (_b = data.count) !== null && _b !== void 0 ? _b : 0,
205
+ },
206
+ });
207
+ })
208
+ .catch(() => { });
209
+ closeDrawer();
210
+ }
211
+ else {
212
+ const r = status.results;
213
+ const detail = ((_j = r === null || r === void 0 ? void 0 : r.errors) === null || _j === void 0 ? void 0 : _j.length)
214
+ ? formatErrorSummary(t, r.errors)
215
+ : t("unknownError");
216
+ showErrorToast(t("messagesBulkFailed", { action: label }) + "\n" + detail);
217
+ }
218
+ }
219
+ catch (error) {
220
+ if (error.message === "Polling cancelled")
221
+ return;
222
+ showErrorToast(t("messagesBulkFailedDetail", {
223
+ action: label,
224
+ error: error instanceof Error ? error.message : t("unknownError"),
225
+ }));
226
+ }
227
+ }, [dispatch, t]);
228
+ const handleBulkCreate = useCallback((files) => handleBulkFlow(files, "POST"), [handleBulkFlow]);
229
+ const handleBulkUpdate = useCallback((files) => handleBulkFlow(files, "PUT"), [handleBulkFlow]);
230
+ const create = [
231
+ {
232
+ id: "1",
233
+ title: t("downloadEmptyCsvTemplate"),
234
+ handleOnClick: async () => {
235
+ var _a;
236
+ await handleGetAllRecords(((_a = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _a === void 0 ? void 0 : _a.id) || "", 1);
237
+ },
238
+ },
239
+ { id: "2", title: t("addYourDataToTheCsv") },
240
+ {
241
+ id: "3",
242
+ title: t("uploadTheCompletedCsvToTheSystem"),
243
+ },
244
+ ];
245
+ const update = [
246
+ {
247
+ id: "1",
248
+ title: t("downloadPopulatedCsvTemplate"),
249
+ handleOnClick: async () => {
250
+ var _a;
251
+ await handleGetAllRecords(((_a = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _a === void 0 ? void 0 : _a.id) || "", 1000);
252
+ },
253
+ },
254
+ { id: "2", title: t("updateYourDataInTheCsv") },
255
+ {
256
+ id: "3",
257
+ title: t("uploadTheCompletedCsvToTheSystem"),
258
+ },
259
+ ];
260
+ return (_jsxs("div", { className: "space-y-4", children: [_jsx(Timeline, { events: create, heading: t("bulkCreate"), handleOnBulkCreate: handleBulkCreate }), _jsx(Timeline, { events: update, heading: t("bulkUpdate"), handleOnBulkCreate: handleBulkUpdate })] }));
5
261
  };
package/constants.d.ts CHANGED
@@ -10,6 +10,8 @@ export declare const REPORTS_API_ROUTES: {
10
10
  };
11
11
  export declare const ATTENDANCE_API_ROUTES: {
12
12
  readonly UNIT: "/api/v1/attendance";
13
+ readonly BULK: "/api/v1/attendance/bulk";
14
+ readonly BULK_STATUS: (jobId: string) => string;
13
15
  };
14
16
  export declare const ADMISSION_API_ROUTES: Record<string, string>;
15
17
  export declare const CAMPUS_API_ROUTES: Record<string, string>;
@@ -32,12 +34,18 @@ export declare const ENROLLMENT_API_ROUTES: {
32
34
  };
33
35
  export declare const EXPENSE_API_ROUTES: {
34
36
  readonly UNIT: "/api/v1/expense";
37
+ readonly BULK: "/api/v1/expense/bulk";
38
+ readonly BULK_STATUS: (jobId: string) => string;
35
39
  };
36
40
  export declare const FAMILY_API_ROUTES: {
37
41
  readonly UNIT: "/api/v1/family";
42
+ readonly BULK: "/api/v1/family/bulk";
43
+ readonly BULK_STATUS: (jobId: string) => string;
38
44
  };
39
45
  export declare const FAMILY_MEMBER_API_ROUTES: {
40
46
  readonly UNIT: "/api/v1/family-member";
47
+ readonly BULK: "/api/v1/family-member/bulk";
48
+ readonly BULK_STATUS: (jobId: string) => string;
41
49
  };
42
50
  export declare const FEE_STRUCTURE_API_ROUTES: {
43
51
  readonly CLASS: "/api/v1/class";
package/constants.js CHANGED
@@ -13,6 +13,8 @@ export const REPORTS_API_ROUTES = {
13
13
  // ============================================================================
14
14
  export const ATTENDANCE_API_ROUTES = {
15
15
  UNIT: "/api/v1/attendance",
16
+ BULK: "/api/v1/attendance/bulk",
17
+ BULK_STATUS: (jobId) => `/api/v1/attendance/bulk/${jobId}`,
16
18
  };
17
19
  export const ADMISSION_API_ROUTES = {
18
20
  UNIT: "/api/v1/admission",
@@ -39,12 +41,18 @@ export const ENROLLMENT_API_ROUTES = {
39
41
  };
40
42
  export const EXPENSE_API_ROUTES = {
41
43
  UNIT: "/api/v1/expense",
44
+ BULK: "/api/v1/expense/bulk",
45
+ BULK_STATUS: (jobId) => `/api/v1/expense/bulk/${jobId}`,
42
46
  };
43
47
  export const FAMILY_API_ROUTES = {
44
48
  UNIT: "/api/v1/family",
49
+ BULK: "/api/v1/family/bulk",
50
+ BULK_STATUS: (jobId) => `/api/v1/family/bulk/${jobId}`,
45
51
  };
46
52
  export const FAMILY_MEMBER_API_ROUTES = {
47
53
  UNIT: "/api/v1/family-member",
54
+ BULK: "/api/v1/family-member/bulk",
55
+ BULK_STATUS: (jobId) => `/api/v1/family-member/bulk/${jobId}`,
48
56
  };
49
57
  export const FEE_STRUCTURE_API_ROUTES = {
50
58
  CLASS: "/api/v1/class",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appcorp/fusion-storybook",
3
- "version": "0.2.81",
3
+ "version": "0.2.82",
4
4
  "scripts": {
5
5
  "build-storybook": "storybook build",
6
6
  "build:next": "next build",