@ubkinfotech/tecaher-erp 0.1.0

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.
Files changed (146) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +413 -0
  3. package/lib/commonjs/core/api/apiClient.js +38 -0
  4. package/lib/commonjs/core/api/endpoints.js +139 -0
  5. package/lib/commonjs/core/api/interceptor.js +64 -0
  6. package/lib/commonjs/core/auth/authContext.js +30 -0
  7. package/lib/commonjs/core/auth/authService.js +12 -0
  8. package/lib/commonjs/core/hooks/useApiQuery.js +26 -0
  9. package/lib/commonjs/core/provider/ERPProvider.js +63 -0
  10. package/lib/commonjs/core/provider/types.js +5 -0
  11. package/lib/commonjs/core/provider/useERP.js +17 -0
  12. package/lib/commonjs/core/types/api.js +1 -0
  13. package/lib/commonjs/index.js +110 -0
  14. package/lib/commonjs/modules/assignment/hooks/useAssignmentList.js +16 -0
  15. package/lib/commonjs/modules/assignment/hooks/useHomeworkDetails.js +16 -0
  16. package/lib/commonjs/modules/assignment/hooks/useHomeworkSubmissions.js +16 -0
  17. package/lib/commonjs/modules/assignment/screens/AssignmentScreen.js +2615 -0
  18. package/lib/commonjs/modules/assignment/services/assignmentService.js +75 -0
  19. package/lib/commonjs/modules/attendance/hooks/useAttendance.js +16 -0
  20. package/lib/commonjs/modules/attendance/screens/AttendanceScreen.js +866 -0
  21. package/lib/commonjs/modules/attendance/services/attendanceService.js +31 -0
  22. package/lib/commonjs/modules/leaveRequest/hooks/useLeaveRequests.js +16 -0
  23. package/lib/commonjs/modules/leaveRequest/screens/LeaveRequestScreen.js +991 -0
  24. package/lib/commonjs/modules/leaveRequest/services/leaveRequestService.js +42 -0
  25. package/lib/commonjs/modules/marks/hooks/useMarks.js +14 -0
  26. package/lib/commonjs/modules/marks/screens/MarksScreen.js +1621 -0
  27. package/lib/commonjs/modules/marks/services/marksService.js +71 -0
  28. package/lib/commonjs/modules/myAttendance/hooks/useMyAttendance.js +16 -0
  29. package/lib/commonjs/modules/myAttendance/screens/MyAttendanceScreen.js +357 -0
  30. package/lib/commonjs/modules/myAttendance/services/myAttendanceService.js +11 -0
  31. package/lib/commonjs/modules/notes/hooks/useNotes.js +16 -0
  32. package/lib/commonjs/modules/notes/screens/NotesScreen.js +1287 -0
  33. package/lib/commonjs/modules/notes/services/notesService.js +65 -0
  34. package/lib/commonjs/modules/noticeboard/hooks/useNoticeboard.js +16 -0
  35. package/lib/commonjs/modules/noticeboard/screens/NoticeBoardScreen.js +381 -0
  36. package/lib/commonjs/modules/noticeboard/services/noticeboardService.js +16 -0
  37. package/lib/commonjs/modules/notification/hooks/useNotifications.js +16 -0
  38. package/lib/commonjs/modules/notification/screens/NotificationScreen.js +186 -0
  39. package/lib/commonjs/modules/notification/services/notificationService.js +16 -0
  40. package/lib/commonjs/modules/promoteStudent/hooks/usePromoteStudent.js +16 -0
  41. package/lib/commonjs/modules/promoteStudent/screens/PromoteStudentScreen.js +644 -0
  42. package/lib/commonjs/modules/promoteStudent/services/promoteStudentService.js +36 -0
  43. package/lib/commonjs/modules/timetable/hooks/useTimeTable.js +14 -0
  44. package/lib/commonjs/modules/timetable/screens/TimeTableScreen.js +258 -0
  45. package/lib/commonjs/modules/timetable/services/timetableService.js +16 -0
  46. package/lib/commonjs/package.json +1 -0
  47. package/lib/commonjs/shared/empty-states/EmptyState.js +45 -0
  48. package/lib/commonjs/shared/empty-states/ErrorState.js +45 -0
  49. package/lib/commonjs/shared/loaders/LoadingState.js +25 -0
  50. package/lib/commonjs/shared/theme/theme.js +22 -0
  51. package/lib/module/core/api/apiClient.js +32 -0
  52. package/lib/module/core/api/endpoints.js +135 -0
  53. package/lib/module/core/api/interceptor.js +60 -0
  54. package/lib/module/core/auth/authContext.js +23 -0
  55. package/lib/module/core/auth/authService.js +8 -0
  56. package/lib/module/core/hooks/useApiQuery.js +21 -0
  57. package/lib/module/core/provider/ERPProvider.js +56 -0
  58. package/lib/module/core/provider/types.js +3 -0
  59. package/lib/module/core/provider/useERP.js +12 -0
  60. package/lib/module/core/types/api.js +1 -0
  61. package/lib/module/index.js +17 -0
  62. package/lib/module/modules/assignment/hooks/useAssignmentList.js +12 -0
  63. package/lib/module/modules/assignment/hooks/useHomeworkDetails.js +12 -0
  64. package/lib/module/modules/assignment/hooks/useHomeworkSubmissions.js +12 -0
  65. package/lib/module/modules/assignment/screens/AssignmentScreen.js +2609 -0
  66. package/lib/module/modules/assignment/services/assignmentService.js +62 -0
  67. package/lib/module/modules/attendance/hooks/useAttendance.js +12 -0
  68. package/lib/module/modules/attendance/screens/AttendanceScreen.js +860 -0
  69. package/lib/module/modules/attendance/services/attendanceService.js +23 -0
  70. package/lib/module/modules/leaveRequest/hooks/useLeaveRequests.js +12 -0
  71. package/lib/module/modules/leaveRequest/screens/LeaveRequestScreen.js +985 -0
  72. package/lib/module/modules/leaveRequest/services/leaveRequestService.js +35 -0
  73. package/lib/module/modules/marks/hooks/useMarks.js +10 -0
  74. package/lib/module/modules/marks/screens/MarksScreen.js +1615 -0
  75. package/lib/module/modules/marks/services/marksService.js +55 -0
  76. package/lib/module/modules/myAttendance/hooks/useMyAttendance.js +12 -0
  77. package/lib/module/modules/myAttendance/screens/MyAttendanceScreen.js +351 -0
  78. package/lib/module/modules/myAttendance/services/myAttendanceService.js +7 -0
  79. package/lib/module/modules/notes/hooks/useNotes.js +12 -0
  80. package/lib/module/modules/notes/screens/NotesScreen.js +1281 -0
  81. package/lib/module/modules/notes/services/notesService.js +54 -0
  82. package/lib/module/modules/noticeboard/hooks/useNoticeboard.js +12 -0
  83. package/lib/module/modules/noticeboard/screens/NoticeBoardScreen.js +375 -0
  84. package/lib/module/modules/noticeboard/services/noticeboardService.js +12 -0
  85. package/lib/module/modules/notification/hooks/useNotifications.js +12 -0
  86. package/lib/module/modules/notification/screens/NotificationScreen.js +180 -0
  87. package/lib/module/modules/notification/services/notificationService.js +12 -0
  88. package/lib/module/modules/promoteStudent/hooks/usePromoteStudent.js +12 -0
  89. package/lib/module/modules/promoteStudent/screens/PromoteStudentScreen.js +638 -0
  90. package/lib/module/modules/promoteStudent/services/promoteStudentService.js +27 -0
  91. package/lib/module/modules/timetable/hooks/useTimeTable.js +10 -0
  92. package/lib/module/modules/timetable/screens/TimeTableScreen.js +252 -0
  93. package/lib/module/modules/timetable/services/timetableService.js +11 -0
  94. package/lib/module/package.json +1 -0
  95. package/lib/module/shared/empty-states/EmptyState.js +40 -0
  96. package/lib/module/shared/empty-states/ErrorState.js +40 -0
  97. package/lib/module/shared/loaders/LoadingState.js +20 -0
  98. package/lib/module/shared/theme/theme.js +18 -0
  99. package/lib/typescript/core/api/apiClient.d.ts +14 -0
  100. package/lib/typescript/core/api/endpoints.d.ts +164 -0
  101. package/lib/typescript/core/api/interceptor.d.ts +4 -0
  102. package/lib/typescript/core/auth/authContext.d.ts +11 -0
  103. package/lib/typescript/core/auth/authService.d.ts +9 -0
  104. package/lib/typescript/core/hooks/useApiQuery.d.ts +7 -0
  105. package/lib/typescript/core/provider/ERPProvider.d.ts +14 -0
  106. package/lib/typescript/core/provider/types.d.ts +34 -0
  107. package/lib/typescript/core/provider/useERP.d.ts +3 -0
  108. package/lib/typescript/core/types/api.d.ts +11 -0
  109. package/lib/typescript/index.d.ts +18 -0
  110. package/lib/typescript/modules/assignment/hooks/useAssignmentList.d.ts +3 -0
  111. package/lib/typescript/modules/assignment/hooks/useHomeworkDetails.d.ts +4 -0
  112. package/lib/typescript/modules/assignment/hooks/useHomeworkSubmissions.d.ts +4 -0
  113. package/lib/typescript/modules/assignment/screens/AssignmentScreen.d.ts +9 -0
  114. package/lib/typescript/modules/assignment/services/assignmentService.d.ts +89 -0
  115. package/lib/typescript/modules/attendance/hooks/useAttendance.d.ts +3 -0
  116. package/lib/typescript/modules/attendance/screens/AttendanceScreen.d.ts +5 -0
  117. package/lib/typescript/modules/attendance/services/attendanceService.d.ts +33 -0
  118. package/lib/typescript/modules/leaveRequest/hooks/useLeaveRequests.d.ts +3 -0
  119. package/lib/typescript/modules/leaveRequest/screens/LeaveRequestScreen.d.ts +5 -0
  120. package/lib/typescript/modules/leaveRequest/services/leaveRequestService.d.ts +39 -0
  121. package/lib/typescript/modules/marks/hooks/useMarks.d.ts +2 -0
  122. package/lib/typescript/modules/marks/screens/MarksScreen.d.ts +6 -0
  123. package/lib/typescript/modules/marks/services/marksService.d.ts +150 -0
  124. package/lib/typescript/modules/myAttendance/hooks/useMyAttendance.d.ts +3 -0
  125. package/lib/typescript/modules/myAttendance/screens/MyAttendanceScreen.d.ts +5 -0
  126. package/lib/typescript/modules/myAttendance/services/myAttendanceService.d.ts +10 -0
  127. package/lib/typescript/modules/notes/hooks/useNotes.d.ts +3 -0
  128. package/lib/typescript/modules/notes/screens/NotesScreen.d.ts +8 -0
  129. package/lib/typescript/modules/notes/services/notesService.d.ts +58 -0
  130. package/lib/typescript/modules/noticeboard/hooks/useNoticeboard.d.ts +3 -0
  131. package/lib/typescript/modules/noticeboard/screens/NoticeBoardScreen.d.ts +5 -0
  132. package/lib/typescript/modules/noticeboard/services/noticeboardService.d.ts +17 -0
  133. package/lib/typescript/modules/notification/hooks/useNotifications.d.ts +3 -0
  134. package/lib/typescript/modules/notification/screens/NotificationScreen.d.ts +5 -0
  135. package/lib/typescript/modules/notification/services/notificationService.d.ts +8 -0
  136. package/lib/typescript/modules/promoteStudent/hooks/usePromoteStudent.d.ts +3 -0
  137. package/lib/typescript/modules/promoteStudent/screens/PromoteStudentScreen.d.ts +5 -0
  138. package/lib/typescript/modules/promoteStudent/services/promoteStudentService.d.ts +40 -0
  139. package/lib/typescript/modules/timetable/hooks/useTimeTable.d.ts +3 -0
  140. package/lib/typescript/modules/timetable/screens/TimeTableScreen.d.ts +5 -0
  141. package/lib/typescript/modules/timetable/services/timetableService.d.ts +14 -0
  142. package/lib/typescript/shared/empty-states/EmptyState.d.ts +6 -0
  143. package/lib/typescript/shared/empty-states/ErrorState.d.ts +6 -0
  144. package/lib/typescript/shared/loaders/LoadingState.d.ts +3 -0
  145. package/lib/typescript/shared/theme/theme.d.ts +17 -0
  146. package/package.json +89 -0
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.fetchClassTeacherClasses = fetchClassTeacherClasses;
7
+ exports.fetchCoScholasticCategories = fetchCoScholasticCategories;
8
+ exports.fetchCoScholasticEntry = fetchCoScholasticEntry;
9
+ exports.fetchCoScholasticGrades = fetchCoScholasticGrades;
10
+ exports.fetchExamDropdown = fetchExamDropdown;
11
+ exports.fetchMarksClasses = fetchMarksClasses;
12
+ exports.fetchMarksSections = fetchMarksSections;
13
+ exports.fetchScholasticEntry = fetchScholasticEntry;
14
+ exports.fetchStudentRemarks = fetchStudentRemarks;
15
+ exports.fetchTeacherSubjectsForExam = fetchTeacherSubjectsForExam;
16
+ exports.submitCoScholasticMarks = submitCoScholasticMarks;
17
+ exports.submitExamMarks = submitExamMarks;
18
+ exports.submitExamRemark = submitExamRemark;
19
+ var _endpoints = require("../../../core/api/endpoints");
20
+ async function fetchCoScholasticGrades(api) {
21
+ const res = await api.get(_endpoints.endpoints.marks.coscholasticGrades);
22
+ return res.data;
23
+ }
24
+ async function fetchMarksClasses(api) {
25
+ const res = await api.get(_endpoints.endpoints.marks.classDropdown);
26
+ return res.data;
27
+ }
28
+ async function fetchClassTeacherClasses(api) {
29
+ const res = await api.get(_endpoints.endpoints.marks.classTeacherClassList);
30
+ return res.data;
31
+ }
32
+ async function fetchMarksSections(api, args) {
33
+ const res = await api.get(_endpoints.endpoints.marks.sectionDropdown(args));
34
+ return res.data;
35
+ }
36
+ async function fetchExamDropdown(api, args) {
37
+ const res = await api.get(_endpoints.endpoints.marks.examDropdown(args));
38
+ return res.data;
39
+ }
40
+ async function fetchTeacherSubjectsForExam(api, args) {
41
+ const res = await api.get(_endpoints.endpoints.marks.teacherSubjectsForExam(args));
42
+ return res.data;
43
+ }
44
+ async function fetchCoScholasticCategories(api, args) {
45
+ const res = await api.get(_endpoints.endpoints.marks.coScholasticCategories(args));
46
+ return res.data;
47
+ }
48
+ async function fetchScholasticEntry(api, args) {
49
+ const res = await api.get(_endpoints.endpoints.marks.studentListForExamAssessment(args));
50
+ return res.data;
51
+ }
52
+ async function submitExamMarks(api, payload) {
53
+ const res = await api.post(_endpoints.endpoints.marks.submitExamMarks, payload);
54
+ return res.data;
55
+ }
56
+ async function fetchCoScholasticEntry(api, args) {
57
+ const res = await api.get(_endpoints.endpoints.marks.studentListForCoScholastic(args));
58
+ return res.data;
59
+ }
60
+ async function submitCoScholasticMarks(api, payload) {
61
+ const res = await api.post(_endpoints.endpoints.marks.submitCoScholasticMarks, payload);
62
+ return res.data;
63
+ }
64
+ async function fetchStudentRemarks(api, args) {
65
+ const res = await api.get(_endpoints.endpoints.marks.studentListRemarks(args));
66
+ return res.data;
67
+ }
68
+ async function submitExamRemark(api, payload) {
69
+ const res = await api.post(_endpoints.endpoints.marks.submitExamRemarks, payload);
70
+ return res.data;
71
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useMyAttendanceReport = useMyAttendanceReport;
7
+ var _useApiQuery = require("../../../core/hooks/useApiQuery");
8
+ var _myAttendanceService = require("../services/myAttendanceService");
9
+ function useMyAttendanceReport(params) {
10
+ const enabled = !!params && !!params.staffId && !!params.sessionId;
11
+ return (0, _useApiQuery.useApiQuery)({
12
+ queryKey: ['myAttendance', 'report', params?.staffId ?? null, params?.sessionId ?? null, params?.month ?? null, params?.year ?? null],
13
+ enabled,
14
+ queryFn: api => (0, _myAttendanceService.fetchMyAttendanceReport)(api, params)
15
+ });
16
+ }
@@ -0,0 +1,357 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.MyAttendanceScreen = MyAttendanceScreen;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _EmptyState = require("../../../shared/empty-states/EmptyState");
10
+ var _ErrorState = require("../../../shared/empty-states/ErrorState");
11
+ var _LoadingState = require("../../../shared/loaders/LoadingState");
12
+ var _useMyAttendance = require("../hooks/useMyAttendance");
13
+ var _jsxRuntime = require("react/jsx-runtime");
14
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
+ function padMonth(value) {
17
+ const asNumber = Number(value);
18
+ if (Number.isFinite(asNumber)) {
19
+ return String(asNumber).padStart(2, '0');
20
+ }
21
+ return String(value);
22
+ }
23
+ function formatDate(value) {
24
+ if (!value) return '-';
25
+ const parsed = new Date(value);
26
+ if (Number.isNaN(parsed.getTime())) {
27
+ return String(value);
28
+ }
29
+ return parsed.toLocaleDateString('en-GB', {
30
+ day: '2-digit',
31
+ month: 'short',
32
+ year: 'numeric'
33
+ });
34
+ }
35
+ function formatTime(value) {
36
+ if (!value) return '';
37
+ const parsed = new Date(value);
38
+ if (!Number.isNaN(parsed.getTime())) {
39
+ return parsed.toLocaleTimeString('en-US', {
40
+ hour: '2-digit',
41
+ minute: '2-digit',
42
+ hour12: true
43
+ });
44
+ }
45
+ return String(value);
46
+ }
47
+ function getStatusTheme(rawStatus, selectedColor) {
48
+ const status = String(rawStatus ?? '').trim().toLowerCase();
49
+ const accent = typeof selectedColor === 'string' ? selectedColor : undefined;
50
+ if (status === 'present' || status === 'presents' || status === 'p') {
51
+ return {
52
+ label: 'Present',
53
+ borderColor: '#b7eb8f',
54
+ backgroundColor: '#f6ffed',
55
+ textColor: '#389e0d'
56
+ };
57
+ }
58
+ if (status === 'absent' || status === 'a') {
59
+ return {
60
+ label: 'Absent',
61
+ borderColor: accent ?? '#fecaca',
62
+ backgroundColor: '#fef2f2',
63
+ textColor: accent ?? '#dc2626'
64
+ };
65
+ }
66
+ if (status === 'holiday' || status === 'holidays') {
67
+ return {
68
+ label: 'Holiday',
69
+ borderColor: accent ?? '#fde68a',
70
+ backgroundColor: '#fffbeb',
71
+ textColor: accent ?? '#d97706'
72
+ };
73
+ }
74
+ if (status === 'leave' || status === 'leaves' || status === 'l') {
75
+ return {
76
+ label: 'Leave',
77
+ borderColor: accent ?? '#91d5ff',
78
+ backgroundColor: '#e6f7ff',
79
+ textColor: accent ?? '#096dd9'
80
+ };
81
+ }
82
+ if (status === 'upcoming') {
83
+ return {
84
+ label: 'Upcoming',
85
+ borderColor: '#d9d9d9',
86
+ backgroundColor: '#fafafa',
87
+ textColor: '#8c8c8c'
88
+ };
89
+ }
90
+ return {
91
+ label: String(rawStatus ?? '-'),
92
+ borderColor: accent ?? '#d1d5db',
93
+ backgroundColor: '#f9fafb',
94
+ textColor: accent ?? '#111827'
95
+ };
96
+ }
97
+ function MyAttendanceScreen(props) {
98
+ const now = new Date();
99
+ const month = props.month ?? now.getMonth() + 1;
100
+ const year = props.year ?? now.getFullYear();
101
+ const missing = !props.staffId || !props.sessionId;
102
+ const params = missing ? undefined : {
103
+ staffId: props.staffId,
104
+ sessionId: props.sessionId,
105
+ month,
106
+ year
107
+ };
108
+ const {
109
+ data,
110
+ isLoading,
111
+ error
112
+ } = (0, _useMyAttendance.useMyAttendanceReport)(params);
113
+ const payload = data?.data ?? data ?? {};
114
+ const attendanceReport = (0, _react.useMemo)(() => Array.isArray(payload?.attendance_data) ? payload.attendance_data : [], [payload]);
115
+ const attendanceCounts = (0, _react.useMemo)(() => ({
116
+ presents: Number(payload?.attendance_counts?.presents ?? 0),
117
+ absents: Number(payload?.attendance_counts?.absents ?? 0),
118
+ holidays: Number(payload?.attendance_counts?.holidays ?? 0),
119
+ leaves: Number(payload?.attendance_counts?.leaves ?? 0)
120
+ }), [payload]);
121
+ const renderItem = (0, _react.useCallback)(({
122
+ item
123
+ }) => {
124
+ const theme = getStatusTheme(item?.attendance, item?.selectedColor);
125
+ const inTime = formatTime(item?.intime);
126
+ const outTime = formatTime(item?.outtime);
127
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
128
+ style: styles.reportRow,
129
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
130
+ style: styles.reportInfo,
131
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
132
+ style: styles.reportDateText,
133
+ children: formatDate(item?.attendanceDate)
134
+ }), inTime || outTime ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
135
+ style: styles.timeRow,
136
+ children: [inTime ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
137
+ style: styles.timeText,
138
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
139
+ style: styles.inLabel,
140
+ children: "In:"
141
+ }), " ", inTime]
142
+ }) : null, inTime && outTime ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
143
+ style: styles.timeText,
144
+ children: " "
145
+ }) : null, outTime ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
146
+ style: styles.timeText,
147
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
148
+ style: styles.outLabel,
149
+ children: "Out:"
150
+ }), " ", outTime]
151
+ }) : null]
152
+ }) : null]
153
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
154
+ style: [styles.reportBadge, {
155
+ borderColor: theme.borderColor,
156
+ backgroundColor: theme.backgroundColor
157
+ }],
158
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
159
+ style: [styles.reportBadgeText, {
160
+ color: theme.textColor
161
+ }],
162
+ children: theme.label
163
+ })
164
+ })]
165
+ });
166
+ }, []);
167
+ if (missing) {
168
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_EmptyState.EmptyState, {
169
+ title: "Missing parameters",
170
+ message: "Provide staffId, sessionId"
171
+ });
172
+ }
173
+ if (isLoading) {
174
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_LoadingState.LoadingState, {});
175
+ }
176
+ if (error) {
177
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ErrorState.ErrorState, {
178
+ message: error.message
179
+ });
180
+ }
181
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.SafeAreaView, {
182
+ style: styles.root,
183
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.FlatList, {
184
+ data: attendanceReport,
185
+ keyExtractor: (item, index) => String(item?.attendanceDate ?? index),
186
+ renderItem: renderItem,
187
+ contentContainerStyle: styles.content,
188
+ ListHeaderComponent: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
189
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
190
+ style: styles.title,
191
+ children: "Attendance Report"
192
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
193
+ style: styles.subTitle,
194
+ children: [padMonth(month), " / ", year]
195
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
196
+ style: styles.summaryRow,
197
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
198
+ style: [styles.summaryBox, {
199
+ borderColor: '#b7eb8f',
200
+ backgroundColor: '#f6ffed'
201
+ }],
202
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
203
+ style: [styles.summaryCount, {
204
+ color: '#389e0d'
205
+ }],
206
+ children: attendanceCounts.presents
207
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
208
+ style: styles.summaryLabel,
209
+ children: "Present"
210
+ })]
211
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
212
+ style: [styles.summaryBox, {
213
+ borderColor: '#fecaca',
214
+ backgroundColor: '#fef2f2'
215
+ }],
216
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
217
+ style: [styles.summaryCount, {
218
+ color: '#dc2626'
219
+ }],
220
+ children: attendanceCounts.absents
221
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
222
+ style: styles.summaryLabel,
223
+ children: "Absent"
224
+ })]
225
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
226
+ style: [styles.summaryBox, {
227
+ borderColor: '#fde68a',
228
+ backgroundColor: '#fffbeb'
229
+ }],
230
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
231
+ style: [styles.summaryCount, {
232
+ color: '#d97706'
233
+ }],
234
+ children: attendanceCounts.holidays
235
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
236
+ style: styles.summaryLabel,
237
+ children: "Holiday"
238
+ })]
239
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
240
+ style: [styles.summaryBox, {
241
+ borderColor: '#91d5ff',
242
+ backgroundColor: '#e6f7ff'
243
+ }],
244
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
245
+ style: [styles.summaryCount, {
246
+ color: '#096dd9'
247
+ }],
248
+ children: attendanceCounts.leaves
249
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
250
+ style: styles.summaryLabel,
251
+ children: "Leave"
252
+ })]
253
+ })]
254
+ })]
255
+ }),
256
+ ListEmptyComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_EmptyState.EmptyState, {
257
+ title: "No attendance data",
258
+ message: "No attendance data found for this month."
259
+ })
260
+ })
261
+ });
262
+ }
263
+ const styles = _reactNative.StyleSheet.create({
264
+ root: {
265
+ flex: 1,
266
+ backgroundColor: '#f8fafc'
267
+ },
268
+ content: {
269
+ padding: 16,
270
+ paddingBottom: 40
271
+ },
272
+ title: {
273
+ fontSize: 20,
274
+ fontWeight: '700',
275
+ color: '#111827'
276
+ },
277
+ subTitle: {
278
+ marginTop: 4,
279
+ fontSize: 12,
280
+ color: '#6b7280',
281
+ marginBottom: 14
282
+ },
283
+ summaryRow: {
284
+ flexDirection: 'row',
285
+ flexWrap: 'wrap',
286
+ gap: 10,
287
+ marginBottom: 16
288
+ },
289
+ summaryBox: {
290
+ width: '47%',
291
+ borderWidth: 1,
292
+ borderRadius: 14,
293
+ paddingVertical: 14,
294
+ paddingHorizontal: 12,
295
+ backgroundColor: '#ffffff'
296
+ },
297
+ summaryCount: {
298
+ fontSize: 22,
299
+ fontWeight: '800',
300
+ marginBottom: 4
301
+ },
302
+ summaryLabel: {
303
+ fontSize: 13,
304
+ color: '#374151',
305
+ fontWeight: '600'
306
+ },
307
+ reportRow: {
308
+ flexDirection: 'row',
309
+ alignItems: 'center',
310
+ justifyContent: 'space-between',
311
+ padding: 14,
312
+ borderRadius: 14,
313
+ borderWidth: 1,
314
+ borderColor: '#e5e7eb',
315
+ backgroundColor: '#ffffff',
316
+ marginBottom: 10
317
+ },
318
+ reportInfo: {
319
+ flex: 1,
320
+ paddingRight: 10
321
+ },
322
+ reportDateText: {
323
+ fontSize: 14,
324
+ fontWeight: '700',
325
+ color: '#111827'
326
+ },
327
+ timeRow: {
328
+ flexDirection: 'row',
329
+ flexWrap: 'wrap',
330
+ marginTop: 4
331
+ },
332
+ timeText: {
333
+ fontSize: 12,
334
+ color: '#111827'
335
+ },
336
+ inLabel: {
337
+ fontWeight: '700',
338
+ color: '#389e0d'
339
+ },
340
+ outLabel: {
341
+ fontWeight: '700',
342
+ color: '#dc2626'
343
+ },
344
+ reportBadge: {
345
+ minWidth: 86,
346
+ paddingHorizontal: 12,
347
+ paddingVertical: 8,
348
+ borderRadius: 999,
349
+ borderWidth: 1,
350
+ alignItems: 'center',
351
+ justifyContent: 'center'
352
+ },
353
+ reportBadgeText: {
354
+ fontSize: 12,
355
+ fontWeight: '700'
356
+ }
357
+ });
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.fetchMyAttendanceReport = fetchMyAttendanceReport;
7
+ var _endpoints = require("../../../core/api/endpoints");
8
+ async function fetchMyAttendanceReport(api, params) {
9
+ const res = await api.get(_endpoints.endpoints.myAttendance.report(params));
10
+ return res.data;
11
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useNotesList = useNotesList;
7
+ var _useApiQuery = require("../../../core/hooks/useApiQuery");
8
+ var _notesService = require("../services/notesService");
9
+ function useNotesList(params) {
10
+ const page = params.page ?? 1;
11
+ const perPage = params.perPage ?? 10;
12
+ return (0, _useApiQuery.useApiQuery)({
13
+ queryKey: ['notes', 'list', page, perPage, params.classId ?? null, params.sectionId ?? null],
14
+ queryFn: api => (0, _notesService.fetchNotesList)(api, params)
15
+ });
16
+ }