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