@appcorp/fusion-storybook 0.1.36 → 0.1.38
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/attendance/cache.d.ts +1 -1
- package/base-modules/attendance/cache.js +1 -1
- package/base-modules/attendance/constants.d.ts +1 -1
- package/base-modules/attendance/constants.js +1 -1
- package/base-modules/attendance/validate.d.ts +1 -1
- package/base-modules/attendance/validate.js +1 -1
- package/base-modules/course/cache.d.ts +1 -1
- package/base-modules/course/cache.js +1 -1
- package/base-modules/course/context.d.ts +1 -1
- package/base-modules/course/more-actions.js +1 -1
- package/base-modules/course/view.js +2 -2
- package/base-modules/enrollment/cache.d.ts +1 -1
- package/base-modules/enrollment/cache.js +1 -1
- package/base-modules/enrollment/context.d.ts +1 -1
- package/base-modules/enrollment/more-actions.js +1 -1
- package/base-modules/expense/cache.d.ts +14 -0
- package/base-modules/expense/cache.js +31 -0
- package/base-modules/expense/constants.d.ts +26 -0
- package/base-modules/expense/constants.js +56 -0
- package/base-modules/expense/context.d.ts +251 -0
- package/base-modules/expense/context.js +482 -0
- package/base-modules/expense/filter.d.ts +1 -0
- package/base-modules/expense/filter.js +31 -0
- package/base-modules/expense/form.d.ts +1 -0
- package/base-modules/expense/form.js +31 -0
- package/base-modules/expense/more-actions.d.ts +1 -0
- package/base-modules/expense/more-actions.js +56 -0
- package/base-modules/expense/page.d.ts +13 -0
- package/base-modules/expense/page.js +101 -0
- package/base-modules/expense/validate.d.ts +23 -0
- package/base-modules/expense/validate.js +27 -0
- package/base-modules/expense/view.d.ts +1 -0
- package/base-modules/expense/view.js +52 -0
- package/base-modules/fee-structure/cache.d.ts +14 -0
- package/base-modules/fee-structure/cache.js +31 -0
- package/base-modules/fee-structure/constants.d.ts +21 -0
- package/base-modules/fee-structure/constants.js +43 -0
- package/base-modules/fee-structure/context.d.ts +161 -0
- package/base-modules/fee-structure/context.js +410 -0
- package/base-modules/fee-structure/filter.d.ts +1 -0
- package/base-modules/fee-structure/filter.js +23 -0
- package/base-modules/fee-structure/form.d.ts +1 -0
- package/base-modules/fee-structure/form.js +31 -0
- package/base-modules/fee-structure/more-actions.d.ts +1 -0
- package/base-modules/fee-structure/more-actions.js +51 -0
- package/base-modules/fee-structure/page.d.ts +13 -0
- package/base-modules/fee-structure/page.js +100 -0
- package/base-modules/fee-structure/validate.d.ts +15 -0
- package/base-modules/fee-structure/validate.js +15 -0
- package/base-modules/fee-structure/view.d.ts +4 -0
- package/base-modules/fee-structure/view.js +24 -0
- package/base-modules/student-fee/cache.d.ts +15 -0
- package/base-modules/student-fee/cache.js +21 -0
- package/base-modules/student-fee/constants.d.ts +39 -0
- package/base-modules/student-fee/constants.js +66 -0
- package/base-modules/student-fee/context.d.ts +233 -0
- package/base-modules/student-fee/context.js +664 -0
- package/base-modules/student-fee/filter.d.ts +1 -0
- package/base-modules/student-fee/filter.js +31 -0
- package/base-modules/student-fee/form.d.ts +1 -0
- package/base-modules/student-fee/form.js +55 -0
- package/base-modules/student-fee/more-actions.d.ts +1 -0
- package/base-modules/student-fee/more-actions.js +56 -0
- package/base-modules/student-fee/page.d.ts +13 -0
- package/base-modules/student-fee/page.js +120 -0
- package/base-modules/student-fee/validate.d.ts +21 -0
- package/base-modules/student-fee/validate.js +26 -0
- package/base-modules/student-fee/view.d.ts +1 -0
- package/base-modules/student-fee/view.js +35 -0
- package/package.json +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Provides localStorage-based caching for attendances using generic cache system.
|
|
5
5
|
*/
|
|
6
|
-
import { AttendanceBE } from "
|
|
6
|
+
import { AttendanceBE } from "../../type";
|
|
7
7
|
export declare const getCachedAttendancesSync: () => import("@react-pakistan/util-functions").ListResponse<AttendanceBE>;
|
|
8
8
|
export declare const getCachedAttendances: ({ params, }: {
|
|
9
9
|
params: Record<string, unknown>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Provides localStorage-based caching for attendances using generic cache system.
|
|
5
5
|
*/
|
|
6
|
-
import { LS_KEYS } from "
|
|
6
|
+
import { LS_KEYS } from "../../constants";
|
|
7
7
|
import { ATTENDANCE_API_ROUTES } from "./constants";
|
|
8
8
|
import { getCachedData, getCachedDataSync, getCachedItemById, invalidateCache, isCacheStale, preloadCache, } from "@react-pakistan/util-functions";
|
|
9
9
|
// ============================================================================
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - API Routes
|
|
7
7
|
* - Status Options
|
|
8
8
|
*/
|
|
9
|
-
import { ATTENDANCE_STATUS } from "
|
|
9
|
+
import { ATTENDANCE_STATUS } from "../../type";
|
|
10
10
|
export declare const pageLimit: number;
|
|
11
11
|
export declare const ATTENDANCE_API_ROUTES: {
|
|
12
12
|
readonly UNIT: "/api/v1/attendance";
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - API Routes
|
|
7
7
|
* - Status Options
|
|
8
8
|
*/
|
|
9
|
-
import { ATTENDANCE_STATUS } from "
|
|
9
|
+
import { ATTENDANCE_STATUS } from "../../type";
|
|
10
10
|
// ============================================================================
|
|
11
11
|
// PAGE CONFIGURATION
|
|
12
12
|
// ============================================================================
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Provides localStorage-based caching for courses using generic cache system.
|
|
5
5
|
*/
|
|
6
|
-
import { CourseBE } from "
|
|
6
|
+
import { CourseBE } from "../../type";
|
|
7
7
|
export declare const getCachedCoursesSync: () => import("@react-pakistan/util-functions").ListResponse<CourseBE>;
|
|
8
8
|
export declare const getCachedCourses: ({ params, }: {
|
|
9
9
|
params: Record<string, unknown>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Provides localStorage-based caching for courses using generic cache system.
|
|
5
5
|
*/
|
|
6
|
-
import { LS_KEYS } from "
|
|
6
|
+
import { LS_KEYS } from "../../constants";
|
|
7
7
|
import { COURSE_API_ROUTES } from "./constants";
|
|
8
8
|
import { getCachedData, getCachedDataSync, getCachedItemById, invalidateCache, isCacheStale, preloadCache, } from "@react-pakistan/util-functions";
|
|
9
9
|
// ============================================================================
|
|
@@ -8,7 +8,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
8
8
|
import { API_METHODS, downloadFromUrl } from "@react-pakistan/util-functions";
|
|
9
9
|
import { getCachedWorkspaceSync } from "../workspace/cache";
|
|
10
10
|
import converter from "json-2-csv";
|
|
11
|
-
import { Timeline } from "
|
|
11
|
+
import { Timeline } from "../../components/timeline";
|
|
12
12
|
import { useTranslations } from "next-intl";
|
|
13
13
|
export const CourseMoreActions = () => {
|
|
14
14
|
const t = useTranslations("course");
|
|
@@ -14,7 +14,7 @@ import { getCachedSectionsSync } from "../section/cache";
|
|
|
14
14
|
import { getCachedSubjectsSync } from "../subject/cache";
|
|
15
15
|
import { getCachedTeachersSync } from "../teacher/cache";
|
|
16
16
|
import { useTranslations } from "next-intl";
|
|
17
|
-
import { formatValue } from "
|
|
17
|
+
import { formatValue } from "../../utils/format-value";
|
|
18
18
|
export const CourseView = () => {
|
|
19
19
|
var _a, _b, _c, _d, _e;
|
|
20
20
|
const t = useTranslations("course");
|
|
@@ -36,5 +36,5 @@ export const CourseView = () => {
|
|
|
36
36
|
teacher.teacherCode ||
|
|
37
37
|
"—"
|
|
38
38
|
: "—";
|
|
39
|
-
return (_jsxs("div", { className: "space-y-4", children: [_jsx(Card, { children: _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "flex items-center gap-6", children: [_jsx("div", { className: "flex h-24 w-24 items-center justify-center rounded-full
|
|
39
|
+
return (_jsxs("div", { className: "space-y-4", children: [_jsx(Card, { children: _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "flex items-center gap-6", children: [_jsx("div", { className: "bg-primary/10 flex h-24 w-24 items-center justify-center rounded-full", children: _jsx(BookMarked, { className: "text-primary h-12 w-12" }) }), _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("h2", { className: "text-2xl font-bold", children: formatValue(code) }), enabled ? (_jsx(CheckCircle2, { className: "h-5 w-5 text-green-500" })) : (_jsx(XCircle, { className: "h-5 w-5 text-red-500" }))] }), _jsx("p", { className: "text-muted-foreground mt-1", children: sectionName })] })] }) }) }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(BookMarked, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("courseDetails") })] }), _jsx(CardDescription, { children: t("completeCourseInformation") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("courseCode") }), _jsx("p", { className: "text-base", children: formatValue(code) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("section") }), _jsx("p", { className: "text-base", children: sectionName })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("subject") }), _jsx("p", { className: "text-base", children: subjectName })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("teacher") }), _jsx("p", { className: "text-base", children: teacherName })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("status") }), _jsx(Badge, { variant: enabled ? "default" : "secondary", children: enabled ? t("statusActive") : t("statusInactive") })] })] }) })] })] }));
|
|
40
40
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Provides localStorage-based caching for enrollments using generic cache system.
|
|
5
5
|
*/
|
|
6
|
-
import { EnrollmentBE } from "
|
|
6
|
+
import { EnrollmentBE } from "../../type";
|
|
7
7
|
export declare const getCachedEnrollmentsSync: () => import("@react-pakistan/util-functions").ListResponse<EnrollmentBE>;
|
|
8
8
|
export declare const getCachedEnrollments: ({ params, }: {
|
|
9
9
|
params: Record<string, unknown>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Provides localStorage-based caching for enrollments using generic cache system.
|
|
5
5
|
*/
|
|
6
|
-
import { LS_KEYS } from "
|
|
6
|
+
import { LS_KEYS } from "../../constants";
|
|
7
7
|
import { ENROLLMENT_API_ROUTES } from "./constants";
|
|
8
8
|
import { getCachedData, getCachedDataSync, getCachedItemById, invalidateCache, isCacheStale, preloadCache, } from "@react-pakistan/util-functions";
|
|
9
9
|
// ============================================================================
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CourseBE, EnrollmentBE, SectionBE, StudentProfileBE } from "
|
|
1
|
+
import { CourseBE, EnrollmentBE, SectionBE, StudentProfileBE } from "../../type";
|
|
2
2
|
import { type RowAction, type TableRow } from "@appcorp/shadcn/components/enhanced-table";
|
|
3
3
|
export declare const ENROLLMENT_DRAWER: {
|
|
4
4
|
readonly FILTER_DRAWER: string;
|
|
@@ -8,7 +8,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
8
8
|
import { API_METHODS, downloadFromUrl } from "@react-pakistan/util-functions";
|
|
9
9
|
import { getCachedWorkspaceSync } from "../workspace/cache";
|
|
10
10
|
import converter from "json-2-csv";
|
|
11
|
-
import { Timeline } from "
|
|
11
|
+
import { Timeline } from "../../components/timeline";
|
|
12
12
|
import { useTranslations } from "next-intl";
|
|
13
13
|
// ============================================================================
|
|
14
14
|
// COMPONENT
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Expense Module Cache Utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides localStorage-based caching for expenses using generic cache system.
|
|
5
|
+
*/
|
|
6
|
+
import { ExpenseBE } from "../../type";
|
|
7
|
+
export declare const getCachedExpensesSync: () => import("@react-pakistan/util-functions").ListResponse<ExpenseBE>;
|
|
8
|
+
export declare const getCachedExpenses: ({ params, }: {
|
|
9
|
+
params: Record<string, unknown>;
|
|
10
|
+
}) => Promise<import("@react-pakistan/util-functions").ListResponse<ExpenseBE>>;
|
|
11
|
+
export declare const getCachedExpenseById: (expenseId: string) => ExpenseBE | null;
|
|
12
|
+
export declare const invalidateExpensesCache: () => void;
|
|
13
|
+
export declare const preloadExpenses: () => Promise<import("@react-pakistan/util-functions").ListResponse<ExpenseBE>>;
|
|
14
|
+
export declare const isExpensesCacheStale: () => boolean;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Expense Module Cache Utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides localStorage-based caching for expenses using generic cache system.
|
|
5
|
+
*/
|
|
6
|
+
import { LS_KEYS } from "../../constants";
|
|
7
|
+
import { EXPENSE_API_ROUTES } from "./constants";
|
|
8
|
+
import { getCachedData, getCachedDataSync, getCachedItemById, invalidateCache, isCacheStale, preloadCache, } from "@react-pakistan/util-functions";
|
|
9
|
+
// ============================================================================
|
|
10
|
+
// CACHE CONFIGURATION
|
|
11
|
+
// ============================================================================
|
|
12
|
+
const EXPENSE_CACHE_CONFIG = {
|
|
13
|
+
cacheKey: LS_KEYS.EXPENSES,
|
|
14
|
+
apiUrl: EXPENSE_API_ROUTES.UNIT,
|
|
15
|
+
};
|
|
16
|
+
// ============================================================================
|
|
17
|
+
// EXPENSE-SPECIFIC CACHE FUNCTIONS
|
|
18
|
+
// ============================================================================
|
|
19
|
+
export const getCachedExpensesSync = () => getCachedDataSync(LS_KEYS.EXPENSES);
|
|
20
|
+
export const getCachedExpenses = ({ params, }) => getCachedData({
|
|
21
|
+
config: EXPENSE_CACHE_CONFIG,
|
|
22
|
+
params,
|
|
23
|
+
headers: {
|
|
24
|
+
"Content-Type": "application/json",
|
|
25
|
+
"x-api-token": process.env.NEXT_PUBLIC_API_KEY,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
export const getCachedExpenseById = (expenseId) => getCachedItemById(LS_KEYS.EXPENSES, expenseId);
|
|
29
|
+
export const invalidateExpensesCache = () => invalidateCache(LS_KEYS.EXPENSES);
|
|
30
|
+
export const preloadExpenses = () => preloadCache(EXPENSE_CACHE_CONFIG);
|
|
31
|
+
export const isExpensesCacheStale = () => isCacheStale(LS_KEYS.EXPENSES);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Expense Module Constants
|
|
3
|
+
*
|
|
4
|
+
* Organization:
|
|
5
|
+
* - Page Configuration
|
|
6
|
+
* - API Routes
|
|
7
|
+
* - Filter Options
|
|
8
|
+
*
|
|
9
|
+
* Table configuration is co-located in page.tsx.
|
|
10
|
+
*/
|
|
11
|
+
export declare const pageLimit: number;
|
|
12
|
+
export declare const EXPENSE_API_ROUTES: {
|
|
13
|
+
readonly UNIT: "/api/v1/expense";
|
|
14
|
+
};
|
|
15
|
+
export declare const EXPENSE_CATEGORY_OPTIONS: {
|
|
16
|
+
label: string;
|
|
17
|
+
value: string;
|
|
18
|
+
}[];
|
|
19
|
+
export declare const EXPENSE_STATUS_OPTIONS: {
|
|
20
|
+
label: string;
|
|
21
|
+
value: string;
|
|
22
|
+
}[];
|
|
23
|
+
export declare const PAYMENT_METHOD_OPTIONS: {
|
|
24
|
+
label: string;
|
|
25
|
+
value: string;
|
|
26
|
+
}[];
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Expense Module Constants
|
|
3
|
+
*
|
|
4
|
+
* Organization:
|
|
5
|
+
* - Page Configuration
|
|
6
|
+
* - API Routes
|
|
7
|
+
* - Filter Options
|
|
8
|
+
*
|
|
9
|
+
* Table configuration is co-located in page.tsx.
|
|
10
|
+
*/
|
|
11
|
+
// ============================================================================
|
|
12
|
+
// PAGE CONFIGURATION
|
|
13
|
+
// ============================================================================
|
|
14
|
+
export const pageLimit = Number(process.env.NEXT_PUBLIC_PAGE_LIMIT) || 10;
|
|
15
|
+
// ============================================================================
|
|
16
|
+
// API ROUTES
|
|
17
|
+
// ============================================================================
|
|
18
|
+
export const EXPENSE_API_ROUTES = {
|
|
19
|
+
UNIT: "/api/v1/expense",
|
|
20
|
+
};
|
|
21
|
+
// ============================================================================
|
|
22
|
+
// FILTER OPTIONS
|
|
23
|
+
// ============================================================================
|
|
24
|
+
export const EXPENSE_CATEGORY_OPTIONS = [
|
|
25
|
+
{ label: "Salary", value: "SALARY" },
|
|
26
|
+
{ label: "Utilities", value: "UTILITIES" },
|
|
27
|
+
{ label: "Maintenance", value: "MAINTENANCE" },
|
|
28
|
+
{ label: "Supplies", value: "SUPPLIES" },
|
|
29
|
+
{ label: "Transport", value: "TRANSPORT" },
|
|
30
|
+
{ label: "Marketing", value: "MARKETING" },
|
|
31
|
+
{ label: "Insurance", value: "INSURANCE" },
|
|
32
|
+
{ label: "Rent", value: "RENT" },
|
|
33
|
+
{ label: "Technology", value: "TECHNOLOGY" },
|
|
34
|
+
{ label: "Professional Fees", value: "PROFESSIONAL" },
|
|
35
|
+
{ label: "Training", value: "TRAINING" },
|
|
36
|
+
{ label: "Events", value: "EVENTS" },
|
|
37
|
+
{ label: "Food", value: "FOOD" },
|
|
38
|
+
{ label: "Miscellaneous", value: "MISCELLANEOUS" },
|
|
39
|
+
];
|
|
40
|
+
export const EXPENSE_STATUS_OPTIONS = [
|
|
41
|
+
{ label: "Pending", value: "PENDING" },
|
|
42
|
+
{ label: "Approved", value: "APPROVED" },
|
|
43
|
+
{ label: "Paid", value: "PAID" },
|
|
44
|
+
{ label: "Rejected", value: "REJECTED" },
|
|
45
|
+
{ label: "Cancelled", value: "CANCELLED" },
|
|
46
|
+
];
|
|
47
|
+
export const PAYMENT_METHOD_OPTIONS = [
|
|
48
|
+
{ label: "Cash", value: "CASH" },
|
|
49
|
+
{ label: "Bank Transfer", value: "BANK_TRANSFER" },
|
|
50
|
+
{ label: "Credit Card", value: "CREDIT_CARD" },
|
|
51
|
+
{ label: "Debit Card", value: "DEBIT_CARD" },
|
|
52
|
+
{ label: "Cheque", value: "CHEQUE" },
|
|
53
|
+
{ label: "Online", value: "ONLINE" },
|
|
54
|
+
{ label: "UPI", value: "UPI" },
|
|
55
|
+
{ label: "Mobile Wallet", value: "MOBILE_WALLET" },
|
|
56
|
+
];
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { RowAction, TableRow } from "@appcorp/shadcn/components/enhanced-table";
|
|
2
|
+
import { EXPENSE_CATEGORY, EXPENSE_STATUS, ExpenseBE, PAYMENT_METHOD, SchoolBE } from "../../type";
|
|
3
|
+
export declare const EXPENSE_DRAWER: {
|
|
4
|
+
readonly FILTER_DRAWER: string;
|
|
5
|
+
readonly FORM_DRAWER: string;
|
|
6
|
+
readonly MORE_ACTIONS_DRAWER: string;
|
|
7
|
+
readonly VIEW_DRAWER: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const EXPENSE_ACTION_TYPES: {
|
|
10
|
+
readonly RESET_FORM: "RESET_FORM";
|
|
11
|
+
readonly SET_CURRENT_PAGE: "SET_CURRENT_PAGE";
|
|
12
|
+
readonly SET_PAGE_LIMIT: "SET_PAGE_LIMIT";
|
|
13
|
+
readonly SET_SEARCH_QUERY: "SET_SEARCH_QUERY";
|
|
14
|
+
readonly SET_DRAWER: "SET_DRAWER";
|
|
15
|
+
readonly SET_ITEMS: "SET_ITEMS";
|
|
16
|
+
readonly SET_FORM_DATA: "SET_FORM_DATA";
|
|
17
|
+
readonly SET_DISABLE_SAVE_BUTTON: "SET_DISABLE_SAVE_BUTTON";
|
|
18
|
+
readonly SET_INPUT_FIELD: "SET_INPUT_FIELD";
|
|
19
|
+
readonly SET_ERRORS: "SET_ERRORS";
|
|
20
|
+
readonly SET_FILTERS: "SET_FILTERS";
|
|
21
|
+
}, expenseModuleConfig: import("@react-pakistan/util-functions/factory/generic-module-factory").ModuleConfig<{
|
|
22
|
+
items: ExpenseBE[];
|
|
23
|
+
count: number;
|
|
24
|
+
currentPage: number;
|
|
25
|
+
pageLimit: number;
|
|
26
|
+
searchQuery: string;
|
|
27
|
+
disableSaveButton: boolean;
|
|
28
|
+
drawer: string | null;
|
|
29
|
+
errors: Record<string, string>;
|
|
30
|
+
amount: number;
|
|
31
|
+
approvedBy: string;
|
|
32
|
+
attachments: string[];
|
|
33
|
+
category: EXPENSE_CATEGORY | "";
|
|
34
|
+
description: string;
|
|
35
|
+
enabled: boolean;
|
|
36
|
+
expenseDate: string;
|
|
37
|
+
id: string;
|
|
38
|
+
invoiceNumber: string;
|
|
39
|
+
paidBy: string;
|
|
40
|
+
paymentDate: string;
|
|
41
|
+
paymentMethod: PAYMENT_METHOD | "";
|
|
42
|
+
receiptNumber: string;
|
|
43
|
+
remarks: string;
|
|
44
|
+
schoolId: string;
|
|
45
|
+
status: EXPENSE_STATUS | "";
|
|
46
|
+
title: string;
|
|
47
|
+
transactionId: string;
|
|
48
|
+
vendorContact: string;
|
|
49
|
+
vendorName: string;
|
|
50
|
+
filterCategory: EXPENSE_CATEGORY | "";
|
|
51
|
+
filterEnabled: boolean | undefined;
|
|
52
|
+
filterStatus: EXPENSE_STATUS | "";
|
|
53
|
+
school: SchoolBE | undefined;
|
|
54
|
+
}>, initialExpenseState: {
|
|
55
|
+
items: ExpenseBE[];
|
|
56
|
+
count: number;
|
|
57
|
+
currentPage: number;
|
|
58
|
+
pageLimit: number;
|
|
59
|
+
searchQuery: string;
|
|
60
|
+
disableSaveButton: boolean;
|
|
61
|
+
drawer: string | null;
|
|
62
|
+
errors: Record<string, string>;
|
|
63
|
+
amount: number;
|
|
64
|
+
approvedBy: string;
|
|
65
|
+
attachments: string[];
|
|
66
|
+
category: EXPENSE_CATEGORY | "";
|
|
67
|
+
description: string;
|
|
68
|
+
enabled: boolean;
|
|
69
|
+
expenseDate: string;
|
|
70
|
+
id: string;
|
|
71
|
+
invoiceNumber: string;
|
|
72
|
+
paidBy: string;
|
|
73
|
+
paymentDate: string;
|
|
74
|
+
paymentMethod: PAYMENT_METHOD | "";
|
|
75
|
+
receiptNumber: string;
|
|
76
|
+
remarks: string;
|
|
77
|
+
schoolId: string;
|
|
78
|
+
status: EXPENSE_STATUS | "";
|
|
79
|
+
title: string;
|
|
80
|
+
transactionId: string;
|
|
81
|
+
vendorContact: string;
|
|
82
|
+
vendorName: string;
|
|
83
|
+
filterCategory: EXPENSE_CATEGORY | "";
|
|
84
|
+
filterEnabled: boolean | undefined;
|
|
85
|
+
filterStatus: EXPENSE_STATUS | "";
|
|
86
|
+
school: SchoolBE | undefined;
|
|
87
|
+
}, ExpenseProvider: import("react").FC<{
|
|
88
|
+
children: React.ReactNode;
|
|
89
|
+
}>, expenseReducer: (state: {
|
|
90
|
+
items: ExpenseBE[];
|
|
91
|
+
count: number;
|
|
92
|
+
currentPage: number;
|
|
93
|
+
pageLimit: number;
|
|
94
|
+
searchQuery: string;
|
|
95
|
+
disableSaveButton: boolean;
|
|
96
|
+
drawer: string | null;
|
|
97
|
+
errors: Record<string, string>;
|
|
98
|
+
amount: number;
|
|
99
|
+
approvedBy: string;
|
|
100
|
+
attachments: string[];
|
|
101
|
+
category: EXPENSE_CATEGORY | "";
|
|
102
|
+
description: string;
|
|
103
|
+
enabled: boolean;
|
|
104
|
+
expenseDate: string;
|
|
105
|
+
id: string;
|
|
106
|
+
invoiceNumber: string;
|
|
107
|
+
paidBy: string;
|
|
108
|
+
paymentDate: string;
|
|
109
|
+
paymentMethod: PAYMENT_METHOD | "";
|
|
110
|
+
receiptNumber: string;
|
|
111
|
+
remarks: string;
|
|
112
|
+
schoolId: string;
|
|
113
|
+
status: EXPENSE_STATUS | "";
|
|
114
|
+
title: string;
|
|
115
|
+
transactionId: string;
|
|
116
|
+
vendorContact: string;
|
|
117
|
+
vendorName: string;
|
|
118
|
+
filterCategory: EXPENSE_CATEGORY | "";
|
|
119
|
+
filterEnabled: boolean | undefined;
|
|
120
|
+
filterStatus: EXPENSE_STATUS | "";
|
|
121
|
+
school: SchoolBE | undefined;
|
|
122
|
+
}, action: any) => {
|
|
123
|
+
items: ExpenseBE[];
|
|
124
|
+
count: number;
|
|
125
|
+
currentPage: number;
|
|
126
|
+
pageLimit: number;
|
|
127
|
+
searchQuery: string;
|
|
128
|
+
disableSaveButton: boolean;
|
|
129
|
+
drawer: string | null;
|
|
130
|
+
errors: Record<string, string>;
|
|
131
|
+
amount: number;
|
|
132
|
+
approvedBy: string;
|
|
133
|
+
attachments: string[];
|
|
134
|
+
category: EXPENSE_CATEGORY | "";
|
|
135
|
+
description: string;
|
|
136
|
+
enabled: boolean;
|
|
137
|
+
expenseDate: string;
|
|
138
|
+
id: string;
|
|
139
|
+
invoiceNumber: string;
|
|
140
|
+
paidBy: string;
|
|
141
|
+
paymentDate: string;
|
|
142
|
+
paymentMethod: PAYMENT_METHOD | "";
|
|
143
|
+
receiptNumber: string;
|
|
144
|
+
remarks: string;
|
|
145
|
+
schoolId: string;
|
|
146
|
+
status: EXPENSE_STATUS | "";
|
|
147
|
+
title: string;
|
|
148
|
+
transactionId: string;
|
|
149
|
+
vendorContact: string;
|
|
150
|
+
vendorName: string;
|
|
151
|
+
filterCategory: EXPENSE_CATEGORY | "";
|
|
152
|
+
filterEnabled: boolean | undefined;
|
|
153
|
+
filterStatus: EXPENSE_STATUS | "";
|
|
154
|
+
school: SchoolBE | undefined;
|
|
155
|
+
}, useExpenseContext: () => import("@react-pakistan/util-functions/factory/generic-module-factory").GenericModuleContext<{
|
|
156
|
+
items: ExpenseBE[];
|
|
157
|
+
count: number;
|
|
158
|
+
currentPage: number;
|
|
159
|
+
pageLimit: number;
|
|
160
|
+
searchQuery: string;
|
|
161
|
+
disableSaveButton: boolean;
|
|
162
|
+
drawer: string | null;
|
|
163
|
+
errors: Record<string, string>;
|
|
164
|
+
amount: number;
|
|
165
|
+
approvedBy: string;
|
|
166
|
+
attachments: string[];
|
|
167
|
+
category: EXPENSE_CATEGORY | "";
|
|
168
|
+
description: string;
|
|
169
|
+
enabled: boolean;
|
|
170
|
+
expenseDate: string;
|
|
171
|
+
id: string;
|
|
172
|
+
invoiceNumber: string;
|
|
173
|
+
paidBy: string;
|
|
174
|
+
paymentDate: string;
|
|
175
|
+
paymentMethod: PAYMENT_METHOD | "";
|
|
176
|
+
receiptNumber: string;
|
|
177
|
+
remarks: string;
|
|
178
|
+
schoolId: string;
|
|
179
|
+
status: EXPENSE_STATUS | "";
|
|
180
|
+
title: string;
|
|
181
|
+
transactionId: string;
|
|
182
|
+
vendorContact: string;
|
|
183
|
+
vendorName: string;
|
|
184
|
+
filterCategory: EXPENSE_CATEGORY | "";
|
|
185
|
+
filterEnabled: boolean | undefined;
|
|
186
|
+
filterStatus: EXPENSE_STATUS | "";
|
|
187
|
+
school: SchoolBE | undefined;
|
|
188
|
+
}>;
|
|
189
|
+
export declare const useExpenseModule: () => {
|
|
190
|
+
applyFilters: () => void;
|
|
191
|
+
byIdLoading: boolean;
|
|
192
|
+
clearFilters: () => void;
|
|
193
|
+
deleteLoading: boolean;
|
|
194
|
+
handleChange: (field: string, value: string | number | boolean | string[] | undefined) => void;
|
|
195
|
+
handleCloseDrawer: () => void;
|
|
196
|
+
handleCreate: () => void;
|
|
197
|
+
handleDelete: (row?: TableRow) => void;
|
|
198
|
+
handleEdit: (row?: TableRow) => void;
|
|
199
|
+
handleFilters: () => void;
|
|
200
|
+
handleMoreActions: () => void;
|
|
201
|
+
handlePageChange: (page: number) => void;
|
|
202
|
+
handlePageLimitChange: (limit: number) => void;
|
|
203
|
+
handleSearch: (query: string) => void;
|
|
204
|
+
handleSubmit: () => void;
|
|
205
|
+
handleView: (row?: TableRow) => void;
|
|
206
|
+
headerActions: {
|
|
207
|
+
enabled: boolean;
|
|
208
|
+
handleOnClick: () => void;
|
|
209
|
+
label: string;
|
|
210
|
+
order: number;
|
|
211
|
+
icon: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
212
|
+
}[];
|
|
213
|
+
listLoading: boolean;
|
|
214
|
+
rowActions: RowAction[];
|
|
215
|
+
updateLoading: boolean;
|
|
216
|
+
state: {
|
|
217
|
+
items: ExpenseBE[];
|
|
218
|
+
count: number;
|
|
219
|
+
currentPage: number;
|
|
220
|
+
pageLimit: number;
|
|
221
|
+
searchQuery: string;
|
|
222
|
+
disableSaveButton: boolean;
|
|
223
|
+
drawer: string | null;
|
|
224
|
+
errors: Record<string, string>;
|
|
225
|
+
amount: number;
|
|
226
|
+
approvedBy: string;
|
|
227
|
+
attachments: string[];
|
|
228
|
+
category: EXPENSE_CATEGORY | "";
|
|
229
|
+
description: string;
|
|
230
|
+
enabled: boolean;
|
|
231
|
+
expenseDate: string;
|
|
232
|
+
id: string;
|
|
233
|
+
invoiceNumber: string;
|
|
234
|
+
paidBy: string;
|
|
235
|
+
paymentDate: string;
|
|
236
|
+
paymentMethod: PAYMENT_METHOD | "";
|
|
237
|
+
receiptNumber: string;
|
|
238
|
+
remarks: string;
|
|
239
|
+
schoolId: string;
|
|
240
|
+
status: EXPENSE_STATUS | "";
|
|
241
|
+
title: string;
|
|
242
|
+
transactionId: string;
|
|
243
|
+
vendorContact: string;
|
|
244
|
+
vendorName: string;
|
|
245
|
+
filterCategory: EXPENSE_CATEGORY | "";
|
|
246
|
+
filterEnabled: boolean | undefined;
|
|
247
|
+
filterStatus: EXPENSE_STATUS | "";
|
|
248
|
+
school: SchoolBE | undefined;
|
|
249
|
+
};
|
|
250
|
+
dispatch: React.Dispatch<any>;
|
|
251
|
+
};
|