ubk.erp.webpack 1.4.4 → 1.4.6

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
@@ -194,7 +194,6 @@ const TransportBulkPage = ({ token }) => {
194
194
  2. **Upload & Validate** — Upload Excel file and preview validation results
195
195
  3. **Review** — View valid/invalid/duplicate rows with detailed status messages
196
196
  4. **Import** — Confirm import and download error reports for failed rows
197
- ```
198
197
 
199
198
  ### Using the AttendanceDashboard Module
200
199
 
@@ -237,6 +236,7 @@ import {
237
236
  Sms,
238
237
  SmsSetting,
239
238
  SmsAlertSetting,
239
+ RolePermission,
240
240
  } from "ubk.erp.webpack";
241
241
 
242
242
  const GeneralSettingPage = ({ token }) => {
@@ -255,6 +255,10 @@ const GeneralSettingPage = ({ token }) => {
255
255
  <Sms token={token} />
256
256
  <SmsSetting token={token} />
257
257
  <SmsAlertSetting token={token} />
258
+ <RolePermission
259
+ token={token}
260
+ onSaved={({ roleId, response }) => console.log("Permissions saved for role", roleId, response)}
261
+ />
258
262
  </>
259
263
  );
260
264
  };
@@ -474,6 +478,10 @@ const IncomePage = ({ token }) => {
474
478
  | `LibraryReport` | Monthly report. |
475
479
  | `LibraryRenewalReport` | Library Report. |
476
480
 
481
+ ### Exam
482
+
483
+ Grade, admit cards, exam settings and instructions, marks, results, room management and the Exam Management v2 API — see **[📝 Exam Module](#-exam-module)**.
484
+
477
485
  # 📚 Library `IssueReturn` — Return Callback
478
486
 
479
487
  `IssueReturn` accepts an optional `onReturn` callback that is invoked after a successful book return.
@@ -778,6 +786,7 @@ const ApplyLeavePage = ({ token }) => {
778
786
  | `PaymentGateway` | Payment gateway credentials and integration settings. |
779
787
  | `SmsSetting` | SMS gateway details (API key, URL, header key) with edit/view toggle. |
780
788
  | `SmsAlertSetting` | SMS alert settings — gateway configuration, template CRUD, and status toggling. |
789
+ | `RolePermission` | Pick a role, then tick Add / Edit / View / Delete per submenu (grouped by menu, with per-column select-all) and save. Also adds new roles. Optional `onSaved({ roleId, response })` callback after a successful save. |
781
790
 
782
791
  ### Communicate
783
792
 
@@ -798,12 +807,14 @@ const CommunicatePage = ({ token }) => {
798
807
  };
799
808
  ```
800
809
 
801
- ### Exam
810
+ ## 📝 Exam Module
811
+
812
+ ### Exam Components
802
813
 
803
814
  | Component | Description |
804
815
  | :--- | :--- |
805
816
  |
806
- | `Exam` | Create an exam schedule. |
817
+ | `Exam` | Create an exam schedule for a class and one or more of its sections (multi-select; all sections pre-selected). |
807
818
  | `ExamList` | Exam schedule list. |
808
819
  | `ExamEdit` | Edit an exam schedule. |
809
820
  | `ExamDetails` | Exam schedule details. |
@@ -876,7 +887,45 @@ const ExamPage = ({ token }) => {
876
887
 
877
888
  See `src/Layout/Exam/Services/examsService.js` for the full list.
878
889
 
890
+ ### Exam Management v2 (API layer)
891
+
892
+ A client for the new `api/exammgmt/*` endpoints (generic exam tree: entry/composite exams, unlimited mark components, grading scales, co-scholastic, readiness/publish, reports). Screens are not built yet — this is the data layer they will use, and you can use it directly.
893
+
894
+ ```jsx
895
+ import { examMgmtApi, ExamMgmtApiError, saveBlobAsFile, canPublish } from "ubk.erp.webpack";
879
896
 
897
+ const api = examMgmtApi(token); // uses the same base URL as setBaseUrl()
898
+
899
+ const term1 = await api.exams.create({ name: "Term 1", code: "TERM1", node_type: "composite", combine_rule: "sum", class_id: 11 });
900
+ await api.exams.addChild(term1.id, { child_id: 1, scale_to: 10 });
901
+
902
+ const grid = await api.marksEntry.entryStructure(2, 22, { sectionId: 1 });
903
+ await api.marksEntry.bulkSave(2, 22, [{ student_id: 64, marks: [{ component_id: 3, value: 72 }] }]);
904
+
905
+ const { status, issues } = await api.exams.readiness(term1.id);
906
+ if (canPublish(status)) await api.exams.publish(term1.id);
907
+
908
+ saveBlobAsFile(await api.examReport.pdf(term1.id, 64), "report-64.pdf");
909
+
910
+ try {
911
+ await api.exams.create({ code: "TERM1" /* … */ });
912
+ } catch (err) {
913
+ if (err instanceof ExamMgmtApiError && err.isValidation) form.setFields(err.toAntdFields());
914
+ }
915
+ ```
916
+
917
+ | Group | Methods |
918
+ | :--- | :--- |
919
+ | `exams` | `create`, `list`, `detail`, `update`, `remove`, `children`, `addChild`, `updateChild`, `removeChild`, `subjects`, `saveSubjects`, `saveComponents`, `readiness`, `publish`, `lock` |
920
+ | `marksEntry` | `entryStructure(examId, subjectId, { sectionId })`, `bulkSave(examId, subjectId, rows, { sectionId })` |
921
+ | `grading` | `createScale`, `listScales({ scaleType })`, `scale`, `saveBands`, `deleteScale` |
922
+ | `coScholastic` | `createCategory`, `listCategories`, `deleteCategory`, `createArea`, `listAreas(classId)`, `deleteArea`, `entryStructure(examId, { sectionId })`, `bulkSave(examId, rows, { sectionId })` |
923
+ | `examReport` | `data`, `preview` (HTML string), `pdf` / `download` (Blob), `generate(examId, { sectionId })`, `files` |
924
+ | `backgroundJob(jobId)` | Poll a `generate` job |
925
+
926
+ - Every method resolves to the envelope's `data`. Failures (404 / 409 / 422 / 500, `Status` other than `Success`, network errors) reject with `ExamMgmtApiError` (`status`, `message`, `errors`, `fieldErrors`, `ruleErrors`, `toAntdFields()`, `isValidation` / `isNotFound` / `isConflict`).
927
+ - Constants: `EXAM_NODE_TYPES`, `COMBINE_RULES`, `EXAM_STATUS`, `MARK_STATUS`, `SCALE_TYPES`. Lifecycle helpers: `canEditStructure`, `canEditMarks`, `canGenerateReport`, `canPublish`.
928
+ - Override paths with `VITE_EXAMMGMT_BASE_URL` (default `api/exammgmt`) and `VITE_BACKGROUND_JOBS_URL` (default `api/background-jobs`).
880
929
 
881
930
  ## 🛠️ Development
882
931
 
@@ -0,0 +1,149 @@
1
+ export function setBaseUrl(url: any): void;
2
+ export function getAssetBaseUrl(): any;
3
+ export function setImageBaseUrl(url: any): void;
4
+ export function getImageBaseUrl(): any;
5
+ export function decodeJwtPayload(token: any): any;
6
+ export function getBranchIdFromToken(token: any): any;
7
+ export function getAuthToken(): string;
8
+ export function addData(url: any, data: any, token: any): Promise<any>;
9
+ export function postData(url: any, data: any, token: any): Promise<any>;
10
+ export function getNewData(url: any, token: any): Promise<any>;
11
+ export function getMenuData(url: any, token: any): Promise<any>;
12
+ export function addDataReturn(url: any, data: any, token: any): Promise<boolean>;
13
+ export function addDataTigget(url: any, data: any, token: any): Promise<any>;
14
+ export function addDataTiggetwithOutArg(url: any, data: any, token: any): Promise<any>;
15
+ export function addDataTiggetGET(url: any, data: any, token: any): Promise<any>;
16
+ export const studentsearchByNameID: "api/branchapi/library/studentsearchByNameID";
17
+ export const booksearchBybookname: "api/branchapi/library/booksearchBybookname";
18
+ export const returnedLibrarybook: "api/branchapi/library/returnedLibrarybook";
19
+ export const issueLibrarybook: "api/branchapi/library/issueLibrarybook";
20
+ export const FeesDetailsUrl: "/fess_managment/FessStatement/getStudentFeesDetails";
21
+ export const getsetting_allowances_dedectionBranch: "api/branchapi/GeneralSettings/getsetting_allowances_dedectionBranch";
22
+ export function addDataTigger(url: any, data: any, token: any): Promise<any>;
23
+ export function sendRequest(url: any, data: any, token: any): Promise<any>;
24
+ export function updateData(url: any, data: any, token: any): Promise<any>;
25
+ export function getDataById(url: any, data: any, token: any): Promise<any>;
26
+ export function getwhatsapp(url: any, data: any): Promise<any>;
27
+ export function deleteData(url: any, id: any, token: any): Promise<any>;
28
+ export const libraryRenewalDashboard: "api/report/LibraryRenewalReport/dashboard";
29
+ export const libraryRenewalHistory: "api/report/LibraryRenewalReport/renewalHistory";
30
+ export const libraryRenewalFineReport: "api/report/LibraryRenewalReport/renewalFineReport";
31
+ export const libraryRenewalCurrentlyRenewed: "api/report/LibraryRenewalReport/currentlyRenewedBooks";
32
+ export const libraryRenewalUpcoming: "api/report/LibraryRenewalReport/upcomingRenewalDue";
33
+ export const libraryRenewalOverdue: "api/report/LibraryRenewalReport/overdueRenewalReport";
34
+ export const libraryRenewalLimit: "api/report/LibraryRenewalReport/renewalLimitReport";
35
+ export const libraryRenewalStatus: "api/report/LibraryRenewalReport/renewalStatusReport";
36
+ export const libraryRenewalStudentWise: "api/report/LibraryRenewalReport/studentWiseReport";
37
+ export const libraryRenewalBookWise: "api/report/LibraryRenewalReport/bookWiseReport";
38
+ export const libraryRenewalClassWise: "api/report/LibraryRenewalReport/classWiseReport";
39
+ export const libraryRenewalStaffWise: "api/report/LibraryRenewalReport/staffWiseReport";
40
+ export const libraryRenewalStatistics: "api/report/LibraryRenewalReport/renewalStatisticsByDate";
41
+ export const visitorListUrl: "api/branchapi/Frontoffice/visitortablelist";
42
+ export const purposeUrl: "api/branchapi/Frontoffice/purposedropdown";
43
+ export const visitorAddUrl: "api/branchapi/frontoffice/addvisitors";
44
+ export const visitorUpdateUrl: "api/branchapi/frontoffice/editvisitorsdata";
45
+ export const visitorDeleteUrl: "api/branchapi/frontoffice/deletevisitors";
46
+ export const visitorUploadUrl: "api/branchapi/frontoffice/uploadfrontofficeDocument";
47
+ export const generalcallUrl: "api/branchapi/frontoffice/generalcallsShowdata";
48
+ export const generalcallAddUrl: "api/branchapi/frontoffice/addgenaralcalls";
49
+ export const generalcallUpdateUrl: "api/branchapi/frontoffice/editgeneralcall";
50
+ export const generalcallDeleteUrl: "api/branchapi/frontoffice/deletegeneralcall";
51
+ export const postalDispatchUrl: "api/branchapi/frontoffice/postaldispatchtablelist";
52
+ export const postalDispatchAddUrl: "api/branchapi/frontoffice/addpostaldispatch";
53
+ export const postalDispatchUpdateUrl: "api/branchapi/frontoffice/editpostaldispatch";
54
+ export const postalDispatchDeleteUrl: "api/branchapi/frontoffice/deletepostalreceivedispatch";
55
+ export const postalReceiveUrl: "api/branchapi/frontoffice/postalrecivetablelist";
56
+ export const postalReceiveAddUrl: "api/branchapi/frontoffice/addpostalrecive";
57
+ export const postalReceiveUpdateUrl: "api/branchapi/frontoffice/editpostalrecive";
58
+ export const postalReceiveDeleteUrl: "api/branchapi/frontoffice/deletepostalreceivedispatch";
59
+ export const complainUrl: "api/branchapi/frontoffice/complainttablelist";
60
+ export const complainTypeUrl: "api/branchapi/frontoffice/complainttypedropdown";
61
+ export const complainAddUrl: "api/branchapi/frontoffice/addcomplaint";
62
+ export const complainUpdateUrl: "api/branchapi/frontoffice/editcomplaint";
63
+ export const complainDeleteUrl: "api/branchapi/frontoffice/deletecomplaint";
64
+ export const purposeTableUrl: "api/branchapi/Frontoffice/purposetablelist";
65
+ export const complaintTypeTableUrl: "api/branchapi/Frontoffice/complaint_typetablelist";
66
+ export const sourceTableUrl: "api/branchapi/Frontoffice/sourcetablelist";
67
+ export const referencTableUrl: "api/branchapi/Frontoffice/referencetablelist";
68
+ export const purposeAddUrl: "api/branchapi/frontoffice/addvisitors_purpose";
69
+ export const complainTypeAddUrl: "api/branchapi/frontoffice/addcomplaint_type";
70
+ export const sourceAddUrl: "api/branchapi/frontoffice/addsource";
71
+ export const referenceAddUrl: "api/branchapi/frontoffice/addreference";
72
+ export const deleteVisitorsPurpose: "api/branchapi/frontoffice/deleteVisitorsPurpose";
73
+ export const deleteComplaintType: "api/branchapi/frontoffice/deletecomplaint_type";
74
+ export const deleteSource: "api/branchapi/frontoffice/deletesource";
75
+ export const deleteReference: "api/branchapi/frontoffice/deletereference";
76
+ export const studentGatePassList: "api/branchapi/Student/studentGatePassList";
77
+ export const studentGatePass: "api/branchapi/Student/studentGatePass";
78
+ export const routeTableListUrl: "api/branchapi/Transport/routeTableList";
79
+ export const routeShowdataUrl: "api/branchapi/Transport/routeShowdata";
80
+ export const uploadRouteByCsvUrl: "api/branchapi/transport/uploadroutebyCSV";
81
+ export const routeSampleTemplateUrl: "/sample_templates/route_upload.xlsx";
82
+ export const classUrl: "api/branchapi/academy/classdropdownlist";
83
+ export const sectionUrl: "api/branchapi/academy/sectionoftheClass";
84
+ export const classSubjectdropdownUrl: "api/branchapi/academy/classSubjectdropdown";
85
+ export const subjectUrl: "api/branchapi/academy/subjecttableList";
86
+ export const getSubjectsbyClassaslablevalue: "api/branchapi/academy/getSubjectsbyClassaslablevalue";
87
+ export const routeStudentList: "api/branchapi/Transport/routeStudentList";
88
+ export const getrouteDropdownUrl: "api/branchapi/Transport/getrouteDropdown";
89
+ export const getvehicleListByRouteIdwithCount: "api/branchapi/transport/getvehicleListByRouteIdwithCount";
90
+ export const getStoppageDropdown: "api/branchapi/transport/getStoppageDropdown";
91
+ export const showRouteAssignStudentUrl: "api/branchapi/Transport/showRouteAssignStudent";
92
+ export const assignTransportRoutesStudent: "api/branchapi/Transport/assignTransportRoutesStudent";
93
+ export const updateTransportRoutesStudent: "api/branchapi/Transport/updateTransportRoutesStudent";
94
+ export const removeStudentTransport: "api/branchapi/transport/removeStudentTransport";
95
+ export const assignTransportRoutesStudentBulkUrl: "api/branchapi/transport/assignTransportRoutesStudentBulk";
96
+ export const assignStudentSampleTemplateUrl: "/sample_templates/student_transport_upload.xlsx";
97
+ export const homeworkListUrl: "api/branchapi/homeworks/gethomeworklistByClassSectionBranch";
98
+ export const homeworkAddUrl: "api/branchapi/homeworks/addHomework";
99
+ export const homeworkUpdateUrl: "api/student/Homework/updateHomework";
100
+ export const homeworkDeleteUrl: "api/student/Homework/deleteHomework";
101
+ export const incomeListUrl: "api/branchapi/income/incomeTableList";
102
+ export const incomeAddUrl: "api/branchapi/income/addincome";
103
+ export const incomeUpdateUrl: "api/branchapi/income/editincome";
104
+ export const incomeDeleteUrl: "api/branchapi/income/deleteincome";
105
+ export const incomeHeadDropdownUrl: "api/branchapi/income/incomeheadDropdown";
106
+ export const incomeHeadListUrl: "api/branchapi/income/incomeheadTableList";
107
+ export const incomeHeadAddUrl: "api/branchapi/income/addincomehead";
108
+ export const incomeHeadUpdateUrl: "api/branchapi/income/editincomehead";
109
+ export const incomeHeadDeleteUrl: "api/branchapi/income/deleteincomehead";
110
+ export const incomeShowUrl: "api/branchapi/income/incomeShowdata";
111
+ export const incomeHeadShowUrl: "api/branchapi/income/incomeheadShowdata";
112
+ export const incomeSearchByDateUrl: "api/branchapi/income/searchincomebydates";
113
+ export const expenseListUrl: "api/branchapi/expense/expenseTableList";
114
+ export const expenseAddUrl: "api/branchapi/expense/addexpense";
115
+ export const expenseUpdateUrl: "api/branchapi/expense/editexpense";
116
+ export const expenseDeleteUrl: "api/branchapi/expense/deleteExpense";
117
+ export const expenseHeadDropdownUrl: "api/branchapi/expense/expenseheadDropdown";
118
+ export const expenseHeadListUrl: "api/branchapi/expense/expenseheadTableList";
119
+ export const expenseHeadAddUrl: "api/branchapi/expense/addexpensehead";
120
+ export const expenseHeadUpdateUrl: "api/branchapi/expense/editexpensehead";
121
+ export const expenseHeadDeleteUrl: "api/branchapi/expense/deleteexpensehead";
122
+ export const expenseShowUrl: "api/branchapi/expense/expenseShowdata";
123
+ export const expenseVoucherbyIDUrl: "api/branchapi/expense/expenseVoucherbyID";
124
+ export const expenseHeadShowUrl: "api/branchapi/expense/expenseheadShowdata";
125
+ export const expenseSearchByDateUrl: "api/branchapi/expense/searchexpensebydates";
126
+ export const vendorListUrl: "api/accounts/vendor/vendorlist";
127
+ export const studentLoginTableUrl: "api/student/studentDetails/studentLoginCredentialList";
128
+ export const studentListUrl: "/branchapi/student/studentlist";
129
+ export const studentListUrl1: "api/branchapi/student/studentlist";
130
+ export const studentSearchByKeywordUrl: "api/branchapi/student/studentsearchbyKeywords";
131
+ export const studentSearchByClassSectionUrl: "api/branchapi/student/studentsearchbyClassSection";
132
+ export const deleteStudentUrl: "branchapi/student/deleteStudent";
133
+ export const addStudentMedicineUrl: "/branchapi/student/addStudentMedicineDetails";
134
+ export const studentMedicineDetailsUrl: "/branchapi/student/StudentMedicineDetails";
135
+ export const getStudentClassSubjectUrl: "/branchapi/academy/getstudentClasssubjectByStudentId";
136
+ export const removeAssignStudentSubjectUrl: "/branchapi/academy/removeAssignStudentSubject";
137
+ export const extraCurricularActivitiesUrl: "/branchapi/feesCollection/extraCurricularActivitiesFess";
138
+ export const unAssignStudentSubjectUrl: "/branchapi/academy/unAssigneStudentSubject";
139
+ export const bulkUploadStudentUrl: "/branchapi/student/uploadstudentbyCSV";
140
+ export const categoryTableUrl: "api/branchapi/academy/categorytableList";
141
+ export const studentSampleFileUrl: "/sample_student.xlsx";
142
+ export const transportBulkUploadDownloadTemplate: "api/branchapi/transport/downloadBulkTemplate";
143
+ export const transportBulkUploadValidate: "api/branchapi/transport/validateBulkUpload";
144
+ export const transportBulkUploadConfirm: "api/branchapi/transport/confirmBulkImport";
145
+ export const transportBulkUploadErrorReport: "api/branchapi/transport/downloadBulkErrorReport";
146
+ export function downloadBulkTemplate({ class_id, section_id }: {} | undefined, token: any): Promise<any>;
147
+ export function validateBulkUpload(file: any, token: any): Promise<any>;
148
+ export function confirmBulkImport(rows: any, token: any, duplicateAction?: string): Promise<any>;
149
+ export function downloadBulkErrorReport(rows: any, token: any): Promise<any>;
package/dist/Api/api.d.ts CHANGED
@@ -25,6 +25,14 @@ export function updateData(url: any, data: any, token: any): Promise<any>;
25
25
  export function getDataById(url: any, data: any, token: any): Promise<any>;
26
26
  export function getwhatsapp(url: any, data: any): Promise<any>;
27
27
  export function deleteData(url: any, id: any, token: any): Promise<any>;
28
+ export function apiRequest({ method, url, data, params, token, responseType }: {
29
+ method?: string;
30
+ url: string;
31
+ data?: any;
32
+ params?: object;
33
+ token?: string;
34
+ responseType?: string;
35
+ }): Promise<import('axios').AxiosResponse<any, any, {}>>;
28
36
  export const libraryRenewalDashboard: "api/report/LibraryRenewalReport/dashboard";
29
37
  export const libraryRenewalHistory: "api/report/LibraryRenewalReport/renewalHistory";
30
38
  export const libraryRenewalFineReport: "api/report/LibraryRenewalReport/renewalFineReport";
@@ -0,0 +1,170 @@
1
+ /**
2
+ * @param {{
3
+ * request: (opts: {method: string, url: string, data?: any, params?: object, token?: string, responseType?: string}) => Promise<{data: any, status: number}>,
4
+ * token?: string,
5
+ * basePath?: string,
6
+ * jobsPath?: string,
7
+ * }} options
8
+ */
9
+ export function createExamMgmtClient({ request, token, basePath, jobsPath, }?: {
10
+ request: (opts: {
11
+ method: string;
12
+ url: string;
13
+ data?: any;
14
+ params?: object;
15
+ token?: string;
16
+ responseType?: string;
17
+ }) => Promise<{
18
+ data: any;
19
+ status: number;
20
+ }>;
21
+ token?: string;
22
+ basePath?: string;
23
+ jobsPath?: string;
24
+ }): {
25
+ exams: {
26
+ /** POST Exams/create — see spec for fields (name, code, node_type, class_id, …). */
27
+ create: (exam: any) => Promise<any>;
28
+ /** GET Exams/list — paginated; pass page/per_page and any filters (e.g. class_id). */
29
+ list: (params?: {}) => Promise<any>;
30
+ detail: (id: any) => Promise<any>;
31
+ /** PUT Exams/update/{id} — node_type, class and session cannot be changed. */
32
+ update: (id: any, changes: any) => Promise<any>;
33
+ remove: (id: any) => Promise<any>;
34
+ children: (id: any) => Promise<any>;
35
+ /** POST Exams/addChild/{id} — { child_id, scale_to?, label? }; resolves to the parent's children. */
36
+ addChild: (id: any, link: any) => Promise<any>;
37
+ /** PUT Exams/updateChild/{id}/{linkId} — { scale_to?, label?, sort_order? }. */
38
+ updateChild: (id: any, linkId: any, changes: any) => Promise<any>;
39
+ removeChild: (id: any, linkId: any) => Promise<any>;
40
+ /** GET Exams/subjects/{id} — every class subject, flagged is_applicable, with components. */
41
+ subjects: (id: any) => Promise<any>;
42
+ /** POST Exams/saveSubjects/{id} — subjects: [{ subject_id, max_marks?, pass_marks?, subject_type?, include_in_total? }]. */
43
+ saveSubjects: (id: any, subjects: any) => Promise<any>;
44
+ /**
45
+ * POST Exams/saveComponents/{id}/{subjectId} — components: [{ id?, name, max_marks, pass_marks?, include_in_total? }].
46
+ * Rows with `id` update in place (keeping marks); omitted existing components are deleted.
47
+ */
48
+ saveComponents: (id: any, subjectId: any, components: any) => Promise<any>;
49
+ /** GET Exams/readiness/{id} — { status, exam_status, checks, issues }. Stamps the exam `ready` when clean. */
50
+ readiness: (id: any) => Promise<any>;
51
+ publish: (id: any) => Promise<any>;
52
+ lock: (id: any) => Promise<any>;
53
+ };
54
+ marksEntry: {
55
+ /** GET MarksEntry/entryStructure/{examId}/{subjectId}?section_id= — roster, components and saved marks. */
56
+ entryStructure: (examId: any, subjectId: any, { sectionId }?: {}) => Promise<any>;
57
+ /**
58
+ * POST MarksEntry/bulkSave/{examId}/{subjectId}?section_id= — all-or-nothing.
59
+ * rows: [{ student_id, marks: [{ component_id, value?, status? }] }]; resolves to { saved_students, saved_marks }.
60
+ */
61
+ bulkSave: (examId: any, subjectId: any, rows: any, { sectionId }?: {}) => Promise<any>;
62
+ };
63
+ grading: {
64
+ /** POST Grading/createScale — { name, scale_type, bands?: [{ grade_label, min_value, max_value }] }. */
65
+ createScale: (scale: any) => Promise<any>;
66
+ listScales: ({ scaleType }?: {}) => Promise<any>;
67
+ scale: (id: any) => Promise<any>;
68
+ /** POST Grading/saveBands/{id} — replaces all bands. */
69
+ saveBands: (id: any, bands: any) => Promise<any>;
70
+ deleteScale: (id: any) => Promise<any>;
71
+ };
72
+ coScholastic: {
73
+ createCategory: (category: any) => Promise<any>;
74
+ listCategories: () => Promise<any>;
75
+ deleteCategory: (id: any) => Promise<any>;
76
+ /** POST CoScholastic/createArea — { class_id, name, fk_scale_id, category_id?, sort_order? }. */
77
+ createArea: (area: any) => Promise<any>;
78
+ listAreas: (classId: any) => Promise<any>;
79
+ deleteArea: (id: any) => Promise<any>;
80
+ /** GET CoScholastic/entryStructure/{examId}?section_id= — students × areas, saved marks and remarks. */
81
+ entryStructure: (examId: any, { sectionId }?: {}) => Promise<any>;
82
+ /** POST CoScholastic/bulkSave/{examId}?section_id= — rows: [{ student_id, remarks?, marks: [{ area_id, grade_label? | value? }] }]. */
83
+ bulkSave: (examId: any, rows: any, { sectionId }?: {}) => Promise<any>;
84
+ };
85
+ examReport: {
86
+ /** GET ExamReport/data — report JSON (works on drafts). */
87
+ data: (examId: any, studentId: any) => Promise<any>;
88
+ /** GET ExamReport/preview — rendered HTML string (works on drafts). */
89
+ preview: (examId: any, studentId: any) => Promise<any>;
90
+ /** GET ExamReport/pdf — single-student PDF Blob (needs ready or later). */
91
+ pdf: (examId: any, studentId: any) => Promise<any>;
92
+ /** POST ExamReport/generate/{examId} — queues a bulk job; resolves to { job_id, status, total }. 409 if one is active. */
93
+ generate: (examId: any, { sectionId }?: {}) => Promise<any>;
94
+ files: (examId: any, { sectionId }?: {}) => Promise<any>;
95
+ /** GET ExamReport/download — an already generated PDF as a Blob. */
96
+ download: (examId: any, studentId: any) => Promise<any>;
97
+ };
98
+ backgroundJob: (jobId: any) => Promise<any>;
99
+ };
100
+ /**
101
+ * Exam Management v2 ("generic exam tree") API client.
102
+ *
103
+ * Pure module: it never imports axios or the app's API helpers. The transport is injected
104
+ * (`request`), which keeps this file unit-testable. `examMgmtService.js` wires it to the
105
+ * shared axios client.
106
+ *
107
+ * Every endpoint answers with the envelope {Status, message, data, errors}. Methods resolve
108
+ * to `data`; any failure (HTTP 404/409/422/500, Status !== "Success", or a network error)
109
+ * rejects with an ExamMgmtApiError.
110
+ */
111
+ export const EXAM_NODE_TYPES: Readonly<{
112
+ ENTRY: "entry";
113
+ COMPOSITE: "composite";
114
+ }>;
115
+ export const COMBINE_RULES: Readonly<{
116
+ SUM: "sum";
117
+ AVERAGE: "average";
118
+ BEST_N: "best_n";
119
+ }>;
120
+ export const EXAM_STATUS: Readonly<{
121
+ DRAFT: "draft";
122
+ READY: "ready";
123
+ PUBLISHED: "published";
124
+ LOCKED: "locked";
125
+ }>;
126
+ export const MARK_STATUS: Readonly<{
127
+ PRESENT: "present";
128
+ ABSENT: "absent";
129
+ EXEMPT: "exempt";
130
+ }>;
131
+ export const SCALE_TYPES: Readonly<{
132
+ SCHOLASTIC: "scholastic";
133
+ CO_SCHOLASTIC: "co_scholastic";
134
+ }>;
135
+ export function canEditStructure(status: any): boolean;
136
+ export function canEditMarks(status: any): boolean;
137
+ export function canGenerateReport(status: any): boolean;
138
+ export function canPublish(status: any): boolean;
139
+ export class ExamMgmtApiError extends Error {
140
+ /**
141
+ * @param {{ status?: number, message?: string, errors?: Array<{field: string|null, message: string}>, body?: any }} info
142
+ */
143
+ constructor({ status, message, errors, body }?: {
144
+ status?: number;
145
+ message?: string;
146
+ errors?: Array<{
147
+ field: string | null;
148
+ message: string;
149
+ }>;
150
+ body?: any;
151
+ });
152
+ status: number;
153
+ errors: {
154
+ field: string | null;
155
+ message: string;
156
+ }[];
157
+ body: any;
158
+ /** Validation errors keyed by field: { code: "Exam code ... already exists ..." } */
159
+ get fieldErrors(): any;
160
+ /** Business-rule messages (errors with `field: null`). */
161
+ get ruleErrors(): string[];
162
+ /** Shape for antd `form.setFields(...)`. */
163
+ toAntdFields(): {
164
+ name: string;
165
+ errors: any[];
166
+ }[];
167
+ get isValidation(): boolean;
168
+ get isNotFound(): boolean;
169
+ get isConflict(): boolean;
170
+ }
@@ -0,0 +1,51 @@
1
+ export function examMgmtApi(token: any): {
2
+ exams: {
3
+ create: (exam: any) => Promise<any>;
4
+ list: (params?: {}) => Promise<any>;
5
+ detail: (id: any) => Promise<any>;
6
+ update: (id: any, changes: any) => Promise<any>;
7
+ remove: (id: any) => Promise<any>;
8
+ children: (id: any) => Promise<any>;
9
+ addChild: (id: any, link: any) => Promise<any>;
10
+ updateChild: (id: any, linkId: any, changes: any) => Promise<any>;
11
+ removeChild: (id: any, linkId: any) => Promise<any>;
12
+ subjects: (id: any) => Promise<any>;
13
+ saveSubjects: (id: any, subjects: any) => Promise<any>;
14
+ saveComponents: (id: any, subjectId: any, components: any) => Promise<any>;
15
+ readiness: (id: any) => Promise<any>;
16
+ publish: (id: any) => Promise<any>;
17
+ lock: (id: any) => Promise<any>;
18
+ };
19
+ marksEntry: {
20
+ entryStructure: (examId: any, subjectId: any, { sectionId }?: {}) => Promise<any>;
21
+ bulkSave: (examId: any, subjectId: any, rows: any, { sectionId }?: {}) => Promise<any>;
22
+ };
23
+ grading: {
24
+ createScale: (scale: any) => Promise<any>;
25
+ listScales: ({ scaleType }?: {}) => Promise<any>;
26
+ scale: (id: any) => Promise<any>;
27
+ saveBands: (id: any, bands: any) => Promise<any>;
28
+ deleteScale: (id: any) => Promise<any>;
29
+ };
30
+ coScholastic: {
31
+ createCategory: (category: any) => Promise<any>;
32
+ listCategories: () => Promise<any>;
33
+ deleteCategory: (id: any) => Promise<any>;
34
+ createArea: (area: any) => Promise<any>;
35
+ listAreas: (classId: any) => Promise<any>;
36
+ deleteArea: (id: any) => Promise<any>;
37
+ entryStructure: (examId: any, { sectionId }?: {}) => Promise<any>;
38
+ bulkSave: (examId: any, rows: any, { sectionId }?: {}) => Promise<any>;
39
+ };
40
+ examReport: {
41
+ data: (examId: any, studentId: any) => Promise<any>;
42
+ preview: (examId: any, studentId: any) => Promise<any>;
43
+ pdf: (examId: any, studentId: any) => Promise<any>;
44
+ generate: (examId: any, { sectionId }?: {}) => Promise<any>;
45
+ files: (examId: any, { sectionId }?: {}) => Promise<any>;
46
+ download: (examId: any, studentId: any) => Promise<any>;
47
+ };
48
+ backgroundJob: (jobId: any) => Promise<any>;
49
+ };
50
+ export function saveBlobAsFile(blob: any, fileName: any): void;
51
+ export { ExamMgmtApiError, EXAM_NODE_TYPES, COMBINE_RULES, EXAM_STATUS, MARK_STATUS, SCALE_TYPES, canEditStructure, canEditMarks, canGenerateReport, canPublish } from './examMgmtClient';
@@ -0,0 +1 @@
1
+ export { examMgmtApi, saveBlobAsFile, ExamMgmtApiError, EXAM_NODE_TYPES, COMBINE_RULES, EXAM_STATUS, MARK_STATUS, SCALE_TYPES, canEditStructure, canEditMarks, canGenerateReport, canPublish } from './Services/examMgmtService';
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ export default RolePermissionPage;
3
+ declare function RolePermissionPage({ token, onSaved }: {
4
+ token: any;
5
+ onSaved: any;
6
+ }): React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ export default RolePermission;
3
+ declare function RolePermission({ token, onSaved }: {
4
+ token: any;
5
+ onSaved: any;
6
+ }): React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ export const rolePermissionEndpoints: {
2
+ roleDropdown: any;
3
+ addRole: any;
4
+ menuAndSubmenu: any;
5
+ save: any;
6
+ };
@@ -0,0 +1 @@
1
+ export { default } from './RolePermission';
@@ -54,23 +54,30 @@ export namespace endpoints {
54
54
  export { remove_2 as remove };
55
55
  export let byId: any;
56
56
  }
57
+ namespace rolePermission {
58
+ export let roleDropdown: any;
59
+ export let addRole: any;
60
+ export let menuAndSubmenu: any;
61
+ let save_3: any;
62
+ export { save_3 as save };
63
+ }
57
64
  namespace paymentGateway {
58
65
  let get_4: any;
59
66
  export { get_4 as get };
60
- let save_3: any;
61
- export { save_3 as save };
67
+ let save_4: any;
68
+ export { save_4 as save };
62
69
  }
63
70
  namespace smsGateway {
64
71
  let get_5: any;
65
72
  export { get_5 as get };
66
- let save_4: any;
67
- export { save_4 as save };
73
+ let save_5: any;
74
+ export { save_5 as save };
68
75
  }
69
76
  namespace smsDetails {
70
77
  let get_6: any;
71
78
  export { get_6 as get };
72
- let save_5: any;
73
- export { save_5 as save };
79
+ let save_6: any;
80
+ export { save_6 as save };
74
81
  }
75
82
  namespace smsTemplates {
76
83
  let table_2: any;
@@ -90,7 +97,8 @@ export namespace endpoints {
90
97
  let classDropdown_1: any;
91
98
  export { classDropdown_1 as classDropdown };
92
99
  export let sectionByClass: any;
93
- export let roleDropdown: any;
100
+ let roleDropdown_1: any;
101
+ export { roleDropdown_1 as roleDropdown };
94
102
  export let staffSearch: any;
95
103
  export let studentDropdown: any;
96
104
  export let sendMessage: any;
@@ -104,8 +112,8 @@ export namespace endpoints {
104
112
  export { classDropdown_2 as classDropdown };
105
113
  let sectionByClass_1: any;
106
114
  export { sectionByClass_1 as sectionByClass };
107
- let roleDropdown_1: any;
108
- export { roleDropdown_1 as roleDropdown };
115
+ let roleDropdown_2: any;
116
+ export { roleDropdown_2 as roleDropdown };
109
117
  }
110
118
  function getMessages(whatsappBaseUrl: any): string;
111
119
  function getSendMessages(whatsappBaseUrl: any): string;
@@ -12,3 +12,4 @@ export { default as PaymentGateway } from './PaymentGateway';
12
12
  export { default as Sms } from './Sms';
13
13
  export { default as SmsAlertSetting } from './SmsAlertSetting';
14
14
  export { default as SmsSetting } from './SmsSetting';
15
+ export { default as RolePermission } from './RolePermission';