@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,252 @@
1
+ "use strict";
2
+
3
+ import React, { useEffect, useMemo, useState } from 'react';
4
+ import { ActivityIndicator, FlatList, SafeAreaView, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
5
+ import { useERP } from "../../../core/provider/useERP.js";
6
+ import { EmptyState } from "../../../shared/empty-states/EmptyState.js";
7
+ import { ErrorState } from "../../../shared/empty-states/ErrorState.js";
8
+ import { fetchTeacherTimeTable, fetchTimeTable } from "../services/timetableService.js";
9
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
+ export function TimeTableScreen(props) {
11
+ const {
12
+ api
13
+ } = useERP();
14
+ const isTeacherMode = props.staffId !== undefined && props.sessionId !== undefined;
15
+ const missing = props.sessionId === undefined || !isTeacherMode && (!props.classId || !props.sectionId);
16
+ const [loading, setLoading] = useState(true);
17
+ const [items, setItems] = useState([]);
18
+ const [error, setError] = useState(null);
19
+ const [selectedDay, setSelectedDay] = useState(new Date().toLocaleDateString('en-US', {
20
+ weekday: 'long'
21
+ }).toLowerCase());
22
+ useEffect(() => {
23
+ if (missing) {
24
+ setLoading(false);
25
+ return;
26
+ }
27
+ setLoading(true);
28
+ setError(null);
29
+ const load = async () => {
30
+ try {
31
+ const res = isTeacherMode ? await fetchTeacherTimeTable(api, {
32
+ staffId: props.staffId,
33
+ sessionId: props.sessionId
34
+ }) : await fetchTimeTable(api, {
35
+ classId: props.classId,
36
+ sectionId: props.sectionId,
37
+ sessionId: props.sessionId
38
+ });
39
+ const list = Array.isArray(res?.data) ? res.data : [];
40
+ setItems(list);
41
+ } catch (e) {
42
+ setError(String(e?.message ?? 'Could not load time table'));
43
+ } finally {
44
+ setLoading(false);
45
+ }
46
+ };
47
+ load().catch(() => {});
48
+ }, [api, isTeacherMode, missing, props.classId, props.sectionId, props.sessionId, props.staffId]);
49
+ const days = useMemo(() => ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'], []);
50
+ const filtered = useMemo(() => {
51
+ return items.filter(item => String(item?.day_name ?? '').toLowerCase() === selectedDay);
52
+ }, [items, selectedDay]);
53
+ if (missing) {
54
+ return /*#__PURE__*/_jsx(EmptyState, {
55
+ title: "Missing parameters",
56
+ message: "Provide staffId + sessionId, or classId + sectionId + sessionId"
57
+ });
58
+ }
59
+ if (loading) {
60
+ return /*#__PURE__*/_jsx(SafeAreaView, {
61
+ style: styles.root,
62
+ children: /*#__PURE__*/_jsx(View, {
63
+ style: styles.loaderWrap,
64
+ children: /*#__PURE__*/_jsx(ActivityIndicator, {
65
+ size: "large",
66
+ color: "#1D4ED8"
67
+ })
68
+ })
69
+ });
70
+ }
71
+ if (error) {
72
+ return /*#__PURE__*/_jsx(ErrorState, {
73
+ message: error
74
+ });
75
+ }
76
+ return /*#__PURE__*/_jsx(SafeAreaView, {
77
+ style: styles.root,
78
+ children: /*#__PURE__*/_jsxs(View, {
79
+ style: styles.content,
80
+ children: [/*#__PURE__*/_jsx(Text, {
81
+ style: styles.title,
82
+ children: "Time Table"
83
+ }), /*#__PURE__*/_jsx(FlatList, {
84
+ horizontal: true,
85
+ data: days,
86
+ keyExtractor: item => item,
87
+ showsHorizontalScrollIndicator: false,
88
+ contentContainerStyle: styles.dayList,
89
+ style: styles.dayStrip,
90
+ renderItem: ({
91
+ item
92
+ }) => {
93
+ const active = selectedDay === item;
94
+ return /*#__PURE__*/_jsx(TouchableOpacity, {
95
+ onPress: () => setSelectedDay(item),
96
+ style: [styles.dayBtn, active ? styles.dayBtnActive : null],
97
+ children: /*#__PURE__*/_jsx(Text, {
98
+ style: [styles.dayBtnText, active ? styles.dayBtnTextActive : null],
99
+ children: item.charAt(0).toUpperCase() + item.slice(1, 3)
100
+ })
101
+ });
102
+ }
103
+ }), /*#__PURE__*/_jsx(FlatList, {
104
+ data: filtered,
105
+ keyExtractor: (item, index) => String(item?.id ?? `${selectedDay}-${index}`),
106
+ contentContainerStyle: filtered.length ? styles.list : styles.emptyWrap,
107
+ renderItem: ({
108
+ item
109
+ }) => /*#__PURE__*/_jsxs(View, {
110
+ style: styles.card,
111
+ children: [/*#__PURE__*/_jsxs(View, {
112
+ style: styles.timeWrap,
113
+ children: [/*#__PURE__*/_jsxs(Text, {
114
+ style: styles.timeText,
115
+ children: [String(item?.time_from ?? '').slice(0, 5), " - ", String(item?.time_to ?? '').slice(0, 5)]
116
+ }), /*#__PURE__*/_jsxs(Text, {
117
+ style: styles.periodText,
118
+ children: ["Period ", String(item?.order_no ?? '-')]
119
+ })]
120
+ }), /*#__PURE__*/_jsxs(View, {
121
+ style: styles.infoWrap,
122
+ children: [/*#__PURE__*/_jsx(Text, {
123
+ style: styles.subjectText,
124
+ children: String(item?.subject_name ?? 'Subject')
125
+ }), /*#__PURE__*/_jsxs(Text, {
126
+ style: styles.classText,
127
+ children: ["Class: ", String(item?.class_name ?? '-'), " (", String(item?.section_name ?? '-'), ")"]
128
+ }), item?.room_no ? /*#__PURE__*/_jsxs(Text, {
129
+ style: styles.roomText,
130
+ children: ["Room: ", String(item.room_no)]
131
+ }) : null]
132
+ })]
133
+ }),
134
+ ListEmptyComponent: /*#__PURE__*/_jsxs(Text, {
135
+ style: styles.emptyText,
136
+ children: ["No classes scheduled for ", selectedDay]
137
+ })
138
+ })]
139
+ })
140
+ });
141
+ }
142
+ const styles = StyleSheet.create({
143
+ root: {
144
+ flex: 1,
145
+ backgroundColor: '#F3F4F6'
146
+ },
147
+ content: {
148
+ flex: 1
149
+ },
150
+ loaderWrap: {
151
+ flex: 1,
152
+ alignItems: 'center',
153
+ justifyContent: 'center'
154
+ },
155
+ title: {
156
+ fontSize: 20,
157
+ fontWeight: '700',
158
+ color: '#111827',
159
+ padding: 16,
160
+ paddingBottom: 8
161
+ },
162
+ dayStrip: {
163
+ maxHeight: 66,
164
+ flexGrow: 0
165
+ },
166
+ dayList: {
167
+ paddingHorizontal: 12,
168
+ paddingBottom: 12,
169
+ alignItems: 'center'
170
+ },
171
+ dayBtn: {
172
+ backgroundColor: '#E5E7EB',
173
+ width: 86,
174
+ height: 52,
175
+ borderRadius: 22,
176
+ marginHorizontal: 4,
177
+ alignItems: 'center',
178
+ justifyContent: 'center'
179
+ },
180
+ dayBtnActive: {
181
+ backgroundColor: '#1D4ED8'
182
+ },
183
+ dayBtnText: {
184
+ fontSize: 14,
185
+ fontWeight: '600',
186
+ color: '#111827'
187
+ },
188
+ dayBtnTextActive: {
189
+ color: '#FFFFFF'
190
+ },
191
+ list: {
192
+ padding: 16,
193
+ paddingTop: 8,
194
+ paddingBottom: 32
195
+ },
196
+ emptyWrap: {
197
+ flexGrow: 1,
198
+ padding: 16,
199
+ justifyContent: 'center'
200
+ },
201
+ card: {
202
+ backgroundColor: '#FFFFFF',
203
+ borderWidth: 1,
204
+ borderColor: '#E5E7EB',
205
+ borderRadius: 14,
206
+ padding: 14,
207
+ marginBottom: 12,
208
+ flexDirection: 'row'
209
+ },
210
+ timeWrap: {
211
+ width: 98,
212
+ borderRightWidth: 1,
213
+ borderRightColor: '#E5E7EB',
214
+ paddingRight: 12,
215
+ justifyContent: 'center'
216
+ },
217
+ timeText: {
218
+ fontSize: 14,
219
+ fontWeight: '700',
220
+ color: '#1D4ED8'
221
+ },
222
+ periodText: {
223
+ fontSize: 12,
224
+ color: '#6B7280',
225
+ marginTop: 4
226
+ },
227
+ infoWrap: {
228
+ flex: 1,
229
+ paddingLeft: 14,
230
+ justifyContent: 'center'
231
+ },
232
+ subjectText: {
233
+ fontSize: 17,
234
+ fontWeight: '700',
235
+ color: '#111827',
236
+ marginBottom: 4
237
+ },
238
+ classText: {
239
+ fontSize: 14,
240
+ color: '#374151'
241
+ },
242
+ roomText: {
243
+ fontSize: 13,
244
+ color: '#6B7280',
245
+ marginTop: 2
246
+ },
247
+ emptyText: {
248
+ fontSize: 16,
249
+ textAlign: 'center',
250
+ color: '#6B7280'
251
+ }
252
+ });
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ import { endpoints } from "../../../core/api/endpoints.js";
4
+ export async function fetchTimeTable(api, params) {
5
+ const res = await api.get(endpoints.timetable.classSection(params));
6
+ return res.data;
7
+ }
8
+ export async function fetchTeacherTimeTable(api, params) {
9
+ const res = await api.get(endpoints.timetable.teacher(params));
10
+ return res.data;
11
+ }
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ import React from 'react';
4
+ import { StyleSheet, Text, View } from 'react-native';
5
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
+ export function EmptyState({
7
+ title = 'No Data Found',
8
+ message
9
+ }) {
10
+ return /*#__PURE__*/_jsxs(View, {
11
+ style: styles.root,
12
+ children: [/*#__PURE__*/_jsx(Text, {
13
+ style: styles.title,
14
+ children: title
15
+ }), message ? /*#__PURE__*/_jsx(Text, {
16
+ style: styles.message,
17
+ children: message
18
+ }) : null]
19
+ });
20
+ }
21
+ const styles = StyleSheet.create({
22
+ root: {
23
+ flex: 1,
24
+ alignItems: 'center',
25
+ justifyContent: 'center',
26
+ paddingHorizontal: 24
27
+ },
28
+ title: {
29
+ fontSize: 16,
30
+ color: '#6B7280',
31
+ textAlign: 'center'
32
+ },
33
+ message: {
34
+ marginTop: 8,
35
+ fontSize: 13,
36
+ color: '#9CA3AF',
37
+ textAlign: 'center',
38
+ lineHeight: 18
39
+ }
40
+ });
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ import React from 'react';
4
+ import { StyleSheet, Text, View } from 'react-native';
5
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
+ export function ErrorState({
7
+ title = 'Something went wrong',
8
+ message
9
+ }) {
10
+ return /*#__PURE__*/_jsxs(View, {
11
+ style: styles.root,
12
+ children: [/*#__PURE__*/_jsx(Text, {
13
+ style: styles.title,
14
+ children: title
15
+ }), message ? /*#__PURE__*/_jsx(Text, {
16
+ style: styles.message,
17
+ children: message
18
+ }) : null]
19
+ });
20
+ }
21
+ const styles = StyleSheet.create({
22
+ root: {
23
+ flex: 1,
24
+ alignItems: 'center',
25
+ justifyContent: 'center',
26
+ paddingHorizontal: 24
27
+ },
28
+ title: {
29
+ fontSize: 16,
30
+ color: '#DC2626',
31
+ textAlign: 'center',
32
+ fontWeight: '600'
33
+ },
34
+ message: {
35
+ marginTop: 8,
36
+ fontSize: 14,
37
+ color: '#6B7280',
38
+ textAlign: 'center'
39
+ }
40
+ });
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ import React from 'react';
4
+ import { ActivityIndicator, StyleSheet, View } from 'react-native';
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ export function LoadingState() {
7
+ return /*#__PURE__*/_jsx(View, {
8
+ style: styles.root,
9
+ children: /*#__PURE__*/_jsx(ActivityIndicator, {
10
+ size: "large"
11
+ })
12
+ });
13
+ }
14
+ const styles = StyleSheet.create({
15
+ root: {
16
+ flex: 1,
17
+ alignItems: 'center',
18
+ justifyContent: 'center'
19
+ }
20
+ });
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ export const theme = {
4
+ colors: {
5
+ primary: '#2563EB',
6
+ danger: '#DC2626',
7
+ text: '#111827',
8
+ muted: '#6B7280',
9
+ background: '#FFFFFF'
10
+ },
11
+ spacing: {
12
+ xs: 4,
13
+ sm: 8,
14
+ md: 12,
15
+ lg: 16,
16
+ xl: 24
17
+ }
18
+ };
@@ -0,0 +1,14 @@
1
+ import { AxiosInstance, AxiosRequestConfig } from 'axios';
2
+ import type { ApiError } from '../types/api';
3
+ import type { ERPAuthConfig, ERPNetworkConfig } from '../provider/types';
4
+ export type CreateApiClientArgs = {
5
+ network: ERPNetworkConfig;
6
+ auth: ERPAuthConfig;
7
+ };
8
+ export declare function normalizeApiError(e: unknown): ApiError;
9
+ export declare function createApiClient(args: CreateApiClientArgs): AxiosInstance;
10
+ export type RetryableAxiosRequestConfig = AxiosRequestConfig & {
11
+ __retryCount?: number;
12
+ __didRefreshAuth?: boolean;
13
+ };
14
+ //# sourceMappingURL=apiClient.d.ts.map
@@ -0,0 +1,164 @@
1
+ export declare const endpoints: {
2
+ readonly attendance: {
3
+ readonly studentsForAttendance: (args: {
4
+ classId: string | number;
5
+ sectionId: string | number;
6
+ sessionId: string | number;
7
+ date?: string;
8
+ }) => string;
9
+ readonly updateStatus: "staff/teacherAPP/AttendenceSection/studentstatusupdate";
10
+ readonly notify: "staff/teacherAPP/AttendenceSection/studentAttendanceNotification";
11
+ readonly classDropdown: "staff/teacherAPP/attendenceSection/getclassDropdownforTeacher";
12
+ readonly sectionDropdown: (args: {
13
+ classId: string | number;
14
+ }) => string;
15
+ };
16
+ readonly assignment: {
17
+ readonly listByClassSection: (args: {
18
+ page: number;
19
+ perPage: number;
20
+ classId?: string | number;
21
+ sectionId?: string | number;
22
+ subjectId?: string | number;
23
+ }) => string;
24
+ readonly add: "staff/teacherAPP/StaffHomework/addHomework";
25
+ readonly classDropdown: "staff/teacherAPP/attendenceSection/getclassDropdownforTeacher";
26
+ readonly sectionDropdown: (args: {
27
+ classId: string | number;
28
+ }) => string;
29
+ readonly teacherSubjectsByClass: (args: {
30
+ classId: string | number;
31
+ sessionId: string | number;
32
+ }) => string;
33
+ readonly uploadFile: "superAdmin/uploadFile";
34
+ readonly submissionsList: (args: {
35
+ homeworkId: string | number;
36
+ }) => string;
37
+ readonly giveMarks: "staff/teacherAPP/StaffHomework/givemarkstoHomework";
38
+ readonly showHomework: (args: {
39
+ homeworkId: string | number;
40
+ }) => string;
41
+ readonly updateHomework: "staff/teacherAPP/StaffHomework/updateHomework";
42
+ };
43
+ readonly leaveRequest: {
44
+ readonly table: (args: {
45
+ page: number;
46
+ perPage: number;
47
+ }) => string;
48
+ readonly leaveTypes: "staff/teacherAPP/staffLeave/leavetypeDropdown";
49
+ readonly apply: "staff/teacherAPP/staffLeave/applyLeave";
50
+ };
51
+ readonly marks: {
52
+ readonly coscholasticGrades: "staff/teacherAPP/ExamDetails/gradeDropdownCoScholastic";
53
+ readonly classDropdown: "staff/teacherAPP/attendenceSection/getclassDropdownforTeacher";
54
+ readonly classTeacherClassList: "staff/teacherAPP/ExamDetails/getClassTeacherClassList";
55
+ readonly sectionDropdown: (args: {
56
+ classId: string | number;
57
+ }) => string;
58
+ readonly examDropdown: (args: {
59
+ sessionId: string | number;
60
+ classId: string | number;
61
+ }) => string;
62
+ readonly teacherSubjectsForExam: (args: {
63
+ sessionId: string | number;
64
+ examId: string | number;
65
+ classId: string | number;
66
+ sectionId: string | number;
67
+ }) => string;
68
+ readonly coScholasticCategories: (args: {
69
+ sessionId: string | number;
70
+ examId: string | number;
71
+ classId: string | number;
72
+ }) => string;
73
+ readonly studentListForExamAssessment: (args: {
74
+ classId: string | number;
75
+ examId: string | number;
76
+ sectionId: string | number;
77
+ subjectId: string | number;
78
+ }) => string;
79
+ readonly submitExamMarks: "staff/teacherAPP/ExamDetails/addexamMarksV2";
80
+ readonly studentListForCoScholastic: (args: {
81
+ classId: string | number;
82
+ examId: string | number;
83
+ sectionId: string | number;
84
+ categoryId: string | number;
85
+ }) => string;
86
+ readonly submitCoScholasticMarks: "staff/teacherAPP/ExamDetails/assignCoscholasticMarks";
87
+ readonly studentListRemarks: (args: {
88
+ classId: string | number;
89
+ examId: string | number;
90
+ sectionId: string | number;
91
+ }) => string;
92
+ readonly submitExamRemarks: "staff/teacherAPP/ExamDetails/studentExamRemarks";
93
+ };
94
+ readonly myAttendance: {
95
+ readonly report: (args: {
96
+ staffId: string | number;
97
+ month: string | number;
98
+ year: string | number;
99
+ sessionId: string | number;
100
+ }) => string;
101
+ };
102
+ readonly notes: {
103
+ readonly listByClassSection: (args: {
104
+ page: number;
105
+ perPage: number;
106
+ classId?: string | number;
107
+ sectionId?: string | number;
108
+ subjectId?: string | number;
109
+ }) => string;
110
+ readonly classDropdown: "staff/teacherAPP/attendenceSection/getclassDropdownforTeacher";
111
+ readonly sectionDropdown: (args: {
112
+ classId: string | number;
113
+ }) => string;
114
+ readonly teacherSubjectsByClass: (args: {
115
+ classId: string | number;
116
+ sessionId: string | number;
117
+ }) => string;
118
+ readonly details: (args: {
119
+ noteId: string | number;
120
+ }) => string;
121
+ readonly add: "staff/teacherAPP/Notes/addNotes";
122
+ readonly update: "staff/teacherAPP/Notes/updateNote";
123
+ readonly upload: "staff/teacherAPP/Notes/uploadnotes";
124
+ };
125
+ readonly noticeboard: {
126
+ readonly list: (args: {
127
+ page: number;
128
+ perPage: number;
129
+ }) => string;
130
+ };
131
+ readonly notification: {
132
+ readonly list: (args: {
133
+ page: number;
134
+ perPage: number;
135
+ }) => string;
136
+ };
137
+ readonly promoteStudent: {
138
+ readonly classDropdown: "staff/teacherAPP/attendenceSection/getclassDropdownforTeacher";
139
+ readonly sectionDropdown: (args: {
140
+ classId: string | number;
141
+ }) => string;
142
+ readonly allSectionDropdown: (args: {
143
+ classId: string | number;
144
+ }) => string;
145
+ readonly sessionDropdown: "staff/teacherAPP/StudentDetails/sessiondropdown";
146
+ readonly searchByClassSection: (args: {
147
+ classId: string | number;
148
+ sectionId: string | number;
149
+ }) => string;
150
+ readonly submit: "staff/teacherAPP/StudentDetails/promotestudent";
151
+ };
152
+ readonly timetable: {
153
+ readonly teacher: (args: {
154
+ staffId: string | number;
155
+ sessionId: string | number;
156
+ }) => string;
157
+ readonly classSection: (args: {
158
+ classId: string | number;
159
+ sectionId: string | number;
160
+ sessionId: string | number;
161
+ }) => string;
162
+ };
163
+ };
164
+ //# sourceMappingURL=endpoints.d.ts.map
@@ -0,0 +1,4 @@
1
+ import type { AxiosInstance } from 'axios';
2
+ import type { CreateApiClientArgs } from './apiClient';
3
+ export declare function attachInterceptors(instance: AxiosInstance, args: CreateApiClientArgs): void;
4
+ //# sourceMappingURL=interceptor.d.ts.map
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { ReactNode } from 'react';
3
+ export type AuthContextValue = {
4
+ authToken: string | null;
5
+ setAuthToken: (token: string | null) => void;
6
+ };
7
+ export declare const AuthContext: React.Context<AuthContextValue | null>;
8
+ export declare function AuthProvider({ children }: {
9
+ children: ReactNode;
10
+ }): React.JSX.Element;
11
+ //# sourceMappingURL=authContext.d.ts.map
@@ -0,0 +1,9 @@
1
+ export type AuthStorage = {
2
+ getAuthToken: () => Promise<string | null>;
3
+ setAuthToken: (token: string | null) => Promise<void>;
4
+ };
5
+ export declare function createAuthService(storage: AuthStorage): {
6
+ getAuthToken: () => Promise<string | null>;
7
+ setAuthToken: (token: string | null) => Promise<void>;
8
+ };
9
+ //# sourceMappingURL=authService.d.ts.map
@@ -0,0 +1,7 @@
1
+ import { useERP as useERPNamed } from '../provider/useERP';
2
+ export declare function useApiQuery<TData>(args: {
3
+ queryKey: readonly unknown[];
4
+ queryFn: (api: ReturnType<typeof useERPNamed>['api']) => Promise<TData>;
5
+ enabled?: boolean;
6
+ }): import("@tanstack/react-query/build/legacy/_tsup-dts-rollup").UseQueryResult<NoInfer<TData_1>, Error>;
7
+ //# sourceMappingURL=useApiQuery.d.ts.map
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import type { AxiosInstance } from 'axios';
3
+ import type { ERPProviderProps } from './types';
4
+ export type ERPContextValue = {
5
+ api: AxiosInstance;
6
+ baseUrl: string;
7
+ fileBaseUrl?: string;
8
+ schoolCode?: string;
9
+ authToken?: string | null;
10
+ getAuthToken?: () => Promise<string | null>;
11
+ };
12
+ export declare const ERPContext: React.Context<ERPContextValue | null>;
13
+ export declare function ERPProvider(props: ERPProviderProps): React.JSX.Element;
14
+ //# sourceMappingURL=ERPProvider.d.ts.map
@@ -0,0 +1,34 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ApiError } from '../types/api';
3
+ export type ERPHeaders = Record<string, string>;
4
+ export type ERPNetworkRetry = {
5
+ retries: number;
6
+ delayMs: number;
7
+ };
8
+ export type ERPNetworkConfig = {
9
+ baseUrl: string;
10
+ headers?: ERPHeaders;
11
+ schoolCode?: string;
12
+ retry?: ERPNetworkRetry;
13
+ onError?: (error: ApiError) => void;
14
+ };
15
+ export type ERPAuthConfig = {
16
+ authToken?: string | null;
17
+ getAuthToken?: () => Promise<string | null>;
18
+ refreshAuthToken?: () => Promise<string | null>;
19
+ onUnauthorized?: (error: ApiError) => void;
20
+ };
21
+ export type ERPProviderProps = {
22
+ baseUrl: string;
23
+ fileBaseUrl?: string;
24
+ schoolCode?: string;
25
+ authToken?: string | null;
26
+ getAuthToken?: () => Promise<string | null>;
27
+ refreshAuthToken?: () => Promise<string | null>;
28
+ headers?: ERPHeaders;
29
+ retry?: ERPNetworkRetry;
30
+ onError?: (error: ApiError) => void;
31
+ onUnauthorized?: (error: ApiError) => void;
32
+ children: ReactNode;
33
+ };
34
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,3 @@
1
+ export declare function useERP(): import("./ERPProvider").ERPContextValue;
2
+ export default useERP;
3
+ //# sourceMappingURL=useERP.d.ts.map
@@ -0,0 +1,11 @@
1
+ export type ApiResult<T> = {
2
+ Status?: string;
3
+ Message?: string;
4
+ data?: T;
5
+ };
6
+ export type ApiError = {
7
+ message: string;
8
+ status?: number;
9
+ data?: unknown;
10
+ };
11
+ //# sourceMappingURL=api.d.ts.map