@appcorp/fusion-storybook 0.2.12 → 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 (173) 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/admission/filter.d.ts +1 -1
  6. package/base-modules/admission/form.d.ts +1 -1
  7. package/base-modules/admission/more-actions.d.ts +1 -1
  8. package/base-modules/admission/page.d.ts +8 -1
  9. package/base-modules/admission/page.js +25 -4
  10. package/base-modules/admission/view.d.ts +1 -1
  11. package/base-modules/attendance/form.d.ts +1 -1
  12. package/base-modules/attendance/page.d.ts +8 -1
  13. package/base-modules/attendance/page.js +25 -4
  14. package/base-modules/attendance/view.d.ts +1 -1
  15. package/base-modules/campus/filter.d.ts +1 -1
  16. package/base-modules/campus/form.d.ts +1 -1
  17. package/base-modules/campus/more-actions.d.ts +1 -1
  18. package/base-modules/campus/more-actions.js +0 -1
  19. package/base-modules/campus/page.d.ts +8 -1
  20. package/base-modules/campus/page.js +25 -4
  21. package/base-modules/campus/view.d.ts +1 -1
  22. package/base-modules/class/filter.d.ts +1 -1
  23. package/base-modules/class/form.d.ts +1 -1
  24. package/base-modules/class/more-actions.d.ts +1 -1
  25. package/base-modules/class/more-actions.js +1 -6
  26. package/base-modules/class/page.d.ts +8 -1
  27. package/base-modules/class/page.js +25 -4
  28. package/base-modules/class/view.d.ts +1 -1
  29. package/base-modules/course/filter.d.ts +1 -1
  30. package/base-modules/course/form.d.ts +1 -1
  31. package/base-modules/course/more-actions.d.ts +1 -1
  32. package/base-modules/course/page.d.ts +8 -1
  33. package/base-modules/course/page.js +25 -4
  34. package/base-modules/course/view.d.ts +1 -1
  35. package/base-modules/discount-code/filter.d.ts +2 -1
  36. package/base-modules/discount-code/form.d.ts +1 -1
  37. package/base-modules/discount-code/page.d.ts +8 -1
  38. package/base-modules/discount-code/page.js +25 -4
  39. package/base-modules/discount-code/view.d.ts +1 -1
  40. package/base-modules/enrollment/filter.d.ts +1 -1
  41. package/base-modules/enrollment/form.d.ts +1 -1
  42. package/base-modules/enrollment/more-actions.d.ts +1 -1
  43. package/base-modules/enrollment/page.d.ts +8 -1
  44. package/base-modules/enrollment/page.js +25 -4
  45. package/base-modules/enrollment/view.d.ts +1 -1
  46. package/base-modules/expense/filter.d.ts +1 -1
  47. package/base-modules/expense/form.d.ts +1 -1
  48. package/base-modules/expense/more-actions.d.ts +1 -1
  49. package/base-modules/expense/more-actions.js +1 -6
  50. package/base-modules/expense/page.d.ts +8 -1
  51. package/base-modules/expense/page.js +25 -4
  52. package/base-modules/expense/view.d.ts +1 -1
  53. package/base-modules/family/filter.d.ts +1 -1
  54. package/base-modules/family/form.d.ts +1 -1
  55. package/base-modules/family/more-actions.d.ts +1 -1
  56. package/base-modules/family/page.d.ts +8 -1
  57. package/base-modules/family/page.js +25 -4
  58. package/base-modules/family/view.d.ts +1 -1
  59. package/base-modules/family-member/filter.d.ts +1 -1
  60. package/base-modules/family-member/form.d.ts +1 -1
  61. package/base-modules/family-member/more-actions.d.ts +1 -1
  62. package/base-modules/family-member/page.d.ts +8 -1
  63. package/base-modules/family-member/page.js +25 -4
  64. package/base-modules/family-member/view.d.ts +1 -1
  65. package/base-modules/fee-structure/filter.d.ts +1 -1
  66. package/base-modules/fee-structure/form.d.ts +1 -1
  67. package/base-modules/fee-structure/more-actions.d.ts +1 -1
  68. package/base-modules/fee-structure/more-actions.js +1 -6
  69. package/base-modules/fee-structure/page.d.ts +8 -1
  70. package/base-modules/fee-structure/page.js +25 -4
  71. package/base-modules/fee-structure/view.d.ts +1 -1
  72. package/base-modules/rbac/assign-permissions.d.ts +1 -1
  73. package/base-modules/rbac/filter.d.ts +1 -1
  74. package/base-modules/rbac/form.d.ts +1 -1
  75. package/base-modules/rbac/more-actions.d.ts +1 -1
  76. package/base-modules/rbac/page.d.ts +8 -1
  77. package/base-modules/rbac/page.js +25 -4
  78. package/base-modules/rbac/view.d.ts +7 -1
  79. package/base-modules/school/drawer.d.ts +1 -1
  80. package/base-modules/school/filter.d.ts +1 -1
  81. package/base-modules/school/form.d.ts +1 -1
  82. package/base-modules/school/more-actions.d.ts +1 -1
  83. package/base-modules/school/view.d.ts +1 -1
  84. package/base-modules/section/filter.d.ts +1 -1
  85. package/base-modules/section/form.d.ts +1 -1
  86. package/base-modules/section/more-actions.d.ts +1 -1
  87. package/base-modules/section/page.d.ts +8 -1
  88. package/base-modules/section/page.js +25 -4
  89. package/base-modules/section/view.d.ts +1 -1
  90. package/base-modules/student-fee/context/shared.d.ts +178 -0
  91. package/base-modules/student-fee/context/shared.js +59 -0
  92. package/base-modules/student-fee/context/use-student-fee-module.d.ts +64 -0
  93. package/base-modules/student-fee/context/use-student-fee-module.js +610 -0
  94. package/base-modules/student-fee/context.d.ts +21 -235
  95. package/base-modules/student-fee/context.js +2 -674
  96. package/base-modules/student-fee/filter.d.ts +1 -1
  97. package/base-modules/student-fee/form.d.ts +1 -1
  98. package/base-modules/student-fee/more-actions.d.ts +1 -1
  99. package/base-modules/student-fee/more-actions.js +1 -6
  100. package/base-modules/student-fee/page.d.ts +8 -1
  101. package/base-modules/student-fee/page.js +25 -4
  102. package/base-modules/student-fee/view.d.ts +1 -1
  103. package/base-modules/student-profile/context/module-base.d.ts +187 -0
  104. package/base-modules/student-profile/context/module-base.js +50 -0
  105. package/base-modules/student-profile/context/use-student-profile-module.d.ts +70 -0
  106. package/base-modules/student-profile/context/use-student-profile-module.js +506 -0
  107. package/base-modules/student-profile/context.d.ts +20 -256
  108. package/base-modules/student-profile/context.js +2 -601
  109. package/base-modules/student-profile/filter.d.ts +1 -1
  110. package/base-modules/student-profile/form.d.ts +1 -1
  111. package/base-modules/student-profile/more-actions.d.ts +1 -1
  112. package/base-modules/student-profile/page.d.ts +8 -1
  113. package/base-modules/student-profile/page.js +25 -4
  114. package/base-modules/student-profile/view.d.ts +1 -1
  115. package/base-modules/subject/filter.d.ts +1 -1
  116. package/base-modules/subject/form.d.ts +1 -1
  117. package/base-modules/subject/more-actions.d.ts +1 -1
  118. package/base-modules/subject/page.d.ts +8 -1
  119. package/base-modules/subject/page.js +25 -4
  120. package/base-modules/subject/view.d.ts +1 -1
  121. package/base-modules/teacher/avatar-upload.js +1 -4
  122. package/base-modules/teacher/filter.d.ts +1 -1
  123. package/base-modules/teacher/form.d.ts +1 -1
  124. package/base-modules/teacher/more-actions.d.ts +1 -1
  125. package/base-modules/teacher/more-actions.js +1 -6
  126. package/base-modules/teacher/page.d.ts +8 -1
  127. package/base-modules/teacher/page.js +25 -4
  128. package/base-modules/teacher/view.d.ts +1 -1
  129. package/base-modules/user/context/use-user-module.d.ts +53 -0
  130. package/base-modules/user/context/use-user-module.js +546 -0
  131. package/base-modules/user/context.d.ts +1 -52
  132. package/base-modules/user/context.js +5 -547
  133. package/base-modules/user/drawer.d.ts +1 -1
  134. package/base-modules/user/filter.d.ts +1 -1
  135. package/base-modules/user/form.d.ts +1 -1
  136. package/base-modules/user/more-actions.d.ts +1 -1
  137. package/base-modules/user/page.d.ts +8 -1
  138. package/base-modules/user/page.js +25 -4
  139. package/base-modules/user/view.d.ts +1 -1
  140. package/base-modules/workspace/context.d.ts +1 -1
  141. package/base-modules/workspace/drawer.d.ts +1 -1
  142. package/base-modules/workspace/filter.d.ts +1 -1
  143. package/base-modules/workspace/form.d.ts +1 -1
  144. package/base-modules/workspace/more-actions.d.ts +1 -1
  145. package/base-modules/workspace/view.d.ts +1 -1
  146. package/base-modules/workspace-user/filter.d.ts +1 -1
  147. package/base-modules/workspace-user/form.d.ts +1 -1
  148. package/base-modules/workspace-user/more-actions.d.ts +1 -1
  149. package/base-modules/workspace-user/more-actions.js +1 -6
  150. package/base-modules/workspace-user/page.d.ts +8 -1
  151. package/base-modules/workspace-user/page.js +25 -4
  152. package/base-modules/workspace-user/view.d.ts +1 -1
  153. package/components/module-error.d.ts +9 -0
  154. package/components/module-error.js +3 -0
  155. package/components/timeline.d.ts +1 -1
  156. package/package.json +6 -5
  157. package/tsconfig.build.tsbuildinfo +1 -1
  158. package/type.d.ts +3 -1242
  159. package/type.js +3 -445
  160. package/types/academics.d.ts +264 -0
  161. package/types/academics.js +8 -0
  162. package/types/admission.d.ts +85 -0
  163. package/types/admission.js +6 -0
  164. package/types/communication.d.ts +165 -0
  165. package/types/communication.js +7 -0
  166. package/types/enums.d.ts +411 -0
  167. package/types/enums.js +442 -0
  168. package/types/finance.d.ts +126 -0
  169. package/types/finance.js +7 -0
  170. package/types/index.d.ts +12 -0
  171. package/types/index.js +12 -0
  172. package/types/user-management.d.ts +236 -0
  173. 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";