@sekolaos/shared-schema 1.0.3 → 1.1.1

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 (63) hide show
  1. package/dist/cjs/academic/academic-year.schema.js +8 -1
  2. package/dist/cjs/academic/academic-year.schema.js.map +1 -1
  3. package/dist/cjs/academic/class-room.schema.js +10 -3
  4. package/dist/cjs/academic/class-room.schema.js.map +1 -1
  5. package/dist/cjs/academic/subject.schema.js +11 -2
  6. package/dist/cjs/academic/subject.schema.js.map +1 -1
  7. package/dist/cjs/academic/teaching-schedule.schema.js +10 -1
  8. package/dist/cjs/academic/teaching-schedule.schema.js.map +1 -1
  9. package/dist/cjs/attendance/attendance-class.schema.js +9 -1
  10. package/dist/cjs/attendance/attendance-class.schema.js.map +1 -1
  11. package/dist/cjs/attendance/attendance-kiosk.schema.js +48 -1
  12. package/dist/cjs/attendance/attendance-kiosk.schema.js.map +1 -1
  13. package/dist/cjs/attendance/barcode-rolling.schema.js +27 -1
  14. package/dist/cjs/attendance/barcode-rolling.schema.js.map +1 -1
  15. package/dist/cjs/attendance/picket-assignment.schema.js +7 -1
  16. package/dist/cjs/attendance/picket-assignment.schema.js.map +1 -1
  17. package/dist/cjs/common/common.schema.js +15 -1
  18. package/dist/cjs/common/common.schema.js.map +1 -1
  19. package/dist/cjs/tenant/tenant.schema.js +37 -1
  20. package/dist/cjs/tenant/tenant.schema.js.map +1 -1
  21. package/dist/cjs/user/student.schema.js +13 -1
  22. package/dist/cjs/user/student.schema.js.map +1 -1
  23. package/dist/cjs/user/user.schema.js +29 -1
  24. package/dist/cjs/user/user.schema.js.map +1 -1
  25. package/dist/esm/academic/academic-year.schema.js +8 -1
  26. package/dist/esm/academic/academic-year.schema.js.map +1 -1
  27. package/dist/esm/academic/class-room.schema.js +10 -3
  28. package/dist/esm/academic/class-room.schema.js.map +1 -1
  29. package/dist/esm/academic/subject.schema.js +11 -2
  30. package/dist/esm/academic/subject.schema.js.map +1 -1
  31. package/dist/esm/academic/teaching-schedule.schema.js +9 -0
  32. package/dist/esm/academic/teaching-schedule.schema.js.map +1 -1
  33. package/dist/esm/attendance/attendance-class.schema.js +8 -0
  34. package/dist/esm/attendance/attendance-class.schema.js.map +1 -1
  35. package/dist/esm/attendance/attendance-kiosk.schema.js +48 -1
  36. package/dist/esm/attendance/attendance-kiosk.schema.js.map +1 -1
  37. package/dist/esm/attendance/barcode-rolling.schema.js +26 -0
  38. package/dist/esm/attendance/barcode-rolling.schema.js.map +1 -1
  39. package/dist/esm/attendance/picket-assignment.schema.js +7 -1
  40. package/dist/esm/attendance/picket-assignment.schema.js.map +1 -1
  41. package/dist/esm/common/common.schema.js +14 -0
  42. package/dist/esm/common/common.schema.js.map +1 -1
  43. package/dist/esm/tenant/tenant.schema.js +36 -0
  44. package/dist/esm/tenant/tenant.schema.js.map +1 -1
  45. package/dist/esm/user/student.schema.js +13 -1
  46. package/dist/esm/user/student.schema.js.map +1 -1
  47. package/dist/esm/user/user.schema.js +29 -1
  48. package/dist/esm/user/user.schema.js.map +1 -1
  49. package/dist/types/academic/academic-year.schema.d.ts +29 -4
  50. package/dist/types/academic/class-room.schema.d.ts +37 -12
  51. package/dist/types/academic/subject.schema.d.ts +25 -2
  52. package/dist/types/academic/teaching-schedule.schema.d.ts +25 -0
  53. package/dist/types/attendance/attendance-class.schema.d.ts +23 -0
  54. package/dist/types/attendance/attendance-kiosk.schema.d.ts +281 -0
  55. package/dist/types/attendance/barcode-rolling.schema.d.ts +75 -0
  56. package/dist/types/attendance/picket-assignment.schema.d.ts +17 -0
  57. package/dist/types/auth/role.schema.d.ts +4 -4
  58. package/dist/types/common/common.schema.d.ts +12 -0
  59. package/dist/types/tenant/attendance-shift.schema.d.ts +8 -8
  60. package/dist/types/tenant/tenant.schema.d.ts +79 -5
  61. package/dist/types/user/student.schema.d.ts +43 -0
  62. package/dist/types/user/user.schema.d.ts +88 -2
  63. package/package.json +1 -1
