@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
@@ -33,7 +33,6 @@ export const CampusMoreActions = () => {
33
33
  {
34
34
  id: "3",
35
35
  title: t("uploadTheCompletedCsvToTheSystem"),
36
- handleOnClick: () => console.log("clicked"),
37
36
  },
38
37
  ];
39
38
  return (_jsx("div", { className: "space-y-4", children: _jsx(Timeline, { events: update, heading: t("bulkUpdate") }) }));
@@ -32,7 +32,6 @@ export const ClassMoreActions = () => {
32
32
  {
33
33
  id: "3",
34
34
  title: t("uploadTheCompletedCsvToTheSystem"),
35
- handleOnClick: () => console.log("clicked"),
36
35
  },
37
36
  ];
38
37
  const update = [
@@ -45,11 +44,7 @@ export const ClassMoreActions = () => {
45
44
  },
46
45
  },
47
46
  { id: "2", title: t("updateYourDataInTheCsv") },
48
- {
49
- id: "3",
50
- title: t("uploadTheCompletedCsvToTheSystem"),
51
- handleOnClick: () => console.log("clicked"),
52
- },
47
+ { id: "3", title: t("uploadTheCompletedCsvToTheSystem") },
53
48
  ];
54
49
  return (_jsxs("div", { className: "space-y-4", children: [_jsx(Timeline, { events: create, heading: t("bulkCreate") }), _jsx(Timeline, { events: update, heading: t("bulkUpdate") })] }));
55
50
  };
@@ -33,7 +33,6 @@ export const ExpenseMoreActions = () => {
33
33
  {
34
34
  id: "3",
35
35
  title: t("uploadTheCompletedCsvToTheSystem"),
36
- handleOnClick: () => console.log("clicked"),
37
36
  },
38
37
  ];
39
38
  const update = [
@@ -46,11 +45,7 @@ export const ExpenseMoreActions = () => {
46
45
  },
47
46
  },
48
47
  { id: "2", title: t("updateYourDataInTheCsv") },
49
- {
50
- id: "3",
51
- title: t("uploadTheCompletedCsvToTheSystem"),
52
- handleOnClick: () => console.log("clicked"),
53
- },
48
+ { id: "3", title: t("uploadTheCompletedCsvToTheSystem") },
54
49
  ];
55
50
  return (_jsxs("div", { className: "space-y-4", children: [_jsx(Timeline, { events: create, heading: t("bulkCreate") }), _jsx(Timeline, { events: update, heading: t("bulkUpdate") })] }));
56
51
  };
@@ -28,7 +28,6 @@ export const FeeStructureMoreActions = () => {
28
28
  {
29
29
  id: "3",
30
30
  title: t("uploadTheCompletedCsvToTheSystem"),
31
- handleOnClick: () => console.log("clicked"),
32
31
  },
33
32
  ];
34
33
  const update = [
@@ -41,11 +40,7 @@ export const FeeStructureMoreActions = () => {
41
40
  },
42
41
  },
43
42
  { id: "2", title: t("updateYourDataInTheCsv") },
44
- {
45
- id: "3",
46
- title: t("uploadTheCompletedCsvToTheSystem"),
47
- handleOnClick: () => console.log("clicked"),
48
- },
43
+ { id: "3", title: t("uploadTheCompletedCsvToTheSystem") },
49
44
  ];
50
45
  return (_jsxs("div", { className: "space-y-4", children: [_jsx(Timeline, { events: create, heading: t("bulkCreate") }), _jsx(Timeline, { events: update, heading: t("bulkUpdate") })] }));
51
46
  };
