@appcorp/fusion-storybook 0.3.76 → 0.3.77
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/student-fee/context/use-student-fee-module.js +2 -2
- package/base-modules/student-fee/monthly-create.d.ts +0 -1
- package/base-modules/student-fee/monthly-create.js +56 -15
- package/base-modules/student-fee/monthly-form.d.ts +0 -1
- package/base-modules/student-fee/monthly-form.js +49 -27
- package/base-modules/student-fee/more-actions.js +5 -1
- package/base-modules/student-fee/page.js +8 -6
- package/base-modules/student-fee/single-entry-form.d.ts +0 -66
- package/base-modules/student-fee/single-entry-form.js +274 -103
- package/base-modules/student-fee/single-entry.d.ts +0 -1
- package/base-modules/student-fee/single-entry.js +94 -28
- package/package.json +2 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- /package/base-modules/student-fee/{msic-1.d.ts → misc-1.d.ts} +0 -0
- /package/base-modules/student-fee/{msic-1.js → misc-1.js} +0 -0
- /package/base-modules/student-fee/{msic-2.d.ts → misc-2.d.ts} +0 -0
- /package/base-modules/student-fee/{msic-2.js → misc-2.js} +0 -0
|
@@ -460,7 +460,7 @@ export const useStudentFeeModule = () => {
|
|
|
460
460
|
resetRecordFormState();
|
|
461
461
|
dispatch({
|
|
462
462
|
type: STUDENT_FEE_ACTION_TYPES.SET_DRAWER,
|
|
463
|
-
payload: { drawer: STUDENT_FEE_DRAWER.
|
|
463
|
+
payload: { drawer: STUDENT_FEE_DRAWER.MISC_DRAWER_2 },
|
|
464
464
|
});
|
|
465
465
|
}, [dispatch, resetRecordFormState]);
|
|
466
466
|
const handleCreateMonthly = useCallback(() => {
|
|
@@ -471,7 +471,7 @@ export const useStudentFeeModule = () => {
|
|
|
471
471
|
});
|
|
472
472
|
dispatch({
|
|
473
473
|
type: STUDENT_FEE_ACTION_TYPES.SET_DRAWER,
|
|
474
|
-
payload: { drawer: STUDENT_FEE_DRAWER.
|
|
474
|
+
payload: { drawer: STUDENT_FEE_DRAWER.MISC_DRAWER_1 },
|
|
475
475
|
});
|
|
476
476
|
}, [dispatch, resetRecordFormState]);
|
|
477
477
|
const handleView = useCallback((row) => {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const StudentFeeCreateMonthly: () => import("react").JSX.Element;
|
|
@@ -1,15 +1,56 @@
|
|
|
1
|
-
"use
|
|
2
|
-
|
|
3
|
-
import { EnhancedDrawerHeader } from "@appcorp/shadcn/components/enhanced-drawer-header";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
// "use client";
|
|
3
|
+
// import { EnhancedDrawerHeader } from "@appcorp/shadcn/components/enhanced-drawer-header";
|
|
4
|
+
// import {
|
|
5
|
+
// EnhancedDrawerFooter,
|
|
6
|
+
// DRAWER_FOOTER_COMPONENT_TYPE,
|
|
7
|
+
// } from "@appcorp/shadcn/components/enhanced-drawer-footer";
|
|
8
|
+
// import { DrawerGeneric } from "@appcorp/shadcn/components/drawer-generic";
|
|
9
|
+
// import { useStudentFeeModule, STUDENT_FEE_DRAWER } from "./context";
|
|
10
|
+
// import { useTranslations } from "next-intl";
|
|
11
|
+
// import { StudentFeeMonthlyForm } from "./monthly-form";
|
|
12
|
+
// export const StudentFeeCreateMonthly = () => {
|
|
13
|
+
// const { closeDrawer, handleProceedMonthlyCreation, state, updateLoading } =
|
|
14
|
+
// useStudentFeeModule();
|
|
15
|
+
// const t = useTranslations("studentFee");
|
|
16
|
+
// const { disableSaveButton, drawer, errors } = state;
|
|
17
|
+
// const isOpen = drawer === STUDENT_FEE_DRAWER.MISC_DRAWER_1;
|
|
18
|
+
// return (
|
|
19
|
+
// <DrawerGeneric
|
|
20
|
+
// filterDrawer={null}
|
|
21
|
+
// filterDrawerHeader={null}
|
|
22
|
+
// filterDrawerFooter={null}
|
|
23
|
+
// formDrawer={isOpen ? <StudentFeeMonthlyForm /> : null}
|
|
24
|
+
// formDrawerHeader={
|
|
25
|
+
// isOpen ? (
|
|
26
|
+
// <EnhancedDrawerHeader
|
|
27
|
+
// title={t("drawerCreateMonthlyTitle")}
|
|
28
|
+
// description={t("drawerCreateMonthlyDescription")}
|
|
29
|
+
// />
|
|
30
|
+
// ) : null
|
|
31
|
+
// }
|
|
32
|
+
// formDrawerFooter={
|
|
33
|
+
// isOpen ? (
|
|
34
|
+
// <EnhancedDrawerFooter
|
|
35
|
+
// applyFilters={() => {}}
|
|
36
|
+
// clearFilters={() => {}}
|
|
37
|
+
// closeDrawer={closeDrawer}
|
|
38
|
+
// disableSaveButton={disableSaveButton}
|
|
39
|
+
// drawerType={DRAWER_FOOTER_COMPONENT_TYPE.FORM_DRAWER}
|
|
40
|
+
// errors={errors}
|
|
41
|
+
// handleSubmit={handleProceedMonthlyCreation}
|
|
42
|
+
// updateLoading={updateLoading}
|
|
43
|
+
// />
|
|
44
|
+
// ) : null
|
|
45
|
+
// }
|
|
46
|
+
// viewDrawer={null}
|
|
47
|
+
// viewDrawerHeader={null}
|
|
48
|
+
// viewDrawerFooter={null}
|
|
49
|
+
// moreActionsDrawer={null}
|
|
50
|
+
// moreActionsDrawerHeader={null}
|
|
51
|
+
// moreActionsDrawerFooter={null}
|
|
52
|
+
// onOpenChange={(open: boolean) => !open && closeDrawer()}
|
|
53
|
+
// open={isOpen}
|
|
54
|
+
// />
|
|
55
|
+
// );
|
|
56
|
+
// };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const StudentFeeMonthlyForm: () => import("react").JSX.Element;
|
|
@@ -1,27 +1,49 @@
|
|
|
1
|
-
"use
|
|
2
|
-
|
|
3
|
-
import { useCallback, useState } from "react";
|
|
4
|
-
import { useTranslations } from "next-intl";
|
|
5
|
-
import { EnhancedCheckbox } from "@appcorp/shadcn/components/enhanced-checkbox";
|
|
6
|
-
import { useStudentFeeModule, STUDENT_FEE_ACTION_TYPES } from "./context";
|
|
7
|
-
const CHECKBOX_KEYS = [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
];
|
|
13
|
-
export const StudentFeeMonthlyForm = () => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
// "use client";
|
|
3
|
+
// import { useCallback, useState } from "react";
|
|
4
|
+
// import { useTranslations } from "next-intl";
|
|
5
|
+
// import { EnhancedCheckbox } from "@appcorp/shadcn/components/enhanced-checkbox";
|
|
6
|
+
// import { useStudentFeeModule, STUDENT_FEE_ACTION_TYPES } from "./context";
|
|
7
|
+
// const CHECKBOX_KEYS = [
|
|
8
|
+
// "formMonthlyCheckStudentProfile",
|
|
9
|
+
// "formMonthlyCheckFeeStructure",
|
|
10
|
+
// "formMonthlyCheckGmail",
|
|
11
|
+
// "formMonthlyCheckReady",
|
|
12
|
+
// ] as const;
|
|
13
|
+
// export const StudentFeeMonthlyForm = () => {
|
|
14
|
+
// const t = useTranslations("studentFee");
|
|
15
|
+
// const { dispatch } = useStudentFeeModule();
|
|
16
|
+
// const [checked, setChecked] = useState<Record<string, boolean>>(
|
|
17
|
+
// Object.fromEntries(CHECKBOX_KEYS.map((key) => [key, false]))
|
|
18
|
+
// );
|
|
19
|
+
// // const allChecked = CHECKBOX_KEYS.every((key) => checked[key]);
|
|
20
|
+
// const handleCheckChange = useCallback(
|
|
21
|
+
// (key: string, value: boolean) => {
|
|
22
|
+
// const next = { ...checked, [key]: value };
|
|
23
|
+
// setChecked(next);
|
|
24
|
+
// dispatch({
|
|
25
|
+
// type: STUDENT_FEE_ACTION_TYPES.SET_DISABLE_SAVE_BUTTON,
|
|
26
|
+
// payload: { disabled: !CHECKBOX_KEYS.every((k) => next[k]) },
|
|
27
|
+
// });
|
|
28
|
+
// },
|
|
29
|
+
// [checked, dispatch]
|
|
30
|
+
// );
|
|
31
|
+
// return (
|
|
32
|
+
// <div className="grid grid-cols-1 gap-4">
|
|
33
|
+
// <p className="text-foreground text-sm">
|
|
34
|
+
// {t("formMonthlyWarningMessage")}
|
|
35
|
+
// </p>
|
|
36
|
+
// <div className="flex flex-col gap-3">
|
|
37
|
+
// {CHECKBOX_KEYS.map((key) => (
|
|
38
|
+
// <EnhancedCheckbox
|
|
39
|
+
// key={key}
|
|
40
|
+
// checked={checked[key]}
|
|
41
|
+
// id={key}
|
|
42
|
+
// label={t(key)}
|
|
43
|
+
// onCheckedChange={(value: boolean) => handleCheckChange(key, value)}
|
|
44
|
+
// />
|
|
45
|
+
// ))}
|
|
46
|
+
// </div>
|
|
47
|
+
// </div>
|
|
48
|
+
// );
|
|
49
|
+
// };
|
|
@@ -232,5 +232,9 @@ export const StudentFeeMoreActions = () => {
|
|
|
232
232
|
title: t("uploadTheCompletedCsvToTheSystem"),
|
|
233
233
|
},
|
|
234
234
|
];
|
|
235
|
-
return (_jsxs("div", { className: "space-y-4", children: [_jsx(Button
|
|
235
|
+
return (_jsxs("div", { className: "space-y-4", children: [_jsx(Button
|
|
236
|
+
// disabled={new Date().getDate() !== 1}
|
|
237
|
+
, {
|
|
238
|
+
// disabled={new Date().getDate() !== 1}
|
|
239
|
+
onClick: handleCreateMonthly, children: t("actionsButtonCreateMonthly") }), _jsx(Button, { onClick: handleCreateSingleEntry, children: t("actionsButtonSingleEntry") }), _jsx(Separator, {}), _jsx(Timeline, { events: update, heading: t("bulkUpdate"), handleOnBulkCreate: handleBulkUpdate })] }));
|
|
236
240
|
};
|
|
@@ -28,8 +28,8 @@ import { StudentFeeView } from "./view";
|
|
|
28
28
|
import { resolveRbacPermissions } from "../../utils/resolve-rbac-permissions";
|
|
29
29
|
import { RbacNoAccess } from "../../components/rbac-no-access";
|
|
30
30
|
import { formatStudentName, formatAmount, formatAmountPaid, formatAmountDue, } from "./constants";
|
|
31
|
-
import { StudentFeeMonthly } from "./
|
|
32
|
-
import { StudentFeeSingle } from "./
|
|
31
|
+
import { StudentFeeMonthly } from "./misc-1";
|
|
32
|
+
import { StudentFeeSingle } from "./misc-2";
|
|
33
33
|
// ============================================================================
|
|
34
34
|
// TABLE COLUMN CONFIGURATION (static — formatters imported from constants)
|
|
35
35
|
// ============================================================================
|
|
@@ -101,16 +101,18 @@ const createStudentFeeConfig = ({ dispatch, drawerButtonCancel, drawerButtonSave
|
|
|
101
101
|
drawerFilterTitle,
|
|
102
102
|
drawerFormDescription,
|
|
103
103
|
drawerFormTitle,
|
|
104
|
-
drawerMoreActionsDescription,
|
|
105
|
-
drawerMoreActionsTitle,
|
|
106
|
-
drawerViewDescription,
|
|
107
|
-
drawerViewTitle,
|
|
108
104
|
drawerMisc1Description,
|
|
109
105
|
drawerMisc1Title,
|
|
110
106
|
drawerMisc2Description,
|
|
111
107
|
drawerMisc2Title,
|
|
108
|
+
drawerMoreActionsDescription,
|
|
109
|
+
drawerMoreActionsTitle,
|
|
110
|
+
drawerViewDescription,
|
|
111
|
+
drawerViewTitle,
|
|
112
112
|
filterContent: components.filter,
|
|
113
113
|
formContent: components.form,
|
|
114
|
+
misc1Content: components.misc1,
|
|
115
|
+
misc2Content: components.misc2,
|
|
114
116
|
moreActionsContent: components.moreActions,
|
|
115
117
|
saveLabel: drawerButtonSave,
|
|
116
118
|
searchPlaceholder: tableSearchPlaceholder,
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
import { DISCOUNT_TYPE, PAYMENT_STATUS } from "../../type";
|
|
3
|
-
interface StudentProfileSummary {
|
|
4
|
-
id: string;
|
|
5
|
-
computerNumber: string;
|
|
6
|
-
firstName: string;
|
|
7
|
-
lastName: string;
|
|
8
|
-
status: string;
|
|
9
|
-
}
|
|
10
|
-
interface FeeRecordSummary {
|
|
11
|
-
amount: number;
|
|
12
|
-
amountDue: number;
|
|
13
|
-
amountPaid: number;
|
|
14
|
-
createdAt: string;
|
|
15
|
-
discountAmount: number | null;
|
|
16
|
-
discountCodeId: string | null;
|
|
17
|
-
dueDate: string;
|
|
18
|
-
enabled: boolean;
|
|
19
|
-
familyId: string;
|
|
20
|
-
feeStructureId: string;
|
|
21
|
-
fine?: number | null;
|
|
22
|
-
id: string;
|
|
23
|
-
lastRemindedAt: string | null;
|
|
24
|
-
paidAt?: Date | string | null;
|
|
25
|
-
nextFollowUpAt: string | null;
|
|
26
|
-
reliabilityScore: number | null;
|
|
27
|
-
remarks: string | null;
|
|
28
|
-
riskLevel: string | null;
|
|
29
|
-
schoolId: string;
|
|
30
|
-
status: PAYMENT_STATUS;
|
|
31
|
-
studentProfileId: string;
|
|
32
|
-
updatedAt: string;
|
|
33
|
-
family: {
|
|
34
|
-
address: string;
|
|
35
|
-
city: string;
|
|
36
|
-
country: string;
|
|
37
|
-
id: string;
|
|
38
|
-
} | null;
|
|
39
|
-
feeStructure: {
|
|
40
|
-
name: string;
|
|
41
|
-
amount: number;
|
|
42
|
-
id: string;
|
|
43
|
-
} | null;
|
|
44
|
-
discountCode: {
|
|
45
|
-
code: string;
|
|
46
|
-
discountValue: number;
|
|
47
|
-
discountType: DISCOUNT_TYPE;
|
|
48
|
-
} | null;
|
|
49
|
-
}
|
|
50
|
-
interface StudentFeeByCNResponse {
|
|
51
|
-
studentProfile: StudentProfileSummary;
|
|
52
|
-
studentFees: FeeRecordSummary[];
|
|
53
|
-
}
|
|
54
|
-
interface SingleEntryStudentFeeFormProps {
|
|
55
|
-
amountPaid: string;
|
|
56
|
-
feeByComputerNumber: StudentFeeByCNResponse | null;
|
|
57
|
-
fetchByComputerNumber: (url: string | undefined, options: object) => void;
|
|
58
|
-
fetchingByCN: boolean;
|
|
59
|
-
paidAt: string;
|
|
60
|
-
remarks: string;
|
|
61
|
-
setAmountPaid: (value: string) => void;
|
|
62
|
-
setPaidAt: (value: string) => void;
|
|
63
|
-
setRemarks: (value: string) => void;
|
|
64
|
-
}
|
|
65
|
-
export declare const SingleEntryStudentFeeForm: FC<SingleEntryStudentFeeFormProps>;
|
|
66
|
-
export {};
|