ubk.erp.webpack 1.4.2 → 1.4.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 CHANGED
@@ -562,15 +562,22 @@ const LibraryPage = ({ token }) => {
562
562
  import { AddStaff } from "ubk.erp.webpack";
563
563
 
564
564
  const AddStaffPage = ({ token }) => {
565
+ const handleStepComplete = (payload) => {
566
+ // Fires after Basic, Experience and Payroll each save successfully
567
+ console.log("Step saved:", payload.step, payload.staffId, payload.data);
568
+ };
569
+
565
570
  const handleFinished = (rec) => {
566
- // Optionally refresh staff list or show a notification
567
- console.log("Staff created successfully",rec);
571
+ // Fires once, after the final (Payroll) step saves
572
+ console.log("Staff created successfully", rec.staffId, rec);
568
573
  };
569
574
 
570
- return <AddStaff token={token} onFinished={handleFinished} />;
575
+ return <AddStaff token={token} onStepComplete={handleStepComplete} onFinished={handleFinished} />;
571
576
  };
572
577
  ```
573
578
 
579
+ `AddStaff` accepts the same callbacks as `StaffWizard` (`onStepComplete`, `onReturn`, `onFinished`) — see **StaffWizard — Return Callback** below. `onFinished` is only called after all three steps are saved.
580
+
574
581
  ### Store
575
582
 
576
583
  | Component | Description |
@@ -617,6 +624,7 @@ const AddStaffPage = ({ token }) => {
617
624
  | `onNavigate` | `(action: string, record: object) => void` | No | Called when the Edit button is clicked. Receives `("staff-edit", record)`. If provided, the parent handles navigation. |
618
625
  | `onFinished` | `(res: any) => void` | No | Called after the wizard (edit drawer) completes successfully. |
619
626
  | `onDelete` | `(payload: DeletePayload) => void` | No | Called after a staff member is deactivated. |
627
+ | `onPasswordChange` | `(payload: PasswordChangePayload) => void` | No | Called after a staff member's password is changed successfully. Receives `{ id, password, record, response }` — `password` is the new password as entered, `response` is the API response from `updateStaffPassword`. |
620
628
 
621
629
  ## DeletePayload Shape
622
630
 
@@ -632,6 +640,7 @@ const AddStaffPage = ({ token }) => {
632
640
 
633
641
  - Clicking the **Edit** button: if `onNavigate` is provided, it calls `onNavigate("staff-edit", record)`. Otherwise, opens an inline edit drawer with `StaffWizard` in `mode="edit"`.
634
642
  - Clicking **Delete/Deactivate**: sends a deactivate request to the API. On success, refreshes the list and calls `onDelete({ id, record, response })`.
643
+ - Clicking **Change password** (key icon): opens a modal with New Password + Confirm Password. On save it posts `{ staff_id, new_passwod }` to `api/branchapi/staff/updateStaffPassword` (override with `VITE_HR_STAFF_CHANGE_PASSWORD_URL`), then calls `onPasswordChange({ id, password, record, response })`.
635
644
  - `onFinished` fires after the edit wizard completes successfully, allowing the parent to refresh its own data.
636
645
 
637
646
  ## Usage
@@ -674,24 +683,26 @@ const StaffPage = ({ token }) => {
674
683
  | `mode` | `'add' \| 'edit'` | No | Determines whether basic info is edited or created. Default: `"add"`. |
675
684
  | `staffId` | `string` | No | Staff ID when editing; ignored when `mode="add"`. |
676
685
  | `onStepComplete` | `(payload: object) => void` | No | Called after **every** step's successful save. |
677
- | `onFinished` | `() => void` | No | Called after the final (Payroll) step completes. |
686
+ | `onReturn` | `(payload: object) => void` | No | Alias of `onStepComplete` — receives the same payload. |
687
+ | `onFinished` | `(result: object) => void` | No | Called after the final (Payroll) step completes. Receives `{ staffId, payroll, result, data }`. |
678
688
 
679
689
  ## Payload Shape
680
690
 
681
- The `onStepComplete` callback receives an object:
691
+ The `onStepComplete` / `onReturn` callback receives an object:
682
692
 
683
693
  ```ts
684
694
  {
685
695
  step: "basic" | "experience" | "payroll";
686
- data?: object; // Step-specific data
696
+ staffId: string | number | null; // id of the staff being created/edited
697
+ data: object; // Step-specific data (below)
687
698
  }
688
699
  ```
689
700
 
690
701
  | Step | `data` contents |
691
702
  | :--- | :--- |
692
- | `"basic"` | `{ staffId, basic }` from Step1's `onSubmitted` |
693
- | `"experience"` | `{ experience, result }` from Step2's `onSubmitted` |
694
- | `"payroll"` | `{ payroll, result }` from Step3's `onSubmitted` |
703
+ | `"basic"` | `{ staffId, basic, data }` from Step1 (`data` = raw API response) |
704
+ | `"experience"` | `{ experience, result, data }` from Step2 |
705
+ | `"payroll"` | `{ payroll, result, data }` from Step3 |
695
706
 
696
707
  ## Behavior
697
708
 
@@ -787,6 +798,84 @@ const CommunicatePage = ({ token }) => {
787
798
  };
788
799
  ```
789
800
 
801
+ ### Exam
802
+
803
+ | Component | Description |
804
+ | :--- | :--- |
805
+ |
806
+ | `Exam` | Create an exam schedule. |
807
+ | `ExamList` | Exam schedule list. |
808
+ | `ExamEdit` | Edit an exam schedule. |
809
+ | `ExamDetails` | Exam schedule details. |
810
+ | `ExamLink` | Exam links. |
811
+ | `ExamType` | Exam type list. |
812
+ | `Grade` | Grade master — add, edit and delete grades with a mark range (Mark From / Mark To) and remark. |
813
+ | `CoScholasticAreaGrade` | Co-scholastic grade master — add, edit and delete grades with a remark (no mark range). |
814
+ | `ExamSetting` | Per exam/class report card settings: class-teacher signature per section, Exam I/C signature, report card title, marksheet issue date, promoted-to and abbreviations. |
815
+ | `ExamInstruction` | Pick an exam and edit its instructions in a rich-text editor (bold, italic, underline, lists). Saved as HTML and printed on the admit card. |
816
+ | `Assessment` | Assessment management. |
817
+ | `AssignMarks` | Enter exam marks for students. |
818
+ | `CoScholasticAreaMarks` | Search by Class / Section / Exam / Co-Scholastic Category, then enter a grade per student per skill and save. |
819
+ | `StudentResult` | Search by Class / Section / Exam to see each student's marks, percentage, marks-entry progress, meetings and attendance. Edit remarks, meeting dates, attendance and result per student. |
820
+ | `MarksReport` | Marks report. |
821
+ | `AdmitCardSetting` | Admit card settings (photo, room no, subject list, exam time, invigilator and Exam I/C signature toggles). |
822
+ | `AdmitPrint` | Search by Class / Section / Exam and print admit cards using one of three templates. The class's assigned template is preselected. |
823
+ | `RoomManagment` | Add/delete exam rooms, and assign rooms with roll-number ranges per section for a class and exam. |
824
+
825
+ ### Using the Exam Module
826
+
827
+ ```jsx
828
+ import {
829
+ Grade,
830
+ CoScholasticAreaGrade,
831
+ ExamSetting,
832
+ ExamInstruction,
833
+ CoScholasticAreaMarks,
834
+ StudentResult,
835
+ AdmitPrint,
836
+ RoomManagment,
837
+ } from "ubk.erp.webpack";
838
+
839
+ const ExamPage = ({ token }) => {
840
+ return (
841
+ <>
842
+ <Grade token={token} />
843
+ <CoScholasticAreaGrade token={token} />
844
+ <ExamSetting token={token} />
845
+ <ExamInstruction token={token} />
846
+ <CoScholasticAreaMarks token={token} />
847
+ <StudentResult token={token} />
848
+ <AdmitPrint token={token} />
849
+ <RoomManagment token={token} />
850
+ </>
851
+ );
852
+ };
853
+ ```
854
+
855
+ **Notes:**
856
+ - `AdmitPrint` reads the session name from `localStorage.academy_session` (templates 2 and 3). Set it in the host app, otherwise the session shows as blank / `-`.
857
+ - `AdmitPrint` requests `per_page=10` students per search.
858
+ - The **View Result** button in `StudentResult` navigates to `/ExamDashboard/SingleResult?id=…&exam_id=…`, which is not part of this library yet.
859
+ - `RoomManagment` is spelled as in the original project (no "e" after "g").
860
+
861
+ **Endpoint overrides** — each Exam endpoint has a built-in default and can be overridden with a `VITE_*` variable in `.env`, for example:
862
+
863
+ | Variable | Default |
864
+ | :--- | :--- |
865
+ | `VITE_GRADE_TABLE_URL` / `_ADD_URL` / `_EDIT_URL` / `_DELETE_URL` | `/api/exam/exam/getgradeTable`, `addGrade`, `editGradec`, `deleteGrade` |
866
+ | `VITE_COSCHOLASTIC_GRADE_TABLE_URL` / `_ADD_URL` / `_EDIT_URL` / `_DELETE_URL` | `/api/exam/exam/getgradeTableCoScholastic`, `addGradeCoScholastic`, `editGradeCoScholastic`, `deleteGradeCoScholastic` |
867
+ | `VITE_COSCHOLASTIC_GRADE_DROPDOWN_URL` | `/api/exam/exam/gradeDropdownCoScholastic` |
868
+ | `VITE_COSCHOLASTIC_ASSIGN_MARKS_URL` | `/api/exam/exam/assignCoscholasticMarks` |
869
+ | `VITE_COSCHOLASTIC_CATEGORY_DROPDOWN_URL` | `/api/branchapi/academy/getscholasticCategoryByClassId` |
870
+ | `VITE_EXAM_SETTING_UPLOAD_FILE_URL` | `api/SuperAdmin/uploadFile` (signature uploads, saved to `schoolFile`) |
871
+ | `VITE_EXAM_ROOM_LIST_URL` / `_DELETE_URL` | `/api/exam/Exam/listClassRoom`, `/api/exam/Exam/removeClassRoom` |
872
+ | `VITE_EXAM_ROOM_ADD_URL` | `/api/exam/exam/addClassRoom` |
873
+ | `VITE_EXAM_ROOM_ASSIGNED_LIST_URL` | `/api/exam/Exam/getClassRoomdata` |
874
+ | `VITE_EXAM_ROOM_ASSIGN_URL` / `_REMOVE_URL` | `/api/exam/exam/assignClassRoom`, `/api/exam/exam/remove_exam_class_room` |
875
+ | `VITE_EXAM_ROOM_DROPDOWN_URL` / `_EXAM_DROPDOWN_URL` | `/api/exam/exam/roomDropdown`, `examdropdown_new` |
876
+
877
+ See `src/Layout/Exam/Services/examsService.js` for the full list.
878
+
790
879
 
791
880
 
792
881
  ## 🛠️ Development
@@ -0,0 +1,5 @@
1
+ import { default as React } from 'react';
2
+ export default AdmitPrint;
3
+ declare function AdmitPrint({ token }: {
4
+ token: any;
5
+ }): React.JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { default as React } from 'react';
2
+ export default CoScholasticAreaGrade;
3
+ declare function CoScholasticAreaGrade({ token }: {
4
+ token: any;
5
+ }): React.JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { default as React } from 'react';
2
+ export function templateOptionAdmit(): {
3
+ label: string;
4
+ value: string;
5
+ }[];
6
+ export function buildTemplateContext(data: any): {
7
+ academy_session: any;
8
+ exam_details: any;
9
+ receipt_info: any;
10
+ general_setting: any;
11
+ students: any;
12
+ settings: any;
13
+ };
14
+ export default AdmitCardTemplate;
15
+ declare function AdmitCardTemplate({ templateId, data }: {
16
+ templateId: any;
17
+ data: any;
18
+ }): React.JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ export default AssignClassRoomEditor;
3
+ /**
4
+ * Add mode (no rowData): pick class + exam, then fill roll ranges per section.
5
+ * Update mode (rowData = an assigned-room record): locked to that record's class, exam and section.
6
+ * Calls onSubmit(formData) with class_id, exam_id, the row arrays and added/updated/deleted JSON.
7
+ */
8
+ declare function AssignClassRoomEditor({ token, rowData, onSubmit }: {
9
+ token: any;
10
+ rowData: any;
11
+ onSubmit: any;
12
+ }): React.JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { default as React } from 'react';
2
+ export default Grade;
3
+ declare function Grade({ token }: {
4
+ token: any;
5
+ }): React.JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { default as React } from 'react';
2
+ export default AdmitPrintPage;
3
+ declare function AdmitPrintPage({ token }: {
4
+ token: any;
5
+ }): React.JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { default as React } from 'react';
2
+ export default CoScholasticAreaGradePage;
3
+ declare function CoScholasticAreaGradePage({ token }: {
4
+ token: any;
5
+ }): React.JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { default as React } from 'react';
2
+ export default GradePage;
3
+ declare function GradePage({ token }: {
4
+ token: any;
5
+ }): React.JSX.Element;
@@ -6,11 +6,31 @@ export namespace endpoints {
6
6
  let edit: any;
7
7
  let remove: any;
8
8
  }
9
- export namespace examSchedule {
9
+ export namespace grade {
10
+ let table_1: any;
11
+ export { table_1 as table };
10
12
  let add_1: any;
11
13
  export { add_1 as add };
12
14
  let edit_1: any;
13
15
  export { edit_1 as edit };
16
+ let remove_1: any;
17
+ export { remove_1 as remove };
18
+ }
19
+ export namespace coScholasticGrade {
20
+ let table_2: any;
21
+ export { table_2 as table };
22
+ let add_2: any;
23
+ export { add_2 as add };
24
+ let edit_2: any;
25
+ export { edit_2 as edit };
26
+ let remove_2: any;
27
+ export { remove_2 as remove };
28
+ }
29
+ export namespace examSchedule {
30
+ let add_3: any;
31
+ export { add_3 as add };
32
+ let edit_3: any;
33
+ export { edit_3 as edit };
14
34
  export let getById: any;
15
35
  export let list: any;
16
36
  let dropdown_1: any;
@@ -29,17 +49,17 @@ export namespace endpoints {
29
49
  export let update: any;
30
50
  }
31
51
  export namespace examSetting {
32
- let table_1: any;
33
- export { table_1 as table };
34
- let add_2: any;
35
- export { add_2 as add };
52
+ let table_3: any;
53
+ export { table_3 as table };
54
+ let add_4: any;
55
+ export { add_4 as add };
36
56
  export let uploadSignature: any;
37
57
  export let typeByExamId: any;
38
58
  export let assignMarksheetClass: any;
39
59
  }
40
60
  export namespace assessment {
41
- let table_2: any;
42
- export { table_2 as table };
61
+ let table_4: any;
62
+ export { table_4 as table };
43
63
  let dropdown_3: any;
44
64
  export { dropdown_3 as dropdown };
45
65
  let _delete: any;
@@ -62,6 +82,7 @@ export namespace endpoints {
62
82
  let getGradeTable: any;
63
83
  let getGradeTableCoScholastic: any;
64
84
  let getAdmitCard: any;
85
+ let subjectDropdown: any;
65
86
  }
66
87
  export namespace admitCardSetting {
67
88
  let get_1: any;
@@ -72,14 +93,18 @@ export namespace endpoints {
72
93
  export namespace roomManagement {
73
94
  let list_1: any;
74
95
  export { list_1 as list };
75
- let remove_1: any;
76
- export { remove_1 as remove };
96
+ export let removeRoom: any;
97
+ export let assignedList: any;
98
+ export let examDropdown: any;
99
+ let remove_3: any;
100
+ export { remove_3 as remove };
77
101
  export let assign: any;
78
- let add_3: any;
79
- export { add_3 as add };
102
+ let add_5: any;
103
+ export { add_5 as add };
80
104
  export let roomDropdown: any;
81
105
  }
82
- export let examDropdown: any;
106
+ let examDropdown_1: any;
107
+ export { examDropdown_1 as examDropdown };
83
108
  export let examDropdownInstruction: any;
84
109
  export namespace observation {
85
110
  let dropdown_4: any;
@@ -89,19 +114,24 @@ export namespace endpoints {
89
114
  export let deleteType: any;
90
115
  export let editType: any;
91
116
  export let addType: any;
92
- let add_4: any;
93
- export { add_4 as add };
117
+ let add_6: any;
118
+ export { add_6 as add };
94
119
  }
95
120
  export let coscholasticCategoryDropdown: any;
121
+ export namespace coScholasticMarks {
122
+ export let gradeDropdown: any;
123
+ let assign_1: any;
124
+ export { assign_1 as assign };
125
+ }
96
126
  export namespace templateType {
97
127
  let get_2: any;
98
128
  export { get_2 as get };
99
129
  export let assignClassDropdown: any;
100
130
  export let assignTable: any;
101
- let assign_1: any;
102
- export { assign_1 as assign };
103
- let remove_2: any;
104
- export { remove_2 as remove };
131
+ let assign_2: any;
132
+ export { assign_2 as assign };
133
+ let remove_4: any;
134
+ export { remove_4 as remove };
105
135
  }
106
136
  export let classSubjectDropdown: any;
107
137
  export let sectionDropdown: any;
@@ -1,35 +1,10 @@
1
- export function useExamTypeDropdown(token: any): {
2
- isLoading: boolean;
3
- error: any;
4
- examTypeOptions: any;
5
- };
6
- export function useExamDropdown(classId: any, token: any): {
7
- isLoading: boolean;
8
- error: any;
9
- examList: any;
10
- mutate: import('swr').KeyedMutator<any>;
11
- };
12
- export function useExamSchedule(token: any): {
13
- isLoading: boolean;
14
- error: any;
15
- examSchedule: any;
16
- mutate: import('swr').KeyedMutator<any>;
17
- };
18
- export function useAssessmentTable(token: any): {
19
- isLoading: boolean;
20
- error: any;
21
- assessmentData: any;
22
- mutate: import('swr').KeyedMutator<any>;
23
- };
24
- export function useExamSettingTable(page: any, perPage: any, token: any): {
25
- isLoading: boolean;
26
- error: any;
27
- examSettingData: any;
28
- mutate: import('swr').KeyedMutator<any>;
29
- };
30
- export function useStudentResult(token: any): {
31
- isLoading: boolean;
32
- error: any;
33
- studentResultData: any;
34
- mutate: import('swr').KeyedMutator<any>;
35
- };
1
+ export function useSubmit(handler: any): (boolean | ((...args: any[]) => Promise<any>))[];
2
+ export function usePaginatedFetcher(): {
3
+ fetchAllPagesWithProgress: (tableData: any, exam_id: any, onProgress: any, token: any) => Promise<any[]>;
4
+ isMutating: boolean;
5
+ };
6
+ declare namespace _default {
7
+ export { useSubmit };
8
+ export { usePaginatedFetcher };
9
+ }
10
+ export default _default;
@@ -2,6 +2,9 @@ export { default as StudentResult } from './StudentResult';
2
2
  export { default as Exam } from './Exam';
3
3
  export { default as ExamList } from './ExamList';
4
4
  export { default as ExamType } from './ExamType';
5
+ export { default as Grade } from './Grade';
6
+ export { default as AdmitPrint } from './AdmitPrint';
7
+ export { default as CoScholasticAreaGrade } from './CoScholasticAreaGrade';
5
8
  export { default as ExamSetting } from './ExamSetting';
6
9
  export { default as Assessment } from './Assessment';
7
10
  export { default as ExamInstruction } from './ExamInstruction';
@@ -1,7 +1,8 @@
1
1
  import { default as React } from 'react';
2
2
  export default AddStaff;
3
- declare function AddStaff({ token, onFinished, onReturn }: {
3
+ declare function AddStaff({ token, onStepComplete, onFinished, onReturn }: {
4
4
  token: any;
5
+ onStepComplete: any;
5
6
  onFinished: any;
6
7
  onReturn: any;
7
8
  }): React.JSX.Element;
@@ -1,7 +1,8 @@
1
1
  import { default as React } from 'react';
2
2
  export default AddStaffPage;
3
- declare function AddStaffPage({ token, onFinished, onReturn }: {
3
+ declare function AddStaffPage({ token, onStepComplete, onFinished, onReturn }: {
4
4
  token: any;
5
+ onStepComplete: any;
5
6
  onFinished: any;
6
7
  onReturn: any;
7
8
  }): React.JSX.Element;
@@ -3,6 +3,7 @@ export const addStaffEndpoints: {
3
3
  searchByRole: any;
4
4
  searchByKeywords: any;
5
5
  deactivate: any;
6
+ changePassword: any;
6
7
  basicById: any;
7
8
  experienceById: any;
8
9
  payrollById: any;
@@ -6,6 +6,7 @@ export namespace endpoints {
6
6
  let searchByRole: any;
7
7
  let searchByKeywords: any;
8
8
  let deactivate: any;
9
+ let changePassword: any;
9
10
  let basicById: any;
10
11
  let experienceById: any;
11
12
  let payrollById: any;
@@ -1,8 +1,9 @@
1
1
  import { default as React } from 'react';
2
2
  export default StaffDirectoryPage;
3
- declare function StaffDirectoryPage({ token, onNavigate, onFinished, onDelete, }: {
3
+ declare function StaffDirectoryPage({ token, onNavigate, onFinished, onDelete, onPasswordChange, }: {
4
4
  token: any;
5
5
  onNavigate: any;
6
6
  onFinished: any;
7
7
  onDelete: any;
8
+ onPasswordChange: any;
8
9
  }): React.JSX.Element;
@@ -3,6 +3,7 @@ export const staffEndpoints: {
3
3
  searchByRole: any;
4
4
  searchByKeywords: any;
5
5
  deactivate: any;
6
+ changePassword: any;
6
7
  basicById: any;
7
8
  experienceById: any;
8
9
  payrollById: any;
@@ -1,8 +1,9 @@
1
1
  import { default as React } from 'react';
2
2
  export default StaffDirectory;
3
- declare function StaffDirectory({ token, onNavigate, onFinished, onDelete }: {
3
+ declare function StaffDirectory({ token, onNavigate, onFinished, onDelete, onPasswordChange }: {
4
4
  token: any;
5
5
  onNavigate: any;
6
6
  onFinished: any;
7
7
  onDelete: any;
8
+ onPasswordChange: any;
8
9
  }): React.JSX.Element;
@@ -1,9 +1,10 @@
1
1
  import { default as React } from 'react';
2
2
  export default StaffWizard;
3
- declare function StaffWizard({ token, mode, staffId: staffIdProp, onStepComplete, onFinished, }: {
3
+ declare function StaffWizard({ token, mode, staffId: staffIdProp, onStepComplete, onFinished, onReturn, }: {
4
4
  token: any;
5
5
  mode?: string | undefined;
6
6
  staffId: any;
7
7
  onStepComplete: any;
8
8
  onFinished: any;
9
+ onReturn: any;
9
10
  }): React.JSX.Element;