@@ -0,0 +1,178 @@
1
+ import { StudentFeeBE, PAYMENT_STATUS, FEE_RISK_LEVEL } from "../../../type";
2
+ export declare const STUDENT_FEE_DRAWER: {
3
+ readonly FILTER_DRAWER: string;
4
+ readonly FORM_DRAWER: string;
5
+ readonly MORE_ACTIONS_DRAWER: string;
6
+ readonly VIEW_DRAWER: string;
7
+ };
8
+ export interface StudentFeesListResponse {
9
+ items: StudentFeeBE[];
10
+ count: number;
11
+ currentPage: number;
12
+ pageLimit: number;
13
+ }
14
+ export declare const STUDENT_FEE_ACTION_TYPES: {
15
+ readonly RESET_FORM: "RESET_FORM";
16
+ readonly SET_CURRENT_PAGE: "SET_CURRENT_PAGE";
17
+ readonly SET_PAGE_LIMIT: "SET_PAGE_LIMIT";
18
+ readonly SET_SEARCH_QUERY: "SET_SEARCH_QUERY";
19
+ readonly SET_DRAWER: "SET_DRAWER";
20
+ readonly SET_ITEMS: "SET_ITEMS";
21
+ readonly SET_FORM_DATA: "SET_FORM_DATA";
22
+ readonly SET_DISABLE_SAVE_BUTTON: "SET_DISABLE_SAVE_BUTTON";
23
+ readonly SET_INPUT_FIELD: "SET_INPUT_FIELD";
24
+ readonly SET_ERRORS: "SET_ERRORS";
25
+ readonly SET_FILTERS: "SET_FILTERS";
26
+ }, studentFeeModuleConfig: import("@react-pakistan/util-functions/factory/generic-module-factory").ModuleConfig<{
27
+ items: StudentFeeBE[];
28
+ count: number;
29
+ currentPage: number;
30
+ pageLimit: number;
31
+ searchQuery: string;
32
+ disableSaveButton: boolean;
33
+ drawer: string | null;
34
+ errors: Record<string, string>;
35
+ amount: number;
36
+ amountDue: number;
37
+ amountPaid: number;
38
+ discountAmount: number;
39
+ discountCodeId: string | null;
40
+ dueDate: string;
41
+ enabled: boolean;
42
+ familyId: string;
43
+ feeStructureId: string;
44
+ id: string;
45
+ lastRemindedAt: Date | string | null;
46
+ nextFollowUpAt: Date | string | null;
47
+ originalFee: number;
48
+ reliabilityScore: number | null;
49
+ remarks: string | null;
50
+ riskLevel: FEE_RISK_LEVEL | null;
51
+ schoolId: string;
52
+ status: PAYMENT_STATUS;
53
+ studentProfileId: string;
54
+ filterEnabled: boolean | undefined;
55
+ filterStatus: PAYMENT_STATUS | "";
56
+ }>, initialStudentFeeState: {
57
+ items: StudentFeeBE[];
58
+ count: number;
59
+ currentPage: number;
60
+ pageLimit: number;
61
+ searchQuery: string;
62
+ disableSaveButton: boolean;
63
+ drawer: string | null;
64
+ errors: Record<string, string>;
65
+ amount: number;
66
+ amountDue: number;
67
+ amountPaid: number;
68
+ discountAmount: number;
69
+ discountCodeId: string | null;
70
+ dueDate: string;
71
+ enabled: boolean;
72
+ familyId: string;
73
+ feeStructureId: string;
74
+ id: string;
75
+ lastRemindedAt: Date | string | null;
76
+ nextFollowUpAt: Date | string | null;
77
+ originalFee: number;
78
+ reliabilityScore: number | null;
79
+ remarks: string | null;
80
+ riskLevel: FEE_RISK_LEVEL | null;
81
+ schoolId: string;
82
+ status: PAYMENT_STATUS;
83
+ studentProfileId: string;
84
+ filterEnabled: boolean | undefined;
85
+ filterStatus: PAYMENT_STATUS | "";
86
+ }, StudentFeeProvider: import("react").FC<{
87
+ children: React.ReactNode;
88
+ }>, studentFeeReducer: (state: {
89
+ items: StudentFeeBE[];
90
+ count: number;
91
+ currentPage: number;
92
+ pageLimit: number;
93
+ searchQuery: string;
94
+ disableSaveButton: boolean;
95
+ drawer: string | null;
96
+ errors: Record<string, string>;
97
+ amount: number;
98
+ amountDue: number;
99
+ amountPaid: number;
100
+ discountAmount: number;
101
+ discountCodeId: string | null;
102
+ dueDate: string;
103
+ enabled: boolean;
104
+ familyId: string;
105
+ feeStructureId: string;
106
+ id: string;
107
+ lastRemindedAt: Date | string | null;
108
+ nextFollowUpAt: Date | string | null;
109
+ originalFee: number;
110
+ reliabilityScore: number | null;
111
+ remarks: string | null;
112
+ riskLevel: FEE_RISK_LEVEL | null;
113
+ schoolId: string;
114
+ status: PAYMENT_STATUS;
115
+ studentProfileId: string;
116
+ filterEnabled: boolean | undefined;
117
+ filterStatus: PAYMENT_STATUS | "";
118
+ }, action: any) => {
119
+ items: StudentFeeBE[];
120
+ count: number;
121
+ currentPage: number;
122
+ pageLimit: number;
123
+ searchQuery: string;
124
+ disableSaveButton: boolean;
125
+ drawer: string | null;
126
+ errors: Record<string, string>;
127
+ amount: number;
128
+ amountDue: number;
129
+ amountPaid: number;
130
+ discountAmount: number;
131
+ discountCodeId: string | null;
132
+ dueDate: string;
133
+ enabled: boolean;
134
+ familyId: string;
135
+ feeStructureId: string;
136
+ id: string;
137
+ lastRemindedAt: Date | string | null;
138
+ nextFollowUpAt: Date | string | null;
139
+ originalFee: number;
140
+ reliabilityScore: number | null;
141
+ remarks: string | null;
142
+ riskLevel: FEE_RISK_LEVEL | null;
143
+ schoolId: string;
144
+ status: PAYMENT_STATUS;
145
+ studentProfileId: string;
146
+ filterEnabled: boolean | undefined;
147
+ filterStatus: PAYMENT_STATUS | "";
148
+ }, useStudentFeeContext: () => import("@react-pakistan/util-functions/factory/generic-module-factory").GenericModuleContext<{
149
+ items: StudentFeeBE[];
150
+ count: number;
151
+ currentPage: number;
152
+ pageLimit: number;
153
+ searchQuery: string;
154
+ disableSaveButton: boolean;
155
+ drawer: string | null;
156
+ errors: Record<string, string>;
157
+ amount: number;
158
+ amountDue: number;
159
+ amountPaid: number;
160
+ discountAmount: number;
161
+ discountCodeId: string | null;
162
+ dueDate: string;
163
+ enabled: boolean;
164
+ familyId: string;
165
+ feeStructureId: string;
166
+ id: string;
167
+ lastRemindedAt: Date | string | null;
168
+ nextFollowUpAt: Date | string | null;
169
+ originalFee: number;
170
+ reliabilityScore: number | null;
171
+ remarks: string | null;
172
+ riskLevel: FEE_RISK_LEVEL | null;
173
+ schoolId: string;
174
+ status: PAYMENT_STATUS;
175
+ studentProfileId: string;
176
+ filterEnabled: boolean | undefined;
177
+ filterStatus: PAYMENT_STATUS | "";
178
+ }>;
@@ -0,0 +1,59 @@
1
+ "use client";
2
+ import { createGenericModule } from "@react-pakistan/util-functions/factory/generic-module-factory";
3
+ import { DRAWER_TYPES } from "@react-pakistan/util-functions/factory/generic-component-factory";
4
+ import { PAYMENT_STATUS } from "../../../type";
5
+ import { pageLimit } from "../constants";
6
+ // ============================================================================
7
+ // 1.1 DRAWER TYPES
8
+ // ============================================================================
9
+ export const STUDENT_FEE_DRAWER = {
10
+ FILTER_DRAWER: DRAWER_TYPES.FILTER_DRAWER,
11
+ FORM_DRAWER: DRAWER_TYPES.FORM_DRAWER,
12
+ MORE_ACTIONS_DRAWER: DRAWER_TYPES.MORE_ACTIONS_DRAWER,
13
+ VIEW_DRAWER: DRAWER_TYPES.VIEW_DRAWER,
14
+ };
15
+ const studentFeeConfig = {
16
+ name: "StudentFee",
17
+ displayName: "Student Fee",
18
+ drawerTypes: DRAWER_TYPES,
19
+ initialState: {
20
+ // List Data
21
+ items: [],
22
+ count: 0,
23
+ // Search & Pagination
24
+ currentPage: 1,
25
+ pageLimit,
26
+ searchQuery: "",
27
+ // UI State
28
+ disableSaveButton: false,
29
+ drawer: null,
30
+ errors: {},
31
+ // Form State
32
+ amount: 0,
33
+ amountDue: 0,
34
+ amountPaid: 0,
35
+ discountAmount: 0,
36
+ discountCodeId: null,
37
+ dueDate: new Date().toISOString().slice(0, 10),
38
+ enabled: true,
39
+ familyId: "",
40
+ feeStructureId: "",
41
+ id: "",
42
+ lastRemindedAt: null,
43
+ nextFollowUpAt: null,
44
+ originalFee: 0,
45
+ reliabilityScore: null,
46
+ remarks: null,
47
+ riskLevel: null,
48
+ schoolId: "",
49
+ status: PAYMENT_STATUS.PENDING,
50
+ studentProfileId: "",
51
+ // Filters
52
+ filterEnabled: undefined,
53
+ filterStatus: "",
54
+ },
55
+ };
56
+ // ============================================================================
57
+ // 1.3 CREATE STUDENT FEE MODULE
58
+ // ============================================================================
59
+ export const { actionTypes: STUDENT_FEE_ACTION_TYPES, config: studentFeeModuleConfig, initialState: initialStudentFeeState, Provider: StudentFeeProvider, reducer: studentFeeReducer, useContext: useStudentFeeContext, } = createGenericModule(studentFeeConfig);
@@ -0,0 +1,64 @@
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 useStudentFeeModule: () => {
4
+ applyFilters: () => void;
5
+ byIdLoading: boolean;
6
+ clearFilters: () => void;
7
+ clearSearch: () => void;
8
+ closeDrawer: () => void;
9
+ deleteLoading: boolean;
10
+ handleChange: (field: string, value: string | number | boolean | PAYMENT_STATUS | FEE_RISK_LEVEL | null | undefined) => void;
11
+ handleCreate: () => void;
12
+ handleDelete: (row?: TableRow) => void;
13
+ handleEdit: (row?: TableRow) => void;
14
+ handleFilters: () => void;
15
+ handleMoreActions: () => void;
16
+ handlePageChange: (page: number | unknown) => void;
17
+ handlePageLimitChange: (k: string, value: object) => void;
18
+ handleSearch: (query: string) => void;
19
+ handleSubmit: () => void;
20
+ handleView: (row?: TableRow) => void;
21
+ headerActions: {
22
+ enabled: boolean;
23
+ handleOnClick: () => void;
24
+ label: string;
25
+ order: number;
26
+ }[];
27
+ listFetchNow: (url?: string, config?: import("@react-pakistan/util-functions/hooks/use-fetch").FetchConfig) => void;
28
+ listLoading: boolean;
29
+ rowActions: RowAction[];
30
+ toggleStatus: (row?: TableRow) => void;
31
+ updateLoading: boolean;
32
+ state: {
33
+ items: StudentFeeBE[];
34
+ count: number;
35
+ currentPage: number;
36
+ pageLimit: number;
37
+ searchQuery: string;
38
+ disableSaveButton: boolean;
39
+ drawer: string | null;
40
+ errors: Record<string, string>;
41
+ amount: number;
42
+ amountDue: number;
43
+ amountPaid: number;
44
+ discountAmount: number;
45
+ discountCodeId: string | null;
46
+ dueDate: string;
47
+ enabled: boolean;
48
+ familyId: string;
49
+ feeStructureId: string;
50
+ id: string;
51
+ lastRemindedAt: Date | string | null;
52
+ nextFollowUpAt: Date | string | null;
53
+ originalFee: number;
54
+ reliabilityScore: number | null;
55
+ remarks: string | null;
56
+ riskLevel: FEE_RISK_LEVEL | null;
57
+ schoolId: string;
58
+ status: PAYMENT_STATUS;
59
+ studentProfileId: string;
60
+ filterEnabled: boolean | undefined;
61
+ filterStatus: PAYMENT_STATUS | "";
62
+ };
63
+ dispatch: React.Dispatch<any>;
64
+ };