@react-pakistan/util-functions 1.25.88 → 1.25.90

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.
@@ -0,0 +1,266 @@
1
+ /**
2
+ * TypeScript Types Generated from Prisma Schema - Academics
3
+ *
4
+ * This file contains TypeScript interfaces for class, section, subject, course,
5
+ * teacher, enrollment, attendance, grade, schedule, student profile, family,
6
+ * and family member domain models.
7
+ */
8
+ import { GENDER, FAMILY_MEMBER_ROLE, STUDENT_STATUS, ATTENDANCE_STATUS, GRADE_TYPE, DAY_OF_WEEK } from './enums';
9
+ import type { SchoolBE, CampusBE, UserBE } from './user-management';
10
+ import type { FeeStructureBE, StudentFeeBE } from './finance';
11
+ /**
12
+ * Family represents a household sharing a single user account
13
+ * Contains parents and students using the same login credentials
14
+ */
15
+ export interface FamilyBE {
16
+ address: string | null;
17
+ city: string | null;
18
+ country: string | null;
19
+ createdAt: string;
20
+ enabled: boolean;
21
+ familyCode: string;
22
+ id: string;
23
+ postalCode: string | null;
24
+ schoolId: string;
25
+ state: string | null;
26
+ updatedAt: string;
27
+ members?: FamilyMemberBE[];
28
+ school?: SchoolBE;
29
+ studentFees?: StudentFeeBE[];
30
+ }
31
+ /**
32
+ * FamilyMember represents individuals within a family
33
+ * Multiple members (parents + students) share the family's user account
34
+ */
35
+ export interface FamilyMemberBE {
36
+ avatar: string | null;
37
+ bloodGroup: string | null;
38
+ createdAt: string;
39
+ dateOfBirth: Date | string | null;
40
+ email: string | null;
41
+ emergencyPhone: string | null;
42
+ enabled: boolean;
43
+ familyId: string;
44
+ firstName: string;
45
+ gender: GENDER;
46
+ id: string;
47
+ idNumber: string;
48
+ isPrimary: boolean;
49
+ lastName: string;
50
+ occupation: string | null;
51
+ organization: string | null;
52
+ phone: string | null;
53
+ relationship: string;
54
+ role: FAMILY_MEMBER_ROLE;
55
+ updatedAt: string;
56
+ family?: FamilyBE;
57
+ studentProfile?: StudentProfileBE;
58
+ }
59
+ /**
60
+ * StudentProfile extends FamilyMember with student-specific data
61
+ */
62
+ export interface StudentProfileBE {
63
+ campusId: string | null;
64
+ computerNumber: string;
65
+ createdAt: string;
66
+ discountCodeId: string | null;
67
+ enabled: boolean;
68
+ familyMemberId: string;
69
+ hafiz: boolean;
70
+ id: string;
71
+ notes: string | null;
72
+ orphan: boolean;
73
+ previousSchool: string | null;
74
+ remarks: string | null;
75
+ schoolId: string;
76
+ status: STUDENT_STATUS;
77
+ studentCode: string;
78
+ updatedAt: string;
79
+ attendances?: AttendanceBE[];
80
+ campus?: CampusBE;
81
+ enrollments?: EnrollmentBE[];
82
+ familyMember?: FamilyMemberBE;
83
+ grades?: GradeBE[];
84
+ studentFees?: StudentFeeBE[];
85
+ }
86
+ /**
87
+ * Class represents grade levels (e.g., Grade 1, Grade 2, Grade 10)
88
+ */
89
+ export interface ClassBE {
90
+ campusId: string | null;
91
+ code: string;
92
+ createdAt: string;
93
+ description: string | null;
94
+ enabled: boolean;
95
+ id: string;
96
+ name: string;
97
+ schoolId: string;
98
+ updatedAt: string;
99
+ campus?: CampusBE;
100
+ feeStructures?: FeeStructureBE[];
101
+ school?: SchoolBE;
102
+ sections?: SectionBE[];
103
+ }
104
+ /**
105
+ * Section represents a named division within a school (school-wide pool).
106
+ */
107
+ export interface SectionBE {
108
+ capacity: number | null;
109
+ createdAt: string;
110
+ enabled: boolean;
111
+ id: string;
112
+ name: string;
113
+ schoolId: string;
114
+ updatedAt: string;
115
+ class?: ClassBE;
116
+ courses?: CourseBE[];
117
+ enrollments?: EnrollmentBE[];
118
+ school?: SchoolBE;
119
+ }
120
+ /**
121
+ * Subject represents academic subjects (e.g., Mathematics, English, Science)
122
+ */
123
+ export interface SubjectBE {
124
+ code: string;
125
+ createdAt: string;
126
+ description: string | null;
127
+ enabled: boolean;
128
+ id: string;
129
+ name: string;
130
+ schoolId: string;
131
+ updatedAt: string;
132
+ courses?: CourseBE[];
133
+ school?: SchoolBE;
134
+ }
135
+ /**
136
+ * Course represents a subject taught in a specific section by a teacher
137
+ */
138
+ export interface CourseBE {
139
+ classId: string;
140
+ code: string;
141
+ createdAt: string;
142
+ enabled: boolean;
143
+ id: string;
144
+ schoolId: string;
145
+ sectionId: string;
146
+ subjectId: string;
147
+ teacherId: string;
148
+ updatedAt: Date;
149
+ class?: ClassBE;
150
+ grades?: GradeBE[];
151
+ schedules?: ScheduleBE[];
152
+ school?: SchoolBE;
153
+ section?: SectionBE;
154
+ subject?: SubjectBE;
155
+ teacher?: TeacherBE;
156
+ }
157
+ /**
158
+ * Teacher represents teaching staff
159
+ */
160
+ export interface TeacherBE {
161
+ address: string | null;
162
+ avatar: string | null;
163
+ bio: string | null;
164
+ campusId: string | null;
165
+ city: string | null;
166
+ country: string | null;
167
+ createdAt: string;
168
+ dateOfBirth: Date | string | null;
169
+ emergencyPhone: string | null;
170
+ enabled: boolean;
171
+ experience: number | null;
172
+ firstName: string;
173
+ gender: GENDER | null;
174
+ id: string;
175
+ joiningDate: Date | string;
176
+ lastName: string;
177
+ phone: string | null;
178
+ postalCode: string | null;
179
+ qualification: string | null;
180
+ schoolId: string;
181
+ specialization: string | null;
182
+ state: string | null;
183
+ teacherCode: string;
184
+ updatedAt: Date;
185
+ userId: string | null;
186
+ campus?: CampusBE;
187
+ courses?: CourseBE[];
188
+ school?: SchoolBE;
189
+ user?: UserBE | null;
190
+ }
191
+ /**
192
+ * Enrollment represents a student enrolled in a section.
193
+ * All courses taught in that section are implied.
194
+ */
195
+ export interface EnrollmentBE {
196
+ createdAt: string;
197
+ enabled: boolean;
198
+ enrollmentDate: Date | string;
199
+ id: string;
200
+ classId: string;
201
+ sectionId: string;
202
+ studentProfileId: string;
203
+ updatedAt: string;
204
+ class?: ClassBE;
205
+ grades?: GradeBE[];
206
+ section?: SectionBE;
207
+ studentProfile?: StudentProfileBE;
208
+ }
209
+ /**
210
+ * Attendance tracks daily student presence in courses
211
+ */
212
+ export interface AttendanceBE {
213
+ createdAt: string;
214
+ date: Date | string;
215
+ enabled: boolean;
216
+ id: string;
217
+ remarks: string | null;
218
+ schoolId: string;
219
+ status: ATTENDANCE_STATUS;
220
+ studentProfileId: string;
221
+ updatedAt: string;
222
+ school?: SchoolBE;
223
+ studentProfile?: StudentProfileBE;
224
+ }
225
+ /**
226
+ * Grade represents student assessment results
227
+ */
228
+ export interface GradeBE {
229
+ assessmentDate: Date | string;
230
+ courseId: string;
231
+ createdAt: Date;
232
+ enabled: boolean;
233
+ enrollmentId: string;
234
+ grade: string | null;
235
+ gradeType: GRADE_TYPE;
236
+ id: string;
237
+ marksObtained: number;
238
+ maxMarks: number;
239
+ percentage: number | null;
240
+ remarks: string | null;
241
+ schoolId: string;
242
+ studentProfileId: string;
243
+ title: string;
244
+ updatedAt: Date;
245
+ course?: CourseBE;
246
+ enrollment?: EnrollmentBE;
247
+ school?: SchoolBE;
248
+ studentProfile?: StudentProfileBE;
249
+ }
250
+ /**
251
+ * Schedule represents class timetable
252
+ */
253
+ export interface ScheduleBE {
254
+ courseId: string;
255
+ createdAt: string;
256
+ dayOfWeek: DAY_OF_WEEK;
257
+ enabled: boolean;
258
+ endTime: string;
259
+ id: string;
260
+ room: string | null;
261
+ schoolId: string;
262
+ startTime: string;
263
+ updatedAt: string;
264
+ course?: CourseBE;
265
+ school?: SchoolBE;
266
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ /**
3
+ * TypeScript Types Generated from Prisma Schema - Academics
4
+ *
5
+ * This file contains TypeScript interfaces for class, section, subject, course,
6
+ * teacher, enrollment, attendance, grade, schedule, student profile, family,
7
+ * and family member domain models.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,85 @@
1
+ /**
2
+ * TypeScript Types Generated from Prisma Schema - Admission
3
+ *
4
+ * This file contains TypeScript interfaces for the admission domain models.
5
+ */
6
+ import { GENDER, ADMISSION_STATUS } from './enums';
7
+ import type { SchoolBE } from './user-management';
8
+ export interface AdmissionDetails {
9
+ classForAdmission: string;
10
+ previousSchool: string;
11
+ siblings: string;
12
+ }
13
+ export interface FatherDetails {
14
+ fatherIdNumber: string;
15
+ fatherFirstName: string;
16
+ fatherLastName: string;
17
+ fatherMobile: string;
18
+ fatherOccupation: string;
19
+ fatherOrganization: string;
20
+ emergencyContact: boolean;
21
+ }
22
+ export interface MotherDetails {
23
+ motherIdNumber: string;
24
+ motherFirstName: string;
25
+ motherLastName: string;
26
+ motherMobile: string;
27
+ emergencyContact: boolean;
28
+ }
29
+ export interface HomeDetails {
30
+ address: string;
31
+ city: string;
32
+ country: string;
33
+ postalCode: string;
34
+ state: string;
35
+ }
36
+ export interface StudentDetails {
37
+ studentIdNumber: string;
38
+ discountCodeId: string;
39
+ dob: string;
40
+ emergencyContact: string;
41
+ firstName: string;
42
+ gender: GENDER;
43
+ hafiz: boolean;
44
+ lastName: string;
45
+ orphan: boolean;
46
+ registrationCode: string;
47
+ }
48
+ export interface OfficeUse {
49
+ admissionNotes: string;
50
+ notes: string;
51
+ }
52
+ /**
53
+ * StudentAdmission stores raw application payloads as JSON blobs.
54
+ * This model mirrors the Prisma StudentAdmission model which keeps
55
+ * structured form data in Json columns so the application layer can
56
+ * process/transform it into domain entities on approval.
57
+ */
58
+ export interface AdmissionAIBE {
59
+ id: string;
60
+ admissionId: string;
61
+ schoolId: string;
62
+ score: number;
63
+ decision: string;
64
+ reasons: string[];
65
+ confidence: number;
66
+ processedAt: string;
67
+ createdAt: string;
68
+ updatedAt: string;
69
+ }
70
+ export interface AdmissionBE {
71
+ admissionDetails: AdmissionDetails | null;
72
+ createdAt: string;
73
+ enabled: boolean;
74
+ fatherDetails: FatherDetails | null;
75
+ homeDetails: HomeDetails | null;
76
+ id: string;
77
+ motherDetails: MotherDetails | null;
78
+ officeUse: OfficeUse | null;
79
+ schoolId: string;
80
+ status: ADMISSION_STATUS;
81
+ studentDetails: StudentDetails | null;
82
+ updatedAt: string;
83
+ school?: SchoolBE;
84
+ aiAnalysis?: AdmissionAIBE | null;
85
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * TypeScript Types Generated from Prisma Schema - Admission
4
+ *
5
+ * This file contains TypeScript interfaces for the admission domain models.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,165 @@
1
+ /**
2
+ * TypeScript Types Generated from Prisma Schema - Communication
3
+ *
4
+ * This file contains TypeScript interfaces for campaigns, blog posts,
5
+ * referrals, push tokens, mobile notifications, and notification preferences.
6
+ */
7
+ import { CAMPAIGN_STATUS, CAMPAIGN_CONTACT_STATUS, DEVICE_PLATFORM, NOTIFICATION_TYPE, REFERRAL_CHANNEL, REFERRAL_STATUS } from './enums';
8
+ import type { SchoolBE, UserBE } from './user-management';
9
+ /**
10
+ * Individual recipient within a broadcast campaign
11
+ */
12
+ export interface CampaignContactBE {
13
+ campaignId: string;
14
+ createdAt: string;
15
+ errorMessage: string | null;
16
+ id: string;
17
+ name: string;
18
+ phoneNumber: string;
19
+ sentAt: string | null;
20
+ status: CAMPAIGN_CONTACT_STATUS;
21
+ updatedAt: string;
22
+ }
23
+ /**
24
+ * WhatsApp broadcast campaign
25
+ */
26
+ export interface CampaignBE {
27
+ createdAt: string;
28
+ enabled: boolean;
29
+ id: string;
30
+ messageTemplate: string;
31
+ name: string;
32
+ schoolId: string;
33
+ status: CAMPAIGN_STATUS;
34
+ updatedAt: string;
35
+ workerJobId: string | null;
36
+ contacts?: CampaignContactBE[];
37
+ _count?: {
38
+ contacts: number;
39
+ };
40
+ school?: SchoolBE;
41
+ }
42
+ /**
43
+ * BlogPost metadata and content (MDX/Markdown stored in `content`).
44
+ */
45
+ export interface BlogPostBE {
46
+ authorId: string | null;
47
+ clapCount: number;
48
+ commentCount: number;
49
+ content: string;
50
+ createdAt: string;
51
+ enabled: boolean;
52
+ excerpt: string | null;
53
+ id: string;
54
+ publishedAt: Date | string | null;
55
+ schoolId: string | null;
56
+ slug: string;
57
+ title: string;
58
+ updatedAt: string;
59
+ author?: UserBE;
60
+ claps?: BlogPostClapBE[];
61
+ comments?: BlogCommentBE[];
62
+ school?: SchoolBE | null;
63
+ }
64
+ export interface BlogCommentBE {
65
+ authorId: string | null;
66
+ clapCount: number;
67
+ content: string;
68
+ createdAt: string;
69
+ enabled: boolean;
70
+ id: string;
71
+ parentId: string | null;
72
+ postId: string;
73
+ updatedAt: string;
74
+ author?: UserBE | null;
75
+ claps?: BlogCommentClapBE[];
76
+ parent?: BlogCommentBE | null;
77
+ post?: BlogPostBE;
78
+ replies?: BlogCommentBE[];
79
+ }
80
+ export interface BlogPostClapBE {
81
+ createdAt: string;
82
+ id: string;
83
+ postId: string;
84
+ sessionId: string | null;
85
+ userId: string | null;
86
+ post?: BlogPostBE;
87
+ user?: UserBE | null;
88
+ }
89
+ export interface BlogCommentClapBE {
90
+ commentId: string;
91
+ createdAt: string;
92
+ id: string;
93
+ sessionId: string | null;
94
+ userId: string | null;
95
+ comment?: BlogCommentBE;
96
+ user?: UserBE | null;
97
+ }
98
+ /**
99
+ * A referral invite sent by a school user to encourage another school to join the platform
100
+ */
101
+ export interface ReferralBE {
102
+ channel: REFERRAL_CHANNEL;
103
+ createdAt: string;
104
+ enabled: boolean;
105
+ errorMessage: string | null;
106
+ id: string;
107
+ inviterUserId: string;
108
+ personalNote: string | null;
109
+ recipientEmail: string | null;
110
+ recipientName: string | null;
111
+ recipientPhone: string | null;
112
+ schoolId: string;
113
+ sentAt: string | null;
114
+ status: REFERRAL_STATUS;
115
+ updatedAt: string;
116
+ workerJobId: string | null;
117
+ school?: SchoolBE;
118
+ }
119
+ /**
120
+ * Expo push token registered by a mobile device for a specific user
121
+ */
122
+ export interface UserPushTokenBE {
123
+ appVersion: string | null;
124
+ createdAt: string;
125
+ deviceId: string | null;
126
+ id: string;
127
+ platform: DEVICE_PLATFORM;
128
+ pushToken: string;
129
+ updatedAt: string;
130
+ userId: string;
131
+ user?: UserBE;
132
+ }
133
+ /**
134
+ * Push notification delivered to a mobile user
135
+ */
136
+ export interface MobileNotificationBE {
137
+ archived: boolean;
138
+ body: string;
139
+ createdAt: string;
140
+ data: Record<string, unknown> | null;
141
+ id: string;
142
+ read: boolean;
143
+ title: string;
144
+ type: NOTIFICATION_TYPE;
145
+ updatedAt: string;
146
+ userId: string;
147
+ user?: UserBE;
148
+ }
149
+ /**
150
+ * Per-user notification category and channel preferences
151
+ */
152
+ export interface NotificationPreferenceBE {
153
+ alertEnabled: boolean;
154
+ assignmentEnabled: boolean;
155
+ attendanceEnabled: boolean;
156
+ createdAt: string;
157
+ emailEnabled: boolean;
158
+ generalEnabled: boolean;
159
+ id: string;
160
+ paymentEnabled: boolean;
161
+ pushEnabled: boolean;
162
+ updatedAt: string;
163
+ userId: string;
164
+ user?: UserBE;
165
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ /**
3
+ * TypeScript Types Generated from Prisma Schema - Communication
4
+ *
5
+ * This file contains TypeScript interfaces for campaigns, blog posts,
6
+ * referrals, push tokens, mobile notifications, and notification preferences.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });