@appcorp/fusion-storybook 0.2.13 → 0.2.14

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 (48) hide show
  1. package/base-modules/admission/context/use-admission-module.d.ts +88 -0
  2. package/base-modules/admission/context/use-admission-module.js +771 -0
  3. package/base-modules/admission/context.d.ts +1 -87
  4. package/base-modules/admission/context.js +3 -769
  5. package/base-modules/campus/more-actions.js +0 -1
  6. package/base-modules/class/more-actions.js +1 -6
  7. package/base-modules/expense/more-actions.js +1 -6
  8. package/base-modules/fee-structure/more-actions.js +1 -6
  9. package/base-modules/student-fee/context/shared.d.ts +178 -0
  10. package/base-modules/student-fee/context/shared.js +59 -0
  11. package/base-modules/student-fee/context/use-student-fee-module.d.ts +64 -0
  12. package/base-modules/student-fee/context/use-student-fee-module.js +610 -0
  13. package/base-modules/student-fee/context.d.ts +21 -235
  14. package/base-modules/student-fee/context.js +2 -674
  15. package/base-modules/student-fee/more-actions.js +1 -6
  16. package/base-modules/student-profile/context/module-base.d.ts +187 -0
  17. package/base-modules/student-profile/context/module-base.js +50 -0
  18. package/base-modules/student-profile/context/use-student-profile-module.d.ts +70 -0
  19. package/base-modules/student-profile/context/use-student-profile-module.js +506 -0
  20. package/base-modules/student-profile/context.d.ts +20 -256
  21. package/base-modules/student-profile/context.js +2 -601
  22. package/base-modules/teacher/avatar-upload.js +1 -4
  23. package/base-modules/teacher/more-actions.js +1 -6
  24. package/base-modules/user/context/use-user-module.d.ts +53 -0
  25. package/base-modules/user/context/use-user-module.js +546 -0
  26. package/base-modules/user/context.d.ts +1 -52
  27. package/base-modules/user/context.js +5 -547
  28. package/base-modules/workspace-user/more-actions.js +1 -6
  29. package/components/module-error.d.ts +9 -0
  30. package/components/module-error.js +3 -0
  31. package/package.json +5 -4
  32. package/tsconfig.build.tsbuildinfo +1 -1
  33. package/type.d.ts +3 -1242
  34. package/type.js +3 -445
  35. package/types/academics.d.ts +264 -0
  36. package/types/academics.js +8 -0
  37. package/types/admission.d.ts +85 -0
  38. package/types/admission.js +6 -0
  39. package/types/communication.d.ts +165 -0
  40. package/types/communication.js +7 -0
  41. package/types/enums.d.ts +411 -0
  42. package/types/enums.js +442 -0
  43. package/types/finance.d.ts +126 -0
  44. package/types/finance.js +7 -0
  45. package/types/index.d.ts +12 -0
  46. package/types/index.js +12 -0
  47. package/types/user-management.d.ts +236 -0
  48. package/types/user-management.js +7 -0
