@appcorp/fusion-storybook 0.3.76 → 0.3.78

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.
@@ -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.MISC_DRAWER_1 },
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.MISC_DRAWER_2 },
474
+ payload: { drawer: STUDENT_FEE_DRAWER.MISC_DRAWER_1 },
475
475
  });
476
476
  }, [dispatch, resetRecordFormState]);
477
477
  const handleView = useCallback((row) => {
@@ -14,7 +14,7 @@ import { EnhancedInput } from "@appcorp/shadcn/components/enhanced-input";
14
14
  import { getCachedWorkspaceSync } from "../workspace/cache";
15
15
  import { useDebounce } from "@react-pakistan/util-functions/hooks/use-debounce";
16
16
  import { useFetch } from "@react-pakistan/util-functions/hooks/use-fetch";
17
- import { STUDENT_FEE_API_ROUTES } from "@/constants";
17
+ import { STUDENT_FEE_API_ROUTES } from "../../constants";
18
18
  import { API_METHODS } from "@react-pakistan/util-functions/constants/api-methods";
19
19
  import { DISCOUNT_TYPE } from "../../types";
20
20
  import { Loader2 } from "lucide-react";
@@ -1 +0,0 @@
1
- export declare const StudentFeeCreateMonthly: () => import("react").JSX.Element;
@@ -1,15 +1,56 @@
1
- "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { EnhancedDrawerHeader } from "@appcorp/shadcn/components/enhanced-drawer-header";
4
- import { EnhancedDrawerFooter, DRAWER_FOOTER_COMPONENT_TYPE, } from "@appcorp/shadcn/components/enhanced-drawer-footer";
5
- import { DrawerGeneric } from "@appcorp/shadcn/components/drawer-generic";
6
- import { useStudentFeeModule, STUDENT_FEE_DRAWER } from "./context";
7
- import { useTranslations } from "next-intl";
8
- import { StudentFeeMonthlyForm } from "./monthly-form";
9
- export const StudentFeeCreateMonthly = () => {
10
- const { closeDrawer, handleProceedMonthlyCreation, state, updateLoading } = useStudentFeeModule();
11
- const t = useTranslations("studentFee");
12
- const { disableSaveButton, drawer, errors } = state;
13
- const isOpen = drawer === STUDENT_FEE_DRAWER.MISC_DRAWER_1;
14
- return (_jsx(DrawerGeneric, { filterDrawer: null, filterDrawerHeader: null, filterDrawerFooter: null, formDrawer: isOpen ? _jsx(StudentFeeMonthlyForm, {}) : null, formDrawerHeader: isOpen ? (_jsx(EnhancedDrawerHeader, { title: t("drawerCreateMonthlyTitle"), description: t("drawerCreateMonthlyDescription") })) : null, formDrawerFooter: isOpen ? (_jsx(EnhancedDrawerFooter, { applyFilters: () => { }, clearFilters: () => { }, closeDrawer: closeDrawer, disableSaveButton: disableSaveButton, drawerType: DRAWER_FOOTER_COMPONENT_TYPE.FORM_DRAWER, errors: errors, handleSubmit: handleProceedMonthlyCreation, updateLoading: updateLoading })) : null, viewDrawer: null, viewDrawerHeader: null, viewDrawerFooter: null, moreActionsDrawer: null, moreActionsDrawerHeader: null, moreActionsDrawerFooter: null, onOpenChange: (open) => !open && closeDrawer(), open: isOpen }));
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 client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
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
- ];
13
- export const StudentFeeMonthlyForm = () => {
14
- const t = useTranslations("studentFee");
15
- const { dispatch } = useStudentFeeModule();
16
- const [checked, setChecked] = useState(Object.fromEntries(CHECKBOX_KEYS.map((key) => [key, false])));
17
- // const allChecked = CHECKBOX_KEYS.every((key) => checked[key]);
18
- const handleCheckChange = useCallback((key, value) => {
19
- const next = Object.assign(Object.assign({}, checked), { [key]: value });
20
- setChecked(next);
21
- dispatch({
22
- type: STUDENT_FEE_ACTION_TYPES.SET_DISABLE_SAVE_BUTTON,
23
- payload: { disabled: !CHECKBOX_KEYS.every((k) => next[k]) },
24
- });
25
- }, [checked, dispatch]);
26
- return (_jsxs("div", { className: "grid grid-cols-1 gap-4", children: [_jsx("p", { className: "text-foreground text-sm", children: t("formMonthlyWarningMessage") }), _jsx("div", { className: "flex flex-col gap-3", children: CHECKBOX_KEYS.map((key) => (_jsx(EnhancedCheckbox, { checked: checked[key], id: key, label: t(key), onCheckedChange: (value) => handleCheckChange(key, value) }, key))) })] }));
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, { disabled: new Date().getDate() !== 1, onClick: handleCreateMonthly, children: t('actionsButtonCreateMonthly') }), _jsx(Button, { onClick: handleCreateSingleEntry, children: t('actionsButtonSingleEntry') }), _jsx(Separator, {}), _jsx(Timeline, { events: update, heading: t("bulkUpdate"), handleOnBulkCreate: handleBulkUpdate })] }));
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 "./msic-1";
32
- import { StudentFeeSingle } from "./msic-2";
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 {};