@appcorp/fusion-storybook 0.2.13 → 0.2.15
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/admission/context/use-admission-module.d.ts +88 -0
- package/base-modules/admission/context/use-admission-module.js +771 -0
- package/base-modules/admission/context.d.ts +1 -87
- package/base-modules/admission/context.js +3 -769
- package/base-modules/attendance/more-actions.js +7 -2
- package/base-modules/campus/more-actions.js +0 -1
- package/base-modules/class/more-actions.js +1 -6
- package/base-modules/enrollment/context.d.ts +1 -13
- package/base-modules/enrollment/context.js +0 -3
- package/base-modules/enrollment/form.js +2 -6
- package/base-modules/enrollment/page.d.ts +0 -1
- package/base-modules/enrollment/page.js +5 -13
- package/base-modules/enrollment/validate.d.ts +0 -1
- package/base-modules/enrollment/validate.js +0 -1
- package/base-modules/enrollment/view.js +4 -7
- package/base-modules/expense/more-actions.js +1 -6
- package/base-modules/fee-structure/more-actions.js +1 -6
- package/base-modules/student-fee/context/shared.d.ts +178 -0
- package/base-modules/student-fee/context/shared.js +59 -0
- package/base-modules/student-fee/context/use-student-fee-module.d.ts +64 -0
- package/base-modules/student-fee/context/use-student-fee-module.js +610 -0
- package/base-modules/student-fee/context.d.ts +21 -235
- package/base-modules/student-fee/context.js +2 -674
- package/base-modules/student-fee/more-actions.js +1 -6
- package/base-modules/student-profile/constants.js +7 -3
- package/base-modules/student-profile/context/module-base.d.ts +187 -0
- package/base-modules/student-profile/context/module-base.js +50 -0
- package/base-modules/student-profile/context/use-student-profile-module.d.ts +70 -0
- package/base-modules/student-profile/context/use-student-profile-module.js +506 -0
- package/base-modules/student-profile/context.d.ts +20 -256
- package/base-modules/student-profile/context.js +2 -601
- package/base-modules/teacher/avatar-upload.js +1 -4
- package/base-modules/teacher/more-actions.js +1 -6
- package/base-modules/user/context/use-user-module.d.ts +53 -0
- package/base-modules/user/context/use-user-module.js +546 -0
- package/base-modules/user/context.d.ts +1 -52
- package/base-modules/user/context.js +5 -547
- package/base-modules/workspace-user/more-actions.js +1 -6
- package/components/module-error.d.ts +9 -0
- package/components/module-error.js +3 -0
- package/package.json +5 -4
- package/tsconfig.build.tsbuildinfo +1 -1
- package/type.d.ts +3 -1242
- package/type.js +3 -445
- package/types/academics.d.ts +262 -0
- package/types/academics.js +8 -0
- package/types/admission.d.ts +85 -0
- package/types/admission.js +6 -0
- package/types/communication.d.ts +165 -0
- package/types/communication.js +7 -0
- package/types/enums.d.ts +411 -0
- package/types/enums.js +442 -0
- package/types/finance.d.ts +126 -0
- package/types/finance.js +7 -0
- package/types/index.d.ts +12 -0
- package/types/index.js +12 -0
- package/types/user-management.d.ts +236 -0
- package/types/user-management.js +7 -0
|
@@ -10,15 +10,20 @@ import { useMemo, useState } from "react";
|
|
|
10
10
|
export const AttendanceMoreActions = ({ labelAttendanceStatus, labelCourse, labelCourseInfo, labelCoursePlaceholder, labelNoCourseFound, labelRemarks, labelRemarksInfo, labelRemarksPlaceholder, labelSearchCourses, labelStatusAbsent, labelStatusExcused, labelStatusHalfDay, labelStatusLate, labelStatusPresent, }) => {
|
|
11
11
|
const enrollment = getCachedEnrollmentsSync().items;
|
|
12
12
|
const studentProfiles = getCachedStudentProfilesSync().items;
|
|
13
|
+
const courses = getCachedCoursesSync().items;
|
|
13
14
|
const [courseId, setCourseId] = useState("");
|
|
14
15
|
const [remarks, setRemarks] = useState({});
|
|
15
16
|
const [attendance, setAttendance] = useState({});
|
|
16
17
|
const [errors] = useState({});
|
|
18
|
+
// Find the section for the selected course, then get students enrolled in that section
|
|
17
19
|
const studentsInCourse = useMemo(() => {
|
|
20
|
+
const courseObj = courses.find((c) => c.id === courseId);
|
|
21
|
+
if (!courseObj)
|
|
22
|
+
return [];
|
|
18
23
|
return enrollment
|
|
19
|
-
.filter((e) => e.
|
|
24
|
+
.filter((e) => e.sectionId === courseObj.sectionId)
|
|
20
25
|
.map((e) => e.studentProfileId);
|
|
21
|
-
}, [enrollment, courseId]);
|
|
26
|
+
}, [enrollment, courseId, courses]);
|
|
22
27
|
return (_jsxs("div", { className: "space-y-4", children: [_jsx(EnhancedCombobox, { emptyText: labelNoCourseFound, error: errors.courseId, id: "courseId", info: labelCourseInfo, label: labelCourse, onValueChange: (value) => setCourseId(value), options: getCachedCoursesSync().items.map((c) => ({
|
|
23
28
|
label: c.code.trim(),
|
|
24
29
|
value: c.id,
|
|
@@ -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
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type RowAction, type TableRow } from "@appcorp/shadcn/components/enhanced-table";
|
|
2
|
-
import {
|
|
2
|
+
import { EnrollmentBE, SectionBE, StudentProfileBE } from "../../type";
|
|
3
3
|
export declare const ENROLLMENT_DRAWER: {
|
|
4
4
|
readonly FILTER_DRAWER: string;
|
|
5
5
|
readonly FORM_DRAWER: string;
|
|
@@ -26,7 +26,6 @@ export declare const ENROLLMENT_ACTION_TYPES: {
|
|
|
26
26
|
searchQuery: string;
|
|
27
27
|
disableSaveButton: boolean;
|
|
28
28
|
drawer: string | null;
|
|
29
|
-
courseId: string;
|
|
30
29
|
enabled: boolean;
|
|
31
30
|
enrollmentDate: string;
|
|
32
31
|
errors: Record<string, string>;
|
|
@@ -34,7 +33,6 @@ export declare const ENROLLMENT_ACTION_TYPES: {
|
|
|
34
33
|
id: string;
|
|
35
34
|
sectionId: string;
|
|
36
35
|
studentProfileId: string;
|
|
37
|
-
course: CourseBE | undefined;
|
|
38
36
|
section: SectionBE | undefined;
|
|
39
37
|
studentProfile: StudentProfileBE | undefined;
|
|
40
38
|
}>, initialEnrollmentState: {
|
|
@@ -45,7 +43,6 @@ export declare const ENROLLMENT_ACTION_TYPES: {
|
|
|
45
43
|
searchQuery: string;
|
|
46
44
|
disableSaveButton: boolean;
|
|
47
45
|
drawer: string | null;
|
|
48
|
-
courseId: string;
|
|
49
46
|
enabled: boolean;
|
|
50
47
|
enrollmentDate: string;
|
|
51
48
|
errors: Record<string, string>;
|
|
@@ -53,7 +50,6 @@ export declare const ENROLLMENT_ACTION_TYPES: {
|
|
|
53
50
|
id: string;
|
|
54
51
|
sectionId: string;
|
|
55
52
|
studentProfileId: string;
|
|
56
|
-
course: CourseBE | undefined;
|
|
57
53
|
section: SectionBE | undefined;
|
|
58
54
|
studentProfile: StudentProfileBE | undefined;
|
|
59
55
|
}, EnrollmentProvider: import("react").FC<{
|
|
@@ -66,7 +62,6 @@ export declare const ENROLLMENT_ACTION_TYPES: {
|
|
|
66
62
|
searchQuery: string;
|
|
67
63
|
disableSaveButton: boolean;
|
|
68
64
|
drawer: string | null;
|
|
69
|
-
courseId: string;
|
|
70
65
|
enabled: boolean;
|
|
71
66
|
enrollmentDate: string;
|
|
72
67
|
errors: Record<string, string>;
|
|
@@ -74,7 +69,6 @@ export declare const ENROLLMENT_ACTION_TYPES: {
|
|
|
74
69
|
id: string;
|
|
75
70
|
sectionId: string;
|
|
76
71
|
studentProfileId: string;
|
|
77
|
-
course: CourseBE | undefined;
|
|
78
72
|
section: SectionBE | undefined;
|
|
79
73
|
studentProfile: StudentProfileBE | undefined;
|
|
80
74
|
}, action: any) => {
|
|
@@ -85,7 +79,6 @@ export declare const ENROLLMENT_ACTION_TYPES: {
|
|
|
85
79
|
searchQuery: string;
|
|
86
80
|
disableSaveButton: boolean;
|
|
87
81
|
drawer: string | null;
|
|
88
|
-
courseId: string;
|
|
89
82
|
enabled: boolean;
|
|
90
83
|
enrollmentDate: string;
|
|
91
84
|
errors: Record<string, string>;
|
|
@@ -93,7 +86,6 @@ export declare const ENROLLMENT_ACTION_TYPES: {
|
|
|
93
86
|
id: string;
|
|
94
87
|
sectionId: string;
|
|
95
88
|
studentProfileId: string;
|
|
96
|
-
course: CourseBE | undefined;
|
|
97
89
|
section: SectionBE | undefined;
|
|
98
90
|
studentProfile: StudentProfileBE | undefined;
|
|
99
91
|
}, useEnrollmentContext: () => import("@react-pakistan/util-functions/factory/generic-module-factory").GenericModuleContext<{
|
|
@@ -104,7 +96,6 @@ export declare const ENROLLMENT_ACTION_TYPES: {
|
|
|
104
96
|
searchQuery: string;
|
|
105
97
|
disableSaveButton: boolean;
|
|
106
98
|
drawer: string | null;
|
|
107
|
-
courseId: string;
|
|
108
99
|
enabled: boolean;
|
|
109
100
|
enrollmentDate: string;
|
|
110
101
|
errors: Record<string, string>;
|
|
@@ -112,7 +103,6 @@ export declare const ENROLLMENT_ACTION_TYPES: {
|
|
|
112
103
|
id: string;
|
|
113
104
|
sectionId: string;
|
|
114
105
|
studentProfileId: string;
|
|
115
|
-
course: CourseBE | undefined;
|
|
116
106
|
section: SectionBE | undefined;
|
|
117
107
|
studentProfile: StudentProfileBE | undefined;
|
|
118
108
|
}>;
|
|
@@ -152,7 +142,6 @@ export declare const useEnrollmentModule: () => {
|
|
|
152
142
|
searchQuery: string;
|
|
153
143
|
disableSaveButton: boolean;
|
|
154
144
|
drawer: string | null;
|
|
155
|
-
courseId: string;
|
|
156
145
|
enabled: boolean;
|
|
157
146
|
enrollmentDate: string;
|
|
158
147
|
errors: Record<string, string>;
|
|
@@ -160,7 +149,6 @@ export declare const useEnrollmentModule: () => {
|
|
|
160
149
|
id: string;
|
|
161
150
|
sectionId: string;
|
|
162
151
|
studentProfileId: string;
|
|
163
|
-
course: CourseBE | undefined;
|
|
164
152
|
section: SectionBE | undefined;
|
|
165
153
|
studentProfile: StudentProfileBE | undefined;
|
|
166
154
|
};
|
|
@@ -54,7 +54,6 @@ const enrollmentConfig = {
|
|
|
54
54
|
disableSaveButton: false,
|
|
55
55
|
drawer: null,
|
|
56
56
|
// Form State
|
|
57
|
-
courseId: "",
|
|
58
57
|
enabled: true,
|
|
59
58
|
enrollmentDate: new Date().toISOString().split("T")[0],
|
|
60
59
|
errors: {},
|
|
@@ -63,7 +62,6 @@ const enrollmentConfig = {
|
|
|
63
62
|
sectionId: "",
|
|
64
63
|
studentProfileId: "",
|
|
65
64
|
// Relations (populated from byId fetch)
|
|
66
|
-
course: undefined,
|
|
67
65
|
section: undefined,
|
|
68
66
|
studentProfile: undefined,
|
|
69
67
|
},
|
|
@@ -102,7 +100,6 @@ export const useEnrollmentModule = () => {
|
|
|
102
100
|
debouncedQuery,
|
|
103
101
|
]);
|
|
104
102
|
const updateParams = useMemo(() => ({
|
|
105
|
-
courseId: state.courseId,
|
|
106
103
|
enabled: state.enabled,
|
|
107
104
|
enrollmentDate: state.enrollmentDate,
|
|
108
105
|
id: state.id,
|
|
@@ -16,24 +16,20 @@ import { Separator } from "@appcorp/shadcn/components/ui/separator";
|
|
|
16
16
|
import { DATE_FORMATS, formatDate } from "@react-pakistan/util-functions";
|
|
17
17
|
import { useEnrollmentModule } from "./context";
|
|
18
18
|
import { getCachedStudentProfilesSync } from "../student-profile/cache";
|
|
19
|
-
import { getCachedCoursesSync } from "../course/cache";
|
|
20
19
|
import { getCachedSectionsSync } from "../section/cache";
|
|
21
20
|
import { useTranslations } from "next-intl";
|
|
22
21
|
// ============================================================================
|
|
23
22
|
// COMPONENT
|
|
24
23
|
// ============================================================================
|
|
25
24
|
export const EnrollmentForm = () => {
|
|
26
|
-
const { state: {
|
|
25
|
+
const { state: { enabled, enrollmentDate, errors, sectionId, studentProfileId, }, handleChange, } = useEnrollmentModule();
|
|
27
26
|
const t = useTranslations("enrollment");
|
|
28
27
|
return (_jsxs("div", { className: "space-y-4", children: [_jsx(EnhancedInput, { error: errors.enrollmentDate, id: "enrollmentDate", info: t("formEnrollmentDateInfo"), label: t("formEnrollmentDateLabel"), onChange: (e) => handleChange("enrollmentDate", e.target.value), placeholder: t("formEnrollmentDatePlaceholder"), required: true, type: "date", value: enrollmentDate
|
|
29
28
|
? formatDate(enrollmentDate, DATE_FORMATS.YYYY_MM_DD)
|
|
30
29
|
: "" }), _jsx(Separator, {}), _jsx(EnhancedCombobox, { emptyText: t("formNoStudentEmpty"), error: errors.studentProfileId, id: "studentProfileId", info: t("formStudentInfo"), label: t("formStudentLabel"), onValueChange: (value) => handleChange("studentProfileId", value), options: (getCachedStudentProfilesSync().items || []).map((s) => ({
|
|
31
30
|
label: s.studentCode || s.id,
|
|
32
31
|
value: s.id,
|
|
33
|
-
})), placeholder: t("formStudentPlaceholder"), required: true, searchPlaceholder: t("formSearchStudentsPlaceholder"), value: studentProfileId || "" }), _jsx(EnhancedCombobox, { emptyText: t("
|
|
34
|
-
label: c.code || c.id,
|
|
35
|
-
value: c.id,
|
|
36
|
-
})), placeholder: t("formCoursePlaceholder"), required: true, searchPlaceholder: t("formSearchCoursesPlaceholder"), value: courseId || "" }), _jsx(EnhancedCombobox, { emptyText: t("formNoSectionEmpty"), error: errors.sectionId, id: "sectionId", info: t("sectionInfo"), label: t("section"), onValueChange: (value) => handleChange("sectionId", value), options: (getCachedSectionsSync().items || []).map((s) => {
|
|
32
|
+
})), placeholder: t("formStudentPlaceholder"), required: true, searchPlaceholder: t("formSearchStudentsPlaceholder"), value: studentProfileId || "" }), _jsx(EnhancedCombobox, { emptyText: t("formNoSectionEmpty"), error: errors.sectionId, id: "sectionId", info: t("sectionInfo"), label: t("section"), onValueChange: (value) => handleChange("sectionId", value), options: (getCachedSectionsSync().items || []).map((s) => {
|
|
37
33
|
var _a;
|
|
38
34
|
return ({
|
|
39
35
|
label: ((_a = s.class) === null || _a === void 0 ? void 0 : _a.code) ? `${s.class.code}-${s.name}` : s.name,
|
|
@@ -34,11 +34,6 @@ const tableBodyCols = [
|
|
|
34
34
|
key: "studentProfile",
|
|
35
35
|
textFormatter: (_, row) => { var _a, _b; return (_b = (_a = row.studentProfile) === null || _a === void 0 ? void 0 : _a.studentCode) !== null && _b !== void 0 ? _b : "N/A"; },
|
|
36
36
|
},
|
|
37
|
-
{
|
|
38
|
-
componentType: COMPONENT_TYPE.TEXT,
|
|
39
|
-
key: "course",
|
|
40
|
-
textFormatter: (_, row) => { var _a, _b; return (_b = (_a = row.course) === null || _a === void 0 ? void 0 : _a.code) !== null && _b !== void 0 ? _b : "N/A"; },
|
|
41
|
-
},
|
|
42
37
|
{
|
|
43
38
|
componentType: COMPONENT_TYPE.TEXT,
|
|
44
39
|
key: "section",
|
|
@@ -69,17 +64,16 @@ const createComponentInstances = () => ({
|
|
|
69
64
|
moreActions: _jsx(EnrollmentMoreActions, {}),
|
|
70
65
|
view: _jsx(EnrollmentView, {}),
|
|
71
66
|
});
|
|
72
|
-
const createEnrollmentConfig = ({ cancelLabel, dispatch, drawerFilterDescription, drawerFilterTitle, drawerFormDescription, drawerFormTitle, drawerMoreActionsDescription, drawerMoreActionsTitle, drawerViewDescription, drawerViewTitle, labelActions,
|
|
67
|
+
const createEnrollmentConfig = ({ cancelLabel, dispatch, drawerFilterDescription, drawerFilterTitle, drawerFormDescription, drawerFormTitle, drawerMoreActionsDescription, drawerMoreActionsTitle, drawerViewDescription, drawerViewTitle, labelActions, labelEnabled, labelEnrollmentDate, labelId, labelSection, labelStudent, saveLabel, searchPlaceholder, tableDescription, tableTitle, }) => {
|
|
73
68
|
const components = createComponentInstances();
|
|
74
69
|
return {
|
|
75
70
|
moduleName: "enrollment",
|
|
76
71
|
tableColumns: [
|
|
77
72
|
{ label: labelId, width: "5%" },
|
|
78
|
-
{ label: labelStudent, width: "
|
|
79
|
-
{ label:
|
|
80
|
-
{ label:
|
|
81
|
-
{ label:
|
|
82
|
-
{ label: labelEnabled, width: "10%" },
|
|
73
|
+
{ label: labelStudent, width: "25%" },
|
|
74
|
+
{ label: labelSection, width: "25%" },
|
|
75
|
+
{ label: labelEnrollmentDate, width: "20%" },
|
|
76
|
+
{ label: labelEnabled, width: "15%" },
|
|
83
77
|
{ label: labelActions, width: "5%" },
|
|
84
78
|
],
|
|
85
79
|
cancelLabel,
|
|
@@ -122,7 +116,6 @@ const EnrollmentPageInner = (props) => {
|
|
|
122
116
|
drawerMoreActionsTitle: props.drawerMoreActionsTitle,
|
|
123
117
|
drawerMoreActionsDescription: props.drawerMoreActionsDescription,
|
|
124
118
|
labelActions: props.labelActions,
|
|
125
|
-
labelCourse: props.labelCourse,
|
|
126
119
|
labelEnabled: props.labelEnabled,
|
|
127
120
|
labelEnrollmentDate: props.labelEnrollmentDate,
|
|
128
121
|
labelId: props.labelId,
|
|
@@ -144,7 +137,6 @@ const EnrollmentPageInner = (props) => {
|
|
|
144
137
|
props.drawerMoreActionsTitle,
|
|
145
138
|
props.drawerMoreActionsDescription,
|
|
146
139
|
props.labelActions,
|
|
147
|
-
props.labelCourse,
|
|
148
140
|
props.labelEnabled,
|
|
149
141
|
props.labelEnrollmentDate,
|
|
150
142
|
props.labelId,
|
|
@@ -9,7 +9,6 @@ import { z } from "zod";
|
|
|
9
9
|
// ============================================================================
|
|
10
10
|
export const enrollmentFormValidation = z.object({
|
|
11
11
|
studentProfileId: z.string().min(1, "Student is required"),
|
|
12
|
-
courseId: z.string().min(1, "Course is required"),
|
|
13
12
|
sectionId: z.string().min(1, "Section is required"),
|
|
14
13
|
enrollmentDate: z
|
|
15
14
|
.string()
|
|
@@ -17,27 +17,24 @@ import { BookOpen, CheckCircle2, XCircle } from "lucide-react";
|
|
|
17
17
|
import { DATE_FORMATS, formatDate } from "@react-pakistan/util-functions";
|
|
18
18
|
import { useEnrollmentModule } from "./context";
|
|
19
19
|
import { getCachedStudentProfilesSync } from "../student-profile/cache";
|
|
20
|
-
import { getCachedCoursesSync } from "../course/cache";
|
|
21
20
|
import { getCachedSectionsSync } from "../section/cache";
|
|
22
21
|
import { useTranslations } from "next-intl";
|
|
23
22
|
// ============================================================================
|
|
24
23
|
// COMPONENT
|
|
25
24
|
// ============================================================================
|
|
26
25
|
export const EnrollmentView = memo(() => {
|
|
27
|
-
var _a, _b, _c
|
|
28
|
-
const { state: {
|
|
26
|
+
var _a, _b, _c;
|
|
27
|
+
const { state: { enrollmentDate, enabled, sectionId, studentProfileId }, } = useEnrollmentModule();
|
|
29
28
|
const t = useTranslations("enrollment");
|
|
30
29
|
const studentProfile = getCachedStudentProfilesSync().items.find((s) => s.id === studentProfileId);
|
|
31
30
|
const studentName = (_b = (_a = studentProfile === null || studentProfile === void 0 ? void 0 : studentProfile.studentCode) !== null && _a !== void 0 ? _a : studentProfileId) !== null && _b !== void 0 ? _b : "—";
|
|
32
|
-
const course = getCachedCoursesSync().items.find((c) => c.id === courseId);
|
|
33
|
-
const courseName = (_d = (_c = course === null || course === void 0 ? void 0 : course.code) !== null && _c !== void 0 ? _c : courseId) !== null && _d !== void 0 ? _d : "—";
|
|
34
31
|
const section = getCachedSectionsSync().items.find((s) => s.id === sectionId);
|
|
35
32
|
const sectionName = section
|
|
36
|
-
? ((
|
|
33
|
+
? ((_c = section.class) === null || _c === void 0 ? void 0 : _c.code)
|
|
37
34
|
? `${section.class.code}-${section.name}`
|
|
38
35
|
: section.name
|
|
39
36
|
: (sectionId !== null && sectionId !== void 0 ? sectionId : "—");
|
|
40
|
-
return (_jsxs("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(BookOpen, { className: "h-5 w-5 text-primary" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionEnrollmentDetails") })] }), _jsx(CardDescription, { children: t("viewSectionCompleteEnrollmentInformation") })] }), _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-sm font-medium text-muted-foreground", children: t("viewFieldStudent") }), _jsx("p", { className: "text-base", children: studentName })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-sm font-medium text-muted-foreground", children: t("
|
|
37
|
+
return (_jsxs("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(BookOpen, { className: "h-5 w-5 text-primary" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionEnrollmentDetails") })] }), _jsx(CardDescription, { children: t("viewSectionCompleteEnrollmentInformation") })] }), _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-sm font-medium text-muted-foreground", children: t("viewFieldStudent") }), _jsx("p", { className: "text-base", children: studentName })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-sm font-medium text-muted-foreground", children: t("section") }), _jsx("p", { className: "text-base", children: sectionName })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-sm font-medium text-muted-foreground", children: t("viewFieldEnrollmentDate") }), _jsx("p", { className: "text-base", children: enrollmentDate
|
|
41
38
|
? formatDate(enrollmentDate, DATE_FORMATS.LOCALE_DATE)
|
|
42
39
|
: "—" })] })] }) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(BookOpen, { className: "h-5 w-5 text-primary" }), _jsx(CardTitle, { className: "text-lg", children: t("viewFieldStatus") })] }), _jsx(CardDescription, { children: t("viewFieldEnrollmentAvailability") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsx("div", { className: "grid grid-cols-1 gap-6", children: _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-sm font-medium text-muted-foreground", children: t("viewFieldStatus") }), _jsx(Badge, { variant: enabled ? "default" : "destructive", className: "gap-1", children: enabled ? (_jsxs(_Fragment, { children: [_jsx(CheckCircle2, { className: "h-3 w-3" }), " ", t("viewFieldStatusActive")] })) : (_jsxs(_Fragment, { children: [_jsx(XCircle, { className: "h-3 w-3" }), " ", t("viewFieldStatusInactive")] })) })] }) }) })] })] }));
|
|
43
40
|
});
|
|
@@ -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);
|