@nyig/models 0.5.4 → 0.5.6
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 +498 -5355
- package/index.d.ts +498 -5355
- package/index.js +261 -230
- package/index.mjs +259 -230
- package/package.json +5 -5
package/index.mjs
CHANGED
|
@@ -46,6 +46,7 @@ var zBUserInfo = z2.object({
|
|
|
46
46
|
hearAboutUsDetails: z2.string().optional(),
|
|
47
47
|
// show/hide on Aurora event page "who is coming" list
|
|
48
48
|
showOnWhoIsComing: z2.boolean().optional(),
|
|
49
|
+
participateAs: z2.enum(["adult", "youth"]).optional(),
|
|
49
50
|
// Required for youth tournaments
|
|
50
51
|
dateOfBirth: z2.string().optional()
|
|
51
52
|
});
|
|
@@ -60,7 +61,7 @@ var BookingType = /* @__PURE__ */ ((BookingType2) => {
|
|
|
60
61
|
})(BookingType || {});
|
|
61
62
|
|
|
62
63
|
// src/interface/booking/campBooking.ts
|
|
63
|
-
import { z as
|
|
64
|
+
import { z as z20 } from "zod";
|
|
64
65
|
|
|
65
66
|
// src/interface/tracking/attendState.ts
|
|
66
67
|
var AttendState = /* @__PURE__ */ ((AttendState2) => {
|
|
@@ -71,7 +72,7 @@ var AttendState = /* @__PURE__ */ ((AttendState2) => {
|
|
|
71
72
|
})(AttendState || {});
|
|
72
73
|
|
|
73
74
|
// src/interface/tracking/attendance.ts
|
|
74
|
-
import { z as
|
|
75
|
+
import { z as z11 } from "zod";
|
|
75
76
|
|
|
76
77
|
// src/interface/payment/tuition.ts
|
|
77
78
|
import { z as z3 } from "zod";
|
|
@@ -188,43 +189,69 @@ var zBUser = z6.object({
|
|
|
188
189
|
/**
|
|
189
190
|
* For prompting the user to change their password on first login
|
|
190
191
|
*/
|
|
191
|
-
shouldChangePassword: z6.boolean().optional()
|
|
192
|
+
shouldChangePassword: z6.boolean().optional(),
|
|
193
|
+
/**
|
|
194
|
+
* Object storing user preferences
|
|
195
|
+
*/
|
|
196
|
+
info: z6.string().optional()
|
|
192
197
|
});
|
|
193
198
|
var zUser = addAutoProps(zBUser);
|
|
194
199
|
|
|
195
|
-
// src/interface/user/
|
|
200
|
+
// src/interface/user/userInfo.ts
|
|
196
201
|
import { z as z7 } from "zod";
|
|
202
|
+
var zBUserProfile = z7.object({
|
|
203
|
+
firstName: z7.string().min(2).max(50).or(z7.literal("")).optional(),
|
|
204
|
+
lastName: z7.string().min(2).max(50).or(z7.literal("")).optional(),
|
|
205
|
+
address: z7.string().or(z7.literal("")).optional(),
|
|
206
|
+
rank: z7.enum(GoRank).optional(),
|
|
207
|
+
agaId: z7.string().regex(/^\d{4,5}$/, {
|
|
208
|
+
message: `Please enter a valid AGA ID`
|
|
209
|
+
}).or(z7.literal("")).optional(),
|
|
210
|
+
participateAs: z7.enum(["adult", "youth"]).optional(),
|
|
211
|
+
showOnWhoIsComing: z7.boolean().optional(),
|
|
212
|
+
preferredEmail: z7.email().optional(),
|
|
213
|
+
phoneNumber: z7.string().regex(/^\d{10}/, {
|
|
214
|
+
message: `Please enter a valid 10-digit US phone number with numbers only`
|
|
215
|
+
}).or(z7.literal("")).optional(),
|
|
216
|
+
birthDate: z7.string().regex(/^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/, {
|
|
217
|
+
message: "Enter a valid date in yyyy-mm-dd format"
|
|
218
|
+
}).or(z7.literal("")).optional()
|
|
219
|
+
});
|
|
220
|
+
var zUserProfile = addAutoProps(zBUserProfile);
|
|
221
|
+
|
|
222
|
+
// src/interface/user/student.ts
|
|
223
|
+
import { z as z8 } from "zod";
|
|
197
224
|
var zBStudent = zBUser.extend({
|
|
198
|
-
rank:
|
|
199
|
-
guardian:
|
|
225
|
+
rank: z8.nativeEnum(GoRank),
|
|
226
|
+
guardian: z8.string().optional()
|
|
200
227
|
});
|
|
201
228
|
var zStudent = addAutoProps(zBStudent);
|
|
202
229
|
|
|
203
230
|
// src/interface/user/teacher.ts
|
|
204
|
-
import { z as
|
|
231
|
+
import { z as z9 } from "zod";
|
|
205
232
|
var zBTeacher = zBUser.extend({
|
|
206
|
-
rank:
|
|
233
|
+
rank: z9.nativeEnum(GoRank),
|
|
207
234
|
/**
|
|
208
235
|
* Inactive teachers are not shown on public endpoints
|
|
209
236
|
*/
|
|
210
|
-
isInactive:
|
|
237
|
+
isInactive: z9.boolean().optional(),
|
|
211
238
|
/**
|
|
212
239
|
* If true, teacher is never available for booking
|
|
213
240
|
*/
|
|
214
|
-
doesNotTeachPrivateLessons:
|
|
241
|
+
doesNotTeachPrivateLessons: z9.boolean().optional(),
|
|
215
242
|
/**
|
|
216
243
|
* Teacher's position, e.g., instructor, president
|
|
217
244
|
*/
|
|
218
|
-
title:
|
|
245
|
+
title: z9.string().optional(),
|
|
219
246
|
/**
|
|
220
247
|
* Teacher's bio text describing experience
|
|
221
248
|
* new lines will be rendered as paragraphs
|
|
222
249
|
*/
|
|
223
|
-
bio:
|
|
250
|
+
bio: z9.string().optional(),
|
|
224
251
|
/**
|
|
225
252
|
* Permanent URL of the image
|
|
226
253
|
*/
|
|
227
|
-
imageUrl:
|
|
254
|
+
imageUrl: z9.string().optional(),
|
|
228
255
|
/** Format is illustrated below, where teacher is available
|
|
229
256
|
* Mon 9-12am 3-6pm & Tue 10-12am 6-10pm
|
|
230
257
|
* [
|
|
@@ -237,54 +264,54 @@ var zBTeacher = zBUser.extend({
|
|
|
237
264
|
* [],
|
|
238
265
|
* ]
|
|
239
266
|
*/
|
|
240
|
-
available:
|
|
267
|
+
available: z9.array(z9.array(z9.array(z9.number()))).optional()
|
|
241
268
|
});
|
|
242
269
|
var zTeacher = addAutoProps(zBTeacher);
|
|
243
270
|
var zTeacherResponse = zTeacher.omit({ password: true, roles: true, editedBy: true, updatedAt: true, createdAt: true }).extend({
|
|
244
|
-
role:
|
|
271
|
+
role: z9.number().int()
|
|
245
272
|
});
|
|
246
273
|
|
|
247
274
|
// src/interface/user/auth.ts
|
|
248
|
-
import { z as
|
|
249
|
-
var zCreateAdminAccountRequest =
|
|
250
|
-
_id:
|
|
251
|
-
user:
|
|
252
|
-
pwd:
|
|
275
|
+
import { z as z10 } from "zod";
|
|
276
|
+
var zCreateAdminAccountRequest = z10.object({
|
|
277
|
+
_id: z10.string(),
|
|
278
|
+
user: z10.string().min(3, "Username must be at least 3 characters"),
|
|
279
|
+
pwd: z10.string().min(6)
|
|
253
280
|
});
|
|
254
|
-
var zChangePasswordRequest =
|
|
255
|
-
prev:
|
|
256
|
-
next:
|
|
281
|
+
var zChangePasswordRequest = z10.object({
|
|
282
|
+
prev: z10.string().min(6),
|
|
283
|
+
next: z10.string().min(6)
|
|
257
284
|
});
|
|
258
|
-
var zLoginRequest =
|
|
259
|
-
user:
|
|
260
|
-
pwd:
|
|
285
|
+
var zLoginRequest = z10.object({
|
|
286
|
+
user: z10.string().min(3, "Username must be at least 3 characters"),
|
|
287
|
+
pwd: z10.string().min(6)
|
|
261
288
|
});
|
|
262
|
-
var zLoginResponse =
|
|
263
|
-
user:
|
|
264
|
-
token:
|
|
289
|
+
var zLoginResponse = z10.object({
|
|
290
|
+
user: z10.string(),
|
|
291
|
+
token: z10.string()
|
|
265
292
|
});
|
|
266
293
|
|
|
267
294
|
// src/interface/tracking/attendance.ts
|
|
268
|
-
var zBAttendance =
|
|
269
|
-
student:
|
|
270
|
-
states:
|
|
295
|
+
var zBAttendance = z11.object({
|
|
296
|
+
student: z11.string(),
|
|
297
|
+
states: z11.array(z11.nativeEnum(AttendState)),
|
|
271
298
|
/**
|
|
272
299
|
* @deprecated This field is no longer used
|
|
273
300
|
*/
|
|
274
301
|
tuition: zTuition.optional(),
|
|
275
|
-
paid:
|
|
276
|
-
campOption:
|
|
302
|
+
paid: z11.boolean().optional(),
|
|
303
|
+
campOption: z11.nativeEnum(CampOption).optional()
|
|
277
304
|
});
|
|
278
305
|
var zAttendance = addAutoProps(zBAttendance);
|
|
279
306
|
var zAttendanceRequest = zAttendance.extend({
|
|
280
|
-
_id:
|
|
307
|
+
_id: z11.string().optional()
|
|
281
308
|
});
|
|
282
309
|
var zAttendanceResponse = zAttendance.extend({
|
|
283
310
|
student: zStudent
|
|
284
311
|
});
|
|
285
312
|
|
|
286
313
|
// src/interface/tracking/campTracker.ts
|
|
287
|
-
import { z as
|
|
314
|
+
import { z as z14 } from "zod";
|
|
288
315
|
|
|
289
316
|
// src/interface/course/ageGroup.ts
|
|
290
317
|
var AgeGroup = /* @__PURE__ */ ((AgeGroup2) => {
|
|
@@ -312,36 +339,36 @@ var NYIGSchool = /* @__PURE__ */ ((NYIGSchool2) => {
|
|
|
312
339
|
})(NYIGSchool || {});
|
|
313
340
|
|
|
314
341
|
// src/interface/course/course.ts
|
|
315
|
-
import { z as
|
|
316
|
-
var zBCourse =
|
|
317
|
-
name:
|
|
318
|
-
category:
|
|
342
|
+
import { z as z12 } from "zod";
|
|
343
|
+
var zBCourse = z12.object({
|
|
344
|
+
name: z12.string(),
|
|
345
|
+
category: z12.nativeEnum(CourseCategory),
|
|
319
346
|
/**
|
|
320
347
|
* @unit SECONDS - Duration of the course in seconds
|
|
321
348
|
*/
|
|
322
|
-
duration:
|
|
349
|
+
duration: z12.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"),
|
|
323
350
|
/**
|
|
324
351
|
* @unit CENTS - Price of the course in cents
|
|
325
352
|
*/
|
|
326
|
-
price:
|
|
327
|
-
description:
|
|
353
|
+
price: z12.coerce.number().int("Tuition must be a whole number in cents").min(1, "Tuition must not be less than or equal to 0"),
|
|
354
|
+
description: z12.string().or(z12.literal("")).optional(),
|
|
328
355
|
/**
|
|
329
356
|
* NYIG School locations
|
|
330
357
|
*/
|
|
331
|
-
nyigSchool:
|
|
358
|
+
nyigSchool: z12.nativeEnum(NYIGSchool),
|
|
332
359
|
/**
|
|
333
360
|
* Recommended level before taking this course
|
|
334
361
|
*/
|
|
335
|
-
recLevel:
|
|
362
|
+
recLevel: z12.string().or(z12.literal("")).optional(),
|
|
336
363
|
/**
|
|
337
364
|
* Camp tuition for half-day option
|
|
338
365
|
*/
|
|
339
|
-
halfCampTuition:
|
|
366
|
+
halfCampTuition: z12.coerce.number().int("Tuition must be a whole number in cents").min(1, "Tuition must not be less than or equal to 0").optional(),
|
|
340
367
|
/**
|
|
341
368
|
* Camp tuition for full-day option
|
|
342
369
|
*/
|
|
343
|
-
fullCampTuition:
|
|
344
|
-
superadminOnly:
|
|
370
|
+
fullCampTuition: z12.coerce.number().int("Tuition must be a whole number in cents").min(1, "Tuition must not be less than or equal to 0").optional(),
|
|
371
|
+
superadminOnly: z12.boolean().optional()
|
|
345
372
|
});
|
|
346
373
|
var zCourse = addAutoProps(zBCourse);
|
|
347
374
|
|
|
@@ -354,57 +381,57 @@ var Season = /* @__PURE__ */ ((Season2) => {
|
|
|
354
381
|
})(Season || {});
|
|
355
382
|
|
|
356
383
|
// src/interface/semester/semester.ts
|
|
357
|
-
import { z as
|
|
358
|
-
var zBSemester =
|
|
359
|
-
season:
|
|
360
|
-
year:
|
|
361
|
-
startDate:
|
|
362
|
-
endDate:
|
|
384
|
+
import { z as z13 } from "zod";
|
|
385
|
+
var zBSemester = z13.object({
|
|
386
|
+
season: z13.nativeEnum(Season),
|
|
387
|
+
year: z13.coerce.number().min(2022).max(2999),
|
|
388
|
+
startDate: z13.coerce.date(),
|
|
389
|
+
endDate: z13.coerce.date(),
|
|
363
390
|
/**
|
|
364
391
|
* Format: start, end, start, end, ...
|
|
365
392
|
*/
|
|
366
|
-
blackoutDates:
|
|
393
|
+
blackoutDates: z13.array(z13.coerce.date()),
|
|
367
394
|
/**
|
|
368
395
|
* List of names of some break: date range
|
|
369
396
|
*/
|
|
370
|
-
importantDates:
|
|
397
|
+
importantDates: z13.array(z13.string())
|
|
371
398
|
});
|
|
372
399
|
var zSemester = addAutoProps(zBSemester);
|
|
373
400
|
|
|
374
401
|
// src/interface/tracking/campTracker.ts
|
|
375
402
|
var MAX_TEACHERS = 10;
|
|
376
|
-
var zBCampTracker =
|
|
377
|
-
course:
|
|
378
|
-
teachers:
|
|
379
|
-
semester:
|
|
403
|
+
var zBCampTracker = z14.object({
|
|
404
|
+
course: z14.string(),
|
|
405
|
+
teachers: z14.array(z14.string()).min(1, "Camp must have at least 1 teacher").max(MAX_TEACHERS, `Camp can have at most ${MAX_TEACHERS} teachers`),
|
|
406
|
+
semester: z14.string(),
|
|
380
407
|
/**
|
|
381
408
|
* occurrences are tracked by week for camps
|
|
382
409
|
*/
|
|
383
|
-
occurrences:
|
|
410
|
+
occurrences: z14.array(z14.string()).min(1, "Camp must have at least 1 date range"),
|
|
384
411
|
/**
|
|
385
412
|
* attendances are tracked by week for camps
|
|
386
413
|
*/
|
|
387
|
-
attendances:
|
|
388
|
-
publicDescription:
|
|
389
|
-
isNonPublic:
|
|
390
|
-
notes:
|
|
414
|
+
attendances: z14.array(zAttendanceRequest),
|
|
415
|
+
publicDescription: z14.string().optional(),
|
|
416
|
+
isNonPublic: z14.boolean().optional(),
|
|
417
|
+
notes: z14.string().optional()
|
|
391
418
|
});
|
|
392
419
|
var zCampTracker = addAutoProps(zBCampTracker);
|
|
393
420
|
var zCampTrackerResponse = zCampTracker.extend({
|
|
394
421
|
course: zCourse,
|
|
395
|
-
teachers:
|
|
422
|
+
teachers: z14.array(zTeacher).min(1, "Camp must have at least 1 teacher").max(MAX_TEACHERS, `Camp can have at most ${MAX_TEACHERS} teachers`),
|
|
396
423
|
semester: zSemester,
|
|
397
|
-
attendances:
|
|
424
|
+
attendances: z14.array(zAttendanceResponse)
|
|
398
425
|
});
|
|
399
426
|
|
|
400
427
|
// src/interface/tracking/classTracker.ts
|
|
401
|
-
import { z as
|
|
428
|
+
import { z as z17 } from "zod";
|
|
402
429
|
|
|
403
430
|
// src/interface/tracking/classTimesInput.ts
|
|
404
|
-
import { z as
|
|
431
|
+
import { z as z16 } from "zod";
|
|
405
432
|
|
|
406
433
|
// src/interface/tracking/dayOfWeek.ts
|
|
407
|
-
import { z as
|
|
434
|
+
import { z as z15 } from "zod";
|
|
408
435
|
var DayOfWeek = /* @__PURE__ */ ((DayOfWeek2) => {
|
|
409
436
|
DayOfWeek2[DayOfWeek2["SUNDAY"] = 0] = "SUNDAY";
|
|
410
437
|
DayOfWeek2[DayOfWeek2["MONDAY"] = 1] = "MONDAY";
|
|
@@ -415,33 +442,33 @@ var DayOfWeek = /* @__PURE__ */ ((DayOfWeek2) => {
|
|
|
415
442
|
DayOfWeek2[DayOfWeek2["SATURDAY"] = 6] = "SATURDAY";
|
|
416
443
|
return DayOfWeek2;
|
|
417
444
|
})(DayOfWeek || {});
|
|
418
|
-
var zDayOfWeek =
|
|
445
|
+
var zDayOfWeek = z15.nativeEnum(DayOfWeek);
|
|
419
446
|
|
|
420
447
|
// src/interface/tracking/classTimesInput.ts
|
|
421
|
-
var zClassTimesInput =
|
|
422
|
-
startDate:
|
|
423
|
-
freq:
|
|
424
|
-
daysOfWeek:
|
|
425
|
-
numberOfClasses:
|
|
448
|
+
var zClassTimesInput = z16.object({
|
|
449
|
+
startDate: z16.date(),
|
|
450
|
+
freq: z16.coerce.number().min(1, "Please select a valid frequency"),
|
|
451
|
+
daysOfWeek: z16.array(zDayOfWeek),
|
|
452
|
+
numberOfClasses: z16.coerce.number().int().min(1, "Must enroll in at least one class")
|
|
426
453
|
});
|
|
427
454
|
|
|
428
455
|
// src/interface/tracking/classTracker.ts
|
|
429
|
-
var zBClassTracker =
|
|
430
|
-
course:
|
|
431
|
-
teacher:
|
|
432
|
-
student:
|
|
433
|
-
classTimes:
|
|
434
|
-
completedList:
|
|
456
|
+
var zBClassTracker = z17.object({
|
|
457
|
+
course: z17.string(),
|
|
458
|
+
teacher: z17.string(),
|
|
459
|
+
student: z17.string(),
|
|
460
|
+
classTimes: z17.array(z17.coerce.date()),
|
|
461
|
+
completedList: z17.array(z17.boolean()),
|
|
435
462
|
/**
|
|
436
463
|
* Virtual mongoose field when all values in completedList is true
|
|
437
464
|
*/
|
|
438
|
-
completed:
|
|
465
|
+
completed: z17.boolean().optional(),
|
|
439
466
|
/**
|
|
440
467
|
* @deprecated This field is no longer used
|
|
441
468
|
*/
|
|
442
|
-
paid:
|
|
443
|
-
paused:
|
|
444
|
-
notes:
|
|
469
|
+
paid: z17.boolean().optional(),
|
|
470
|
+
paused: z17.boolean().optional(),
|
|
471
|
+
notes: z17.string().optional()
|
|
445
472
|
});
|
|
446
473
|
var zClassTracker = addAutoProps(zBClassTracker);
|
|
447
474
|
var zClassTrackerResponse = zClassTracker.extend({
|
|
@@ -454,89 +481,89 @@ var zTrackerCreate = zBClassTracker.extend({
|
|
|
454
481
|
});
|
|
455
482
|
|
|
456
483
|
// src/interface/tracking/groupTracker.ts
|
|
457
|
-
import { z as
|
|
484
|
+
import { z as z19 } from "zod";
|
|
458
485
|
|
|
459
486
|
// src/interface/tracking/scheduleData.ts
|
|
460
|
-
import { z as
|
|
461
|
-
var zScheduleData =
|
|
462
|
-
startTime:
|
|
487
|
+
import { z as z18 } from "zod";
|
|
488
|
+
var zScheduleData = z18.object({
|
|
489
|
+
startTime: z18.string(),
|
|
463
490
|
// String in 24 hour "HH:mm" format
|
|
464
|
-
dayOfWeek:
|
|
491
|
+
dayOfWeek: z18.number().int().min(0).max(6),
|
|
465
492
|
// integeters in 0 - 6
|
|
466
|
-
startDate:
|
|
493
|
+
startDate: z18.string().optional(),
|
|
467
494
|
// First day of class, optional for backwards compatibility
|
|
468
|
-
numberOfClasses:
|
|
495
|
+
numberOfClasses: z18.number().int().min(0).optional()
|
|
469
496
|
// optional for backwards compatibility
|
|
470
497
|
});
|
|
471
498
|
|
|
472
499
|
// src/interface/tracking/groupTracker.ts
|
|
473
|
-
var zBGroupTracker =
|
|
474
|
-
course:
|
|
475
|
-
teacher:
|
|
476
|
-
semester:
|
|
500
|
+
var zBGroupTracker = z19.object({
|
|
501
|
+
course: z19.string(),
|
|
502
|
+
teacher: z19.string(),
|
|
503
|
+
semester: z19.string(),
|
|
477
504
|
scheduleData: zScheduleData,
|
|
478
505
|
/**
|
|
479
506
|
* occurrences are tracked by week for Groups
|
|
480
507
|
*/
|
|
481
|
-
occurrences:
|
|
508
|
+
occurrences: z19.array(z19.string()),
|
|
482
509
|
/**
|
|
483
510
|
* attendances are tracked by week for Groups
|
|
484
511
|
*/
|
|
485
|
-
attendances:
|
|
512
|
+
attendances: z19.array(zAttendanceRequest),
|
|
486
513
|
/**
|
|
487
514
|
* public-facing ID of the course instance, e.g., 101
|
|
488
515
|
*/
|
|
489
|
-
courseId:
|
|
516
|
+
courseId: z19.string().optional(),
|
|
490
517
|
/**
|
|
491
518
|
* Age group of the class instance, e.g. "adult", "youth"
|
|
492
519
|
*/
|
|
493
|
-
ageGroup:
|
|
520
|
+
ageGroup: z19.nativeEnum(AgeGroup).optional(),
|
|
494
521
|
/**
|
|
495
522
|
* If true, the course is hidden from public view
|
|
496
523
|
*/
|
|
497
|
-
isNonPublic:
|
|
498
|
-
notes:
|
|
524
|
+
isNonPublic: z19.boolean().optional(),
|
|
525
|
+
notes: z19.string().optional()
|
|
499
526
|
});
|
|
500
527
|
var zGroupTracker = addAutoProps(zBGroupTracker);
|
|
501
528
|
var zGroupTrackerResponse = zGroupTracker.extend({
|
|
502
529
|
course: zCourse,
|
|
503
530
|
teacher: zTeacher,
|
|
504
531
|
semester: zSemester,
|
|
505
|
-
attendances:
|
|
532
|
+
attendances: z19.array(zAttendanceResponse)
|
|
506
533
|
});
|
|
507
534
|
|
|
508
535
|
// src/interface/booking/campBooking.ts
|
|
509
|
-
var zBCampBooking =
|
|
510
|
-
ctId:
|
|
511
|
-
isOnline:
|
|
512
|
-
classDates:
|
|
513
|
-
campOption:
|
|
514
|
-
shipping:
|
|
536
|
+
var zBCampBooking = z20.object({
|
|
537
|
+
ctId: z20.string().optional(),
|
|
538
|
+
isOnline: z20.boolean(),
|
|
539
|
+
classDates: z20.string(),
|
|
540
|
+
campOption: z20.nativeEnum(CampOption),
|
|
541
|
+
shipping: z20.boolean().optional()
|
|
515
542
|
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
516
543
|
var zCampBooking = addAutoProps(zBCampBooking);
|
|
517
544
|
|
|
518
545
|
// src/interface/booking/groupBooking.ts
|
|
519
|
-
import { z as
|
|
520
|
-
var zBGroupBooking =
|
|
521
|
-
gtId:
|
|
522
|
-
isTrial:
|
|
523
|
-
isOnline:
|
|
524
|
-
classDate:
|
|
525
|
-
shipping:
|
|
546
|
+
import { z as z21 } from "zod";
|
|
547
|
+
var zBGroupBooking = z21.object({
|
|
548
|
+
gtId: z21.string().optional(),
|
|
549
|
+
isTrial: z21.boolean().optional(),
|
|
550
|
+
isOnline: z21.boolean(),
|
|
551
|
+
classDate: z21.string().optional(),
|
|
552
|
+
shipping: z21.boolean().optional()
|
|
526
553
|
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
527
554
|
var zGroupBooking = addAutoProps(zBGroupBooking);
|
|
528
555
|
|
|
529
556
|
// src/interface/booking/privateBooking.ts
|
|
530
|
-
import { z as
|
|
531
|
-
var zBPrivateBooking =
|
|
532
|
-
courseId:
|
|
533
|
-
teacherId:
|
|
534
|
-
classDate:
|
|
557
|
+
import { z as z22 } from "zod";
|
|
558
|
+
var zBPrivateBooking = z22.object({
|
|
559
|
+
courseId: z22.string(),
|
|
560
|
+
teacherId: z22.string(),
|
|
561
|
+
classDate: z22.string().optional()
|
|
535
562
|
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
536
563
|
var zPrivateBooking = addAutoProps(zBPrivateBooking);
|
|
537
564
|
|
|
538
565
|
// src/interface/payment/invoice.ts
|
|
539
|
-
import { z as
|
|
566
|
+
import { z as z23 } from "zod";
|
|
540
567
|
|
|
541
568
|
// src/interface/payment/paymentMethod.ts
|
|
542
569
|
var PaymentMethod = /* @__PURE__ */ ((PaymentMethod2) => {
|
|
@@ -548,93 +575,93 @@ var PaymentMethod = /* @__PURE__ */ ((PaymentMethod2) => {
|
|
|
548
575
|
})(PaymentMethod || {});
|
|
549
576
|
|
|
550
577
|
// src/interface/payment/invoice.ts
|
|
551
|
-
var zDiscount =
|
|
552
|
-
desc:
|
|
553
|
-
amount:
|
|
578
|
+
var zDiscount = z23.object({
|
|
579
|
+
desc: z23.string().min(1, "Discount description cannot be empty"),
|
|
580
|
+
amount: z23.coerce.number()
|
|
554
581
|
});
|
|
555
|
-
var zInvoiceItem =
|
|
556
|
-
course:
|
|
557
|
-
price:
|
|
558
|
-
units:
|
|
582
|
+
var zInvoiceItem = z23.object({
|
|
583
|
+
course: z23.string().min(1, "Course description cannot be empty"),
|
|
584
|
+
price: z23.coerce.number(),
|
|
585
|
+
units: z23.coerce.number()
|
|
559
586
|
});
|
|
560
|
-
var zInvoicePackage =
|
|
561
|
-
student:
|
|
562
|
-
items:
|
|
587
|
+
var zInvoicePackage = z23.object({
|
|
588
|
+
student: z23.string(),
|
|
589
|
+
items: z23.array(zInvoiceItem).min(1, "Package must contain at least one item")
|
|
563
590
|
});
|
|
564
591
|
var zInvoicePackageResponse = zInvoicePackage.extend({
|
|
565
592
|
student: zStudent
|
|
566
593
|
});
|
|
567
|
-
var zBInvoice =
|
|
568
|
-
billTo:
|
|
569
|
-
packages:
|
|
570
|
-
discounts:
|
|
571
|
-
textbook:
|
|
572
|
-
shipping:
|
|
573
|
-
paid:
|
|
574
|
-
paidAt:
|
|
575
|
-
showEin:
|
|
576
|
-
notes:
|
|
577
|
-
feeLabel:
|
|
578
|
-
createdBy:
|
|
594
|
+
var zBInvoice = z23.object({
|
|
595
|
+
billTo: z23.string().min(1, "The 'Bill To' field must not be empty"),
|
|
596
|
+
packages: z23.array(zInvoicePackage).min(1, "Invoice must include at least one package"),
|
|
597
|
+
discounts: z23.array(zDiscount),
|
|
598
|
+
textbook: z23.coerce.number().int().min(0).optional(),
|
|
599
|
+
shipping: z23.coerce.number().int().min(0).optional(),
|
|
600
|
+
paid: z23.nativeEnum(PaymentMethod).optional(),
|
|
601
|
+
paidAt: z23.string().optional(),
|
|
602
|
+
showEin: z23.boolean().optional(),
|
|
603
|
+
notes: z23.string().or(z23.literal("")).optional(),
|
|
604
|
+
feeLabel: z23.string().optional(),
|
|
605
|
+
createdBy: z23.string()
|
|
579
606
|
});
|
|
580
607
|
var zInvoice = addAutoProps(zBInvoice);
|
|
581
608
|
var zInvoiceResponse = zInvoice.extend({
|
|
582
609
|
createdBy: zTeacher,
|
|
583
610
|
editedBy: zTeacher.optional(),
|
|
584
|
-
packages:
|
|
611
|
+
packages: z23.array(zInvoicePackageResponse)
|
|
585
612
|
});
|
|
586
613
|
|
|
587
614
|
// src/interface/payment/teacherPayment.ts
|
|
588
|
-
import { z as
|
|
589
|
-
var zTeacherPaymentRow =
|
|
590
|
-
course:
|
|
591
|
-
length:
|
|
592
|
-
count:
|
|
593
|
-
wage:
|
|
615
|
+
import { z as z24 } from "zod";
|
|
616
|
+
var zTeacherPaymentRow = z24.object({
|
|
617
|
+
course: z24.string().min(1, "select or enter a course"),
|
|
618
|
+
length: z24.coerce.number().gt(0, "must be > 0"),
|
|
619
|
+
count: z24.coerce.number().int().gt(0, "must be > 0"),
|
|
620
|
+
wage: z24.coerce.number().gt(0, "wage must be > 0")
|
|
594
621
|
});
|
|
595
|
-
var zBTeacherPayment =
|
|
596
|
-
teacher:
|
|
597
|
-
rows:
|
|
598
|
-
paid:
|
|
622
|
+
var zBTeacherPayment = z24.object({
|
|
623
|
+
teacher: z24.string().min(1, "select or enter a teacher"),
|
|
624
|
+
rows: z24.array(zTeacherPaymentRow),
|
|
625
|
+
paid: z24.boolean().optional(),
|
|
599
626
|
/**
|
|
600
627
|
* paymentNotes differentiates from notes as it is displayed on the rendered PDF
|
|
601
628
|
*/
|
|
602
|
-
paymentNotes:
|
|
629
|
+
paymentNotes: z24.string().optional()
|
|
603
630
|
});
|
|
604
631
|
var zTeacherPayment = addAutoProps(zBTeacherPayment);
|
|
605
632
|
var zTeacherPaymentResponse = zTeacherPayment.extend({
|
|
606
|
-
teacher:
|
|
607
|
-
editedBy:
|
|
633
|
+
teacher: z24.object({ _id: z24.string(), name: z24.string(), rank: z24.string().optional() }),
|
|
634
|
+
editedBy: z24.object({ _id: z24.string(), name: z24.string(), rank: z24.string().optional() })
|
|
608
635
|
});
|
|
609
636
|
|
|
610
637
|
// src/interface/public/aurora.ts
|
|
611
|
-
import { z as
|
|
612
|
-
var zTeacherDisplay =
|
|
613
|
-
name:
|
|
614
|
-
email:
|
|
615
|
-
title:
|
|
616
|
-
imageUrl:
|
|
617
|
-
bio:
|
|
618
|
-
});
|
|
619
|
-
var zCourseTable =
|
|
620
|
-
id:
|
|
621
|
-
name:
|
|
622
|
-
duration:
|
|
623
|
-
dateAndTime:
|
|
624
|
-
recommendedLevel:
|
|
625
|
-
tuition:
|
|
638
|
+
import { z as z25 } from "zod";
|
|
639
|
+
var zTeacherDisplay = z25.object({
|
|
640
|
+
name: z25.string(),
|
|
641
|
+
email: z25.string().email(),
|
|
642
|
+
title: z25.string(),
|
|
643
|
+
imageUrl: z25.string(),
|
|
644
|
+
bio: z25.string()
|
|
645
|
+
});
|
|
646
|
+
var zCourseTable = z25.object({
|
|
647
|
+
id: z25.string(),
|
|
648
|
+
name: z25.string(),
|
|
649
|
+
duration: z25.number(),
|
|
650
|
+
dateAndTime: z25.string(),
|
|
651
|
+
recommendedLevel: z25.string(),
|
|
652
|
+
tuition: z25.string()
|
|
626
653
|
});
|
|
627
654
|
|
|
628
655
|
// src/interface/public/imageDef.ts
|
|
629
|
-
import { z as
|
|
630
|
-
var zImageDef =
|
|
631
|
-
url:
|
|
632
|
-
height:
|
|
633
|
-
width:
|
|
656
|
+
import { z as z26 } from "zod";
|
|
657
|
+
var zImageDef = z26.object({
|
|
658
|
+
url: z26.string().url(),
|
|
659
|
+
height: z26.coerce.number().int(),
|
|
660
|
+
width: z26.coerce.number().int()
|
|
634
661
|
});
|
|
635
662
|
|
|
636
663
|
// src/interface/reporting/reportTicket.ts
|
|
637
|
-
import { z as
|
|
664
|
+
import { z as z27 } from "zod";
|
|
638
665
|
|
|
639
666
|
// src/interface/reporting/ticketStatus.ts
|
|
640
667
|
var TicketStatus = /* @__PURE__ */ ((TicketStatus2) => {
|
|
@@ -646,12 +673,12 @@ var TicketStatus = /* @__PURE__ */ ((TicketStatus2) => {
|
|
|
646
673
|
})(TicketStatus || {});
|
|
647
674
|
|
|
648
675
|
// src/interface/reporting/reportTicket.ts
|
|
649
|
-
var zBReportTicket =
|
|
650
|
-
requester:
|
|
651
|
-
resolver:
|
|
652
|
-
status:
|
|
653
|
-
title:
|
|
654
|
-
description:
|
|
676
|
+
var zBReportTicket = z27.object({
|
|
677
|
+
requester: z27.string(),
|
|
678
|
+
resolver: z27.string().optional(),
|
|
679
|
+
status: z27.nativeEnum(TicketStatus),
|
|
680
|
+
title: z27.string(),
|
|
681
|
+
description: z27.string()
|
|
655
682
|
});
|
|
656
683
|
var zReportTicket = addAutoProps(zBReportTicket);
|
|
657
684
|
var zReportTicketResponse = zReportTicket.extend({
|
|
@@ -660,45 +687,45 @@ var zReportTicketResponse = zReportTicket.extend({
|
|
|
660
687
|
});
|
|
661
688
|
|
|
662
689
|
// src/interface/event/eConfig.ts
|
|
663
|
-
import { z as
|
|
690
|
+
import { z as z30 } from "zod";
|
|
664
691
|
|
|
665
692
|
// src/interface/event/eTicket.ts
|
|
666
|
-
import { z as
|
|
667
|
-
var zBEventTicket =
|
|
668
|
-
name:
|
|
693
|
+
import { z as z28 } from "zod";
|
|
694
|
+
var zBEventTicket = z28.object({
|
|
695
|
+
name: z28.string().min(4, "Name must be at least 4 characters"),
|
|
669
696
|
/**
|
|
670
697
|
* Price in cents
|
|
671
698
|
*/
|
|
672
|
-
price:
|
|
699
|
+
price: z28.coerce.number().min(0, "Price must not be negative"),
|
|
673
700
|
/**
|
|
674
701
|
* @optional description of the ticket
|
|
675
702
|
*/
|
|
676
|
-
description:
|
|
703
|
+
description: z28.string().optional(),
|
|
677
704
|
/**
|
|
678
705
|
* @optional The ticket cannot be purchased if true
|
|
679
706
|
*/
|
|
680
|
-
isNotBuyable:
|
|
707
|
+
isNotBuyable: z28.boolean().optional(),
|
|
681
708
|
/**
|
|
682
709
|
* @optional If date is provided and in the past, ticket cannot be purchased
|
|
683
710
|
*/
|
|
684
|
-
lastBuyableDate:
|
|
711
|
+
lastBuyableDate: z28.coerce.date().optional(),
|
|
685
712
|
/**
|
|
686
713
|
* @optional max limit is 1 unless maxPerOrder is specified
|
|
687
714
|
*/
|
|
688
|
-
maxPerOrder:
|
|
715
|
+
maxPerOrder: z28.coerce.number().int().optional()
|
|
689
716
|
});
|
|
690
717
|
var zEventTicket = addAutoProps(zBEventTicket);
|
|
691
718
|
|
|
692
719
|
// src/interface/event/table.ts
|
|
693
|
-
import { z as
|
|
694
|
-
var zTable =
|
|
695
|
-
var zDetailsTable =
|
|
696
|
-
fields:
|
|
720
|
+
import { z as z29 } from "zod";
|
|
721
|
+
var zTable = z29.array(z29.record(z29.string(), z29.string()));
|
|
722
|
+
var zDetailsTable = z29.object({
|
|
723
|
+
fields: z29.array(z29.string()).length(2),
|
|
697
724
|
data: zTable
|
|
698
725
|
});
|
|
699
|
-
var zScheduleTable =
|
|
700
|
-
fields:
|
|
701
|
-
data:
|
|
726
|
+
var zScheduleTable = z29.object({
|
|
727
|
+
fields: z29.array(z29.string()).length(2),
|
|
728
|
+
data: z29.record(z29.string(), zTable)
|
|
702
729
|
});
|
|
703
730
|
|
|
704
731
|
// src/interface/event/youthOrAdult.ts
|
|
@@ -709,40 +736,40 @@ var YouthOrAdult = /* @__PURE__ */ ((YouthOrAdult2) => {
|
|
|
709
736
|
})(YouthOrAdult || {});
|
|
710
737
|
|
|
711
738
|
// src/interface/event/eConfig.ts
|
|
712
|
-
var zBEventConfig =
|
|
739
|
+
var zBEventConfig = z30.object({
|
|
713
740
|
/**
|
|
714
741
|
* Location of the event
|
|
715
742
|
*/
|
|
716
|
-
location:
|
|
743
|
+
location: z30.string().optional(),
|
|
717
744
|
/**
|
|
718
745
|
* URL of the tournament on the official website
|
|
719
746
|
* Must be a valid URL link
|
|
720
747
|
*/
|
|
721
|
-
url:
|
|
748
|
+
url: z30.string(),
|
|
722
749
|
/**
|
|
723
750
|
* Full name of the tournament
|
|
724
751
|
*/
|
|
725
|
-
title:
|
|
752
|
+
title: z30.string().min(5),
|
|
726
753
|
/**
|
|
727
754
|
* Abbreviated title of the tournament
|
|
728
755
|
*/
|
|
729
|
-
shortTitle:
|
|
756
|
+
shortTitle: z30.string().min(2),
|
|
730
757
|
/**
|
|
731
758
|
* Tournament start date and time
|
|
732
759
|
*/
|
|
733
|
-
tStart:
|
|
760
|
+
tStart: z30.coerce.date(),
|
|
734
761
|
/**
|
|
735
762
|
* Tournament end date and time
|
|
736
763
|
*/
|
|
737
|
-
tEnd:
|
|
764
|
+
tEnd: z30.coerce.date(),
|
|
738
765
|
/**
|
|
739
766
|
* Short description for tournament card
|
|
740
767
|
*/
|
|
741
|
-
shortDescription:
|
|
768
|
+
shortDescription: z30.string().min(5),
|
|
742
769
|
/**
|
|
743
770
|
* Full description
|
|
744
771
|
*/
|
|
745
|
-
description:
|
|
772
|
+
description: z30.string().min(5),
|
|
746
773
|
/**
|
|
747
774
|
* Defines the tournament details table with 2 columns
|
|
748
775
|
* typically Time and Event
|
|
@@ -757,30 +784,30 @@ var zBEventConfig = z29.object({
|
|
|
757
784
|
* @optional description of the tickets step, shown in service
|
|
758
785
|
* when the customer is on step 1 of the booking page
|
|
759
786
|
*/
|
|
760
|
-
ticketsStepDescription:
|
|
787
|
+
ticketsStepDescription: z30.string().optional(),
|
|
761
788
|
/**
|
|
762
789
|
* @optional description of the participant step, shown in service
|
|
763
790
|
* when the customer is on step 2 of the booking page
|
|
764
791
|
*/
|
|
765
|
-
participantStepDescription:
|
|
792
|
+
participantStepDescription: z30.string().optional(),
|
|
766
793
|
/**
|
|
767
794
|
* List of ticket object IDs for this tournament
|
|
768
795
|
*/
|
|
769
|
-
tickets:
|
|
796
|
+
tickets: z30.array(z30.string()),
|
|
770
797
|
/**
|
|
771
798
|
* If false, the tournament registration is closed
|
|
772
799
|
*/
|
|
773
|
-
canRegister:
|
|
800
|
+
canRegister: z30.boolean(),
|
|
774
801
|
/**
|
|
775
802
|
* Defines the registration of youth and adults in the event
|
|
776
803
|
* youth_only - only youth
|
|
777
804
|
* both - both youth and adult
|
|
778
805
|
*/
|
|
779
|
-
youthOrAdult:
|
|
806
|
+
youthOrAdult: z30.nativeEnum(YouthOrAdult).optional(),
|
|
780
807
|
/**
|
|
781
808
|
* If true, free form donation amounts are disabled.
|
|
782
809
|
*/
|
|
783
|
-
donationsDisabled:
|
|
810
|
+
donationsDisabled: z30.boolean().optional(),
|
|
784
811
|
/**
|
|
785
812
|
* Defines URL, height, width of the image
|
|
786
813
|
*/
|
|
@@ -788,42 +815,42 @@ var zBEventConfig = z29.object({
|
|
|
788
815
|
});
|
|
789
816
|
var zEventConfig = addAutoProps(zBEventConfig);
|
|
790
817
|
var zEventConfigResponse = zEventConfig.extend({
|
|
791
|
-
tickets:
|
|
818
|
+
tickets: z30.array(zEventTicket)
|
|
792
819
|
});
|
|
793
820
|
|
|
794
821
|
// src/interface/event/eReg.ts
|
|
795
|
-
import { z as
|
|
822
|
+
import { z as z32 } from "zod";
|
|
796
823
|
|
|
797
824
|
// src/interface/event/eTicketReg.ts
|
|
798
|
-
import { z as
|
|
799
|
-
var zEventTicketReg =
|
|
800
|
-
ticket:
|
|
825
|
+
import { z as z31 } from "zod";
|
|
826
|
+
var zEventTicketReg = z31.object({
|
|
827
|
+
ticket: z31.string(),
|
|
801
828
|
/**
|
|
802
829
|
* integer minimum 1, otherwise no ticket is being bought
|
|
803
830
|
*/
|
|
804
|
-
amount:
|
|
831
|
+
amount: z31.number().int().min(1)
|
|
805
832
|
});
|
|
806
833
|
var zEventTicketRegResponse = zEventTicketReg.extend({
|
|
807
834
|
ticket: zEventTicket
|
|
808
835
|
});
|
|
809
836
|
|
|
810
837
|
// src/interface/event/eReg.ts
|
|
811
|
-
var zBEventReg =
|
|
812
|
-
agaId:
|
|
813
|
-
tournamentId:
|
|
814
|
-
tickets:
|
|
838
|
+
var zBEventReg = z32.object({
|
|
839
|
+
agaId: z32.string(),
|
|
840
|
+
tournamentId: z32.string(),
|
|
841
|
+
tickets: z32.array(zEventTicketReg),
|
|
815
842
|
/**
|
|
816
843
|
* @units CENTS - Donation in cents
|
|
817
844
|
*/
|
|
818
|
-
donation:
|
|
845
|
+
donation: z32.coerce.number().optional(),
|
|
819
846
|
/**
|
|
820
847
|
* How the registration was created, through public endpoint or admin
|
|
821
848
|
*/
|
|
822
|
-
createMethod:
|
|
849
|
+
createMethod: z32.string().optional()
|
|
823
850
|
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
824
851
|
var zEventReg = addAutoProps(zBEventReg);
|
|
825
852
|
var zEventRegResponse = zEventReg.extend({
|
|
826
|
-
tickets:
|
|
853
|
+
tickets: z32.array(zEventTicketRegResponse)
|
|
827
854
|
});
|
|
828
855
|
export {
|
|
829
856
|
AgeGroup,
|
|
@@ -864,6 +891,7 @@ export {
|
|
|
864
891
|
zBTeacherPayment,
|
|
865
892
|
zBUser,
|
|
866
893
|
zBUserInfo,
|
|
894
|
+
zBUserProfile,
|
|
867
895
|
zCampBooking,
|
|
868
896
|
zCampTracker,
|
|
869
897
|
zCampTrackerResponse,
|
|
@@ -909,5 +937,6 @@ export {
|
|
|
909
937
|
zTrackerCreate,
|
|
910
938
|
zTuition,
|
|
911
939
|
zUser,
|
|
940
|
+
zUserProfile,
|
|
912
941
|
zUserRoles
|
|
913
942
|
};
|