@nyig/models 0.2.35 → 0.2.36
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 +395 -261
- package/index.d.ts +395 -261
- package/index.js +257 -248
- package/index.mjs +256 -248
- 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 z15 } from "zod";
|
|
44
44
|
|
|
45
45
|
// src/interface/tracking/attendState.ts
|
|
46
46
|
var AttendState = /* @__PURE__ */ ((AttendState2) => {
|
|
@@ -110,7 +110,7 @@ var zBCampTracker = z6.object({
|
|
|
110
110
|
var zCampTracker = addAutoProps(zBCampTracker);
|
|
111
111
|
|
|
112
112
|
// src/interface/tracking/classTracker.ts
|
|
113
|
-
import { z as
|
|
113
|
+
import { z as z11 } from "zod";
|
|
114
114
|
|
|
115
115
|
// src/interface/payment/invoice.ts
|
|
116
116
|
import { z as z7 } from "zod";
|
|
@@ -152,47 +152,162 @@ var zBInvoice = z7.object({
|
|
|
152
152
|
var zInvoice = addAutoProps(zBInvoice);
|
|
153
153
|
|
|
154
154
|
// src/interface/payment/teacherPayment.ts
|
|
155
|
+
import { z as z10 } from "zod";
|
|
156
|
+
|
|
157
|
+
// src/interface/user/goRank.ts
|
|
158
|
+
var GoRank = /* @__PURE__ */ ((GoRank2) => {
|
|
159
|
+
GoRank2["KYU1"] = "1k";
|
|
160
|
+
GoRank2["KYU2"] = "2k";
|
|
161
|
+
GoRank2["KYU3"] = "3k";
|
|
162
|
+
GoRank2["KYU4"] = "4k";
|
|
163
|
+
GoRank2["KYU5"] = "5k";
|
|
164
|
+
GoRank2["KYU6"] = "6k";
|
|
165
|
+
GoRank2["KYU7"] = "7k";
|
|
166
|
+
GoRank2["KYU8"] = "8k";
|
|
167
|
+
GoRank2["KYU9"] = "9k";
|
|
168
|
+
GoRank2["KYU10"] = "10k";
|
|
169
|
+
GoRank2["KYU11"] = "11k";
|
|
170
|
+
GoRank2["KYU12"] = "12k";
|
|
171
|
+
GoRank2["KYU13"] = "13k";
|
|
172
|
+
GoRank2["KYU14"] = "14k";
|
|
173
|
+
GoRank2["KYU15"] = "15k";
|
|
174
|
+
GoRank2["KYU16"] = "16k";
|
|
175
|
+
GoRank2["KYU17"] = "17k";
|
|
176
|
+
GoRank2["KYU18"] = "18k";
|
|
177
|
+
GoRank2["KYU19"] = "19k";
|
|
178
|
+
GoRank2["KYU20"] = "20k";
|
|
179
|
+
GoRank2["KYU21"] = "21k";
|
|
180
|
+
GoRank2["KYU22"] = "22k";
|
|
181
|
+
GoRank2["KYU23"] = "23k";
|
|
182
|
+
GoRank2["KYU24"] = "24k";
|
|
183
|
+
GoRank2["KYU25"] = "25k";
|
|
184
|
+
GoRank2["DAN1"] = "1d";
|
|
185
|
+
GoRank2["DAN2"] = "2d";
|
|
186
|
+
GoRank2["DAN3"] = "3d";
|
|
187
|
+
GoRank2["DAN4"] = "4d";
|
|
188
|
+
GoRank2["DAN5"] = "5d";
|
|
189
|
+
GoRank2["DAN6"] = "6d";
|
|
190
|
+
GoRank2["DAN7"] = "7d";
|
|
191
|
+
GoRank2["PRO1"] = "1p";
|
|
192
|
+
GoRank2["PRO2"] = "2p";
|
|
193
|
+
GoRank2["PRO3"] = "3p";
|
|
194
|
+
GoRank2["PRO4"] = "4p";
|
|
195
|
+
GoRank2["PRO5"] = "5p";
|
|
196
|
+
GoRank2["PRO6"] = "6p";
|
|
197
|
+
GoRank2["PRO7"] = "7p";
|
|
198
|
+
GoRank2["PRO8"] = "8p";
|
|
199
|
+
GoRank2["PRO9"] = "9p";
|
|
200
|
+
return GoRank2;
|
|
201
|
+
})(GoRank || {});
|
|
202
|
+
|
|
203
|
+
// src/interface/user/user.ts
|
|
155
204
|
import { z as z8 } from "zod";
|
|
156
|
-
var
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
205
|
+
var zBUser = z8.object({
|
|
206
|
+
name: z8.string().min(2).max(100),
|
|
207
|
+
username: z8.string().optional(),
|
|
208
|
+
password: z8.string().optional(),
|
|
209
|
+
roles: z8.array(z8.number().int()).optional(),
|
|
210
|
+
email: z8.string().max(100).email().or(z8.literal("")).optional(),
|
|
211
|
+
address: z8.string().or(z8.literal("")).optional(),
|
|
212
|
+
country: z8.string().length(2, {
|
|
213
|
+
message: "Enter the 2-letter country code"
|
|
214
|
+
}).or(z8.literal("")).optional(),
|
|
215
|
+
phoneNumber: z8.string().regex(/^\d{10}/, {
|
|
216
|
+
message: `Please enter a valid 10-digit US phone number with numbers only`
|
|
217
|
+
}).or(z8.literal("")).optional(),
|
|
218
|
+
birthDate: z8.string().regex(/^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/, {
|
|
219
|
+
message: "Enter a valid date in yyyy-mm-dd format"
|
|
220
|
+
}).or(z8.literal("")).optional()
|
|
161
221
|
});
|
|
162
|
-
var
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
222
|
+
var zUser = addAutoProps(zBUser);
|
|
223
|
+
var zStudent = zUser.extend({
|
|
224
|
+
rank: z8.nativeEnum(GoRank),
|
|
225
|
+
guardian: z8.string().optional()
|
|
226
|
+
});
|
|
227
|
+
var zTeacher = zUser.extend({
|
|
228
|
+
rank: z8.nativeEnum(GoRank),
|
|
229
|
+
/**
|
|
230
|
+
* Inactive teachers are not shown on public endpoints
|
|
231
|
+
*/
|
|
232
|
+
isInactive: z8.boolean().optional(),
|
|
233
|
+
/**
|
|
234
|
+
* Teacher's position, e.g., instructor, president
|
|
235
|
+
*/
|
|
236
|
+
title: z8.string().optional(),
|
|
237
|
+
/**
|
|
238
|
+
* Teacher's bio text describing experience
|
|
239
|
+
* new lines will be rendered as paragraphs
|
|
240
|
+
*/
|
|
241
|
+
bio: z8.string().optional(),
|
|
242
|
+
/** Format is illustrated below, where teacher is available
|
|
243
|
+
* Mon 9-12am 3-6pm & Tue 10-12am 6-10pm
|
|
244
|
+
* [
|
|
245
|
+
* [[9, 12], [15, 18]],
|
|
246
|
+
* [[10, 12], [18, 20]],
|
|
247
|
+
* [],
|
|
248
|
+
* [],
|
|
249
|
+
* [],
|
|
250
|
+
* [],
|
|
251
|
+
* [],
|
|
252
|
+
* ]
|
|
253
|
+
*/
|
|
254
|
+
available: z8.array(z8.array(z8.array(z8.number()))).optional()
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
// src/interface/user/userRoles.ts
|
|
258
|
+
import { z as z9 } from "zod";
|
|
259
|
+
var zUserRoles = z9.object({
|
|
260
|
+
user: z9.number().int(),
|
|
261
|
+
admin: z9.number().int(),
|
|
262
|
+
superadmin: z9.number().int()
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
// src/interface/payment/teacherPayment.ts
|
|
266
|
+
var zTeacherPaymentRow = z10.object({
|
|
267
|
+
course: z10.string().min(1, "select or enter a course"),
|
|
268
|
+
length: z10.coerce.number().gt(0, "must be > 0"),
|
|
269
|
+
count: z10.coerce.number().int().gt(0, "must be > 0"),
|
|
270
|
+
wage: z10.coerce.number().gt(0, "wage must be > 0")
|
|
271
|
+
});
|
|
272
|
+
var zBTeacherPayment = z10.object({
|
|
273
|
+
teacher: z10.string().min(1, "select or enter a teacher"),
|
|
274
|
+
rows: z10.array(zTeacherPaymentRow),
|
|
275
|
+
paid: z10.boolean().optional()
|
|
166
276
|
});
|
|
167
277
|
var zTeacherPayment = addAutoProps(zBTeacherPayment);
|
|
278
|
+
var zTeacherPaymentResponse = z10.object({
|
|
279
|
+
teacher: zTeacher,
|
|
280
|
+
rows: z10.array(zTeacherPaymentRow),
|
|
281
|
+
paid: z10.boolean().optional()
|
|
282
|
+
});
|
|
168
283
|
|
|
169
284
|
// src/interface/tracking/classTracker.ts
|
|
170
|
-
var zBClassTracker =
|
|
171
|
-
course:
|
|
172
|
-
teacher:
|
|
173
|
-
student:
|
|
174
|
-
classTimes:
|
|
175
|
-
completedList:
|
|
285
|
+
var zBClassTracker = z11.object({
|
|
286
|
+
course: z11.string(),
|
|
287
|
+
teacher: z11.string(),
|
|
288
|
+
student: z11.string(),
|
|
289
|
+
classTimes: z11.array(z11.coerce.date()),
|
|
290
|
+
completedList: z11.array(z11.boolean()),
|
|
176
291
|
/**
|
|
177
292
|
* Virtual mongoose field when all values in completedList is true
|
|
178
293
|
*/
|
|
179
|
-
completed:
|
|
294
|
+
completed: z11.boolean().optional(),
|
|
180
295
|
tuition: zTuition.optional(),
|
|
181
|
-
paid:
|
|
182
|
-
paused:
|
|
183
|
-
notes:
|
|
296
|
+
paid: z11.boolean().optional(),
|
|
297
|
+
paused: z11.boolean().optional(),
|
|
298
|
+
notes: z11.string().optional()
|
|
184
299
|
});
|
|
185
300
|
var zClassTracker = addAutoProps(zBClassTracker);
|
|
186
301
|
|
|
187
302
|
// src/interface/tracking/groupTracker.ts
|
|
188
|
-
import { z as
|
|
303
|
+
import { z as z14 } from "zod";
|
|
189
304
|
|
|
190
305
|
// src/interface/tracking/scheduleData.ts
|
|
191
|
-
import { z as
|
|
192
|
-
var zScheduleData =
|
|
193
|
-
startTime:
|
|
306
|
+
import { z as z12 } from "zod";
|
|
307
|
+
var zScheduleData = z12.object({
|
|
308
|
+
startTime: z12.string(),
|
|
194
309
|
// String in 24 hour "HH:mm" format
|
|
195
|
-
dayOfWeek:
|
|
310
|
+
dayOfWeek: z12.number().int().min(0).max(6)
|
|
196
311
|
// integeters in 0 - 6
|
|
197
312
|
});
|
|
198
313
|
|
|
@@ -221,126 +336,126 @@ var NYIGSchool = /* @__PURE__ */ ((NYIGSchool2) => {
|
|
|
221
336
|
})(NYIGSchool || {});
|
|
222
337
|
|
|
223
338
|
// src/interface/course/course.ts
|
|
224
|
-
import { z as
|
|
225
|
-
var zBCourse =
|
|
226
|
-
name:
|
|
227
|
-
category:
|
|
339
|
+
import { z as z13 } from "zod";
|
|
340
|
+
var zBCourse = z13.object({
|
|
341
|
+
name: z13.string(),
|
|
342
|
+
category: z13.nativeEnum(CourseCategory),
|
|
228
343
|
/**
|
|
229
344
|
* @unit SECONDS - Duration of the course in seconds
|
|
230
345
|
*/
|
|
231
|
-
duration:
|
|
346
|
+
duration: z13.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"),
|
|
232
347
|
/**
|
|
233
348
|
* @unit CENTS - Price of the course in cents
|
|
234
349
|
*/
|
|
235
|
-
price:
|
|
236
|
-
description:
|
|
350
|
+
price: z13.coerce.number().int("Tuition must be a whole number in cents").min(1, "Tuition must not be less than or equal to 0"),
|
|
351
|
+
description: z13.string().or(z13.literal("")).optional(),
|
|
237
352
|
/**
|
|
238
353
|
* NYIG School locations
|
|
239
354
|
*/
|
|
240
|
-
nyigSchool:
|
|
355
|
+
nyigSchool: z13.nativeEnum(NYIGSchool),
|
|
241
356
|
/**
|
|
242
357
|
* Recommended level before taking this course
|
|
243
358
|
*/
|
|
244
|
-
recLevel:
|
|
359
|
+
recLevel: z13.string().or(z13.literal("")).optional(),
|
|
245
360
|
/**
|
|
246
361
|
* Camp tuition for half-day option
|
|
247
362
|
*/
|
|
248
|
-
halfCampTuition:
|
|
363
|
+
halfCampTuition: z13.coerce.number().int("Tuition must be a whole number in cents").min(1, "Tuition must not be less than or equal to 0").optional(),
|
|
249
364
|
/**
|
|
250
365
|
* Camp tuition for full-day option
|
|
251
366
|
*/
|
|
252
|
-
fullCampTuition:
|
|
367
|
+
fullCampTuition: z13.coerce.number().int("Tuition must be a whole number in cents").min(1, "Tuition must not be less than or equal to 0").optional()
|
|
253
368
|
});
|
|
254
369
|
var zCourse = addAutoProps(zBCourse);
|
|
255
370
|
|
|
256
371
|
// src/interface/tracking/groupTracker.ts
|
|
257
|
-
var zBGroupTracker =
|
|
258
|
-
course:
|
|
259
|
-
teacher:
|
|
260
|
-
semester:
|
|
372
|
+
var zBGroupTracker = z14.object({
|
|
373
|
+
course: z14.string(),
|
|
374
|
+
teacher: z14.string(),
|
|
375
|
+
semester: z14.string(),
|
|
261
376
|
scheduleData: zScheduleData,
|
|
262
377
|
/**
|
|
263
378
|
* occurrences are tracked by week for Groups
|
|
264
379
|
*/
|
|
265
|
-
occurrences:
|
|
380
|
+
occurrences: z14.array(z14.coerce.date()),
|
|
266
381
|
/**
|
|
267
382
|
* attendances are tracked by week for Groups
|
|
268
383
|
*/
|
|
269
|
-
attendances:
|
|
384
|
+
attendances: z14.array(z14.string()),
|
|
270
385
|
/**
|
|
271
386
|
* public-facing ID of the course instance, e.g., 101
|
|
272
387
|
*/
|
|
273
|
-
courseId:
|
|
388
|
+
courseId: z14.string().optional(),
|
|
274
389
|
/**
|
|
275
390
|
* Age group of the class instance, e.g. "adult", "youth"
|
|
276
391
|
*/
|
|
277
|
-
ageGroup:
|
|
392
|
+
ageGroup: z14.nativeEnum(AgeGroup).optional(),
|
|
278
393
|
/**
|
|
279
394
|
* If true, the course is hidden from public view
|
|
280
395
|
*/
|
|
281
|
-
isNonPublic:
|
|
282
|
-
notes:
|
|
396
|
+
isNonPublic: z14.boolean().optional(),
|
|
397
|
+
notes: z14.string().optional()
|
|
283
398
|
});
|
|
284
399
|
var zGroupTracker = addAutoProps(zBGroupTracker);
|
|
285
400
|
|
|
286
401
|
// src/interface/booking/campBooking.ts
|
|
287
|
-
var zBCampBooking =
|
|
288
|
-
ctId:
|
|
289
|
-
isOnline:
|
|
290
|
-
classDates:
|
|
291
|
-
campOption:
|
|
292
|
-
shipping:
|
|
402
|
+
var zBCampBooking = z15.object({
|
|
403
|
+
ctId: z15.string().optional(),
|
|
404
|
+
isOnline: z15.boolean(),
|
|
405
|
+
classDates: z15.string(),
|
|
406
|
+
campOption: z15.nativeEnum(CampOption),
|
|
407
|
+
shipping: z15.boolean().optional()
|
|
293
408
|
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
294
409
|
var zCampBooking = addAutoProps(zBCampBooking);
|
|
295
410
|
|
|
296
411
|
// src/interface/booking/groupBooking.ts
|
|
297
|
-
import { z as
|
|
298
|
-
var zBGroupBooking =
|
|
299
|
-
gtId:
|
|
300
|
-
isTrial:
|
|
301
|
-
isOnline:
|
|
302
|
-
classDate:
|
|
303
|
-
shipping:
|
|
412
|
+
import { z as z16 } from "zod";
|
|
413
|
+
var zBGroupBooking = z16.object({
|
|
414
|
+
gtId: z16.string().optional(),
|
|
415
|
+
isTrial: z16.boolean().optional(),
|
|
416
|
+
isOnline: z16.boolean(),
|
|
417
|
+
classDate: z16.string().optional(),
|
|
418
|
+
shipping: z16.boolean().optional()
|
|
304
419
|
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
305
420
|
var zGroupBooking = addAutoProps(zBGroupBooking);
|
|
306
421
|
|
|
307
422
|
// src/interface/booking/privateBooking.ts
|
|
308
|
-
import { z as
|
|
309
|
-
var zBPrivateBooking =
|
|
310
|
-
courseId:
|
|
311
|
-
teacherId:
|
|
312
|
-
classDate:
|
|
423
|
+
import { z as z17 } from "zod";
|
|
424
|
+
var zBPrivateBooking = z17.object({
|
|
425
|
+
courseId: z17.string(),
|
|
426
|
+
teacherId: z17.string(),
|
|
427
|
+
classDate: z17.string().optional()
|
|
313
428
|
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
314
429
|
var zPrivateBooking = addAutoProps(zBPrivateBooking);
|
|
315
430
|
|
|
316
431
|
// src/interface/public/aurora.ts
|
|
317
|
-
import { z as
|
|
318
|
-
var zTeacherDisplay =
|
|
319
|
-
name:
|
|
320
|
-
email:
|
|
321
|
-
title:
|
|
322
|
-
imageUrl:
|
|
323
|
-
bio:
|
|
324
|
-
});
|
|
325
|
-
var zCourseTable =
|
|
326
|
-
id:
|
|
327
|
-
name:
|
|
328
|
-
duration:
|
|
329
|
-
dateAndTime:
|
|
330
|
-
recommendedLevel:
|
|
331
|
-
tuition:
|
|
432
|
+
import { z as z18 } from "zod";
|
|
433
|
+
var zTeacherDisplay = z18.object({
|
|
434
|
+
name: z18.string(),
|
|
435
|
+
email: z18.string().email(),
|
|
436
|
+
title: z18.string(),
|
|
437
|
+
imageUrl: z18.string(),
|
|
438
|
+
bio: z18.string()
|
|
439
|
+
});
|
|
440
|
+
var zCourseTable = z18.object({
|
|
441
|
+
id: z18.string(),
|
|
442
|
+
name: z18.string(),
|
|
443
|
+
duration: z18.number(),
|
|
444
|
+
dateAndTime: z18.string(),
|
|
445
|
+
recommendedLevel: z18.string(),
|
|
446
|
+
tuition: z18.string()
|
|
332
447
|
});
|
|
333
448
|
|
|
334
449
|
// src/interface/public/imageDef.ts
|
|
335
|
-
import { z as
|
|
336
|
-
var zImageDef =
|
|
337
|
-
url:
|
|
338
|
-
height:
|
|
339
|
-
width:
|
|
450
|
+
import { z as z19 } from "zod";
|
|
451
|
+
var zImageDef = z19.object({
|
|
452
|
+
url: z19.string(),
|
|
453
|
+
height: z19.number(),
|
|
454
|
+
width: z19.number()
|
|
340
455
|
});
|
|
341
456
|
|
|
342
457
|
// src/interface/reporting/reportTicket.ts
|
|
343
|
-
import { z as
|
|
458
|
+
import { z as z20 } from "zod";
|
|
344
459
|
|
|
345
460
|
// src/interface/reporting/ticketStatus.ts
|
|
346
461
|
var TicketStatus = /* @__PURE__ */ ((TicketStatus2) => {
|
|
@@ -352,12 +467,12 @@ var TicketStatus = /* @__PURE__ */ ((TicketStatus2) => {
|
|
|
352
467
|
})(TicketStatus || {});
|
|
353
468
|
|
|
354
469
|
// src/interface/reporting/reportTicket.ts
|
|
355
|
-
var zBReportTicket =
|
|
356
|
-
requester:
|
|
357
|
-
resolver:
|
|
358
|
-
status:
|
|
359
|
-
title:
|
|
360
|
-
description:
|
|
470
|
+
var zBReportTicket = z20.object({
|
|
471
|
+
requester: z20.string(),
|
|
472
|
+
resolver: z20.string().optional(),
|
|
473
|
+
status: z20.nativeEnum(TicketStatus),
|
|
474
|
+
title: z20.string(),
|
|
475
|
+
description: z20.string()
|
|
361
476
|
});
|
|
362
477
|
var zReportTicket = addAutoProps(zBReportTicket);
|
|
363
478
|
|
|
@@ -370,96 +485,96 @@ var Season = /* @__PURE__ */ ((Season2) => {
|
|
|
370
485
|
})(Season || {});
|
|
371
486
|
|
|
372
487
|
// src/interface/semester/semester.ts
|
|
373
|
-
import { z as
|
|
374
|
-
var zBSemester =
|
|
375
|
-
season:
|
|
376
|
-
year:
|
|
377
|
-
startDate:
|
|
378
|
-
endDate:
|
|
488
|
+
import { z as z21 } from "zod";
|
|
489
|
+
var zBSemester = z21.object({
|
|
490
|
+
season: z21.nativeEnum(Season),
|
|
491
|
+
year: z21.number().min(2022).max(2999),
|
|
492
|
+
startDate: z21.coerce.date(),
|
|
493
|
+
endDate: z21.coerce.date(),
|
|
379
494
|
/**
|
|
380
495
|
* Format: start, end, start, end, ...
|
|
381
496
|
*/
|
|
382
|
-
blackoutDates:
|
|
497
|
+
blackoutDates: z21.array(z21.coerce.date()),
|
|
383
498
|
/**
|
|
384
499
|
* List of names of some break: date range
|
|
385
500
|
*/
|
|
386
|
-
importantDates:
|
|
501
|
+
importantDates: z21.array(z21.string())
|
|
387
502
|
});
|
|
388
503
|
var zSemester = addAutoProps(zBSemester);
|
|
389
504
|
|
|
390
505
|
// src/interface/event/eConfig.ts
|
|
391
|
-
import { z as
|
|
506
|
+
import { z as z24 } from "zod";
|
|
392
507
|
|
|
393
508
|
// src/interface/event/eTicket.ts
|
|
394
|
-
import { z as
|
|
395
|
-
var zBEventTicket =
|
|
396
|
-
name:
|
|
509
|
+
import { z as z22 } from "zod";
|
|
510
|
+
var zBEventTicket = z22.object({
|
|
511
|
+
name: z22.string().min(5, "Name must be at least 5 characters"),
|
|
397
512
|
/**
|
|
398
513
|
* Price in cents
|
|
399
514
|
*/
|
|
400
|
-
price:
|
|
515
|
+
price: z22.number().min(1, "Price must be at least $1"),
|
|
401
516
|
/**
|
|
402
517
|
* @optional description of the ticket
|
|
403
518
|
*/
|
|
404
|
-
description:
|
|
519
|
+
description: z22.string().optional(),
|
|
405
520
|
/**
|
|
406
521
|
* @optional The ticket cannot be purchased if true
|
|
407
522
|
*/
|
|
408
|
-
isNotBuyable:
|
|
523
|
+
isNotBuyable: z22.boolean().optional(),
|
|
409
524
|
/**
|
|
410
525
|
* @optional If date is provided and in the past, ticket cannot be purchased
|
|
411
526
|
*/
|
|
412
|
-
lastBuyableDate:
|
|
527
|
+
lastBuyableDate: z22.coerce.date().optional()
|
|
413
528
|
});
|
|
414
529
|
var zEventTicket = addAutoProps(zBEventTicket);
|
|
415
530
|
|
|
416
531
|
// src/interface/event/table.ts
|
|
417
|
-
import { z as
|
|
418
|
-
var zTable =
|
|
419
|
-
var zDetailsTable =
|
|
420
|
-
fields:
|
|
532
|
+
import { z as z23 } from "zod";
|
|
533
|
+
var zTable = z23.array(z23.record(z23.string(), z23.string()));
|
|
534
|
+
var zDetailsTable = z23.object({
|
|
535
|
+
fields: z23.array(z23.string()).length(2),
|
|
421
536
|
data: zTable
|
|
422
537
|
});
|
|
423
|
-
var zScheduleTable =
|
|
424
|
-
fields:
|
|
425
|
-
data:
|
|
538
|
+
var zScheduleTable = z23.object({
|
|
539
|
+
fields: z23.array(z23.string()).length(2),
|
|
540
|
+
data: z23.record(z23.string(), zTable)
|
|
426
541
|
});
|
|
427
542
|
|
|
428
543
|
// src/interface/event/eConfig.ts
|
|
429
|
-
var zBEventConfig =
|
|
544
|
+
var zBEventConfig = z24.object({
|
|
430
545
|
/**
|
|
431
546
|
* Location of the event
|
|
432
547
|
*/
|
|
433
|
-
location:
|
|
548
|
+
location: z24.string().optional(),
|
|
434
549
|
/**
|
|
435
550
|
* URL of the tournament on the official website
|
|
436
551
|
* Must be a valid URL link
|
|
437
552
|
*/
|
|
438
|
-
url:
|
|
553
|
+
url: z24.string(),
|
|
439
554
|
/**
|
|
440
555
|
* Full name of the tournament
|
|
441
556
|
*/
|
|
442
|
-
title:
|
|
557
|
+
title: z24.string(),
|
|
443
558
|
/**
|
|
444
559
|
* Abbreviated title of the tournament
|
|
445
560
|
*/
|
|
446
|
-
shortTitle:
|
|
561
|
+
shortTitle: z24.string(),
|
|
447
562
|
/**
|
|
448
563
|
* Tournament start date and time
|
|
449
564
|
*/
|
|
450
|
-
tStart:
|
|
565
|
+
tStart: z24.coerce.date(),
|
|
451
566
|
/**
|
|
452
567
|
* Tournament end date and time
|
|
453
568
|
*/
|
|
454
|
-
tEnd:
|
|
569
|
+
tEnd: z24.coerce.date(),
|
|
455
570
|
/**
|
|
456
571
|
* Short description for tournament card
|
|
457
572
|
*/
|
|
458
|
-
shortDescription:
|
|
573
|
+
shortDescription: z24.string(),
|
|
459
574
|
/**
|
|
460
575
|
* Full description
|
|
461
576
|
*/
|
|
462
|
-
description:
|
|
577
|
+
description: z24.string(),
|
|
463
578
|
/**
|
|
464
579
|
* Defines the tournament details table with 2 columns
|
|
465
580
|
* typically Time and Event
|
|
@@ -473,15 +588,15 @@ var zBEventConfig = z22.object({
|
|
|
473
588
|
/**
|
|
474
589
|
* List of ticket object IDs for this tournament
|
|
475
590
|
*/
|
|
476
|
-
tickets:
|
|
591
|
+
tickets: z24.array(z24.string()),
|
|
477
592
|
/**
|
|
478
593
|
* If false, the tournament registration is closed
|
|
479
594
|
*/
|
|
480
|
-
canRegister:
|
|
595
|
+
canRegister: z24.boolean(),
|
|
481
596
|
/**
|
|
482
597
|
* If true, free form donation amounts are disabled.
|
|
483
598
|
*/
|
|
484
|
-
donationsDisabled:
|
|
599
|
+
donationsDisabled: z24.boolean().optional(),
|
|
485
600
|
/**
|
|
486
601
|
* Defines URL, height, width of the image
|
|
487
602
|
*/
|
|
@@ -489,150 +604,42 @@ var zBEventConfig = z22.object({
|
|
|
489
604
|
});
|
|
490
605
|
var zEventConfig = addAutoProps(zBEventConfig);
|
|
491
606
|
var zEventConfigResponse = zEventConfig.extend({
|
|
492
|
-
tickets:
|
|
607
|
+
tickets: z24.array(zEventTicket)
|
|
493
608
|
});
|
|
494
609
|
|
|
495
610
|
// src/interface/event/eReg.ts
|
|
496
|
-
import { z as
|
|
611
|
+
import { z as z26 } from "zod";
|
|
497
612
|
|
|
498
613
|
// src/interface/event/eTicketReg.ts
|
|
499
|
-
import { z as
|
|
500
|
-
var zEventTicketReg =
|
|
501
|
-
ticket:
|
|
614
|
+
import { z as z25 } from "zod";
|
|
615
|
+
var zEventTicketReg = z25.object({
|
|
616
|
+
ticket: z25.string(),
|
|
502
617
|
/**
|
|
503
618
|
* integer minimum 1, otherwise no ticket is being bought
|
|
504
619
|
*/
|
|
505
|
-
amount:
|
|
620
|
+
amount: z25.number().int().min(1)
|
|
506
621
|
});
|
|
507
622
|
var zEventTicketRegResponse = zEventTicketReg.extend({
|
|
508
623
|
ticket: zEventTicket
|
|
509
624
|
});
|
|
510
625
|
|
|
511
626
|
// src/interface/event/eReg.ts
|
|
512
|
-
var zBEventReg =
|
|
513
|
-
agaId:
|
|
514
|
-
tournamentId:
|
|
515
|
-
tickets:
|
|
627
|
+
var zBEventReg = z26.object({
|
|
628
|
+
agaId: z26.string(),
|
|
629
|
+
tournamentId: z26.string(),
|
|
630
|
+
tickets: z26.array(zEventTicketReg),
|
|
516
631
|
/**
|
|
517
632
|
* @units CENTS - Donation in cents
|
|
518
633
|
*/
|
|
519
|
-
donation:
|
|
634
|
+
donation: z26.coerce.number().optional(),
|
|
520
635
|
/**
|
|
521
636
|
* How the registration was created, through public endpoint or admin
|
|
522
637
|
*/
|
|
523
|
-
createMethod:
|
|
638
|
+
createMethod: z26.string().optional()
|
|
524
639
|
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
525
640
|
var zEventReg = addAutoProps(zBEventReg);
|
|
526
641
|
var zEventRegResponse = zEventReg.extend({
|
|
527
|
-
tickets:
|
|
528
|
-
});
|
|
529
|
-
|
|
530
|
-
// src/interface/user/goRank.ts
|
|
531
|
-
var GoRank = /* @__PURE__ */ ((GoRank2) => {
|
|
532
|
-
GoRank2["KYU1"] = "1k";
|
|
533
|
-
GoRank2["KYU2"] = "2k";
|
|
534
|
-
GoRank2["KYU3"] = "3k";
|
|
535
|
-
GoRank2["KYU4"] = "4k";
|
|
536
|
-
GoRank2["KYU5"] = "5k";
|
|
537
|
-
GoRank2["KYU6"] = "6k";
|
|
538
|
-
GoRank2["KYU7"] = "7k";
|
|
539
|
-
GoRank2["KYU8"] = "8k";
|
|
540
|
-
GoRank2["KYU9"] = "9k";
|
|
541
|
-
GoRank2["KYU10"] = "10k";
|
|
542
|
-
GoRank2["KYU11"] = "11k";
|
|
543
|
-
GoRank2["KYU12"] = "12k";
|
|
544
|
-
GoRank2["KYU13"] = "13k";
|
|
545
|
-
GoRank2["KYU14"] = "14k";
|
|
546
|
-
GoRank2["KYU15"] = "15k";
|
|
547
|
-
GoRank2["KYU16"] = "16k";
|
|
548
|
-
GoRank2["KYU17"] = "17k";
|
|
549
|
-
GoRank2["KYU18"] = "18k";
|
|
550
|
-
GoRank2["KYU19"] = "19k";
|
|
551
|
-
GoRank2["KYU20"] = "20k";
|
|
552
|
-
GoRank2["KYU21"] = "21k";
|
|
553
|
-
GoRank2["KYU22"] = "22k";
|
|
554
|
-
GoRank2["KYU23"] = "23k";
|
|
555
|
-
GoRank2["KYU24"] = "24k";
|
|
556
|
-
GoRank2["KYU25"] = "25k";
|
|
557
|
-
GoRank2["DAN1"] = "1d";
|
|
558
|
-
GoRank2["DAN2"] = "2d";
|
|
559
|
-
GoRank2["DAN3"] = "3d";
|
|
560
|
-
GoRank2["DAN4"] = "4d";
|
|
561
|
-
GoRank2["DAN5"] = "5d";
|
|
562
|
-
GoRank2["DAN6"] = "6d";
|
|
563
|
-
GoRank2["DAN7"] = "7d";
|
|
564
|
-
GoRank2["PRO1"] = "1p";
|
|
565
|
-
GoRank2["PRO2"] = "2p";
|
|
566
|
-
GoRank2["PRO3"] = "3p";
|
|
567
|
-
GoRank2["PRO4"] = "4p";
|
|
568
|
-
GoRank2["PRO5"] = "5p";
|
|
569
|
-
GoRank2["PRO6"] = "6p";
|
|
570
|
-
GoRank2["PRO7"] = "7p";
|
|
571
|
-
GoRank2["PRO8"] = "8p";
|
|
572
|
-
GoRank2["PRO9"] = "9p";
|
|
573
|
-
return GoRank2;
|
|
574
|
-
})(GoRank || {});
|
|
575
|
-
|
|
576
|
-
// src/interface/user/user.ts
|
|
577
|
-
import { z as z25 } from "zod";
|
|
578
|
-
var zBUser = z25.object({
|
|
579
|
-
name: z25.string().min(2).max(100),
|
|
580
|
-
username: z25.string().optional(),
|
|
581
|
-
password: z25.string().optional(),
|
|
582
|
-
roles: z25.array(z25.number().int()).optional(),
|
|
583
|
-
email: z25.string().max(100).email().or(z25.literal("")).optional(),
|
|
584
|
-
address: z25.string().or(z25.literal("")).optional(),
|
|
585
|
-
country: z25.string().length(2, {
|
|
586
|
-
message: "Enter the 2-letter country code"
|
|
587
|
-
}).or(z25.literal("")).optional(),
|
|
588
|
-
phoneNumber: z25.string().regex(/^\d{10}/, {
|
|
589
|
-
message: `Please enter a valid 10-digit US phone number with numbers only`
|
|
590
|
-
}).or(z25.literal("")).optional(),
|
|
591
|
-
birthDate: z25.string().regex(/^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/, {
|
|
592
|
-
message: "Enter a valid date in yyyy-mm-dd format"
|
|
593
|
-
}).or(z25.literal("")).optional()
|
|
594
|
-
});
|
|
595
|
-
var zUser = addAutoProps(zBUser);
|
|
596
|
-
var zStudent = zUser.extend({
|
|
597
|
-
rank: z25.nativeEnum(GoRank),
|
|
598
|
-
guardian: z25.string().optional()
|
|
599
|
-
});
|
|
600
|
-
var zTeacher = zUser.extend({
|
|
601
|
-
rank: z25.nativeEnum(GoRank),
|
|
602
|
-
/**
|
|
603
|
-
* Inactive teachers are not shown on public endpoints
|
|
604
|
-
*/
|
|
605
|
-
isInactive: z25.boolean().optional(),
|
|
606
|
-
/**
|
|
607
|
-
* Teacher's position, e.g., instructor, president
|
|
608
|
-
*/
|
|
609
|
-
title: z25.string().optional(),
|
|
610
|
-
/**
|
|
611
|
-
* Teacher's bio text describing experience
|
|
612
|
-
* new lines will be rendered as paragraphs
|
|
613
|
-
*/
|
|
614
|
-
bio: z25.string().optional(),
|
|
615
|
-
/** Format is illustrated below, where teacher is available
|
|
616
|
-
* Mon 9-12am 3-6pm & Tue 10-12am 6-10pm
|
|
617
|
-
* [
|
|
618
|
-
* [[9, 12], [15, 18]],
|
|
619
|
-
* [[10, 12], [18, 20]],
|
|
620
|
-
* [],
|
|
621
|
-
* [],
|
|
622
|
-
* [],
|
|
623
|
-
* [],
|
|
624
|
-
* [],
|
|
625
|
-
* ]
|
|
626
|
-
*/
|
|
627
|
-
available: z25.array(z25.array(z25.array(z25.number()))).optional()
|
|
628
|
-
});
|
|
629
|
-
|
|
630
|
-
// src/interface/user/userRoles.ts
|
|
631
|
-
import { z as z26 } from "zod";
|
|
632
|
-
var zUserRoles = z26.object({
|
|
633
|
-
user: z26.number().int(),
|
|
634
|
-
admin: z26.number().int(),
|
|
635
|
-
superadmin: z26.number().int()
|
|
642
|
+
tickets: z26.array(zEventTicketRegResponse)
|
|
636
643
|
});
|
|
637
644
|
export {
|
|
638
645
|
AgeGroup,
|
|
@@ -693,6 +700,7 @@ export {
|
|
|
693
700
|
zTeacher,
|
|
694
701
|
zTeacherDisplay,
|
|
695
702
|
zTeacherPayment,
|
|
703
|
+
zTeacherPaymentResponse,
|
|
696
704
|
zTeacherPaymentRow,
|
|
697
705
|
zTuition,
|
|
698
706
|
zUser,
|