@@ -10,8 +10,8 @@ export declare const tenantSchema: z.ZodObject<{
10
10
  updatedAt: z.ZodString;
11
11
  }, "strip", z.ZodTypeAny, {
12
12
  id: string;
13
- slug: string;
14
13
  name: string;
14
+ slug: string;
15
15
  timezone: string;
16
16
  createdAt: string;
17
17
  updatedAt: string;
@@ -19,8 +19,8 @@ export declare const tenantSchema: z.ZodObject<{
19
19
  logoUrl?: string | null | undefined;
20
20
  }, {
21
21
  id: string;
22
- slug: string;
23
22
  name: string;
23
+ slug: string;
24
24
  createdAt: string;
25
25
  updatedAt: string;
26
26
  npsn?: string | null | undefined;
@@ -36,19 +36,93 @@ export declare const createTenantSchema: z.ZodObject<Pick<{
36
36
  timezone: z.ZodDefault<z.ZodString>;
37
37
  createdAt: z.ZodString;
38
38
  updatedAt: z.ZodString;
39
- }, "slug" | "name" | "npsn" | "logoUrl" | "timezone">, "strip", z.ZodTypeAny, {
40
- slug: string;
39
+ }, "name" | "slug" | "npsn" | "logoUrl" | "timezone">, "strip", z.ZodTypeAny, {
41
40
  name: string;
41
+ slug: string;
42
42
  timezone: string;
43
43
  npsn?: string | null | undefined;
44
44
  logoUrl?: string | null | undefined;
45
45
  }, {
46
- slug: string;
47
46
  name: string;
47
+ slug: string;
48
+ npsn?: string | null | undefined;
49
+ logoUrl?: string | null | undefined;
50
+ timezone?: string | undefined;
51
+ }>;
52
+ export declare const npsnSchema: z.ZodString;
53
+ export declare const phoneSchema: z.ZodString;
54
+ /**
55
+ * Profil sekolah dapat diperbarui oleh admin sekolah. `slug` sengaja tidak
56
+ * termasuk karena dipakai pada URL layanan dan sesi login lintas subdomain.
57
+ */
58
+ export declare const updateTenantProfileSchema: z.ZodObject<{
59
+ name: z.ZodOptional<z.ZodString>;
60
+ npsn: z.ZodOptional<z.ZodNullable<z.ZodString>>;
61
+ logoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
62
+ timezone: z.ZodOptional<z.ZodString>;
63
+ address: z.ZodOptional<z.ZodNullable<z.ZodString>>;
64
+ phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
65
+ }, "strip", z.ZodTypeAny, {
66
+ name?: string | undefined;
67
+ npsn?: string | null | undefined;
68
+ logoUrl?: string | null | undefined;
69
+ timezone?: string | undefined;
70
+ address?: string | null | undefined;
71
+ phone?: string | null | undefined;
72
+ }, {
73
+ name?: string | undefined;
48
74
  npsn?: string | null | undefined;
49
75
  logoUrl?: string | null | undefined;
50
76
  timezone?: string | undefined;
77
+ address?: string | null | undefined;
78
+ phone?: string | null | undefined;
79
+ }>;
80
+ export declare const tenantParamsSchema: z.ZodObject<{
81
+ id: z.ZodString;
82
+ }, "strip", z.ZodTypeAny, {
83
+ id: string;
84
+ }, {
85
+ id: string;
86
+ }>;
87
+ export declare const attendanceShiftParamsSchema: z.ZodObject<{
88
+ targetType: z.ZodEnum<["SISWA", "GURU"]>;
89
+ }, "strip", z.ZodTypeAny, {
90
+ targetType: "SISWA" | "GURU";
91
+ }, {
92
+ targetType: "SISWA" | "GURU";
93
+ }>;
94
+ export declare const attendanceShiftListQuerySchema: z.ZodObject<{
95
+ targetType: z.ZodOptional<z.ZodEnum<["SISWA", "GURU"]>>;
96
+ }, "strip", z.ZodTypeAny, {
97
+ targetType?: "SISWA" | "GURU" | undefined;
98
+ }, {
99
+ targetType?: "SISWA" | "GURU" | undefined;
100
+ }>;
101
+ /**
102
+ * Body `PUT /tenants/shifts` memuat satu atau kedua shift sekaligus sehingga
103
+ * admin dapat menyimpan form jam presensi dalam satu permintaan.
104
+ */
105
+ export declare const upsertAttendanceShiftsSchema: z.ZodEffects<z.ZodObject<{
106
+ SISWA: z.ZodOptional<z.ZodAny>;
107
+ GURU: z.ZodOptional<z.ZodAny>;
108
+ }, "strip", z.ZodTypeAny, {
109
+ SISWA?: any;
110
+ GURU?: any;
111
+ }, {
112
+ SISWA?: any;
113
+ GURU?: any;
114
+ }>, {
115
+ SISWA?: any;
116
+ GURU?: any;
117
+ }, {
118
+ SISWA?: any;
119
+ GURU?: any;
51
120
  }>;
52
121
  export type Tenant = z.infer<typeof tenantSchema>;
53
122
  export type CreateTenantInput = z.infer<typeof createTenantSchema>;
54
123
  export type CreateTenantSchemaInput = z.input<typeof createTenantSchema>;
124
+ export type UpdateTenantProfileInput = z.infer<typeof updateTenantProfileSchema>;
125
+ export type TenantParams = z.infer<typeof tenantParamsSchema>;
126
+ export type AttendanceShiftParams = z.infer<typeof attendanceShiftParamsSchema>;
127
+ export type AttendanceShiftListQuery = z.infer<typeof attendanceShiftListQuerySchema>;
128
+ export type UpsertAttendanceShiftsInput = z.infer<typeof upsertAttendanceShiftsSchema>;
@@ -53,7 +53,9 @@ export declare const createStudentSchema: z.ZodObject<{
53
53
  parentPhone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
54
54
  barcodeValue: z.ZodOptional<z.ZodString>;
55
55
  photoUrl: z.ZodNullable<z.ZodOptional<z.ZodString>>;
56
+ isActive: z.ZodDefault<z.ZodBoolean>;
56
57
  }, "strip", z.ZodTypeAny, {
58
+ isActive: boolean;
57
59
  classroomId: string;
58
60
  fullName: string;
59
61
  nis: string;
@@ -67,6 +69,7 @@ export declare const createStudentSchema: z.ZodObject<{
67
69
  fullName: string;
68
70
  nis: string;
69
71
  gender: "L" | "P";
72
+ isActive?: boolean | undefined;
70
73
  nisn?: string | null | undefined;
71
74
  parentPhone?: string | null | undefined;
72
75
  barcodeValue?: string | undefined;
@@ -81,7 +84,9 @@ export declare const updateStudentSchema: z.ZodObject<{
81
84
  parentPhone: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
82
85
  barcodeValue: z.ZodOptional<z.ZodOptional<z.ZodString>>;
83
86
  photoUrl: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
87
+ isActive: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
84
88
  }, "strip", z.ZodTypeAny, {
89
+ isActive?: boolean | undefined;
85
90
  classroomId?: string | undefined;
86
91
  fullName?: string | undefined;
87
92
  nis?: string | undefined;
@@ -91,6 +96,7 @@ export declare const updateStudentSchema: z.ZodObject<{
91
96
  barcodeValue?: string | undefined;
92
97
  photoUrl?: string | null | undefined;
93
98
  }, {
99
+ isActive?: boolean | undefined;
94
100
  classroomId?: string | undefined;
95
101
  fullName?: string | undefined;
96
102
  nis?: string | undefined;
@@ -234,6 +240,43 @@ export declare const bulkImportStudentResponseSchema: z.ZodObject<{
234
240
  totalSuccess: number;
235
241
  totalFailed: number;
236
242
  }>;
243
+ export declare const studentParamsSchema: z.ZodObject<{
244
+ id: z.ZodString;
245
+ }, "strip", z.ZodTypeAny, {
246
+ id: string;
247
+ }, {
248
+ id: string;
249
+ }>;
250
+ export declare const studentListQuerySchema: z.ZodObject<{
251
+ sortBy: z.ZodDefault<z.ZodEnum<["fullName", "nis"]>>;
252
+ sortOrder: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
253
+ classroomId: z.ZodOptional<z.ZodString>;
254
+ academicYearId: z.ZodOptional<z.ZodString>;
255
+ isActive: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "true" | "false" | undefined>;
256
+ page: z.ZodDefault<z.ZodNumber>;
257
+ limit: z.ZodDefault<z.ZodNumber>;
258
+ search: z.ZodOptional<z.ZodString>;
259
+ }, "strip", z.ZodTypeAny, {
260
+ page: number;
261
+ limit: number;
262
+ sortBy: "fullName" | "nis";
263
+ sortOrder: "asc" | "desc";
264
+ search?: string | undefined;
265
+ academicYearId?: string | undefined;
266
+ isActive?: boolean | undefined;
267
+ classroomId?: string | undefined;
268
+ }, {
269
+ page?: number | undefined;
270
+ limit?: number | undefined;
271
+ search?: string | undefined;
272
+ sortBy?: "fullName" | "nis" | undefined;
273
+ sortOrder?: "asc" | "desc" | undefined;
274
+ academicYearId?: string | undefined;
275
+ isActive?: "true" | "false" | undefined;
276
+ classroomId?: string | undefined;
277
+ }>;
278
+ export type StudentParams = z.infer<typeof studentParamsSchema>;
279
+ export type StudentListQuery = z.infer<typeof studentListQuerySchema>;
237
280
  export type Gender = z.infer<typeof genderEnum>;
238
281
  export type Student = z.infer<typeof studentSchema>;
239
282
  export type CreateStudentInput = z.infer<typeof createStudentSchema>;
@@ -54,9 +54,9 @@ export declare const userProfileSchema: z.ZodObject<{
54
54
  updatedAt: z.ZodString;
55
55
  }, "strip", z.ZodTypeAny, {
56
56
  id: string;
57
+ tenantId: string;
57
58
  createdAt: string;
58
59
  updatedAt: string;
59
- tenantId: string;
60
60
  isActive: boolean;
61
61
  username: string;
62
62
  email: string;
@@ -71,9 +71,9 @@ export declare const userProfileSchema: z.ZodObject<{
71
71
  }[] | undefined;
72
72
  }, {
73
73
  id: string;
74
+ tenantId: string;
74
75
  createdAt: string;
75
76
  updatedAt: string;
76
- tenantId: string;
77
77
  username: string;
78
78
  email: string;
79
79
  fullName: string;
@@ -147,8 +147,94 @@ export declare const assignUserRolesRequestSchema: z.ZodObject<{
147
147
  academicYearId: string;
148
148
  roleIds: string[];
149
149
  }>;
150
+ export declare const createTeacherSchema: z.ZodObject<{
151
+ username: z.ZodString;
152
+ email: z.ZodString;
153
+ password: z.ZodString;
154
+ fullName: z.ZodString;
155
+ nip: z.ZodNullable<z.ZodOptional<z.ZodString>>;
156
+ phoneNumber: z.ZodNullable<z.ZodOptional<z.ZodString>>;
157
+ roleIds: z.ZodArray<z.ZodString, "many">;
158
+ academicYearId: z.ZodString;
159
+ }, "strip", z.ZodTypeAny, {
160
+ academicYearId: string;
161
+ password: string;
162
+ username: string;
163
+ email: string;
164
+ fullName: string;
165
+ roleIds: string[];
166
+ nip?: string | null | undefined;
167
+ phoneNumber?: string | null | undefined;
168
+ }, {
169
+ academicYearId: string;
170
+ password: string;
171
+ username: string;
172
+ email: string;
173
+ fullName: string;
174
+ roleIds: string[];
175
+ nip?: string | null | undefined;
176
+ phoneNumber?: string | null | undefined;
177
+ }>;
178
+ export declare const updateTeacherSchema: z.ZodObject<{
179
+ username: z.ZodOptional<z.ZodString>;
180
+ email: z.ZodOptional<z.ZodString>;
181
+ password: z.ZodOptional<z.ZodString>;
182
+ fullName: z.ZodOptional<z.ZodString>;
183
+ nip: z.ZodNullable<z.ZodOptional<z.ZodString>>;
184
+ phoneNumber: z.ZodNullable<z.ZodOptional<z.ZodString>>;
185
+ isActive: z.ZodOptional<z.ZodBoolean>;
186
+ }, "strip", z.ZodTypeAny, {
187
+ isActive?: boolean | undefined;
188
+ password?: string | undefined;
189
+ username?: string | undefined;
190
+ email?: string | undefined;
191
+ fullName?: string | undefined;
192
+ nip?: string | null | undefined;
193
+ phoneNumber?: string | null | undefined;
194
+ }, {
195
+ isActive?: boolean | undefined;
196
+ password?: string | undefined;
197
+ username?: string | undefined;
198
+ email?: string | undefined;
199
+ fullName?: string | undefined;
200
+ nip?: string | null | undefined;
201
+ phoneNumber?: string | null | undefined;
202
+ }>;
203
+ export declare const teacherParamsSchema: z.ZodObject<{
204
+ id: z.ZodString;
205
+ }, "strip", z.ZodTypeAny, {
206
+ id: string;
207
+ }, {
208
+ id: string;
209
+ }>;
210
+ export declare const teacherListQuerySchema: z.ZodObject<{
211
+ roleId: z.ZodOptional<z.ZodString>;
212
+ academicYearId: z.ZodOptional<z.ZodString>;
213
+ isActive: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "true" | "false" | undefined>;
214
+ page: z.ZodDefault<z.ZodNumber>;
215
+ limit: z.ZodDefault<z.ZodNumber>;
216
+ search: z.ZodOptional<z.ZodString>;
217
+ }, "strip", z.ZodTypeAny, {
218
+ page: number;
219
+ limit: number;
220
+ search?: string | undefined;
221
+ roleId?: string | undefined;
222
+ academicYearId?: string | undefined;
223
+ isActive?: boolean | undefined;
224
+ }, {
225
+ page?: number | undefined;
226
+ limit?: number | undefined;
227
+ search?: string | undefined;
228
+ roleId?: string | undefined;
229
+ academicYearId?: string | undefined;
230
+ isActive?: "true" | "false" | undefined;
231
+ }>;
150
232
  export type User = z.infer<typeof userSchema>;
151
233
  export type UserProfile = z.infer<typeof userProfileSchema>;
152
234
  export type CreateUserInput = z.infer<typeof createUserSchema>;
153
235
  export type UpdateUserInput = z.infer<typeof updateUserSchema>;
154
236
  export type AssignUserRolesRequest = z.infer<typeof assignUserRolesRequestSchema>;
237
+ export type CreateTeacherInput = z.infer<typeof createTeacherSchema>;
238
+ export type UpdateTeacherInput = z.infer<typeof updateTeacherSchema>;
239
+ export type TeacherParams = z.infer<typeof teacherParamsSchema>;
240
+ export type TeacherListQuery = z.infer<typeof teacherListQuerySchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sekolaos/shared-schema",
3
- "version": "1.0.3",
3
+ "version": "1.1.1",
4
4
  "description": "Single source of truth untuk validasi skema data dan inferensi tipe TypeScript pada ekosistem Sekolaos (backend Express, kiosk presensi, dan modul lainnya).",
5
5
  "license": "ISC",
6
6
  "author": "Sekolaos",