@nyig/models 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.mts +467 -67
- package/index.d.ts +467 -67
- package/index.js +234 -204
- package/index.mjs +230 -204
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -40,7 +40,7 @@ var BookingType = /* @__PURE__ */ ((BookingType2) => {
|
|
|
40
40
|
})(BookingType || {});
|
|
41
41
|
|
|
42
42
|
// src/interface/booking/campBooking.ts
|
|
43
|
-
import { z as
|
|
43
|
+
import { z as z18 } from "zod";
|
|
44
44
|
|
|
45
45
|
// src/interface/tracking/attendState.ts
|
|
46
46
|
var AttendState = /* @__PURE__ */ ((AttendState2) => {
|
|
@@ -51,7 +51,7 @@ var AttendState = /* @__PURE__ */ ((AttendState2) => {
|
|
|
51
51
|
})(AttendState || {});
|
|
52
52
|
|
|
53
53
|
// src/interface/tracking/attendance.ts
|
|
54
|
-
import { z as
|
|
54
|
+
import { z as z10 } from "zod";
|
|
55
55
|
|
|
56
56
|
// src/interface/payment/tuition.ts
|
|
57
57
|
import { z as z3 } from "zod";
|
|
@@ -127,40 +127,42 @@ var GoRank = /* @__PURE__ */ ((GoRank2) => {
|
|
|
127
127
|
})(GoRank || {});
|
|
128
128
|
|
|
129
129
|
// src/interface/user/user.ts
|
|
130
|
-
import { z as
|
|
131
|
-
var zBUser = z5.object({
|
|
132
|
-
name: z5.string().min(2).max(100),
|
|
133
|
-
username: z5.string().optional(),
|
|
134
|
-
password: z5.string().optional(),
|
|
135
|
-
roles: z5.array(z5.number().int()).optional(),
|
|
136
|
-
email: z5.string().max(100).email().or(z5.literal("")).optional(),
|
|
137
|
-
address: z5.string().or(z5.literal("")).optional(),
|
|
138
|
-
country: z5.string().length(2, {
|
|
139
|
-
message: "Enter the 2-letter country code"
|
|
140
|
-
}).or(z5.literal("")).optional(),
|
|
141
|
-
phoneNumber: z5.string().regex(/^\d{10}/, {
|
|
142
|
-
message: `Please enter a valid 10-digit US phone number with numbers only`
|
|
143
|
-
}).or(z5.literal("")).optional(),
|
|
144
|
-
birthDate: z5.string().regex(/^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/, {
|
|
145
|
-
message: "Enter a valid date in yyyy-mm-dd format"
|
|
146
|
-
}).or(z5.literal("")).optional()
|
|
147
|
-
});
|
|
148
|
-
var zUser = addAutoProps(zBUser);
|
|
130
|
+
import { z as z6 } from "zod";
|
|
149
131
|
|
|
150
132
|
// src/interface/user/roles.ts
|
|
151
|
-
import { z as
|
|
133
|
+
import { z as z5 } from "zod";
|
|
152
134
|
var Role = /* @__PURE__ */ ((Role2) => {
|
|
153
135
|
Role2[Role2["SUPERADMIN"] = 7926] = "SUPERADMIN";
|
|
154
136
|
Role2[Role2["ADMIN"] = 2023] = "ADMIN";
|
|
155
137
|
Role2[Role2["USER"] = 2014] = "USER";
|
|
156
138
|
return Role2;
|
|
157
139
|
})(Role || {});
|
|
158
|
-
var zUserRoles =
|
|
159
|
-
user:
|
|
160
|
-
admin:
|
|
161
|
-
superadmin:
|
|
140
|
+
var zUserRoles = z5.object({
|
|
141
|
+
user: z5.number().int(),
|
|
142
|
+
admin: z5.number().int().optional(),
|
|
143
|
+
superadmin: z5.number().int().optional()
|
|
162
144
|
});
|
|
163
145
|
|
|
146
|
+
// src/interface/user/user.ts
|
|
147
|
+
var zBUser = z6.object({
|
|
148
|
+
name: z6.string().min(2).max(100),
|
|
149
|
+
username: z6.string().optional(),
|
|
150
|
+
password: z6.string().optional(),
|
|
151
|
+
roles: zUserRoles.optional(),
|
|
152
|
+
email: z6.string().max(100).email().or(z6.literal("")).optional(),
|
|
153
|
+
address: z6.string().or(z6.literal("")).optional(),
|
|
154
|
+
country: z6.string().length(2, {
|
|
155
|
+
message: "Enter the 2-letter country code"
|
|
156
|
+
}).or(z6.literal("")).optional(),
|
|
157
|
+
phoneNumber: z6.string().regex(/^\d{10}/, {
|
|
158
|
+
message: `Please enter a valid 10-digit US phone number with numbers only`
|
|
159
|
+
}).or(z6.literal("")).optional(),
|
|
160
|
+
birthDate: z6.string().regex(/^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/, {
|
|
161
|
+
message: "Enter a valid date in yyyy-mm-dd format"
|
|
162
|
+
}).or(z6.literal("")).optional()
|
|
163
|
+
});
|
|
164
|
+
var zUser = addAutoProps(zBUser);
|
|
165
|
+
|
|
164
166
|
// src/interface/user/student.ts
|
|
165
167
|
import { z as z7 } from "zod";
|
|
166
168
|
var zBStudent = zBUser.extend({
|
|
@@ -205,13 +207,33 @@ var zTeacherResponse = zTeacher.omit({ password: true, roles: true, editedBy: tr
|
|
|
205
207
|
role: z8.string()
|
|
206
208
|
});
|
|
207
209
|
|
|
210
|
+
// src/interface/user/auth.ts
|
|
211
|
+
import { z as z9 } from "zod";
|
|
212
|
+
var zCreateAdminAccountRequest = z9.object({
|
|
213
|
+
_id: z9.string(),
|
|
214
|
+
user: z9.string().min(3, "Username must be at least 3 characters"),
|
|
215
|
+
pwd: z9.string().min(6)
|
|
216
|
+
});
|
|
217
|
+
var zChangePasswordRequest = z9.object({
|
|
218
|
+
prev: z9.string().min(6),
|
|
219
|
+
next: z9.string().min(6)
|
|
220
|
+
});
|
|
221
|
+
var zLoginRequest = z9.object({
|
|
222
|
+
user: z9.string().min(3, "Username must be at least 3 characters"),
|
|
223
|
+
pwd: z9.string().min(6)
|
|
224
|
+
});
|
|
225
|
+
var zLoginResponse = z9.object({
|
|
226
|
+
user: z9.string(),
|
|
227
|
+
token: z9.string()
|
|
228
|
+
});
|
|
229
|
+
|
|
208
230
|
// src/interface/tracking/attendance.ts
|
|
209
|
-
var zBAttendance =
|
|
210
|
-
student:
|
|
211
|
-
states:
|
|
231
|
+
var zBAttendance = z10.object({
|
|
232
|
+
student: z10.string(),
|
|
233
|
+
states: z10.array(z10.nativeEnum(AttendState)),
|
|
212
234
|
tuition: zTuition,
|
|
213
|
-
paid:
|
|
214
|
-
campOption:
|
|
235
|
+
paid: z10.boolean().optional(),
|
|
236
|
+
campOption: z10.nativeEnum(CampOption).optional()
|
|
215
237
|
});
|
|
216
238
|
var zAttendance = addAutoProps(zBAttendance);
|
|
217
239
|
var zAttendanceResponse = zAttendance.extend({
|
|
@@ -219,30 +241,30 @@ var zAttendanceResponse = zAttendance.extend({
|
|
|
219
241
|
});
|
|
220
242
|
|
|
221
243
|
// src/interface/tracking/campTracker.ts
|
|
222
|
-
import { z as
|
|
223
|
-
var zBCampTracker =
|
|
224
|
-
course:
|
|
225
|
-
teacher:
|
|
226
|
-
semester:
|
|
244
|
+
import { z as z11 } from "zod";
|
|
245
|
+
var zBCampTracker = z11.object({
|
|
246
|
+
course: z11.string(),
|
|
247
|
+
teacher: z11.string(),
|
|
248
|
+
semester: z11.string(),
|
|
227
249
|
/**
|
|
228
250
|
* occurrences are tracked by week for camps
|
|
229
251
|
*/
|
|
230
|
-
occurrences:
|
|
252
|
+
occurrences: z11.array(z11.string()),
|
|
231
253
|
/**
|
|
232
254
|
* attendances are tracked by week for camps
|
|
233
255
|
*/
|
|
234
|
-
attendances:
|
|
235
|
-
publicDescription:
|
|
236
|
-
isNonPublic:
|
|
237
|
-
notes:
|
|
256
|
+
attendances: z11.array(z11.string()),
|
|
257
|
+
publicDescription: z11.string().optional(),
|
|
258
|
+
isNonPublic: z11.boolean().optional(),
|
|
259
|
+
notes: z11.string().optional()
|
|
238
260
|
});
|
|
239
261
|
var zCampTracker = addAutoProps(zBCampTracker);
|
|
240
262
|
|
|
241
263
|
// src/interface/tracking/classTracker.ts
|
|
242
|
-
import { z as
|
|
264
|
+
import { z as z14 } from "zod";
|
|
243
265
|
|
|
244
266
|
// src/interface/payment/invoice.ts
|
|
245
|
-
import { z as
|
|
267
|
+
import { z as z12 } from "zod";
|
|
246
268
|
|
|
247
269
|
// src/interface/payment/paymentMethod.ts
|
|
248
270
|
var PaymentMethod = /* @__PURE__ */ ((PaymentMethod2) => {
|
|
@@ -254,53 +276,53 @@ var PaymentMethod = /* @__PURE__ */ ((PaymentMethod2) => {
|
|
|
254
276
|
})(PaymentMethod || {});
|
|
255
277
|
|
|
256
278
|
// src/interface/payment/invoice.ts
|
|
257
|
-
var zDiscount =
|
|
258
|
-
desc:
|
|
259
|
-
amount:
|
|
279
|
+
var zDiscount = z12.object({
|
|
280
|
+
desc: z12.string().min(1, "Discount description cannot be empty"),
|
|
281
|
+
amount: z12.coerce.number()
|
|
260
282
|
});
|
|
261
|
-
var zInvoiceItem =
|
|
262
|
-
course:
|
|
263
|
-
price:
|
|
264
|
-
units:
|
|
283
|
+
var zInvoiceItem = z12.object({
|
|
284
|
+
course: z12.string().min(1, "Course description cannot be empty"),
|
|
285
|
+
price: z12.coerce.number(),
|
|
286
|
+
units: z12.coerce.number()
|
|
265
287
|
});
|
|
266
|
-
var zInvoicePackage =
|
|
267
|
-
student:
|
|
268
|
-
items:
|
|
288
|
+
var zInvoicePackage = z12.object({
|
|
289
|
+
student: z12.string(),
|
|
290
|
+
items: z12.array(zInvoiceItem).min(1, "Package must contain at least one item")
|
|
269
291
|
});
|
|
270
292
|
var zInvoicePackageResponse = zInvoicePackage.extend({
|
|
271
293
|
student: zStudent
|
|
272
294
|
});
|
|
273
|
-
var zBInvoice =
|
|
274
|
-
billTo:
|
|
275
|
-
packages:
|
|
276
|
-
discounts:
|
|
277
|
-
textbook:
|
|
278
|
-
shipping:
|
|
279
|
-
paid:
|
|
280
|
-
showEin:
|
|
281
|
-
notes:
|
|
282
|
-
createdBy:
|
|
283
|
-
lastEditBy:
|
|
295
|
+
var zBInvoice = z12.object({
|
|
296
|
+
billTo: z12.string().min(1, "The 'Bill To' field must not be empty"),
|
|
297
|
+
packages: z12.array(zInvoicePackage).min(1, "Invoice must include at least one package"),
|
|
298
|
+
discounts: z12.array(zDiscount),
|
|
299
|
+
textbook: z12.coerce.number().int().min(0).optional(),
|
|
300
|
+
shipping: z12.coerce.number().int().min(0).optional(),
|
|
301
|
+
paid: z12.nativeEnum(PaymentMethod).optional(),
|
|
302
|
+
showEin: z12.boolean().optional(),
|
|
303
|
+
notes: z12.string().or(z12.literal("")).optional(),
|
|
304
|
+
createdBy: z12.string(),
|
|
305
|
+
lastEditBy: z12.string().optional()
|
|
284
306
|
});
|
|
285
307
|
var zInvoice = addAutoProps(zBInvoice);
|
|
286
308
|
var zInvoiceResponse = zInvoice.extend({
|
|
287
309
|
createdBy: zTeacher,
|
|
288
310
|
lastEditBy: zTeacher.optional(),
|
|
289
|
-
packages:
|
|
311
|
+
packages: z12.array(zInvoicePackageResponse)
|
|
290
312
|
});
|
|
291
313
|
|
|
292
314
|
// src/interface/payment/teacherPayment.ts
|
|
293
|
-
import { z as
|
|
294
|
-
var zTeacherPaymentRow =
|
|
295
|
-
course:
|
|
296
|
-
length:
|
|
297
|
-
count:
|
|
298
|
-
wage:
|
|
315
|
+
import { z as z13 } from "zod";
|
|
316
|
+
var zTeacherPaymentRow = z13.object({
|
|
317
|
+
course: z13.string().min(1, "select or enter a course"),
|
|
318
|
+
length: z13.coerce.number().gt(0, "must be > 0"),
|
|
319
|
+
count: z13.coerce.number().int().gt(0, "must be > 0"),
|
|
320
|
+
wage: z13.coerce.number().gt(0, "wage must be > 0")
|
|
299
321
|
});
|
|
300
|
-
var zBTeacherPayment =
|
|
301
|
-
teacher:
|
|
302
|
-
rows:
|
|
303
|
-
paid:
|
|
322
|
+
var zBTeacherPayment = z13.object({
|
|
323
|
+
teacher: z13.string().min(1, "select or enter a teacher"),
|
|
324
|
+
rows: z13.array(zTeacherPaymentRow),
|
|
325
|
+
paid: z13.boolean().optional()
|
|
304
326
|
});
|
|
305
327
|
var zTeacherPayment = addAutoProps(zBTeacherPayment);
|
|
306
328
|
var zTeacherPaymentResponse = zTeacherPayment.extend({
|
|
@@ -308,32 +330,32 @@ var zTeacherPaymentResponse = zTeacherPayment.extend({
|
|
|
308
330
|
});
|
|
309
331
|
|
|
310
332
|
// src/interface/tracking/classTracker.ts
|
|
311
|
-
var zBClassTracker =
|
|
312
|
-
course:
|
|
313
|
-
teacher:
|
|
314
|
-
student:
|
|
315
|
-
classTimes:
|
|
316
|
-
completedList:
|
|
333
|
+
var zBClassTracker = z14.object({
|
|
334
|
+
course: z14.string(),
|
|
335
|
+
teacher: z14.string(),
|
|
336
|
+
student: z14.string(),
|
|
337
|
+
classTimes: z14.array(z14.coerce.date()),
|
|
338
|
+
completedList: z14.array(z14.boolean()),
|
|
317
339
|
/**
|
|
318
340
|
* Virtual mongoose field when all values in completedList is true
|
|
319
341
|
*/
|
|
320
|
-
completed:
|
|
342
|
+
completed: z14.boolean().optional(),
|
|
321
343
|
tuition: zTuition.optional(),
|
|
322
|
-
paid:
|
|
323
|
-
paused:
|
|
324
|
-
notes:
|
|
344
|
+
paid: z14.boolean().optional(),
|
|
345
|
+
paused: z14.boolean().optional(),
|
|
346
|
+
notes: z14.string().optional()
|
|
325
347
|
});
|
|
326
348
|
var zClassTracker = addAutoProps(zBClassTracker);
|
|
327
349
|
|
|
328
350
|
// src/interface/tracking/groupTracker.ts
|
|
329
|
-
import { z as
|
|
351
|
+
import { z as z17 } from "zod";
|
|
330
352
|
|
|
331
353
|
// src/interface/tracking/scheduleData.ts
|
|
332
|
-
import { z as
|
|
333
|
-
var zScheduleData =
|
|
334
|
-
startTime:
|
|
354
|
+
import { z as z15 } from "zod";
|
|
355
|
+
var zScheduleData = z15.object({
|
|
356
|
+
startTime: z15.string(),
|
|
335
357
|
// String in 24 hour "HH:mm" format
|
|
336
|
-
dayOfWeek:
|
|
358
|
+
dayOfWeek: z15.number().int().min(0).max(6)
|
|
337
359
|
// integeters in 0 - 6
|
|
338
360
|
});
|
|
339
361
|
|
|
@@ -362,126 +384,126 @@ var NYIGSchool = /* @__PURE__ */ ((NYIGSchool2) => {
|
|
|
362
384
|
})(NYIGSchool || {});
|
|
363
385
|
|
|
364
386
|
// src/interface/course/course.ts
|
|
365
|
-
import { z as
|
|
366
|
-
var zBCourse =
|
|
367
|
-
name:
|
|
368
|
-
category:
|
|
387
|
+
import { z as z16 } from "zod";
|
|
388
|
+
var zBCourse = z16.object({
|
|
389
|
+
name: z16.string(),
|
|
390
|
+
category: z16.nativeEnum(CourseCategory),
|
|
369
391
|
/**
|
|
370
392
|
* @unit SECONDS - Duration of the course in seconds
|
|
371
393
|
*/
|
|
372
|
-
duration:
|
|
394
|
+
duration: z16.coerce.number().int("Duration in seconds must be a whole number").min(1, "Duration in seconds must not be less than or equal to 0"),
|
|
373
395
|
/**
|
|
374
396
|
* @unit CENTS - Price of the course in cents
|
|
375
397
|
*/
|
|
376
|
-
price:
|
|
377
|
-
description:
|
|
398
|
+
price: z16.coerce.number().int("Tuition must be a whole number in cents").min(1, "Tuition must not be less than or equal to 0"),
|
|
399
|
+
description: z16.string().or(z16.literal("")).optional(),
|
|
378
400
|
/**
|
|
379
401
|
* NYIG School locations
|
|
380
402
|
*/
|
|
381
|
-
nyigSchool:
|
|
403
|
+
nyigSchool: z16.nativeEnum(NYIGSchool),
|
|
382
404
|
/**
|
|
383
405
|
* Recommended level before taking this course
|
|
384
406
|
*/
|
|
385
|
-
recLevel:
|
|
407
|
+
recLevel: z16.string().or(z16.literal("")).optional(),
|
|
386
408
|
/**
|
|
387
409
|
* Camp tuition for half-day option
|
|
388
410
|
*/
|
|
389
|
-
halfCampTuition:
|
|
411
|
+
halfCampTuition: z16.coerce.number().int("Tuition must be a whole number in cents").min(1, "Tuition must not be less than or equal to 0").optional(),
|
|
390
412
|
/**
|
|
391
413
|
* Camp tuition for full-day option
|
|
392
414
|
*/
|
|
393
|
-
fullCampTuition:
|
|
415
|
+
fullCampTuition: z16.coerce.number().int("Tuition must be a whole number in cents").min(1, "Tuition must not be less than or equal to 0").optional()
|
|
394
416
|
});
|
|
395
417
|
var zCourse = addAutoProps(zBCourse);
|
|
396
418
|
|
|
397
419
|
// src/interface/tracking/groupTracker.ts
|
|
398
|
-
var zBGroupTracker =
|
|
399
|
-
course:
|
|
400
|
-
teacher:
|
|
401
|
-
semester:
|
|
420
|
+
var zBGroupTracker = z17.object({
|
|
421
|
+
course: z17.string(),
|
|
422
|
+
teacher: z17.string(),
|
|
423
|
+
semester: z17.string(),
|
|
402
424
|
scheduleData: zScheduleData,
|
|
403
425
|
/**
|
|
404
426
|
* occurrences are tracked by week for Groups
|
|
405
427
|
*/
|
|
406
|
-
occurrences:
|
|
428
|
+
occurrences: z17.array(z17.coerce.date()),
|
|
407
429
|
/**
|
|
408
430
|
* attendances are tracked by week for Groups
|
|
409
431
|
*/
|
|
410
|
-
attendances:
|
|
432
|
+
attendances: z17.array(z17.string()),
|
|
411
433
|
/**
|
|
412
434
|
* public-facing ID of the course instance, e.g., 101
|
|
413
435
|
*/
|
|
414
|
-
courseId:
|
|
436
|
+
courseId: z17.string().optional(),
|
|
415
437
|
/**
|
|
416
438
|
* Age group of the class instance, e.g. "adult", "youth"
|
|
417
439
|
*/
|
|
418
|
-
ageGroup:
|
|
440
|
+
ageGroup: z17.nativeEnum(AgeGroup).optional(),
|
|
419
441
|
/**
|
|
420
442
|
* If true, the course is hidden from public view
|
|
421
443
|
*/
|
|
422
|
-
isNonPublic:
|
|
423
|
-
notes:
|
|
444
|
+
isNonPublic: z17.boolean().optional(),
|
|
445
|
+
notes: z17.string().optional()
|
|
424
446
|
});
|
|
425
447
|
var zGroupTracker = addAutoProps(zBGroupTracker);
|
|
426
448
|
|
|
427
449
|
// src/interface/booking/campBooking.ts
|
|
428
|
-
var zBCampBooking =
|
|
429
|
-
ctId:
|
|
430
|
-
isOnline:
|
|
431
|
-
classDates:
|
|
432
|
-
campOption:
|
|
433
|
-
shipping:
|
|
450
|
+
var zBCampBooking = z18.object({
|
|
451
|
+
ctId: z18.string().optional(),
|
|
452
|
+
isOnline: z18.boolean(),
|
|
453
|
+
classDates: z18.string(),
|
|
454
|
+
campOption: z18.nativeEnum(CampOption),
|
|
455
|
+
shipping: z18.boolean().optional()
|
|
434
456
|
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
435
457
|
var zCampBooking = addAutoProps(zBCampBooking);
|
|
436
458
|
|
|
437
459
|
// src/interface/booking/groupBooking.ts
|
|
438
|
-
import { z as
|
|
439
|
-
var zBGroupBooking =
|
|
440
|
-
gtId:
|
|
441
|
-
isTrial:
|
|
442
|
-
isOnline:
|
|
443
|
-
classDate:
|
|
444
|
-
shipping:
|
|
460
|
+
import { z as z19 } from "zod";
|
|
461
|
+
var zBGroupBooking = z19.object({
|
|
462
|
+
gtId: z19.string().optional(),
|
|
463
|
+
isTrial: z19.boolean().optional(),
|
|
464
|
+
isOnline: z19.boolean(),
|
|
465
|
+
classDate: z19.string().optional(),
|
|
466
|
+
shipping: z19.boolean().optional()
|
|
445
467
|
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
446
468
|
var zGroupBooking = addAutoProps(zBGroupBooking);
|
|
447
469
|
|
|
448
470
|
// src/interface/booking/privateBooking.ts
|
|
449
|
-
import { z as
|
|
450
|
-
var zBPrivateBooking =
|
|
451
|
-
courseId:
|
|
452
|
-
teacherId:
|
|
453
|
-
classDate:
|
|
471
|
+
import { z as z20 } from "zod";
|
|
472
|
+
var zBPrivateBooking = z20.object({
|
|
473
|
+
courseId: z20.string(),
|
|
474
|
+
teacherId: z20.string(),
|
|
475
|
+
classDate: z20.string().optional()
|
|
454
476
|
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
455
477
|
var zPrivateBooking = addAutoProps(zBPrivateBooking);
|
|
456
478
|
|
|
457
479
|
// src/interface/public/aurora.ts
|
|
458
|
-
import { z as
|
|
459
|
-
var zTeacherDisplay =
|
|
460
|
-
name:
|
|
461
|
-
email:
|
|
462
|
-
title:
|
|
463
|
-
imageUrl:
|
|
464
|
-
bio:
|
|
465
|
-
});
|
|
466
|
-
var zCourseTable =
|
|
467
|
-
id:
|
|
468
|
-
name:
|
|
469
|
-
duration:
|
|
470
|
-
dateAndTime:
|
|
471
|
-
recommendedLevel:
|
|
472
|
-
tuition:
|
|
480
|
+
import { z as z21 } from "zod";
|
|
481
|
+
var zTeacherDisplay = z21.object({
|
|
482
|
+
name: z21.string(),
|
|
483
|
+
email: z21.string().email(),
|
|
484
|
+
title: z21.string(),
|
|
485
|
+
imageUrl: z21.string(),
|
|
486
|
+
bio: z21.string()
|
|
487
|
+
});
|
|
488
|
+
var zCourseTable = z21.object({
|
|
489
|
+
id: z21.string(),
|
|
490
|
+
name: z21.string(),
|
|
491
|
+
duration: z21.number(),
|
|
492
|
+
dateAndTime: z21.string(),
|
|
493
|
+
recommendedLevel: z21.string(),
|
|
494
|
+
tuition: z21.string()
|
|
473
495
|
});
|
|
474
496
|
|
|
475
497
|
// src/interface/public/imageDef.ts
|
|
476
|
-
import { z as
|
|
477
|
-
var zImageDef =
|
|
478
|
-
url:
|
|
479
|
-
height:
|
|
480
|
-
width:
|
|
498
|
+
import { z as z22 } from "zod";
|
|
499
|
+
var zImageDef = z22.object({
|
|
500
|
+
url: z22.string(),
|
|
501
|
+
height: z22.number(),
|
|
502
|
+
width: z22.number()
|
|
481
503
|
});
|
|
482
504
|
|
|
483
505
|
// src/interface/reporting/reportTicket.ts
|
|
484
|
-
import { z as
|
|
506
|
+
import { z as z23 } from "zod";
|
|
485
507
|
|
|
486
508
|
// src/interface/reporting/ticketStatus.ts
|
|
487
509
|
var TicketStatus = /* @__PURE__ */ ((TicketStatus2) => {
|
|
@@ -493,12 +515,12 @@ var TicketStatus = /* @__PURE__ */ ((TicketStatus2) => {
|
|
|
493
515
|
})(TicketStatus || {});
|
|
494
516
|
|
|
495
517
|
// src/interface/reporting/reportTicket.ts
|
|
496
|
-
var zBReportTicket =
|
|
497
|
-
requester:
|
|
498
|
-
resolver:
|
|
499
|
-
status:
|
|
500
|
-
title:
|
|
501
|
-
description:
|
|
518
|
+
var zBReportTicket = z23.object({
|
|
519
|
+
requester: z23.string(),
|
|
520
|
+
resolver: z23.string().optional(),
|
|
521
|
+
status: z23.nativeEnum(TicketStatus),
|
|
522
|
+
title: z23.string(),
|
|
523
|
+
description: z23.string()
|
|
502
524
|
});
|
|
503
525
|
var zReportTicket = addAutoProps(zBReportTicket);
|
|
504
526
|
var zReportTicketResponse = zReportTicket.extend({
|
|
@@ -515,96 +537,96 @@ var Season = /* @__PURE__ */ ((Season2) => {
|
|
|
515
537
|
})(Season || {});
|
|
516
538
|
|
|
517
539
|
// src/interface/semester/semester.ts
|
|
518
|
-
import { z as
|
|
519
|
-
var zBSemester =
|
|
520
|
-
season:
|
|
521
|
-
year:
|
|
522
|
-
startDate:
|
|
523
|
-
endDate:
|
|
540
|
+
import { z as z24 } from "zod";
|
|
541
|
+
var zBSemester = z24.object({
|
|
542
|
+
season: z24.nativeEnum(Season),
|
|
543
|
+
year: z24.number().min(2022).max(2999),
|
|
544
|
+
startDate: z24.coerce.date(),
|
|
545
|
+
endDate: z24.coerce.date(),
|
|
524
546
|
/**
|
|
525
547
|
* Format: start, end, start, end, ...
|
|
526
548
|
*/
|
|
527
|
-
blackoutDates:
|
|
549
|
+
blackoutDates: z24.array(z24.coerce.date()),
|
|
528
550
|
/**
|
|
529
551
|
* List of names of some break: date range
|
|
530
552
|
*/
|
|
531
|
-
importantDates:
|
|
553
|
+
importantDates: z24.array(z24.string())
|
|
532
554
|
});
|
|
533
555
|
var zSemester = addAutoProps(zBSemester);
|
|
534
556
|
|
|
535
557
|
// src/interface/event/eConfig.ts
|
|
536
|
-
import { z as
|
|
558
|
+
import { z as z27 } from "zod";
|
|
537
559
|
|
|
538
560
|
// src/interface/event/eTicket.ts
|
|
539
|
-
import { z as
|
|
540
|
-
var zBEventTicket =
|
|
541
|
-
name:
|
|
561
|
+
import { z as z25 } from "zod";
|
|
562
|
+
var zBEventTicket = z25.object({
|
|
563
|
+
name: z25.string().min(5, "Name must be at least 5 characters"),
|
|
542
564
|
/**
|
|
543
565
|
* Price in cents
|
|
544
566
|
*/
|
|
545
|
-
price:
|
|
567
|
+
price: z25.number().min(1, "Price must be at least $1"),
|
|
546
568
|
/**
|
|
547
569
|
* @optional description of the ticket
|
|
548
570
|
*/
|
|
549
|
-
description:
|
|
571
|
+
description: z25.string().optional(),
|
|
550
572
|
/**
|
|
551
573
|
* @optional The ticket cannot be purchased if true
|
|
552
574
|
*/
|
|
553
|
-
isNotBuyable:
|
|
575
|
+
isNotBuyable: z25.boolean().optional(),
|
|
554
576
|
/**
|
|
555
577
|
* @optional If date is provided and in the past, ticket cannot be purchased
|
|
556
578
|
*/
|
|
557
|
-
lastBuyableDate:
|
|
579
|
+
lastBuyableDate: z25.coerce.date().optional()
|
|
558
580
|
});
|
|
559
581
|
var zEventTicket = addAutoProps(zBEventTicket);
|
|
560
582
|
|
|
561
583
|
// src/interface/event/table.ts
|
|
562
|
-
import { z as
|
|
563
|
-
var zTable =
|
|
564
|
-
var zDetailsTable =
|
|
565
|
-
fields:
|
|
584
|
+
import { z as z26 } from "zod";
|
|
585
|
+
var zTable = z26.array(z26.record(z26.string(), z26.string()));
|
|
586
|
+
var zDetailsTable = z26.object({
|
|
587
|
+
fields: z26.array(z26.string()).length(2),
|
|
566
588
|
data: zTable
|
|
567
589
|
});
|
|
568
|
-
var zScheduleTable =
|
|
569
|
-
fields:
|
|
570
|
-
data:
|
|
590
|
+
var zScheduleTable = z26.object({
|
|
591
|
+
fields: z26.array(z26.string()).length(2),
|
|
592
|
+
data: z26.record(z26.string(), zTable)
|
|
571
593
|
});
|
|
572
594
|
|
|
573
595
|
// src/interface/event/eConfig.ts
|
|
574
|
-
var zBEventConfig =
|
|
596
|
+
var zBEventConfig = z27.object({
|
|
575
597
|
/**
|
|
576
598
|
* Location of the event
|
|
577
599
|
*/
|
|
578
|
-
location:
|
|
600
|
+
location: z27.string().optional(),
|
|
579
601
|
/**
|
|
580
602
|
* URL of the tournament on the official website
|
|
581
603
|
* Must be a valid URL link
|
|
582
604
|
*/
|
|
583
|
-
url:
|
|
605
|
+
url: z27.string(),
|
|
584
606
|
/**
|
|
585
607
|
* Full name of the tournament
|
|
586
608
|
*/
|
|
587
|
-
title:
|
|
609
|
+
title: z27.string(),
|
|
588
610
|
/**
|
|
589
611
|
* Abbreviated title of the tournament
|
|
590
612
|
*/
|
|
591
|
-
shortTitle:
|
|
613
|
+
shortTitle: z27.string(),
|
|
592
614
|
/**
|
|
593
615
|
* Tournament start date and time
|
|
594
616
|
*/
|
|
595
|
-
tStart:
|
|
617
|
+
tStart: z27.coerce.date(),
|
|
596
618
|
/**
|
|
597
619
|
* Tournament end date and time
|
|
598
620
|
*/
|
|
599
|
-
tEnd:
|
|
621
|
+
tEnd: z27.coerce.date(),
|
|
600
622
|
/**
|
|
601
623
|
* Short description for tournament card
|
|
602
624
|
*/
|
|
603
|
-
shortDescription:
|
|
625
|
+
shortDescription: z27.string(),
|
|
604
626
|
/**
|
|
605
627
|
* Full description
|
|
606
628
|
*/
|
|
607
|
-
description:
|
|
629
|
+
description: z27.string(),
|
|
608
630
|
/**
|
|
609
631
|
* Defines the tournament details table with 2 columns
|
|
610
632
|
* typically Time and Event
|
|
@@ -618,15 +640,15 @@ var zBEventConfig = z26.object({
|
|
|
618
640
|
/**
|
|
619
641
|
* List of ticket object IDs for this tournament
|
|
620
642
|
*/
|
|
621
|
-
tickets:
|
|
643
|
+
tickets: z27.array(z27.string()),
|
|
622
644
|
/**
|
|
623
645
|
* If false, the tournament registration is closed
|
|
624
646
|
*/
|
|
625
|
-
canRegister:
|
|
647
|
+
canRegister: z27.boolean(),
|
|
626
648
|
/**
|
|
627
649
|
* If true, free form donation amounts are disabled.
|
|
628
650
|
*/
|
|
629
|
-
donationsDisabled:
|
|
651
|
+
donationsDisabled: z27.boolean().optional(),
|
|
630
652
|
/**
|
|
631
653
|
* Defines URL, height, width of the image
|
|
632
654
|
*/
|
|
@@ -634,42 +656,42 @@ var zBEventConfig = z26.object({
|
|
|
634
656
|
});
|
|
635
657
|
var zEventConfig = addAutoProps(zBEventConfig);
|
|
636
658
|
var zEventConfigResponse = zEventConfig.extend({
|
|
637
|
-
tickets:
|
|
659
|
+
tickets: z27.array(zEventTicket)
|
|
638
660
|
});
|
|
639
661
|
|
|
640
662
|
// src/interface/event/eReg.ts
|
|
641
|
-
import { z as
|
|
663
|
+
import { z as z29 } from "zod";
|
|
642
664
|
|
|
643
665
|
// src/interface/event/eTicketReg.ts
|
|
644
|
-
import { z as
|
|
645
|
-
var zEventTicketReg =
|
|
646
|
-
ticket:
|
|
666
|
+
import { z as z28 } from "zod";
|
|
667
|
+
var zEventTicketReg = z28.object({
|
|
668
|
+
ticket: z28.string(),
|
|
647
669
|
/**
|
|
648
670
|
* integer minimum 1, otherwise no ticket is being bought
|
|
649
671
|
*/
|
|
650
|
-
amount:
|
|
672
|
+
amount: z28.number().int().min(1)
|
|
651
673
|
});
|
|
652
674
|
var zEventTicketRegResponse = zEventTicketReg.extend({
|
|
653
675
|
ticket: zEventTicket
|
|
654
676
|
});
|
|
655
677
|
|
|
656
678
|
// src/interface/event/eReg.ts
|
|
657
|
-
var zBEventReg =
|
|
658
|
-
agaId:
|
|
659
|
-
tournamentId:
|
|
660
|
-
tickets:
|
|
679
|
+
var zBEventReg = z29.object({
|
|
680
|
+
agaId: z29.string(),
|
|
681
|
+
tournamentId: z29.string(),
|
|
682
|
+
tickets: z29.array(zEventTicketReg),
|
|
661
683
|
/**
|
|
662
684
|
* @units CENTS - Donation in cents
|
|
663
685
|
*/
|
|
664
|
-
donation:
|
|
686
|
+
donation: z29.coerce.number().optional(),
|
|
665
687
|
/**
|
|
666
688
|
* How the registration was created, through public endpoint or admin
|
|
667
689
|
*/
|
|
668
|
-
createMethod:
|
|
690
|
+
createMethod: z29.string().optional()
|
|
669
691
|
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
670
692
|
var zEventReg = addAutoProps(zBEventReg);
|
|
671
693
|
var zEventRegResponse = zEventReg.extend({
|
|
672
|
-
tickets:
|
|
694
|
+
tickets: z29.array(zEventTicketRegResponse)
|
|
673
695
|
});
|
|
674
696
|
export {
|
|
675
697
|
AgeGroup,
|
|
@@ -707,9 +729,11 @@ export {
|
|
|
707
729
|
zBUserInfo,
|
|
708
730
|
zCampBooking,
|
|
709
731
|
zCampTracker,
|
|
732
|
+
zChangePasswordRequest,
|
|
710
733
|
zClassTracker,
|
|
711
734
|
zCourse,
|
|
712
735
|
zCourseTable,
|
|
736
|
+
zCreateAdminAccountRequest,
|
|
713
737
|
zDetailsTable,
|
|
714
738
|
zDiscount,
|
|
715
739
|
zEventConfig,
|
|
@@ -727,6 +751,8 @@ export {
|
|
|
727
751
|
zInvoicePackage,
|
|
728
752
|
zInvoicePackageResponse,
|
|
729
753
|
zInvoiceResponse,
|
|
754
|
+
zLoginRequest,
|
|
755
|
+
zLoginResponse,
|
|
730
756
|
zPrivateBooking,
|
|
731
757
|
zReportTicket,
|
|
732
758
|
zReportTicketResponse,
|