@appcorp/fusion-storybook 0.2.40 → 0.2.42
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/constants.d.ts +5 -17
- package/base-modules/admission/constants.js +12 -7
- package/base-modules/admission/context/use-admission-module.js +11 -48
- package/base-modules/admission/filter.js +23 -3
- package/base-modules/admission/form.js +49 -19
- package/base-modules/attendance/context.js +3 -37
- package/base-modules/attendance/form.js +26 -10
- package/base-modules/attendance/more-actions.js +34 -25
- package/base-modules/campus/context.js +7 -7
- package/base-modules/class/cache.js +0 -1
- package/base-modules/class/context.js +10 -48
- package/base-modules/class/more-actions.js +0 -2
- package/base-modules/course/context.js +3 -37
- package/base-modules/course/form.js +91 -292
- package/base-modules/discount-code/constants.d.ts +5 -0
- package/base-modules/discount-code/constants.js +5 -0
- package/base-modules/discount-code/context.d.ts +1 -0
- package/base-modules/discount-code/context.js +40 -39
- package/base-modules/discount-code/form.js +21 -15
- package/base-modules/discount-code/more-actions.js +1 -1
- package/base-modules/enrollment/context.js +3 -37
- package/base-modules/enrollment/form.js +38 -11
- package/base-modules/enrollment/more-actions.js +0 -2
- package/base-modules/expense/constants.js +1 -1
- package/base-modules/expense/context.js +5 -32
- package/base-modules/expense/filter.js +50 -3
- package/base-modules/expense/form.js +82 -6
- package/base-modules/family/context.js +7 -38
- package/base-modules/family-member/context.js +7 -39
- package/base-modules/fee-structure/context.js +1 -25
- package/base-modules/fee-structure/form.js +77 -89
- package/base-modules/fee-structure/more-actions.js +0 -2
- package/base-modules/rbac/context.d.ts +1 -0
- package/base-modules/rbac/context.js +23 -32
- package/base-modules/school/context.js +1 -1
- package/base-modules/school/form.js +34 -14
- package/base-modules/section/context.d.ts +1 -0
- package/base-modules/section/context.js +40 -47
- package/base-modules/section/form.js +25 -80
- package/base-modules/section/more-actions.js +0 -2
- package/base-modules/section/view.js +9 -7
- package/base-modules/student-fee/context/use-student-fee-module.d.ts +1 -0
- package/base-modules/student-fee/context/use-student-fee-module.js +48 -32
- package/base-modules/student-fee/context.d.ts +1 -1
- package/base-modules/student-fee/context.js +1 -1
- package/base-modules/student-fee/filter.js +23 -3
- package/base-modules/student-fee/form.js +93 -174
- package/base-modules/student-fee/view.d.ts +7 -1
- package/base-modules/student-fee/view.js +17 -20
- package/base-modules/student-profile/constants.d.ts +0 -6
- package/base-modules/student-profile/constants.js +1 -3
- package/base-modules/student-profile/context/use-student-profile-module.d.ts +1 -0
- package/base-modules/student-profile/context/use-student-profile-module.js +62 -55
- package/base-modules/student-profile/context.d.ts +1 -1
- package/base-modules/student-profile/context.js +1 -1
- package/base-modules/student-profile/filter.js +23 -3
- package/base-modules/student-profile/form.js +35 -3
- package/base-modules/subject/context.d.ts +1 -0
- package/base-modules/subject/context.js +38 -47
- package/base-modules/subject/more-actions.js +0 -2
- package/base-modules/teacher/constants.d.ts +0 -6
- package/base-modules/teacher/constants.js +0 -2
- package/base-modules/teacher/context.d.ts +1 -0
- package/base-modules/teacher/context.js +58 -39
- package/base-modules/teacher/form.js +46 -11
- package/base-modules/teacher/more-actions.js +0 -2
- package/base-modules/user/context/use-user-module.d.ts +1 -0
- package/base-modules/user/context/use-user-module.js +36 -32
- package/base-modules/user/context.js +1 -1
- package/base-modules/user/filter.js +6 -4
- package/base-modules/user/form.js +29 -5
- package/base-modules/user/more-actions.js +9 -7
- package/base-modules/user/view.js +3 -1
- package/base-modules/workspace/form.js +18 -8
- package/base-modules/workspace-user/context.d.ts +2 -1
- package/base-modules/workspace-user/context.js +31 -29
- package/package.json +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/base-modules/admission/cache.d.ts +0 -14
- package/base-modules/admission/cache.js +0 -31
- package/base-modules/attendance/cache.d.ts +0 -14
- package/base-modules/attendance/cache.js +0 -31
- package/base-modules/course/cache.d.ts +0 -14
- package/base-modules/course/cache.js +0 -31
- package/base-modules/enrollment/cache.d.ts +0 -14
- package/base-modules/enrollment/cache.js +0 -31
- package/base-modules/expense/cache.d.ts +0 -14
- package/base-modules/expense/cache.js +0 -31
- package/base-modules/family/cache.d.ts +0 -14
- package/base-modules/family/cache.js +0 -31
- package/base-modules/family-member/cache.d.ts +0 -14
- package/base-modules/family-member/cache.js +0 -31
- package/base-modules/rbac/cache.d.ts +0 -27
- package/base-modules/rbac/cache.js +0 -46
- package/base-modules/student-fee/cache.d.ts +0 -15
- package/base-modules/student-fee/cache.js +0 -21
- package/base-modules/workspace-user/cache.d.ts +0 -14
- package/base-modules/workspace-user/cache.js +0 -31
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Admission Module Cache Utilities
|
|
3
|
-
*
|
|
4
|
-
* Provides localStorage-based caching for admissions using generic cache system.
|
|
5
|
-
*/
|
|
6
|
-
import { StudentProfileBE } from "../../type";
|
|
7
|
-
export declare const getCachedAdmissionsSync: () => import("@react-pakistan/util-functions").ListResponse<StudentProfileBE>;
|
|
8
|
-
export declare const getCachedAdmissions: ({ params, }: {
|
|
9
|
-
params: Record<string, unknown>;
|
|
10
|
-
}) => Promise<import("@react-pakistan/util-functions").ListResponse<StudentProfileBE>>;
|
|
11
|
-
export declare const getCachedAdmissionById: (admissionId: string) => StudentProfileBE | null;
|
|
12
|
-
export declare const invalidateAdmissionsCache: () => void;
|
|
13
|
-
export declare const preloadAdmissions: () => Promise<import("@react-pakistan/util-functions").ListResponse<StudentProfileBE>>;
|
|
14
|
-
export declare const isAdmissionsCacheStale: () => boolean;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Admission Module Cache Utilities
|
|
3
|
-
*
|
|
4
|
-
* Provides localStorage-based caching for admissions using generic cache system.
|
|
5
|
-
*/
|
|
6
|
-
import { LS_KEYS } from "../../constants";
|
|
7
|
-
import { ADMISSION_API_ROUTES } from "./constants";
|
|
8
|
-
import { getCachedData, getCachedDataSync, getCachedItemById, invalidateCache, isCacheStale, preloadCache, } from "@react-pakistan/util-functions";
|
|
9
|
-
// ============================================================================
|
|
10
|
-
// CACHE CONFIGURATION
|
|
11
|
-
// ============================================================================
|
|
12
|
-
const ADMISSION_CACHE_CONFIG = {
|
|
13
|
-
apiUrl: ADMISSION_API_ROUTES.UNIT,
|
|
14
|
-
cacheKey: LS_KEYS.ADMISSIONS,
|
|
15
|
-
};
|
|
16
|
-
// ============================================================================
|
|
17
|
-
// ADMISSION-SPECIFIC CACHE FUNCTIONS
|
|
18
|
-
// ============================================================================
|
|
19
|
-
export const getCachedAdmissionsSync = () => getCachedDataSync(LS_KEYS.ADMISSIONS);
|
|
20
|
-
export const getCachedAdmissions = ({ params, }) => getCachedData({
|
|
21
|
-
config: ADMISSION_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 getCachedAdmissionById = (admissionId) => getCachedItemById(LS_KEYS.ADMISSIONS, admissionId);
|
|
29
|
-
export const invalidateAdmissionsCache = () => invalidateCache(LS_KEYS.ADMISSIONS);
|
|
30
|
-
export const preloadAdmissions = () => preloadCache(ADMISSION_CACHE_CONFIG);
|
|
31
|
-
export const isAdmissionsCacheStale = () => isCacheStale(LS_KEYS.ADMISSIONS);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Attendance Module Cache Utilities
|
|
3
|
-
*
|
|
4
|
-
* Provides localStorage-based caching for attendances using generic cache system.
|
|
5
|
-
*/
|
|
6
|
-
import { AttendanceBE } from "../../type";
|
|
7
|
-
export declare const getCachedAttendancesSync: () => import("@react-pakistan/util-functions").ListResponse<AttendanceBE>;
|
|
8
|
-
export declare const getCachedAttendances: ({ params, }: {
|
|
9
|
-
params: Record<string, unknown>;
|
|
10
|
-
}) => Promise<import("@react-pakistan/util-functions").ListResponse<AttendanceBE>>;
|
|
11
|
-
export declare const getCachedAttendanceById: (attendanceId: string) => AttendanceBE | null;
|
|
12
|
-
export declare const invalidateAttendancesCache: () => void;
|
|
13
|
-
export declare const preloadAttendances: () => Promise<import("@react-pakistan/util-functions").ListResponse<AttendanceBE>>;
|
|
14
|
-
export declare const isAttendancesCacheStale: () => boolean;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Attendance Module Cache Utilities
|
|
3
|
-
*
|
|
4
|
-
* Provides localStorage-based caching for attendances using generic cache system.
|
|
5
|
-
*/
|
|
6
|
-
import { LS_KEYS } from "../../constants";
|
|
7
|
-
import { ATTENDANCE_API_ROUTES } from "./constants";
|
|
8
|
-
import { getCachedData, getCachedDataSync, getCachedItemById, invalidateCache, isCacheStale, preloadCache, } from "@react-pakistan/util-functions";
|
|
9
|
-
// ============================================================================
|
|
10
|
-
// CACHE CONFIGURATION
|
|
11
|
-
// ============================================================================
|
|
12
|
-
const ATTENDANCE_CACHE_CONFIG = {
|
|
13
|
-
cacheKey: LS_KEYS.ATTENDANCES,
|
|
14
|
-
apiUrl: ATTENDANCE_API_ROUTES.UNIT,
|
|
15
|
-
};
|
|
16
|
-
// ============================================================================
|
|
17
|
-
// ATTENDANCE-SPECIFIC CACHE FUNCTIONS
|
|
18
|
-
// ============================================================================
|
|
19
|
-
export const getCachedAttendancesSync = () => getCachedDataSync(LS_KEYS.ATTENDANCES);
|
|
20
|
-
export const getCachedAttendances = ({ params, }) => getCachedData({
|
|
21
|
-
config: ATTENDANCE_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 getCachedAttendanceById = (attendanceId) => getCachedItemById(LS_KEYS.ATTENDANCES, attendanceId);
|
|
29
|
-
export const invalidateAttendancesCache = () => invalidateCache(LS_KEYS.ATTENDANCES);
|
|
30
|
-
export const preloadAttendances = () => preloadCache(ATTENDANCE_CACHE_CONFIG);
|
|
31
|
-
export const isAttendancesCacheStale = () => isCacheStale(LS_KEYS.ATTENDANCES);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Course Module Cache Utilities
|
|
3
|
-
*
|
|
4
|
-
* Provides localStorage-based caching for courses using generic cache system.
|
|
5
|
-
*/
|
|
6
|
-
import { CourseBE } from "../../type";
|
|
7
|
-
export declare const getCachedCoursesSync: () => import("@react-pakistan/util-functions").ListResponse<CourseBE>;
|
|
8
|
-
export declare const getCachedCourses: ({ params, }: {
|
|
9
|
-
params: Record<string, unknown>;
|
|
10
|
-
}) => Promise<import("@react-pakistan/util-functions").ListResponse<CourseBE>>;
|
|
11
|
-
export declare const getCachedCourseById: (courseId: string) => CourseBE | null;
|
|
12
|
-
export declare const invalidateCoursesCache: () => void;
|
|
13
|
-
export declare const preloadCourses: () => Promise<import("@react-pakistan/util-functions").ListResponse<CourseBE>>;
|
|
14
|
-
export declare const isCoursesCacheStale: () => boolean;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Course Module Cache Utilities
|
|
3
|
-
*
|
|
4
|
-
* Provides localStorage-based caching for courses using generic cache system.
|
|
5
|
-
*/
|
|
6
|
-
import { LS_KEYS } from "../../constants";
|
|
7
|
-
import { COURSE_API_ROUTES } from "./constants";
|
|
8
|
-
import { getCachedData, getCachedDataSync, getCachedItemById, invalidateCache, isCacheStale, preloadCache, } from "@react-pakistan/util-functions";
|
|
9
|
-
// ============================================================================
|
|
10
|
-
// CACHE CONFIGURATION
|
|
11
|
-
// ============================================================================
|
|
12
|
-
const COURSE_CACHE_CONFIG = {
|
|
13
|
-
cacheKey: LS_KEYS.COURSES,
|
|
14
|
-
apiUrl: COURSE_API_ROUTES.UNIT,
|
|
15
|
-
};
|
|
16
|
-
// ============================================================================
|
|
17
|
-
// COURSE-SPECIFIC CACHE FUNCTIONS
|
|
18
|
-
// ============================================================================
|
|
19
|
-
export const getCachedCoursesSync = () => getCachedDataSync(LS_KEYS.COURSES);
|
|
20
|
-
export const getCachedCourses = ({ params, }) => getCachedData({
|
|
21
|
-
config: COURSE_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 getCachedCourseById = (courseId) => getCachedItemById(LS_KEYS.COURSES, courseId);
|
|
29
|
-
export const invalidateCoursesCache = () => invalidateCache(LS_KEYS.COURSES);
|
|
30
|
-
export const preloadCourses = () => preloadCache(COURSE_CACHE_CONFIG);
|
|
31
|
-
export const isCoursesCacheStale = () => isCacheStale(LS_KEYS.COURSES);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enrollment Module Cache Utilities
|
|
3
|
-
*
|
|
4
|
-
* Provides localStorage-based caching for enrollments using generic cache system.
|
|
5
|
-
*/
|
|
6
|
-
import { EnrollmentBE } from "../../type";
|
|
7
|
-
export declare const getCachedEnrollmentsSync: () => import("@react-pakistan/util-functions").ListResponse<EnrollmentBE>;
|
|
8
|
-
export declare const getCachedEnrollments: ({ params, }: {
|
|
9
|
-
params: Record<string, unknown>;
|
|
10
|
-
}) => Promise<import("@react-pakistan/util-functions").ListResponse<EnrollmentBE>>;
|
|
11
|
-
export declare const getCachedEnrollmentById: (enrollmentId: string) => EnrollmentBE | null;
|
|
12
|
-
export declare const invalidateEnrollmentsCache: () => void;
|
|
13
|
-
export declare const preloadEnrollments: () => Promise<import("@react-pakistan/util-functions").ListResponse<EnrollmentBE>>;
|
|
14
|
-
export declare const isEnrollmentsCacheStale: () => boolean;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enrollment Module Cache Utilities
|
|
3
|
-
*
|
|
4
|
-
* Provides localStorage-based caching for enrollments using generic cache system.
|
|
5
|
-
*/
|
|
6
|
-
import { LS_KEYS } from "../../constants";
|
|
7
|
-
import { ENROLLMENT_API_ROUTES } from "./constants";
|
|
8
|
-
import { getCachedData, getCachedDataSync, getCachedItemById, invalidateCache, isCacheStale, preloadCache, } from "@react-pakistan/util-functions";
|
|
9
|
-
// ============================================================================
|
|
10
|
-
// CACHE CONFIGURATION
|
|
11
|
-
// ============================================================================
|
|
12
|
-
const ENROLLMENT_CACHE_CONFIG = {
|
|
13
|
-
cacheKey: LS_KEYS.ENROLLMENTS,
|
|
14
|
-
apiUrl: ENROLLMENT_API_ROUTES.UNIT,
|
|
15
|
-
};
|
|
16
|
-
// ============================================================================
|
|
17
|
-
// ENROLLMENT-SPECIFIC CACHE FUNCTIONS
|
|
18
|
-
// ============================================================================
|
|
19
|
-
export const getCachedEnrollmentsSync = () => getCachedDataSync(LS_KEYS.ENROLLMENTS);
|
|
20
|
-
export const getCachedEnrollments = ({ params, }) => getCachedData({
|
|
21
|
-
config: ENROLLMENT_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 getCachedEnrollmentById = (enrollmentId) => getCachedItemById(LS_KEYS.ENROLLMENTS, enrollmentId);
|
|
29
|
-
export const invalidateEnrollmentsCache = () => invalidateCache(LS_KEYS.ENROLLMENTS);
|
|
30
|
-
export const preloadEnrollments = () => preloadCache(ENROLLMENT_CACHE_CONFIG);
|
|
31
|
-
export const isEnrollmentsCacheStale = () => isCacheStale(LS_KEYS.ENROLLMENTS);
|
|
@@ -1,14 +0,0 @@
|
|
|
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;
|
|
@@ -1,31 +0,0 @@
|
|
|
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);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Family Module Cache Utilities
|
|
3
|
-
*
|
|
4
|
-
* Provides localStorage-based caching for families using generic cache system.
|
|
5
|
-
*/
|
|
6
|
-
import { FamilyBE } from "../../type";
|
|
7
|
-
export declare const getCachedFamiliesSync: () => import("@react-pakistan/util-functions").ListResponse<FamilyBE>;
|
|
8
|
-
export declare const getCachedFamilies: ({ params, }: {
|
|
9
|
-
params?: Record<string, unknown>;
|
|
10
|
-
}) => Promise<import("@react-pakistan/util-functions").ListResponse<FamilyBE>>;
|
|
11
|
-
export declare const getCachedFamilyById: (familyId: string) => FamilyBE | null;
|
|
12
|
-
export declare const invalidateFamiliesCache: () => void;
|
|
13
|
-
export declare const preloadFamilies: () => Promise<import("@react-pakistan/util-functions").ListResponse<FamilyBE>>;
|
|
14
|
-
export declare const isFamiliesCacheStale: () => boolean;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Family Module Cache Utilities
|
|
3
|
-
*
|
|
4
|
-
* Provides localStorage-based caching for families using generic cache system.
|
|
5
|
-
*/
|
|
6
|
-
import { LS_KEYS } from "../../constants";
|
|
7
|
-
import { FAMILY_API_ROUTES } from "./constants";
|
|
8
|
-
import { getCachedData, getCachedDataSync, getCachedItemById, invalidateCache, isCacheStale, preloadCache, } from "@react-pakistan/util-functions";
|
|
9
|
-
// ============================================================================
|
|
10
|
-
// CACHE CONFIGURATION
|
|
11
|
-
// ============================================================================
|
|
12
|
-
const FAMILY_CACHE_CONFIG = {
|
|
13
|
-
cacheKey: LS_KEYS.FAMILIES,
|
|
14
|
-
apiUrl: FAMILY_API_ROUTES.UNIT,
|
|
15
|
-
};
|
|
16
|
-
// ============================================================================
|
|
17
|
-
// FAMILY-SPECIFIC CACHE FUNCTIONS
|
|
18
|
-
// ============================================================================
|
|
19
|
-
export const getCachedFamiliesSync = () => getCachedDataSync(LS_KEYS.FAMILIES);
|
|
20
|
-
export const getCachedFamilies = ({ params, }) => getCachedData({
|
|
21
|
-
config: FAMILY_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 getCachedFamilyById = (familyId) => getCachedItemById(LS_KEYS.FAMILIES, familyId);
|
|
29
|
-
export const invalidateFamiliesCache = () => invalidateCache(LS_KEYS.FAMILIES);
|
|
30
|
-
export const preloadFamilies = () => preloadCache(FAMILY_CACHE_CONFIG);
|
|
31
|
-
export const isFamiliesCacheStale = () => isCacheStale(LS_KEYS.FAMILIES);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Family Member Module Cache Utilities
|
|
3
|
-
*
|
|
4
|
-
* Provides localStorage-based caching for family members using generic cache system.
|
|
5
|
-
*/
|
|
6
|
-
import { FamilyMemberBE } from "../../type";
|
|
7
|
-
export declare const getCachedFamilyMembersSync: () => import("@react-pakistan/util-functions").ListResponse<FamilyMemberBE>;
|
|
8
|
-
export declare const getCachedFamilyMembers: ({ params, }: {
|
|
9
|
-
params?: Record<string, unknown>;
|
|
10
|
-
}) => Promise<import("@react-pakistan/util-functions").ListResponse<FamilyMemberBE>>;
|
|
11
|
-
export declare const getCachedFamilyMemberById: (familyMemberId: string) => FamilyMemberBE | null;
|
|
12
|
-
export declare const invalidateFamilyMembersCache: () => void;
|
|
13
|
-
export declare const preloadFamilyMembers: () => Promise<import("@react-pakistan/util-functions").ListResponse<FamilyMemberBE>>;
|
|
14
|
-
export declare const isFamilyMembersCacheStale: () => boolean;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Family Member Module Cache Utilities
|
|
3
|
-
*
|
|
4
|
-
* Provides localStorage-based caching for family members using generic cache system.
|
|
5
|
-
*/
|
|
6
|
-
import { LS_KEYS } from "../../constants";
|
|
7
|
-
import { FAMILY_MEMBER_API_ROUTES } from "./constants";
|
|
8
|
-
import { getCachedData, getCachedDataSync, getCachedItemById, invalidateCache, isCacheStale, preloadCache, } from "@react-pakistan/util-functions";
|
|
9
|
-
// ============================================================================
|
|
10
|
-
// CACHE CONFIGURATION
|
|
11
|
-
// ============================================================================
|
|
12
|
-
const FAMILY_MEMBER_CACHE_CONFIG = {
|
|
13
|
-
cacheKey: LS_KEYS.FAMILY_MEMBERS,
|
|
14
|
-
apiUrl: FAMILY_MEMBER_API_ROUTES.UNIT,
|
|
15
|
-
};
|
|
16
|
-
// ============================================================================
|
|
17
|
-
// FAMILY_MEMBER-SPECIFIC CACHE FUNCTIONS
|
|
18
|
-
// ============================================================================
|
|
19
|
-
export const getCachedFamilyMembersSync = () => getCachedDataSync(LS_KEYS.FAMILY_MEMBERS);
|
|
20
|
-
export const getCachedFamilyMembers = ({ params, }) => getCachedData({
|
|
21
|
-
config: FAMILY_MEMBER_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 getCachedFamilyMemberById = (familyMemberId) => getCachedItemById(LS_KEYS.FAMILY_MEMBERS, familyMemberId);
|
|
29
|
-
export const invalidateFamilyMembersCache = () => invalidateCache(LS_KEYS.FAMILY_MEMBERS);
|
|
30
|
-
export const preloadFamilyMembers = () => preloadCache(FAMILY_MEMBER_CACHE_CONFIG);
|
|
31
|
-
export const isFamilyMembersCacheStale = () => isCacheStale(LS_KEYS.FAMILY_MEMBERS);
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* RBAC Module Cache Utilities
|
|
3
|
-
*
|
|
4
|
-
* Convenience wrappers around the shared cache helpers used across modules.
|
|
5
|
-
* These helpers are intentionally small: callers in the UI layer expect
|
|
6
|
-
* simple, well-typed functions such as `getCachedRoles` and
|
|
7
|
-
* `invalidateRolesCache`.
|
|
8
|
-
*
|
|
9
|
-
* Usage examples:
|
|
10
|
-
* - `await getCachedRoles({ params: { page: 1 } })`
|
|
11
|
-
* - `invalidateRolesCache()` after a successful create/update/delete
|
|
12
|
-
*/
|
|
13
|
-
import { RoleBE } from "../../type";
|
|
14
|
-
/** Synchronous access to cached roles (localStorage) */
|
|
15
|
-
export declare const getCachedRolesSync: () => import("@react-pakistan/util-functions").ListResponse<RoleBE>;
|
|
16
|
-
/** Fetch cached list (may call network if cache miss or stale) */
|
|
17
|
-
export declare const getCachedRoles: ({ params, }: {
|
|
18
|
-
params: Record<string, unknown>;
|
|
19
|
-
}) => Promise<import("@react-pakistan/util-functions").ListResponse<RoleBE>>;
|
|
20
|
-
/** Get a single role from the cache by id */
|
|
21
|
-
export declare const getCachedRoleById: (roleId: string) => RoleBE | null;
|
|
22
|
-
/** Remove role cache entries (used after writes) */
|
|
23
|
-
export declare const invalidateRolesCache: () => void;
|
|
24
|
-
/** Preload roles into cache (useful during bootstrap) */
|
|
25
|
-
export declare const preloadRoles: () => Promise<import("@react-pakistan/util-functions").ListResponse<RoleBE>>;
|
|
26
|
-
/** Utility to check if the roles cache is stale */
|
|
27
|
-
export declare const isRolesCacheStale: () => boolean;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* RBAC Module Cache Utilities
|
|
3
|
-
*
|
|
4
|
-
* Convenience wrappers around the shared cache helpers used across modules.
|
|
5
|
-
* These helpers are intentionally small: callers in the UI layer expect
|
|
6
|
-
* simple, well-typed functions such as `getCachedRoles` and
|
|
7
|
-
* `invalidateRolesCache`.
|
|
8
|
-
*
|
|
9
|
-
* Usage examples:
|
|
10
|
-
* - `await getCachedRoles({ params: { page: 1 } })`
|
|
11
|
-
* - `invalidateRolesCache()` after a successful create/update/delete
|
|
12
|
-
*/
|
|
13
|
-
import { LS_KEYS } from "../../constants";
|
|
14
|
-
import { RBAC_API_ROUTES } from "./constants";
|
|
15
|
-
import { getCachedData, getCachedDataSync, getCachedItemById, invalidateCache, isCacheStale, preloadCache, } from "@react-pakistan/util-functions";
|
|
16
|
-
// ============================================================================
|
|
17
|
-
// CACHE CONFIGURATION
|
|
18
|
-
// ============================================================================
|
|
19
|
-
const ROLE_CACHE_CONFIG = {
|
|
20
|
-
cacheKey: LS_KEYS.ROLES,
|
|
21
|
-
apiUrl: RBAC_API_ROUTES.UNIT,
|
|
22
|
-
};
|
|
23
|
-
// ============================================================================
|
|
24
|
-
// ROLE CACHE FUNCTIONS
|
|
25
|
-
// ============================================================================
|
|
26
|
-
/** Synchronous access to cached roles (localStorage) */
|
|
27
|
-
export const getCachedRolesSync = () => getCachedDataSync(LS_KEYS.ROLES);
|
|
28
|
-
/** Fetch cached list (may call network if cache miss or stale) */
|
|
29
|
-
export const getCachedRoles = ({ params, }) => getCachedData({
|
|
30
|
-
config: ROLE_CACHE_CONFIG,
|
|
31
|
-
params,
|
|
32
|
-
headers: {
|
|
33
|
-
"Content-Type": "application/json",
|
|
34
|
-
// "x-api-token": process.env.NEXT_PUBLIC_API_KEY!,
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
/** Get a single role from the cache by id */
|
|
38
|
-
export const getCachedRoleById = (roleId) => getCachedItemById(LS_KEYS.ROLES, roleId);
|
|
39
|
-
/** Remove role cache entries (used after writes) */
|
|
40
|
-
export const invalidateRolesCache = () => {
|
|
41
|
-
invalidateCache(LS_KEYS.ROLES);
|
|
42
|
-
};
|
|
43
|
-
/** Preload roles into cache (useful during bootstrap) */
|
|
44
|
-
export const preloadRoles = () => preloadCache(ROLE_CACHE_CONFIG);
|
|
45
|
-
/** Utility to check if the roles cache is stale */
|
|
46
|
-
export const isRolesCacheStale = () => isCacheStale(LS_KEYS.ROLES);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* StudentFee Cache Utilities
|
|
3
|
-
*
|
|
4
|
-
* Local cache helpers for the student-fee module. Mirrors the layout and
|
|
5
|
-
* naming used by the `user` module cache utilities.
|
|
6
|
-
*/
|
|
7
|
-
import { StudentFeeBE } from "../../type";
|
|
8
|
-
export declare const getCachedStudentFeesSync: () => import("@react-pakistan/util-functions").ListResponse<StudentFeeBE>;
|
|
9
|
-
export declare const getCachedStudentFees: ({ params, }: {
|
|
10
|
-
params: Record<string, unknown>;
|
|
11
|
-
}) => Promise<import("@react-pakistan/util-functions").ListResponse<StudentFeeBE>>;
|
|
12
|
-
export declare const getCachedStudentFeeById: (studentFeeId: string) => StudentFeeBE | null;
|
|
13
|
-
export declare const invalidateStudentFeesCache: () => void;
|
|
14
|
-
export declare const preloadStudentFees: () => Promise<import("@react-pakistan/util-functions").ListResponse<StudentFeeBE>>;
|
|
15
|
-
export declare const isStudentFeesCacheStale: () => boolean;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { LS_KEYS } from "../../constants";
|
|
2
|
-
import { STUDENT_FEE_API_ROUTES } from "./constants";
|
|
3
|
-
import { getCachedData, getCachedDataSync, getCachedItemById, invalidateCache, isCacheStale, preloadCache, } from "@react-pakistan/util-functions";
|
|
4
|
-
// Cache configuration for student fees
|
|
5
|
-
const STUDENT_FEE_CACHE_CONFIG = {
|
|
6
|
-
cacheKey: LS_KEYS.STUDENT_FEES,
|
|
7
|
-
apiUrl: STUDENT_FEE_API_ROUTES.UNIT,
|
|
8
|
-
};
|
|
9
|
-
export const getCachedStudentFeesSync = () => getCachedDataSync(LS_KEYS.STUDENT_FEES);
|
|
10
|
-
export const getCachedStudentFees = ({ params, }) => getCachedData({
|
|
11
|
-
config: STUDENT_FEE_CACHE_CONFIG,
|
|
12
|
-
params,
|
|
13
|
-
headers: {
|
|
14
|
-
"Content-Type": "application/json",
|
|
15
|
-
// "x-api-token": process.env.NEXT_PUBLIC_API_KEY!,
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
export const getCachedStudentFeeById = (studentFeeId) => getCachedItemById(LS_KEYS.STUDENT_FEES, studentFeeId);
|
|
19
|
-
export const invalidateStudentFeesCache = () => invalidateCache(LS_KEYS.STUDENT_FEES);
|
|
20
|
-
export const preloadStudentFees = () => preloadCache(STUDENT_FEE_CACHE_CONFIG);
|
|
21
|
-
export const isStudentFeesCacheStale = () => isCacheStale(LS_KEYS.STUDENT_FEES);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Workspace User Module Cache Utilities
|
|
3
|
-
*
|
|
4
|
-
* Provides localStorage-based caching for workspace users using generic cache system.
|
|
5
|
-
*/
|
|
6
|
-
import { WorkspaceUserBE } from "../../type";
|
|
7
|
-
export declare const getCachedWorkspaceUsersSync: () => import("@react-pakistan/util-functions").ListResponse<WorkspaceUserBE>;
|
|
8
|
-
export declare const getCachedWorkspaceUsers: ({ params, }: {
|
|
9
|
-
params: Record<string, unknown>;
|
|
10
|
-
}) => Promise<import("@react-pakistan/util-functions").ListResponse<WorkspaceUserBE>>;
|
|
11
|
-
export declare const getCachedWorkspaceUserById: (workspaceUserId: string) => WorkspaceUserBE | null;
|
|
12
|
-
export declare const invalidateWorkspaceUsersCache: () => void;
|
|
13
|
-
export declare const preloadWorkspaceUsers: () => Promise<import("@react-pakistan/util-functions").ListResponse<WorkspaceUserBE>>;
|
|
14
|
-
export declare const isWorkspaceUsersCacheStale: () => boolean;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Workspace User Module Cache Utilities
|
|
3
|
-
*
|
|
4
|
-
* Provides localStorage-based caching for workspace users using generic cache system.
|
|
5
|
-
*/
|
|
6
|
-
import { LS_KEYS } from "../../constants";
|
|
7
|
-
import { WORKSPACE_USER_API_ROUTES } from "./constants";
|
|
8
|
-
import { getCachedData, getCachedDataSync, getCachedItemById, invalidateCache, isCacheStale, preloadCache, } from "@react-pakistan/util-functions";
|
|
9
|
-
// ============================================================================
|
|
10
|
-
// CACHE CONFIGURATION
|
|
11
|
-
// ============================================================================
|
|
12
|
-
const WORKSPACE_USER_CACHE_CONFIG = {
|
|
13
|
-
cacheKey: LS_KEYS.WORKSPACE_USERS,
|
|
14
|
-
apiUrl: WORKSPACE_USER_API_ROUTES.UNIT,
|
|
15
|
-
};
|
|
16
|
-
// ============================================================================
|
|
17
|
-
// WORKSPACE_USER-SPECIFIC CACHE FUNCTIONS
|
|
18
|
-
// ============================================================================
|
|
19
|
-
export const getCachedWorkspaceUsersSync = () => getCachedDataSync(LS_KEYS.WORKSPACE_USERS);
|
|
20
|
-
export const getCachedWorkspaceUsers = ({ params, }) => getCachedData({
|
|
21
|
-
config: WORKSPACE_USER_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 getCachedWorkspaceUserById = (workspaceUserId) => getCachedItemById(LS_KEYS.WORKSPACE_USERS, workspaceUserId);
|
|
29
|
-
export const invalidateWorkspaceUsersCache = () => invalidateCache(LS_KEYS.WORKSPACE_USERS);
|
|
30
|
-
export const preloadWorkspaceUsers = () => preloadCache(WORKSPACE_USER_CACHE_CONFIG);
|
|
31
|
-
export const isWorkspaceUsersCacheStale = () => isCacheStale(LS_KEYS.WORKSPACE_USERS);
|