@@ -1,235 +1,21 @@
1
- import { PAYMENT_STATUS, StudentFeeBE, FEE_RISK_LEVEL } from "../../type";
2
- import { type RowAction, type TableRow } from "@appcorp/shadcn/components/enhanced-table";
3
- export declare const STUDENT_FEE_DRAWER: {
4
- readonly FILTER_DRAWER: string;
5
- readonly FORM_DRAWER: string;
6
- readonly MORE_ACTIONS_DRAWER: string;
7
- readonly VIEW_DRAWER: string;
8
- };
9
- export declare const STUDENT_FEE_ACTION_TYPES: {
10
- readonly RESET_FORM: "RESET_FORM";
11
- readonly SET_CURRENT_PAGE: "SET_CURRENT_PAGE";
12
- readonly SET_PAGE_LIMIT: "SET_PAGE_LIMIT";
13
- readonly SET_SEARCH_QUERY: "SET_SEARCH_QUERY";
14
- readonly SET_DRAWER: "SET_DRAWER";
15
- readonly SET_ITEMS: "SET_ITEMS";
16
- readonly SET_FORM_DATA: "SET_FORM_DATA";
17
- readonly SET_DISABLE_SAVE_BUTTON: "SET_DISABLE_SAVE_BUTTON";
18
- readonly SET_INPUT_FIELD: "SET_INPUT_FIELD";
19
- readonly SET_ERRORS: "SET_ERRORS";
20
- readonly SET_FILTERS: "SET_FILTERS";
21
- }, studentFeeModuleConfig: import("@react-pakistan/util-functions/factory/generic-module-factory").ModuleConfig<{
22
- items: StudentFeeBE[];
23
- count: number;
24
- currentPage: number;
25
- pageLimit: number;
26
- searchQuery: string;
27
- disableSaveButton: boolean;
28
- drawer: string | null;
29
- errors: Record<string, string>;
30
- amount: number;
31
- amountDue: number;
32
- amountPaid: number;
33
- discountAmount: number;
34
- discountCodeId: string | null;
35
- dueDate: string;
36
- enabled: boolean;
37
- familyId: string;
38
- feeStructureId: string;
39
- id: string;
40
- lastRemindedAt: Date | string | null;
41
- nextFollowUpAt: Date | string | null;
42
- originalFee: number;
43
- reliabilityScore: number | null;
44
- remarks: string | null;
45
- riskLevel: FEE_RISK_LEVEL | null;
46
- schoolId: string;
47
- status: PAYMENT_STATUS;
48
- studentProfileId: string;
49
- filterEnabled: boolean | undefined;
50
- filterStatus: PAYMENT_STATUS | "";
51
- }>, initialStudentFeeState: {
52
- items: StudentFeeBE[];
53
- count: number;
54
- currentPage: number;
55
- pageLimit: number;
56
- searchQuery: string;
57
- disableSaveButton: boolean;
58
- drawer: string | null;
59
- errors: Record<string, string>;
60
- amount: number;
61
- amountDue: number;
62
- amountPaid: number;
63
- discountAmount: number;
64
- discountCodeId: string | null;
65
- dueDate: string;
66
- enabled: boolean;
67
- familyId: string;
68
- feeStructureId: string;
69
- id: string;
70
- lastRemindedAt: Date | string | null;
71
- nextFollowUpAt: Date | string | null;
72
- originalFee: number;
73
- reliabilityScore: number | null;
74
- remarks: string | null;
75
- riskLevel: FEE_RISK_LEVEL | null;
76
- schoolId: string;
77
- status: PAYMENT_STATUS;
78
- studentProfileId: string;
79
- filterEnabled: boolean | undefined;
80
- filterStatus: PAYMENT_STATUS | "";
81
- }, StudentFeeProvider: import("react").FC<{
82
- children: React.ReactNode;
83
- }>, studentFeeReducer: (state: {
84
- items: StudentFeeBE[];
85
- count: number;
86
- currentPage: number;
87
- pageLimit: number;
88
- searchQuery: string;
89
- disableSaveButton: boolean;
90
- drawer: string | null;
91
- errors: Record<string, string>;
92
- amount: number;
93
- amountDue: number;
94
- amountPaid: number;
95
- discountAmount: number;
96
- discountCodeId: string | null;
97
- dueDate: string;
98
- enabled: boolean;
99
- familyId: string;
100
- feeStructureId: string;
101
- id: string;
102
- lastRemindedAt: Date | string | null;
103
- nextFollowUpAt: Date | string | null;
104
- originalFee: number;
105
- reliabilityScore: number | null;
106
- remarks: string | null;
107
- riskLevel: FEE_RISK_LEVEL | null;
108
- schoolId: string;
109
- status: PAYMENT_STATUS;
110
- studentProfileId: string;
111
- filterEnabled: boolean | undefined;
112
- filterStatus: PAYMENT_STATUS | "";
113
- }, action: any) => {
114
- items: StudentFeeBE[];
115
- count: number;
116
- currentPage: number;
117
- pageLimit: number;
118
- searchQuery: string;
119
- disableSaveButton: boolean;
120
- drawer: string | null;
121
- errors: Record<string, string>;
122
- amount: number;
123
- amountDue: number;
124
- amountPaid: number;
125
- discountAmount: number;
126
- discountCodeId: string | null;
127
- dueDate: string;
128
- enabled: boolean;
129
- familyId: string;
130
- feeStructureId: string;
131
- id: string;
132
- lastRemindedAt: Date | string | null;
133
- nextFollowUpAt: Date | string | null;
134
- originalFee: number;
135
- reliabilityScore: number | null;
136
- remarks: string | null;
137
- riskLevel: FEE_RISK_LEVEL | null;
138
- schoolId: string;
139
- status: PAYMENT_STATUS;
140
- studentProfileId: string;
141
- filterEnabled: boolean | undefined;
142
- filterStatus: PAYMENT_STATUS | "";
143
- }, useStudentFeeContext: () => import("@react-pakistan/util-functions/factory/generic-module-factory").GenericModuleContext<{
144
- items: StudentFeeBE[];
145
- count: number;
146
- currentPage: number;
147
- pageLimit: number;
148
- searchQuery: string;
149
- disableSaveButton: boolean;
150
- drawer: string | null;
151
- errors: Record<string, string>;
152
- amount: number;
153
- amountDue: number;
154
- amountPaid: number;
155
- discountAmount: number;
156
- discountCodeId: string | null;
157
- dueDate: string;
158
- enabled: boolean;
159
- familyId: string;
160
- feeStructureId: string;
161
- id: string;
162
- lastRemindedAt: Date | string | null;
163
- nextFollowUpAt: Date | string | null;
164
- originalFee: number;
165
- reliabilityScore: number | null;
166
- remarks: string | null;
167
- riskLevel: FEE_RISK_LEVEL | null;
168
- schoolId: string;
169
- status: PAYMENT_STATUS;
170
- studentProfileId: string;
171
- filterEnabled: boolean | undefined;
172
- filterStatus: PAYMENT_STATUS | "";
173
- }>;
174
- export declare const useStudentFeeModule: () => {
175
- applyFilters: () => void;
176
- byIdLoading: boolean;
177
- clearFilters: () => void;
178
- clearSearch: () => void;
179
- closeDrawer: () => void;
180
- deleteLoading: boolean;
181
- handleChange: (field: string, value: string | number | boolean | PAYMENT_STATUS | FEE_RISK_LEVEL | null | undefined) => void;
182
- handleCreate: () => void;
183
- handleDelete: (row?: TableRow) => void;
184
- handleEdit: (row?: TableRow) => void;
185
- handleFilters: () => void;
186
- handleMoreActions: () => void;
187
- handlePageChange: (page: number | unknown) => void;
188
- handlePageLimitChange: (k: string, value: object) => void;
189
- handleSearch: (query: string) => void;
190
- handleSubmit: () => void;
191
- handleView: (row?: TableRow) => void;
192
- headerActions: {
193
- enabled: boolean;
194
- handleOnClick: () => void;
195
- label: string;
196
- order: number;
197
- }[];
198
- listFetchNow: (url?: string, config?: import("@react-pakistan/util-functions/hooks/use-fetch").FetchConfig) => void;
199
- listLoading: boolean;
200
- rowActions: RowAction[];
201
- toggleStatus: (row?: TableRow) => void;
202
- updateLoading: boolean;
203
- state: {
204
- items: StudentFeeBE[];
205
- count: number;
206
- currentPage: number;
207
- pageLimit: number;
208
- searchQuery: string;
209
- disableSaveButton: boolean;
210
- drawer: string | null;
211
- errors: Record<string, string>;
212
- amount: number;
213
- amountDue: number;
214
- amountPaid: number;
215
- discountAmount: number;
216
- discountCodeId: string | null;
217
- dueDate: string;
218
- enabled: boolean;
219
- familyId: string;
220
- feeStructureId: string;
221
- id: string;
222
- lastRemindedAt: Date | string | null;
223
- nextFollowUpAt: Date | string | null;
224
- originalFee: number;
225
- reliabilityScore: number | null;
226
- remarks: string | null;
227
- riskLevel: FEE_RISK_LEVEL | null;
228
- schoolId: string;
229
- status: PAYMENT_STATUS;
230
- studentProfileId: string;
231
- filterEnabled: boolean | undefined;
232
- filterStatus: PAYMENT_STATUS | "";
233
- };
234
- dispatch: React.Dispatch<any>;
235
- };
1
+ /**
2
+ * StudentFee Module business logic + API integration
3
+ *
4
+ * Wires the generic module state (created by `createGenericModule`) to network
5
+ * actions using `useModuleEntityV2`. Contains domain-specific handlers for
6
+ * create/view/edit/delete, amount calculations, and fee management flow.
7
+ *
8
+ * Key responsibilities:
9
+ * - expose `useStudentFeeModule()` which UI components call for actions
10
+ * - keep module-specific `apiParams` and callbacks in one place
11
+ * - ensure cache invalidation and toast notifications on mutation
12
+ *
13
+ * Exported utilities:
14
+ * - `StudentFeeProvider` — provider component used by the page
15
+ * - `STUDENT_FEE_ACTION_TYPES` — action type constants (from factory)
16
+ * - `STUDENT_FEE_DRAWER` — drawer type constants
17
+ * - `useStudentFeeModule()` — hook that returns state, dispatch, and handlers
18
+ */
19
+ export { STUDENT_FEE_DRAWER, STUDENT_FEE_ACTION_TYPES, studentFeeModuleConfig, initialStudentFeeState, StudentFeeProvider, studentFeeReducer, useStudentFeeContext, } from "./context/shared";
20
+ export type { StudentFeesListResponse } from "./context/shared";
21
+ export { useStudentFeeModule } from "./context/use-student-fee-module";