@appcorp/fusion-storybook 0.1.4
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/README.md +147 -0
- package/base-modules/admission/cache.d.ts +14 -0
- package/base-modules/admission/cache.js +31 -0
- package/base-modules/admission/constants.d.ts +32 -0
- package/base-modules/admission/constants.js +37 -0
- package/base-modules/admission/context.d.ts +369 -0
- package/base-modules/admission/context.js +755 -0
- package/base-modules/admission/filter.d.ts +1 -0
- package/base-modules/admission/filter.js +31 -0
- package/base-modules/admission/form.d.ts +1 -0
- package/base-modules/admission/form.js +86 -0
- package/base-modules/admission/more-actions.d.ts +1 -0
- package/base-modules/admission/more-actions.js +5 -0
- package/base-modules/admission/page.d.ts +16 -0
- package/base-modules/admission/page.js +128 -0
- package/base-modules/admission/validate.d.ts +38 -0
- package/base-modules/admission/validate.js +70 -0
- package/base-modules/admission/view.d.ts +1 -0
- package/base-modules/admission/view.js +40 -0
- package/base-modules/discount-code/cache.d.ts +27 -0
- package/base-modules/discount-code/cache.js +46 -0
- package/base-modules/discount-code/constants.d.ts +19 -0
- package/base-modules/discount-code/constants.js +26 -0
- package/base-modules/discount-code/context.d.ts +154 -0
- package/base-modules/discount-code/context.js +416 -0
- package/base-modules/discount-code/filter.d.ts +9 -0
- package/base-modules/discount-code/filter.js +14 -0
- package/base-modules/discount-code/form.d.ts +1 -0
- package/base-modules/discount-code/form.js +44 -0
- package/base-modules/discount-code/more-actions.d.ts +9 -0
- package/base-modules/discount-code/more-actions.js +13 -0
- package/base-modules/discount-code/page.d.ts +16 -0
- package/base-modules/discount-code/page.js +120 -0
- package/base-modules/discount-code/validate.d.ts +19 -0
- package/base-modules/discount-code/validate.js +38 -0
- package/base-modules/discount-code/view.d.ts +1 -0
- package/base-modules/discount-code/view.js +26 -0
- package/base-modules/family/cache.d.ts +14 -0
- package/base-modules/family/cache.js +31 -0
- package/base-modules/family/constants.d.ts +22 -0
- package/base-modules/family/constants.js +26 -0
- package/base-modules/family/context.d.ts +173 -0
- package/base-modules/family/context.js +441 -0
- package/base-modules/family/filter.d.ts +1 -0
- package/base-modules/family/filter.js +28 -0
- package/base-modules/family/form.d.ts +1 -0
- package/base-modules/family/form.js +12 -0
- package/base-modules/family/more-actions.d.ts +1 -0
- package/base-modules/family/more-actions.js +5 -0
- package/base-modules/family/page.d.ts +16 -0
- package/base-modules/family/page.js +120 -0
- package/base-modules/family/validate.d.ts +15 -0
- package/base-modules/family/validate.js +18 -0
- package/base-modules/family/view.d.ts +1 -0
- package/base-modules/family/view.js +18 -0
- package/base-modules/family-member/cache.d.ts +14 -0
- package/base-modules/family-member/cache.js +31 -0
- package/base-modules/family-member/constants.d.ts +22 -0
- package/base-modules/family-member/constants.js +26 -0
- package/base-modules/family-member/context.d.ts +215 -0
- package/base-modules/family-member/context.js +486 -0
- package/base-modules/family-member/filter.d.ts +1 -0
- package/base-modules/family-member/filter.js +28 -0
- package/base-modules/family-member/form.d.ts +1 -0
- package/base-modules/family-member/form.js +17 -0
- package/base-modules/family-member/more-actions.d.ts +1 -0
- package/base-modules/family-member/more-actions.js +5 -0
- package/base-modules/family-member/page.d.ts +16 -0
- package/base-modules/family-member/page.js +122 -0
- package/base-modules/family-member/validate.d.ts +24 -0
- package/base-modules/family-member/validate.js +27 -0
- package/base-modules/family-member/view.d.ts +1 -0
- package/base-modules/family-member/view.js +40 -0
- package/base-modules/student-profile/cache.d.ts +14 -0
- package/base-modules/student-profile/cache.js +31 -0
- package/base-modules/student-profile/constants.d.ts +105 -0
- package/base-modules/student-profile/constants.js +132 -0
- package/base-modules/student-profile/context.d.ts +290 -0
- package/base-modules/student-profile/context.js +583 -0
- package/base-modules/student-profile/filter.d.ts +1 -0
- package/base-modules/student-profile/filter.js +26 -0
- package/base-modules/student-profile/form.d.ts +1 -0
- package/base-modules/student-profile/form.js +19 -0
- package/base-modules/student-profile/more-actions.d.ts +1 -0
- package/base-modules/student-profile/more-actions.js +5 -0
- package/base-modules/student-profile/page.d.ts +9 -0
- package/base-modules/student-profile/page.js +86 -0
- package/base-modules/student-profile/validate.d.ts +23 -0
- package/base-modules/student-profile/validate.js +34 -0
- package/base-modules/student-profile/view.d.ts +1 -0
- package/base-modules/student-profile/view.js +29 -0
- package/base-modules/workspace/cache.d.ts +9 -0
- package/base-modules/workspace/cache.js +28 -0
- package/base-modules/workspace/constants.d.ts +10 -0
- package/base-modules/workspace/constants.js +18 -0
- package/base-modules/workspace/context.d.ts +187 -0
- package/base-modules/workspace/context.js +293 -0
- package/base-modules/workspace/drawer.d.ts +1 -0
- package/base-modules/workspace/drawer.js +24 -0
- package/base-modules/workspace/filter.d.ts +1 -0
- package/base-modules/workspace/filter.js +13 -0
- package/base-modules/workspace/form.d.ts +1 -0
- package/base-modules/workspace/form.js +40 -0
- package/base-modules/workspace/more-actions.d.ts +1 -0
- package/base-modules/workspace/more-actions.js +13 -0
- package/base-modules/workspace/page.d.ts +1 -0
- package/base-modules/workspace/page.js +31 -0
- package/base-modules/workspace/validate.d.ts +9 -0
- package/base-modules/workspace/validate.js +8 -0
- package/base-modules/workspace/view.d.ts +1 -0
- package/base-modules/workspace/view.js +52 -0
- package/components/rbac-no-access.d.ts +6 -0
- package/components/rbac-no-access.js +4 -0
- package/constants.d.ts +81 -0
- package/constants.js +81 -0
- package/lib/utils.d.ts +2 -0
- package/lib/utils.js +5 -0
- package/package.json +104 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/type.d.ts +1141 -0
- package/type.js +427 -0
- package/utils/admission-pdf.d.ts +78 -0
- package/utils/admission-pdf.js +73 -0
- package/utils/clear-cache.d.ts +1 -0
- package/utils/clear-cache.js +8 -0
- package/utils/format-value.d.ts +1 -0
- package/utils/format-value.js +1 -0
- package/utils/pdf-generator.d.ts +41 -0
- package/utils/pdf-generator.js +107 -0
- package/utils/resolve-rbac-permissions.d.ts +11 -0
- package/utils/resolve-rbac-permissions.js +251 -0
package/README.md
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# Fusion Storybook
|
|
2
|
+
|
|
3
|
+
A component library built with a modern tech stack for maximum reusability across multiple projects.
|
|
4
|
+
|
|
5
|
+
## Tech Stack
|
|
6
|
+
|
|
7
|
+
- **[Next.js 16](https://nextjs.org/)** - React framework with App Router
|
|
8
|
+
- **[TypeScript](https://www.typescriptlang.org/)** - Type-safe JavaScript
|
|
9
|
+
- **[Tailwind CSS v4](https://tailwindcss.com/)** - Utility-first CSS framework
|
|
10
|
+
- **[ShadcnUI](https://ui.shadcn.com/)** - Accessible component library built on Radix UI
|
|
11
|
+
- **[Storybook 10](https://storybook.js.org/)** - Component development and documentation
|
|
12
|
+
- **[ESLint](https://eslint.org/)** - Code linting with Next.js rules
|
|
13
|
+
- **[Prettier](https://prettier.io/)** - Code formatting with Tailwind class sorting
|
|
14
|
+
- **[Husky](https://typicode.github.io/husky/)** - Git hooks for quality enforcement
|
|
15
|
+
- **[lint-staged](https://github.com/okonet/lint-staged)** - Run linters on staged files
|
|
16
|
+
- **[commitlint](https://commitlint.js.org/)** - Enforce conventional commit messages
|
|
17
|
+
- **[Jest](https://jestjs.io/)** - Unit and integration testing
|
|
18
|
+
- **[Playwright](https://playwright.dev/)** - End-to-end browser testing
|
|
19
|
+
|
|
20
|
+
## Getting Started
|
|
21
|
+
|
|
22
|
+
### Prerequisites
|
|
23
|
+
|
|
24
|
+
- Node.js 20+
|
|
25
|
+
- npm 10+
|
|
26
|
+
|
|
27
|
+
### Installation
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Development
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm run dev
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Open [http://localhost:3000](http://localhost:3000) to view the app.
|
|
40
|
+
|
|
41
|
+
### Storybook
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm run storybook
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Open [http://localhost:6006](http://localhost:6006) to view the Storybook.
|
|
48
|
+
|
|
49
|
+
## Scripts
|
|
50
|
+
|
|
51
|
+
| Script | Description |
|
|
52
|
+
| ------------------------- | -------------------------------- |
|
|
53
|
+
| `npm run dev` | Start Next.js development server |
|
|
54
|
+
| `npm run build` | Build for production |
|
|
55
|
+
| `npm run start` | Start production server |
|
|
56
|
+
| `npm run lint` | Run ESLint |
|
|
57
|
+
| `npm run lint:fix` | Run ESLint with auto-fix |
|
|
58
|
+
| `npm run format` | Format all files with Prettier |
|
|
59
|
+
| `npm run format:check` | Check formatting without writing |
|
|
60
|
+
| `npm run storybook` | Start Storybook dev server |
|
|
61
|
+
| `npm run build-storybook` | Build Storybook for production |
|
|
62
|
+
| `npm run test` | Run Jest unit tests |
|
|
63
|
+
| `npm run test:watch` | Run Jest in watch mode |
|
|
64
|
+
| `npm run test:ci` | Run Jest with coverage (CI mode) |
|
|
65
|
+
| `npm run test:e2e` | Run Playwright e2e tests |
|
|
66
|
+
| `npm run test:e2e:ui` | Run Playwright with UI |
|
|
67
|
+
| `npm run test:e2e:report` | Open Playwright HTML report |
|
|
68
|
+
|
|
69
|
+
## Git Workflow
|
|
70
|
+
|
|
71
|
+
This project enforces code quality via Husky git hooks:
|
|
72
|
+
|
|
73
|
+
### Pre-commit
|
|
74
|
+
|
|
75
|
+
- Runs `lint-staged` which lints and formats only staged files
|
|
76
|
+
|
|
77
|
+
### Commit Message
|
|
78
|
+
|
|
79
|
+
- Enforces [Conventional Commits](https://www.conventionalcommits.org/) format via commitlint
|
|
80
|
+
- Examples:
|
|
81
|
+
- `feat: add new button component`
|
|
82
|
+
- `fix: resolve responsive layout issue`
|
|
83
|
+
- `docs: update README`
|
|
84
|
+
- `test: add unit tests for button`
|
|
85
|
+
|
|
86
|
+
### Pre-push
|
|
87
|
+
|
|
88
|
+
- Runs the full Jest test suite before pushing
|
|
89
|
+
|
|
90
|
+
## Project Structure
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
fusion-storybook/
|
|
94
|
+
├── src/
|
|
95
|
+
│ ├── app/ # Next.js App Router
|
|
96
|
+
│ │ ├── globals.css # Global styles with ShadcnUI CSS variables
|
|
97
|
+
│ │ ├── layout.tsx # Root layout
|
|
98
|
+
│ │ └── page.tsx # Home page
|
|
99
|
+
│ ├── components/
|
|
100
|
+
│ │ └── ui/ # ShadcnUI components
|
|
101
|
+
│ │ └── button.tsx
|
|
102
|
+
│ ├── lib/
|
|
103
|
+
│ │ └── utils.ts # Utility functions (cn helper)
|
|
104
|
+
│ ├── hooks/ # Custom React hooks
|
|
105
|
+
│ ├── stories/ # Storybook stories
|
|
106
|
+
│ └── __tests__/ # Jest unit tests
|
|
107
|
+
├── tests/
|
|
108
|
+
│ └── e2e/ # Playwright e2e tests
|
|
109
|
+
├── .husky/ # Husky git hooks
|
|
110
|
+
├── .storybook/ # Storybook configuration
|
|
111
|
+
├── .vscode/ # VS Code settings
|
|
112
|
+
├── components.json # ShadcnUI configuration
|
|
113
|
+
├── jest.config.ts # Jest configuration
|
|
114
|
+
├── jest.setup.ts # Jest setup (testing-library/jest-dom)
|
|
115
|
+
├── playwright.config.ts # Playwright configuration
|
|
116
|
+
├── commitlint.config.ts # Commitlint configuration
|
|
117
|
+
└── .prettierrc # Prettier configuration
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Adding ShadcnUI Components
|
|
121
|
+
|
|
122
|
+
Once the `shadcn` CLI can reach the registry, use:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
npx shadcn@latest add button
|
|
126
|
+
npx shadcn@latest add dialog
|
|
127
|
+
npx shadcn@latest add dropdown-menu
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## VS Code Integration
|
|
131
|
+
|
|
132
|
+
Install recommended extensions for the best development experience:
|
|
133
|
+
|
|
134
|
+
- **Prettier** - Code formatting
|
|
135
|
+
- **ESLint** - Code linting
|
|
136
|
+
- **Tailwind CSS IntelliSense** - Tailwind class hints
|
|
137
|
+
- **Storybook** - Storybook integration
|
|
138
|
+
- **Playwright** - Test runner integration
|
|
139
|
+
|
|
140
|
+
Format on save is enabled by default via `.vscode/settings.json`.
|
|
141
|
+
|
|
142
|
+
## Code Quality
|
|
143
|
+
|
|
144
|
+
- **ESLint** enforces Next.js and TypeScript best practices
|
|
145
|
+
- **Prettier** with `prettier-plugin-tailwindcss` auto-sorts Tailwind classes
|
|
146
|
+
- **lint-staged** runs linters only on staged files (fast!)
|
|
147
|
+
- **commitlint** ensures consistent commit message format
|
|
@@ -0,0 +1,14 @@
|
|
|
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;
|
|
@@ -0,0 +1,31 @@
|
|
|
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);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Admission Constants
|
|
3
|
+
*
|
|
4
|
+
* Organization:
|
|
5
|
+
* - Page Configuration
|
|
6
|
+
* - API Routes
|
|
7
|
+
* - Table Configuration
|
|
8
|
+
* - Status Options
|
|
9
|
+
*/
|
|
10
|
+
import { ADMISSION_STATUS } from "../../type";
|
|
11
|
+
export declare const pageLimit: number;
|
|
12
|
+
export declare const ADMISSION_API_ROUTES: Record<string, string>;
|
|
13
|
+
export declare const ADMISSION_STATUS_OPTIONS: {
|
|
14
|
+
label: string;
|
|
15
|
+
value: ADMISSION_STATUS;
|
|
16
|
+
}[];
|
|
17
|
+
export declare const ADMISSION_STATUS_OPTIONS_CONST: readonly [{
|
|
18
|
+
readonly label: "Pending";
|
|
19
|
+
readonly value: ADMISSION_STATUS.PENDING;
|
|
20
|
+
}, {
|
|
21
|
+
readonly label: "Approved";
|
|
22
|
+
readonly value: ADMISSION_STATUS.APPROVED;
|
|
23
|
+
}, {
|
|
24
|
+
readonly label: "Rejected";
|
|
25
|
+
readonly value: ADMISSION_STATUS.REJECTED;
|
|
26
|
+
}, {
|
|
27
|
+
readonly label: "Enrolled";
|
|
28
|
+
readonly value: ADMISSION_STATUS.ENROLLED;
|
|
29
|
+
}, {
|
|
30
|
+
readonly label: "Cancelled";
|
|
31
|
+
readonly value: ADMISSION_STATUS.CANCELLED;
|
|
32
|
+
}];
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Admission Constants
|
|
3
|
+
*
|
|
4
|
+
* Organization:
|
|
5
|
+
* - Page Configuration
|
|
6
|
+
* - API Routes
|
|
7
|
+
* - Table Configuration
|
|
8
|
+
* - Status Options
|
|
9
|
+
*/
|
|
10
|
+
import { ADMISSION_STATUS } from "../../type";
|
|
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 ADMISSION_API_ROUTES = {
|
|
19
|
+
UNIT: "/api/v1/admission",
|
|
20
|
+
};
|
|
21
|
+
// ============================================================================
|
|
22
|
+
// STATUS OPTIONS
|
|
23
|
+
// ============================================================================
|
|
24
|
+
export const ADMISSION_STATUS_OPTIONS = [
|
|
25
|
+
{ label: "Pending", value: ADMISSION_STATUS.PENDING },
|
|
26
|
+
{ label: "Approved", value: ADMISSION_STATUS.APPROVED },
|
|
27
|
+
{ label: "Rejected", value: ADMISSION_STATUS.REJECTED },
|
|
28
|
+
{ label: "Enrolled", value: ADMISSION_STATUS.ENROLLED },
|
|
29
|
+
{ label: "Cancelled", value: ADMISSION_STATUS.CANCELLED },
|
|
30
|
+
];
|
|
31
|
+
export const ADMISSION_STATUS_OPTIONS_CONST = [
|
|
32
|
+
{ label: "Pending", value: ADMISSION_STATUS.PENDING },
|
|
33
|
+
{ label: "Approved", value: ADMISSION_STATUS.APPROVED },
|
|
34
|
+
{ label: "Rejected", value: ADMISSION_STATUS.REJECTED },
|
|
35
|
+
{ label: "Enrolled", value: ADMISSION_STATUS.ENROLLED },
|
|
36
|
+
{ label: "Cancelled", value: ADMISSION_STATUS.CANCELLED },
|
|
37
|
+
];
|
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
import { AdmissionAIBE, AdmissionBE } from "../../type";
|
|
2
|
+
import { type RowAction, type TableRow } from "@appcorp/shadcn/components/enhanced-table";
|
|
3
|
+
export declare const ADMISSION_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 ADMISSION_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
|
+
}, admissionModuleConfig: import("@react-pakistan/util-functions/factory/generic-module-factory").ModuleConfig<{
|
|
22
|
+
items: AdmissionBE[];
|
|
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
|
+
id: string;
|
|
31
|
+
bForm: string;
|
|
32
|
+
discountCode: string;
|
|
33
|
+
dob: string;
|
|
34
|
+
emergencyContact: string;
|
|
35
|
+
firstName: string;
|
|
36
|
+
gender: string;
|
|
37
|
+
hafiz: boolean;
|
|
38
|
+
lastName: string;
|
|
39
|
+
orphan: boolean;
|
|
40
|
+
registrationCode: string;
|
|
41
|
+
fatherCnic: string;
|
|
42
|
+
fatherFirstName: string;
|
|
43
|
+
fatherLastName: string;
|
|
44
|
+
fatherMobile: string;
|
|
45
|
+
fatherOccupation: string;
|
|
46
|
+
fatherOrganization: string;
|
|
47
|
+
motherCnic: string;
|
|
48
|
+
motherFirstName: string;
|
|
49
|
+
motherLastName: string;
|
|
50
|
+
motherMobile: string;
|
|
51
|
+
address: string;
|
|
52
|
+
city: string;
|
|
53
|
+
country: string;
|
|
54
|
+
postalCode: string;
|
|
55
|
+
state: string;
|
|
56
|
+
classForAdmission: string;
|
|
57
|
+
previousSchool: string;
|
|
58
|
+
siblings: string;
|
|
59
|
+
admissionNotes: string;
|
|
60
|
+
notes: string;
|
|
61
|
+
enabled: boolean;
|
|
62
|
+
status: string;
|
|
63
|
+
admissionStatus: string;
|
|
64
|
+
schoolId: string;
|
|
65
|
+
familyId: string | null;
|
|
66
|
+
aiAnalysis: AdmissionAIBE | null;
|
|
67
|
+
analyzeLoading: boolean;
|
|
68
|
+
analyzeError: string | null;
|
|
69
|
+
filterEnabled: boolean | undefined;
|
|
70
|
+
filterAdmissionStatus: string | undefined;
|
|
71
|
+
filterStartDate: string | undefined;
|
|
72
|
+
filterEndDate: string | undefined;
|
|
73
|
+
}>, initialAdmissionState: {
|
|
74
|
+
items: AdmissionBE[];
|
|
75
|
+
count: number;
|
|
76
|
+
currentPage: number;
|
|
77
|
+
pageLimit: number;
|
|
78
|
+
searchQuery: string;
|
|
79
|
+
disableSaveButton: boolean;
|
|
80
|
+
drawer: string | null;
|
|
81
|
+
errors: Record<string, string>;
|
|
82
|
+
id: string;
|
|
83
|
+
bForm: string;
|
|
84
|
+
discountCode: string;
|
|
85
|
+
dob: string;
|
|
86
|
+
emergencyContact: string;
|
|
87
|
+
firstName: string;
|
|
88
|
+
gender: string;
|
|
89
|
+
hafiz: boolean;
|
|
90
|
+
lastName: string;
|
|
91
|
+
orphan: boolean;
|
|
92
|
+
registrationCode: string;
|
|
93
|
+
fatherCnic: string;
|
|
94
|
+
fatherFirstName: string;
|
|
95
|
+
fatherLastName: string;
|
|
96
|
+
fatherMobile: string;
|
|
97
|
+
fatherOccupation: string;
|
|
98
|
+
fatherOrganization: string;
|
|
99
|
+
motherCnic: string;
|
|
100
|
+
motherFirstName: string;
|
|
101
|
+
motherLastName: string;
|
|
102
|
+
motherMobile: string;
|
|
103
|
+
address: string;
|
|
104
|
+
city: string;
|
|
105
|
+
country: string;
|
|
106
|
+
postalCode: string;
|
|
107
|
+
state: string;
|
|
108
|
+
classForAdmission: string;
|
|
109
|
+
previousSchool: string;
|
|
110
|
+
siblings: string;
|
|
111
|
+
admissionNotes: string;
|
|
112
|
+
notes: string;
|
|
113
|
+
enabled: boolean;
|
|
114
|
+
status: string;
|
|
115
|
+
admissionStatus: string;
|
|
116
|
+
schoolId: string;
|
|
117
|
+
familyId: string | null;
|
|
118
|
+
aiAnalysis: AdmissionAIBE | null;
|
|
119
|
+
analyzeLoading: boolean;
|
|
120
|
+
analyzeError: string | null;
|
|
121
|
+
filterEnabled: boolean | undefined;
|
|
122
|
+
filterAdmissionStatus: string | undefined;
|
|
123
|
+
filterStartDate: string | undefined;
|
|
124
|
+
filterEndDate: string | undefined;
|
|
125
|
+
}, AdmissionProvider: import("react").FC<{
|
|
126
|
+
children: React.ReactNode;
|
|
127
|
+
}>, admissionReducer: (state: {
|
|
128
|
+
items: AdmissionBE[];
|
|
129
|
+
count: number;
|
|
130
|
+
currentPage: number;
|
|
131
|
+
pageLimit: number;
|
|
132
|
+
searchQuery: string;
|
|
133
|
+
disableSaveButton: boolean;
|
|
134
|
+
drawer: string | null;
|
|
135
|
+
errors: Record<string, string>;
|
|
136
|
+
id: string;
|
|
137
|
+
bForm: string;
|
|
138
|
+
discountCode: string;
|
|
139
|
+
dob: string;
|
|
140
|
+
emergencyContact: string;
|
|
141
|
+
firstName: string;
|
|
142
|
+
gender: string;
|
|
143
|
+
hafiz: boolean;
|
|
144
|
+
lastName: string;
|
|
145
|
+
orphan: boolean;
|
|
146
|
+
registrationCode: string;
|
|
147
|
+
fatherCnic: string;
|
|
148
|
+
fatherFirstName: string;
|
|
149
|
+
fatherLastName: string;
|
|
150
|
+
fatherMobile: string;
|
|
151
|
+
fatherOccupation: string;
|
|
152
|
+
fatherOrganization: string;
|
|
153
|
+
motherCnic: string;
|
|
154
|
+
motherFirstName: string;
|
|
155
|
+
motherLastName: string;
|
|
156
|
+
motherMobile: string;
|
|
157
|
+
address: string;
|
|
158
|
+
city: string;
|
|
159
|
+
country: string;
|
|
160
|
+
postalCode: string;
|
|
161
|
+
state: string;
|
|
162
|
+
classForAdmission: string;
|
|
163
|
+
previousSchool: string;
|
|
164
|
+
siblings: string;
|
|
165
|
+
admissionNotes: string;
|
|
166
|
+
notes: string;
|
|
167
|
+
enabled: boolean;
|
|
168
|
+
status: string;
|
|
169
|
+
admissionStatus: string;
|
|
170
|
+
schoolId: string;
|
|
171
|
+
familyId: string | null;
|
|
172
|
+
aiAnalysis: AdmissionAIBE | null;
|
|
173
|
+
analyzeLoading: boolean;
|
|
174
|
+
analyzeError: string | null;
|
|
175
|
+
filterEnabled: boolean | undefined;
|
|
176
|
+
filterAdmissionStatus: string | undefined;
|
|
177
|
+
filterStartDate: string | undefined;
|
|
178
|
+
filterEndDate: string | undefined;
|
|
179
|
+
}, action: any) => {
|
|
180
|
+
items: AdmissionBE[];
|
|
181
|
+
count: number;
|
|
182
|
+
currentPage: number;
|
|
183
|
+
pageLimit: number;
|
|
184
|
+
searchQuery: string;
|
|
185
|
+
disableSaveButton: boolean;
|
|
186
|
+
drawer: string | null;
|
|
187
|
+
errors: Record<string, string>;
|
|
188
|
+
id: string;
|
|
189
|
+
bForm: string;
|
|
190
|
+
discountCode: string;
|
|
191
|
+
dob: string;
|
|
192
|
+
emergencyContact: string;
|
|
193
|
+
firstName: string;
|
|
194
|
+
gender: string;
|
|
195
|
+
hafiz: boolean;
|
|
196
|
+
lastName: string;
|
|
197
|
+
orphan: boolean;
|
|
198
|
+
registrationCode: string;
|
|
199
|
+
fatherCnic: string;
|
|
200
|
+
fatherFirstName: string;
|
|
201
|
+
fatherLastName: string;
|
|
202
|
+
fatherMobile: string;
|
|
203
|
+
fatherOccupation: string;
|
|
204
|
+
fatherOrganization: string;
|
|
205
|
+
motherCnic: string;
|
|
206
|
+
motherFirstName: string;
|
|
207
|
+
motherLastName: string;
|
|
208
|
+
motherMobile: string;
|
|
209
|
+
address: string;
|
|
210
|
+
city: string;
|
|
211
|
+
country: string;
|
|
212
|
+
postalCode: string;
|
|
213
|
+
state: string;
|
|
214
|
+
classForAdmission: string;
|
|
215
|
+
previousSchool: string;
|
|
216
|
+
siblings: string;
|
|
217
|
+
admissionNotes: string;
|
|
218
|
+
notes: string;
|
|
219
|
+
enabled: boolean;
|
|
220
|
+
status: string;
|
|
221
|
+
admissionStatus: string;
|
|
222
|
+
schoolId: string;
|
|
223
|
+
familyId: string | null;
|
|
224
|
+
aiAnalysis: AdmissionAIBE | null;
|
|
225
|
+
analyzeLoading: boolean;
|
|
226
|
+
analyzeError: string | null;
|
|
227
|
+
filterEnabled: boolean | undefined;
|
|
228
|
+
filterAdmissionStatus: string | undefined;
|
|
229
|
+
filterStartDate: string | undefined;
|
|
230
|
+
filterEndDate: string | undefined;
|
|
231
|
+
}, useAdmissionContext: () => import("@react-pakistan/util-functions/factory/generic-module-factory").GenericModuleContext<{
|
|
232
|
+
items: AdmissionBE[];
|
|
233
|
+
count: number;
|
|
234
|
+
currentPage: number;
|
|
235
|
+
pageLimit: number;
|
|
236
|
+
searchQuery: string;
|
|
237
|
+
disableSaveButton: boolean;
|
|
238
|
+
drawer: string | null;
|
|
239
|
+
errors: Record<string, string>;
|
|
240
|
+
id: string;
|
|
241
|
+
bForm: string;
|
|
242
|
+
discountCode: string;
|
|
243
|
+
dob: string;
|
|
244
|
+
emergencyContact: string;
|
|
245
|
+
firstName: string;
|
|
246
|
+
gender: string;
|
|
247
|
+
hafiz: boolean;
|
|
248
|
+
lastName: string;
|
|
249
|
+
orphan: boolean;
|
|
250
|
+
registrationCode: string;
|
|
251
|
+
fatherCnic: string;
|
|
252
|
+
fatherFirstName: string;
|
|
253
|
+
fatherLastName: string;
|
|
254
|
+
fatherMobile: string;
|
|
255
|
+
fatherOccupation: string;
|
|
256
|
+
fatherOrganization: string;
|
|
257
|
+
motherCnic: string;
|
|
258
|
+
motherFirstName: string;
|
|
259
|
+
motherLastName: string;
|
|
260
|
+
motherMobile: string;
|
|
261
|
+
address: string;
|
|
262
|
+
city: string;
|
|
263
|
+
country: string;
|
|
264
|
+
postalCode: string;
|
|
265
|
+
state: string;
|
|
266
|
+
classForAdmission: string;
|
|
267
|
+
previousSchool: string;
|
|
268
|
+
siblings: string;
|
|
269
|
+
admissionNotes: string;
|
|
270
|
+
notes: string;
|
|
271
|
+
enabled: boolean;
|
|
272
|
+
status: string;
|
|
273
|
+
admissionStatus: string;
|
|
274
|
+
schoolId: string;
|
|
275
|
+
familyId: string | null;
|
|
276
|
+
aiAnalysis: AdmissionAIBE | null;
|
|
277
|
+
analyzeLoading: boolean;
|
|
278
|
+
analyzeError: string | null;
|
|
279
|
+
filterEnabled: boolean | undefined;
|
|
280
|
+
filterAdmissionStatus: string | undefined;
|
|
281
|
+
filterStartDate: string | undefined;
|
|
282
|
+
filterEndDate: string | undefined;
|
|
283
|
+
}>;
|
|
284
|
+
export declare const useAdmissionModule: () => {
|
|
285
|
+
applyFilters: () => void;
|
|
286
|
+
byIdLoading: boolean;
|
|
287
|
+
clearFilters: () => void;
|
|
288
|
+
deleteLoading: boolean;
|
|
289
|
+
handleAddStudent: (row?: unknown) => Promise<void>;
|
|
290
|
+
handleAnalyze: (row?: unknown) => Promise<void>;
|
|
291
|
+
handleChange: (field: string, value: string | number | boolean | undefined | null) => void;
|
|
292
|
+
handleCloseDrawer: () => void;
|
|
293
|
+
handleCreate: () => void;
|
|
294
|
+
handleDelete: (row?: TableRow) => void;
|
|
295
|
+
handleEdit: (row?: TableRow) => void;
|
|
296
|
+
handleFilters: () => void;
|
|
297
|
+
handlePageChange: (page: number) => void;
|
|
298
|
+
handlePageLimitChange: (limit: number) => void;
|
|
299
|
+
handlePrint: (row?: TableRow) => Promise<void>;
|
|
300
|
+
handleSearch: (query: string) => void;
|
|
301
|
+
handleSetEndDate: (endDate: string) => void;
|
|
302
|
+
handleSetStartDate: (startDate: string) => void;
|
|
303
|
+
handleSubmit: () => void;
|
|
304
|
+
handleView: (row?: TableRow) => void;
|
|
305
|
+
headerActions: {
|
|
306
|
+
enabled: boolean;
|
|
307
|
+
handleOnClick: () => void;
|
|
308
|
+
label: string;
|
|
309
|
+
order: number;
|
|
310
|
+
icon: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
311
|
+
}[];
|
|
312
|
+
listLoading: boolean;
|
|
313
|
+
rowActions: RowAction[];
|
|
314
|
+
updateLoading: boolean;
|
|
315
|
+
state: {
|
|
316
|
+
items: AdmissionBE[];
|
|
317
|
+
count: number;
|
|
318
|
+
currentPage: number;
|
|
319
|
+
pageLimit: number;
|
|
320
|
+
searchQuery: string;
|
|
321
|
+
disableSaveButton: boolean;
|
|
322
|
+
drawer: string | null;
|
|
323
|
+
errors: Record<string, string>;
|
|
324
|
+
id: string;
|
|
325
|
+
bForm: string;
|
|
326
|
+
discountCode: string;
|
|
327
|
+
dob: string;
|
|
328
|
+
emergencyContact: string;
|
|
329
|
+
firstName: string;
|
|
330
|
+
gender: string;
|
|
331
|
+
hafiz: boolean;
|
|
332
|
+
lastName: string;
|
|
333
|
+
orphan: boolean;
|
|
334
|
+
registrationCode: string;
|
|
335
|
+
fatherCnic: string;
|
|
336
|
+
fatherFirstName: string;
|
|
337
|
+
fatherLastName: string;
|
|
338
|
+
fatherMobile: string;
|
|
339
|
+
fatherOccupation: string;
|
|
340
|
+
fatherOrganization: string;
|
|
341
|
+
motherCnic: string;
|
|
342
|
+
motherFirstName: string;
|
|
343
|
+
motherLastName: string;
|
|
344
|
+
motherMobile: string;
|
|
345
|
+
address: string;
|
|
346
|
+
city: string;
|
|
347
|
+
country: string;
|
|
348
|
+
postalCode: string;
|
|
349
|
+
state: string;
|
|
350
|
+
classForAdmission: string;
|
|
351
|
+
previousSchool: string;
|
|
352
|
+
siblings: string;
|
|
353
|
+
admissionNotes: string;
|
|
354
|
+
notes: string;
|
|
355
|
+
enabled: boolean;
|
|
356
|
+
status: string;
|
|
357
|
+
admissionStatus: string;
|
|
358
|
+
schoolId: string;
|
|
359
|
+
familyId: string | null;
|
|
360
|
+
aiAnalysis: AdmissionAIBE | null;
|
|
361
|
+
analyzeLoading: boolean;
|
|
362
|
+
analyzeError: string | null;
|
|
363
|
+
filterEnabled: boolean | undefined;
|
|
364
|
+
filterAdmissionStatus: string | undefined;
|
|
365
|
+
filterStartDate: string | undefined;
|
|
366
|
+
filterEndDate: string | undefined;
|
|
367
|
+
};
|
|
368
|
+
dispatch: React.Dispatch<any>;
|
|
369
|
+
};
|