@appcorp/fusion-storybook 0.4.23 → 0.4.25
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/shared.d.ts +11 -1
- package/base-modules/student-fee/context/shared.js +4 -2
- package/base-modules/student-fee/context/use-student-fee-module.d.ts +3 -1
- package/base-modules/student-fee/view.js +4 -14
- package/package.json +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StudentFeeBE, PAYMENT_STATUS, FEE_RISK_LEVEL } from "../../../type";
|
|
1
|
+
import { StudentFeeBE, PAYMENT_STATUS, FEE_RISK_LEVEL, FeeStructureBE, StudentProfileBE } from "../../../type";
|
|
2
2
|
export declare const STUDENT_FEE_DRAWER: {
|
|
3
3
|
readonly FILTER_DRAWER: string;
|
|
4
4
|
readonly FORM_DRAWER: string;
|
|
@@ -46,6 +46,7 @@ export declare const STUDENT_FEE_ACTION_TYPES: {
|
|
|
46
46
|
enabled: boolean;
|
|
47
47
|
familyId: string;
|
|
48
48
|
feeStructureId: string;
|
|
49
|
+
feeStructure: FeeStructureBE | null;
|
|
49
50
|
id: string;
|
|
50
51
|
lastRemindedAt: Date | string | null;
|
|
51
52
|
nextFollowUpAt: Date | string | null;
|
|
@@ -57,6 +58,7 @@ export declare const STUDENT_FEE_ACTION_TYPES: {
|
|
|
57
58
|
schoolId: string;
|
|
58
59
|
status: PAYMENT_STATUS;
|
|
59
60
|
studentProfileId: string;
|
|
61
|
+
studentProfile: StudentProfileBE | null;
|
|
60
62
|
filterEnabled: boolean | undefined;
|
|
61
63
|
filterStatus: PAYMENT_STATUS | "";
|
|
62
64
|
filterFromDate: string;
|
|
@@ -88,6 +90,7 @@ export declare const STUDENT_FEE_ACTION_TYPES: {
|
|
|
88
90
|
enabled: boolean;
|
|
89
91
|
familyId: string;
|
|
90
92
|
feeStructureId: string;
|
|
93
|
+
feeStructure: FeeStructureBE | null;
|
|
91
94
|
id: string;
|
|
92
95
|
lastRemindedAt: Date | string | null;
|
|
93
96
|
nextFollowUpAt: Date | string | null;
|
|
@@ -99,6 +102,7 @@ export declare const STUDENT_FEE_ACTION_TYPES: {
|
|
|
99
102
|
schoolId: string;
|
|
100
103
|
status: PAYMENT_STATUS;
|
|
101
104
|
studentProfileId: string;
|
|
105
|
+
studentProfile: StudentProfileBE | null;
|
|
102
106
|
filterEnabled: boolean | undefined;
|
|
103
107
|
filterStatus: PAYMENT_STATUS | "";
|
|
104
108
|
filterFromDate: string;
|
|
@@ -132,6 +136,7 @@ export declare const STUDENT_FEE_ACTION_TYPES: {
|
|
|
132
136
|
enabled: boolean;
|
|
133
137
|
familyId: string;
|
|
134
138
|
feeStructureId: string;
|
|
139
|
+
feeStructure: FeeStructureBE | null;
|
|
135
140
|
id: string;
|
|
136
141
|
lastRemindedAt: Date | string | null;
|
|
137
142
|
nextFollowUpAt: Date | string | null;
|
|
@@ -143,6 +148,7 @@ export declare const STUDENT_FEE_ACTION_TYPES: {
|
|
|
143
148
|
schoolId: string;
|
|
144
149
|
status: PAYMENT_STATUS;
|
|
145
150
|
studentProfileId: string;
|
|
151
|
+
studentProfile: StudentProfileBE | null;
|
|
146
152
|
filterEnabled: boolean | undefined;
|
|
147
153
|
filterStatus: PAYMENT_STATUS | "";
|
|
148
154
|
filterFromDate: string;
|
|
@@ -174,6 +180,7 @@ export declare const STUDENT_FEE_ACTION_TYPES: {
|
|
|
174
180
|
enabled: boolean;
|
|
175
181
|
familyId: string;
|
|
176
182
|
feeStructureId: string;
|
|
183
|
+
feeStructure: FeeStructureBE | null;
|
|
177
184
|
id: string;
|
|
178
185
|
lastRemindedAt: Date | string | null;
|
|
179
186
|
nextFollowUpAt: Date | string | null;
|
|
@@ -185,6 +192,7 @@ export declare const STUDENT_FEE_ACTION_TYPES: {
|
|
|
185
192
|
schoolId: string;
|
|
186
193
|
status: PAYMENT_STATUS;
|
|
187
194
|
studentProfileId: string;
|
|
195
|
+
studentProfile: StudentProfileBE | null;
|
|
188
196
|
filterEnabled: boolean | undefined;
|
|
189
197
|
filterStatus: PAYMENT_STATUS | "";
|
|
190
198
|
filterFromDate: string;
|
|
@@ -216,6 +224,7 @@ export declare const STUDENT_FEE_ACTION_TYPES: {
|
|
|
216
224
|
enabled: boolean;
|
|
217
225
|
familyId: string;
|
|
218
226
|
feeStructureId: string;
|
|
227
|
+
feeStructure: FeeStructureBE | null;
|
|
219
228
|
id: string;
|
|
220
229
|
lastRemindedAt: Date | string | null;
|
|
221
230
|
nextFollowUpAt: Date | string | null;
|
|
@@ -227,6 +236,7 @@ export declare const STUDENT_FEE_ACTION_TYPES: {
|
|
|
227
236
|
schoolId: string;
|
|
228
237
|
status: PAYMENT_STATUS;
|
|
229
238
|
studentProfileId: string;
|
|
239
|
+
studentProfile: StudentProfileBE | null;
|
|
230
240
|
filterEnabled: boolean | undefined;
|
|
231
241
|
filterStatus: PAYMENT_STATUS | "";
|
|
232
242
|
filterFromDate: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createGenericModule } from "@react-pakistan/util-functions/factory/generic-module-factory";
|
|
3
3
|
import { DRAWER_TYPES } from "@react-pakistan/util-functions/factory/generic-component-factory";
|
|
4
|
-
import { PAYMENT_STATUS } from "../../../type";
|
|
4
|
+
import { PAYMENT_STATUS, } from "../../../type";
|
|
5
5
|
import { filterDateDefaults, pageLimit } from "../constants";
|
|
6
|
-
const { filterFromDate: defaultFilterFromDate, filterToDate: defaultFilterToDate } = filterDateDefaults();
|
|
6
|
+
const { filterFromDate: defaultFilterFromDate, filterToDate: defaultFilterToDate, } = filterDateDefaults();
|
|
7
7
|
// ============================================================================
|
|
8
8
|
// 1.1 DRAWER TYPES
|
|
9
9
|
// ============================================================================
|
|
@@ -47,6 +47,7 @@ const studentFeeConfig = {
|
|
|
47
47
|
enabled: true,
|
|
48
48
|
familyId: "",
|
|
49
49
|
feeStructureId: "",
|
|
50
|
+
feeStructure: null,
|
|
50
51
|
id: "",
|
|
51
52
|
lastRemindedAt: null,
|
|
52
53
|
nextFollowUpAt: null,
|
|
@@ -61,6 +62,7 @@ const studentFeeConfig = {
|
|
|
61
62
|
schoolId: "",
|
|
62
63
|
status: PAYMENT_STATUS.PENDING,
|
|
63
64
|
studentProfileId: "",
|
|
65
|
+
studentProfile: null,
|
|
64
66
|
// Draft filters (drawer edits; not fetched until Apply)
|
|
65
67
|
filterEnabled: undefined,
|
|
66
68
|
filterStatus: "",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PAYMENT_STATUS, FEE_RISK_LEVEL } from "../../../type";
|
|
1
|
+
import { PAYMENT_STATUS, FEE_RISK_LEVEL, StudentProfileBE } from "../../../type";
|
|
2
2
|
import { type RowAction, type TableRow } from "@appcorp/shadcn/components/enhanced-table";
|
|
3
3
|
export declare const useStudentFeeModule: () => {
|
|
4
4
|
applyFilters: () => void;
|
|
@@ -58,6 +58,7 @@ export declare const useStudentFeeModule: () => {
|
|
|
58
58
|
enabled: boolean;
|
|
59
59
|
familyId: string;
|
|
60
60
|
feeStructureId: string;
|
|
61
|
+
feeStructure: import("../../../types").FeeStructureBE | null;
|
|
61
62
|
id: string;
|
|
62
63
|
lastRemindedAt: Date | string | null;
|
|
63
64
|
nextFollowUpAt: Date | string | null;
|
|
@@ -69,6 +70,7 @@ export declare const useStudentFeeModule: () => {
|
|
|
69
70
|
schoolId: string;
|
|
70
71
|
status: PAYMENT_STATUS;
|
|
71
72
|
studentProfileId: string;
|
|
73
|
+
studentProfile: StudentProfileBE | null;
|
|
72
74
|
filterEnabled: boolean | undefined;
|
|
73
75
|
filterStatus: PAYMENT_STATUS | "";
|
|
74
76
|
filterFromDate: string;
|
|
@@ -8,27 +8,17 @@ import { Calendar, FileText, CheckCircle2, XCircle } from "lucide-react";
|
|
|
8
8
|
import { getCachedWorkspaceSync } from "../workspace/cache";
|
|
9
9
|
import { formatDate } from "@react-pakistan/util-functions/general/format-date";
|
|
10
10
|
import { DATE_FORMATS } from "@react-pakistan/util-functions/general/format-date";
|
|
11
|
-
import { API_METHODS } from "@react-pakistan/util-functions/constants/api-methods";
|
|
12
|
-
import { useFetch } from "@react-pakistan/util-functions/hooks/use-fetch";
|
|
13
11
|
import { useTranslations } from "next-intl";
|
|
14
12
|
export const StudentFeeView = () => {
|
|
15
|
-
var _a, _b, _c;
|
|
13
|
+
var _a, _b, _c, _d, _e;
|
|
16
14
|
const { state } = useStudentFeeModule();
|
|
17
|
-
const { amount, amountDue, amountPaid, fine, dueDate, enabled,
|
|
15
|
+
const { amount, amountDue, amountPaid, fine, dueDate, enabled, feeStructure, paidAt, remarks, status, studentProfile, } = state;
|
|
18
16
|
const workspace = getCachedWorkspaceSync();
|
|
19
17
|
const currency = (_b = (_a = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _a === void 0 ? void 0 : _a.currency) !== null && _b !== void 0 ? _b : "";
|
|
20
18
|
const t = useTranslations("studentFee");
|
|
21
|
-
const { data: studentProfile } = useFetch("/api/v1/student-profile", {
|
|
22
|
-
method: API_METHODS.GET,
|
|
23
|
-
params: { id: studentProfileId, workspaceId: workspace === null || workspace === void 0 ? void 0 : workspace.id },
|
|
24
|
-
});
|
|
25
|
-
const { data: feeStructure } = useFetch("/api/v1/fee-structure", {
|
|
26
|
-
method: API_METHODS.GET,
|
|
27
|
-
params: { id: feeStructureId, workspaceId: workspace === null || workspace === void 0 ? void 0 : workspace.id },
|
|
28
|
-
});
|
|
29
19
|
return (_jsx("div", { className: "space-y-4", children: _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(FileText, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionStudentFeeDetails") })] }), _jsx(CardDescription, { children: t("viewSectionReadOnlyStudentFeeInformation") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formStudentLabel") }), _jsx("p", { className: "text-base", children: studentProfile
|
|
30
|
-
? `${studentProfile.firstName} ${studentProfile.lastName}`
|
|
31
|
-
: "—" })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldComputerNumber") }), _jsx("p", { className: "text-base", children: ((
|
|
20
|
+
? `${(_c = studentProfile.familyMember) === null || _c === void 0 ? void 0 : _c.firstName} ${(_d = studentProfile === null || studentProfile === void 0 ? void 0 : studentProfile.familyMember) === null || _d === void 0 ? void 0 : _d.lastName}`
|
|
21
|
+
: "—" })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldComputerNumber") }), _jsx("p", { className: "text-base", children: ((_e = studentProfile === null || studentProfile === void 0 ? void 0 : studentProfile.computerNumber) !== null && _e !== void 0 ? _e : "").split(":")[1] ||
|
|
32
22
|
(studentProfile === null || studentProfile === void 0 ? void 0 : studentProfile.computerNumber) ||
|
|
33
23
|
"—" })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formFeeStructureLabel") }), _jsx("p", { className: "text-base", children: (feeStructure === null || feeStructure === void 0 ? void 0 : feeStructure.name) || "—" })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formTotalAmountLabel") }), _jsxs("p", { className: "text-base", children: [currency, " ", (amount !== null && amount !== void 0 ? amount : 0).toFixed(2)] })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formAmountPaidLabel") }), _jsxs("p", { className: "text-base", children: [currency, " ", (amountPaid !== null && amountPaid !== void 0 ? amountPaid : 0).toFixed(2)] })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldFine") }), _jsxs("p", { className: "text-base", children: [currency, " ", (fine !== null && fine !== void 0 ? fine : 0).toFixed(2)] })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formAmountDueLabel") }), _jsxs("p", { className: "text-base", children: [currency, " ", (amountDue !== null && amountDue !== void 0 ? amountDue : 0).toFixed(2)] })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Calendar, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formDueDateLabel") })] }), _jsx("p", { className: "text-base", children: formatDate(dueDate, DATE_FORMATS.LOCALE_DATE) })] }), paidAt && (_jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Calendar, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formPaidAtLabel") })] }), _jsx("p", { className: "text-base", children: formatDate(paidAt, DATE_FORMATS.LOCALE_DATE) })] })), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formStatusLabel") }), _jsx(Badge, { variant: "secondary", children: status || "—" })] }), remarks && (_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formRemarksLabel") }), _jsx("p", { className: "text-base", children: remarks })] })), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldRecordState") }), _jsxs(Badge, { className: "gap-1", variant: enabled ? "default" : "destructive", children: [enabled ? (_jsx(CheckCircle2, { className: "h-3 w-3" })) : (_jsx(XCircle, { className: "h-3 w-3" })), enabled ? t("badgeActive") : t("badgeInactive")] })] })] }) })] }) }));
|
|
34
24
|
};
|