@nyig/models 0.2.4 → 0.2.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/README.md +5 -0
- package/index.d.mts +1840 -2
- package/index.d.ts +1840 -2
- package/index.js +779 -6
- package/index.mjs +720 -5
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1,9 +1,724 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/interface/booking/bUserInfo.ts
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
var zBUserInfo = z.object({
|
|
4
|
+
firstName: z.string(),
|
|
5
|
+
lastName: z.string(),
|
|
6
|
+
rank: z.string(),
|
|
7
|
+
email: z.string(),
|
|
8
|
+
phone: z.string().optional(),
|
|
9
|
+
address: z.string().optional(),
|
|
10
|
+
notes: z.string().optional()
|
|
6
11
|
});
|
|
12
|
+
|
|
13
|
+
// src/interface/booking/privateBooking.ts
|
|
14
|
+
import { z as z4 } from "zod";
|
|
15
|
+
|
|
16
|
+
// src/mongoose.ts
|
|
17
|
+
import { z as z2 } from "zod";
|
|
18
|
+
function extendZodObjectForMongoose(original) {
|
|
19
|
+
return original.extend({
|
|
20
|
+
_id: z2.string(),
|
|
21
|
+
createdAt: z2.coerce.date().optional(),
|
|
22
|
+
updatedAt: z2.coerce.date().optional()
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// src/interface/booking/bPaymentInfo.ts
|
|
27
|
+
import { z as z3 } from "zod";
|
|
28
|
+
var zBPaymentInfo = z3.object({
|
|
29
|
+
/**
|
|
30
|
+
* @units CENTS - Proposed payment amount in cents of the booking
|
|
31
|
+
*/
|
|
32
|
+
paymentAmount: z3.number(),
|
|
33
|
+
/**
|
|
34
|
+
* True if the payment has been received. Populated by webhook.
|
|
35
|
+
*/
|
|
36
|
+
paymentReceived: z3.boolean().optional(),
|
|
37
|
+
/**
|
|
38
|
+
* When Date is reached, document is deleted by MongoDB sweeper.
|
|
39
|
+
* Creation typically marks one to two weeks.
|
|
40
|
+
* After payment, webhook should extend this date to essentially infinite.
|
|
41
|
+
*/
|
|
42
|
+
expireAt: z3.coerce.date().optional()
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
// src/interface/booking/privateBooking.ts
|
|
46
|
+
var zPrivateBooking = z4.object({
|
|
47
|
+
userId: z4.string().optional(),
|
|
48
|
+
courseId: z4.string(),
|
|
49
|
+
teacherId: z4.string(),
|
|
50
|
+
classDate: z4.string().optional()
|
|
51
|
+
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
52
|
+
var zMPrivateBooking = extendZodObjectForMongoose(zPrivateBooking);
|
|
53
|
+
|
|
54
|
+
// src/interface/booking/groupBooking.ts
|
|
55
|
+
import { z as z5 } from "zod";
|
|
56
|
+
var zGroupBooking = z5.object({
|
|
57
|
+
userId: z5.string().optional(),
|
|
58
|
+
gtId: z5.string().optional(),
|
|
59
|
+
isTrial: z5.boolean().optional(),
|
|
60
|
+
isOnline: z5.boolean(),
|
|
61
|
+
classDate: z5.string().optional(),
|
|
62
|
+
shipping: z5.boolean().optional()
|
|
63
|
+
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
64
|
+
var zMGroupBooking = extendZodObjectForMongoose(zGroupBooking);
|
|
65
|
+
|
|
66
|
+
// src/interface/booking/campBooking.ts
|
|
67
|
+
import { z as z15 } from "zod";
|
|
68
|
+
|
|
69
|
+
// src/interface/tracking/attendState.ts
|
|
70
|
+
var AttendState = /* @__PURE__ */ ((AttendState2) => {
|
|
71
|
+
AttendState2["ABSENT"] = "absent";
|
|
72
|
+
AttendState2["PRESENT"] = "present";
|
|
73
|
+
AttendState2["NONE"] = "none";
|
|
74
|
+
return AttendState2;
|
|
75
|
+
})(AttendState || {});
|
|
76
|
+
|
|
77
|
+
// src/interface/tracking/attendance.ts
|
|
78
|
+
import { z as z7 } from "zod";
|
|
79
|
+
|
|
80
|
+
// src/interface/payment/tuition.ts
|
|
81
|
+
import { z as z6 } from "zod";
|
|
82
|
+
var zTuition = z6.object({
|
|
83
|
+
primary: z6.number(),
|
|
84
|
+
textbook: z6.boolean().optional(),
|
|
85
|
+
shipping: z6.boolean().optional()
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
// src/interface/tracking/campOption.ts
|
|
89
|
+
var CampOption = /* @__PURE__ */ ((CampOption2) => {
|
|
90
|
+
CampOption2["AM"] = "am";
|
|
91
|
+
CampOption2["PM"] = "pm";
|
|
92
|
+
CampOption2["FULL"] = "full";
|
|
93
|
+
return CampOption2;
|
|
94
|
+
})(CampOption || {});
|
|
95
|
+
|
|
96
|
+
// src/interface/tracking/attendance.ts
|
|
97
|
+
var zAttendance = z7.object({
|
|
98
|
+
student: z7.string(),
|
|
99
|
+
states: z7.array(z7.nativeEnum(AttendState)),
|
|
100
|
+
tuition: zTuition,
|
|
101
|
+
paid: z7.boolean().optional(),
|
|
102
|
+
campOption: z7.nativeEnum(CampOption)
|
|
103
|
+
});
|
|
104
|
+
var zMAttendance = extendZodObjectForMongoose(zAttendance);
|
|
105
|
+
|
|
106
|
+
// src/interface/tracking/campTracker.ts
|
|
107
|
+
import { z as z8 } from "zod";
|
|
108
|
+
var zCampTracker = z8.object({
|
|
109
|
+
/**
|
|
110
|
+
* Mongoose object ID
|
|
111
|
+
*/
|
|
112
|
+
course: z8.string(),
|
|
113
|
+
/**
|
|
114
|
+
* Mongoose object ID
|
|
115
|
+
*/
|
|
116
|
+
teacher: z8.string(),
|
|
117
|
+
/**
|
|
118
|
+
* Mongoose object ID
|
|
119
|
+
*/
|
|
120
|
+
semester: z8.string(),
|
|
121
|
+
/**
|
|
122
|
+
* occurrences are tracked by week for camps
|
|
123
|
+
*/
|
|
124
|
+
occurrences: z8.array(z8.string()),
|
|
125
|
+
/**
|
|
126
|
+
* attendances are tracked by week for camps
|
|
127
|
+
*/
|
|
128
|
+
attendances: z8.array(z8.string()),
|
|
129
|
+
notes: z8.string().optional()
|
|
130
|
+
});
|
|
131
|
+
var zMCampTracker = extendZodObjectForMongoose(zCampTracker);
|
|
132
|
+
|
|
133
|
+
// src/interface/tracking/classTracker.ts
|
|
134
|
+
import { z as z11 } from "zod";
|
|
135
|
+
|
|
136
|
+
// src/interface/payment/invoice.ts
|
|
137
|
+
import { z as z9 } from "zod";
|
|
138
|
+
|
|
139
|
+
// src/interface/payment/paymentMethod.ts
|
|
140
|
+
var PaymentMethod = /* @__PURE__ */ ((PaymentMethod2) => {
|
|
141
|
+
PaymentMethod2["CASH"] = "Cash";
|
|
142
|
+
PaymentMethod2["CHECK"] = "Check";
|
|
143
|
+
PaymentMethod2["VENMO"] = "Venmo";
|
|
144
|
+
PaymentMethod2["ZELLE"] = "Zelle Transfer";
|
|
145
|
+
return PaymentMethod2;
|
|
146
|
+
})(PaymentMethod || {});
|
|
147
|
+
|
|
148
|
+
// src/interface/payment/invoice.ts
|
|
149
|
+
var zDiscount = z9.object({
|
|
150
|
+
desc: z9.string(),
|
|
151
|
+
amount: z9.number()
|
|
152
|
+
});
|
|
153
|
+
var zInvoiceItem = z9.object({
|
|
154
|
+
/**
|
|
155
|
+
* Mongoose object ID
|
|
156
|
+
*/
|
|
157
|
+
course: z9.string(),
|
|
158
|
+
price: z9.number(),
|
|
159
|
+
units: z9.number()
|
|
160
|
+
});
|
|
161
|
+
var zInvoicePackage = z9.object({
|
|
162
|
+
/**
|
|
163
|
+
* Mongoose object ID
|
|
164
|
+
*/
|
|
165
|
+
student: z9.string(),
|
|
166
|
+
items: z9.array(zInvoiceItem)
|
|
167
|
+
});
|
|
168
|
+
var zInvoice = z9.object({
|
|
169
|
+
billTo: z9.string(),
|
|
170
|
+
packages: z9.array(zInvoicePackage),
|
|
171
|
+
discounts: z9.array(zDiscount),
|
|
172
|
+
textbook: z9.number().optional(),
|
|
173
|
+
shipping: z9.number().optional(),
|
|
174
|
+
paid: z9.nativeEnum(PaymentMethod).optional(),
|
|
175
|
+
notes: z9.string().optional(),
|
|
176
|
+
/**
|
|
177
|
+
* Mongoose object ID
|
|
178
|
+
*/
|
|
179
|
+
createdBy: z9.string(),
|
|
180
|
+
/**
|
|
181
|
+
* Mongoose object ID
|
|
182
|
+
*/
|
|
183
|
+
lastEditBy: z9.string().optional()
|
|
184
|
+
});
|
|
185
|
+
var zMInvoice = extendZodObjectForMongoose(zInvoice);
|
|
186
|
+
|
|
187
|
+
// src/interface/payment/teacherPayment.ts
|
|
188
|
+
import { z as z10 } from "zod";
|
|
189
|
+
var zTeacherPaymentRow = z10.object({
|
|
190
|
+
course: z10.string(),
|
|
191
|
+
length: z10.number(),
|
|
192
|
+
count: z10.number(),
|
|
193
|
+
wage: z10.number()
|
|
194
|
+
});
|
|
195
|
+
var zTeacherPayment = z10.object({
|
|
196
|
+
teacher: z10.string(),
|
|
197
|
+
rows: z10.array(zTeacherPaymentRow),
|
|
198
|
+
paid: z10.boolean().optional()
|
|
199
|
+
});
|
|
200
|
+
var zMTeacherPayment = extendZodObjectForMongoose(zTeacherPayment);
|
|
201
|
+
|
|
202
|
+
// src/interface/tracking/classTracker.ts
|
|
203
|
+
var zClassTracker = z11.object({
|
|
204
|
+
/**
|
|
205
|
+
* Mongoose object ID
|
|
206
|
+
*/
|
|
207
|
+
course: z11.string(),
|
|
208
|
+
/**
|
|
209
|
+
* Mongoose object ID
|
|
210
|
+
*/
|
|
211
|
+
teacher: z11.string(),
|
|
212
|
+
/**
|
|
213
|
+
* Mongoose object ID
|
|
214
|
+
*/
|
|
215
|
+
semester: z11.string(),
|
|
216
|
+
classTimes: z11.array(z11.coerce.date()),
|
|
217
|
+
completedList: z11.array(z11.boolean()),
|
|
218
|
+
/**
|
|
219
|
+
* Virtual mongoose field when all values in completedList is true
|
|
220
|
+
*/
|
|
221
|
+
completed: z11.boolean().optional(),
|
|
222
|
+
tuition: zTuition.optional(),
|
|
223
|
+
paid: z11.boolean().optional(),
|
|
224
|
+
notes: z11.string().optional()
|
|
225
|
+
});
|
|
226
|
+
var zMClassTracker = extendZodObjectForMongoose(zClassTracker);
|
|
227
|
+
|
|
228
|
+
// src/interface/tracking/groupTracker.ts
|
|
229
|
+
import { z as z14 } from "zod";
|
|
230
|
+
|
|
231
|
+
// src/interface/tracking/scheduleData.ts
|
|
232
|
+
import { z as z12 } from "zod";
|
|
233
|
+
var zScheduleData = z12.object({
|
|
234
|
+
startTime: z12.string(),
|
|
235
|
+
// String in 24 hour "HH:mm" format
|
|
236
|
+
dayOfWeek: z12.number().int().min(0).max(6)
|
|
237
|
+
// integeters in 0 - 6
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
// src/interface/course/ageGroup.ts
|
|
241
|
+
var AgeGroup = /* @__PURE__ */ ((AgeGroup2) => {
|
|
242
|
+
AgeGroup2["ADULT"] = "Adult";
|
|
243
|
+
AgeGroup2["YOUTH"] = "Youth";
|
|
244
|
+
return AgeGroup2;
|
|
245
|
+
})(AgeGroup || {});
|
|
246
|
+
|
|
247
|
+
// src/interface/course/category.ts
|
|
248
|
+
var CourseCategory = /* @__PURE__ */ ((CourseCategory2) => {
|
|
249
|
+
CourseCategory2["GROUP"] = "group";
|
|
250
|
+
CourseCategory2["PRIVATE"] = "private";
|
|
251
|
+
CourseCategory2["SEMIPRIVATE"] = "semiprivate";
|
|
252
|
+
CourseCategory2["CAMP"] = "camp";
|
|
253
|
+
return CourseCategory2;
|
|
254
|
+
})(CourseCategory || {});
|
|
255
|
+
|
|
256
|
+
// src/interface/course/school.ts
|
|
257
|
+
var NYIGSchool = /* @__PURE__ */ ((NYIGSchool2) => {
|
|
258
|
+
NYIGSchool2["MANHATTAN"] = "Manhattan";
|
|
259
|
+
NYIGSchool2["LITTLENECK"] = "Little Neck";
|
|
260
|
+
NYIGSchool2["ONLINE"] = "Online";
|
|
261
|
+
return NYIGSchool2;
|
|
262
|
+
})(NYIGSchool || {});
|
|
263
|
+
|
|
264
|
+
// src/interface/course/course.ts
|
|
265
|
+
import { z as z13 } from "zod";
|
|
266
|
+
var zCourse = z13.object({
|
|
267
|
+
name: z13.string(),
|
|
268
|
+
category: z13.nativeEnum(CourseCategory),
|
|
269
|
+
/**
|
|
270
|
+
* @unit SECONDS - Duration of the course in seconds
|
|
271
|
+
*/
|
|
272
|
+
duration: z13.number(),
|
|
273
|
+
/**
|
|
274
|
+
* @unit CENTS - Price of the course in cents
|
|
275
|
+
*/
|
|
276
|
+
price: z13.number(),
|
|
277
|
+
description: z13.string().optional(),
|
|
278
|
+
/**
|
|
279
|
+
* NYIG School locations
|
|
280
|
+
*/
|
|
281
|
+
nyigSchool: z13.nativeEnum(NYIGSchool),
|
|
282
|
+
/**
|
|
283
|
+
* Recommended level before taking this course
|
|
284
|
+
*/
|
|
285
|
+
recLevel: z13.string(),
|
|
286
|
+
/**
|
|
287
|
+
* Camp tuition for half-day option
|
|
288
|
+
*/
|
|
289
|
+
halfCampTuition: z13.number(),
|
|
290
|
+
/**
|
|
291
|
+
* Camp tuition for full-day option
|
|
292
|
+
*/
|
|
293
|
+
fullCampTuition: z13.number()
|
|
294
|
+
});
|
|
295
|
+
var zMCourse = extendZodObjectForMongoose(zCourse);
|
|
296
|
+
|
|
297
|
+
// src/interface/tracking/groupTracker.ts
|
|
298
|
+
var zGroupTracker = z14.object({
|
|
299
|
+
/**
|
|
300
|
+
* Mongoose object ID
|
|
301
|
+
*/
|
|
302
|
+
course: z14.string(),
|
|
303
|
+
/**
|
|
304
|
+
* Mongoose object ID
|
|
305
|
+
*/
|
|
306
|
+
teacher: z14.string(),
|
|
307
|
+
/**
|
|
308
|
+
* Mongoose object ID
|
|
309
|
+
*/
|
|
310
|
+
semester: z14.string(),
|
|
311
|
+
scheduleData: zScheduleData,
|
|
312
|
+
/**
|
|
313
|
+
* occurrences are tracked by week for Groups
|
|
314
|
+
*/
|
|
315
|
+
occurrences: z14.array(z14.coerce.date()),
|
|
316
|
+
/**
|
|
317
|
+
* attendances are tracked by week for Groups
|
|
318
|
+
*/
|
|
319
|
+
attendances: z14.array(z14.string()),
|
|
320
|
+
/**
|
|
321
|
+
* ID of the course instance, e.g., 101
|
|
322
|
+
*/
|
|
323
|
+
courseId: z14.string().optional(),
|
|
324
|
+
/**
|
|
325
|
+
* Age group of the class instance, e.g. "adult", "youth"
|
|
326
|
+
*/
|
|
327
|
+
ageGroup: z14.nativeEnum(AgeGroup).optional(),
|
|
328
|
+
/**
|
|
329
|
+
* If true, the course is hidden from public view
|
|
330
|
+
*/
|
|
331
|
+
isNonPublic: z14.boolean().optional(),
|
|
332
|
+
notes: z14.string().optional()
|
|
333
|
+
});
|
|
334
|
+
var zMGroupTracker = extendZodObjectForMongoose(zGroupTracker);
|
|
335
|
+
|
|
336
|
+
// src/interface/booking/campBooking.ts
|
|
337
|
+
var zCampBooking = z15.object({
|
|
338
|
+
userId: z15.string().optional(),
|
|
339
|
+
ctId: z15.string().optional(),
|
|
340
|
+
isOnline: z15.boolean(),
|
|
341
|
+
classDates: z15.string(),
|
|
342
|
+
campOption: z15.nativeEnum(CampOption),
|
|
343
|
+
shipping: z15.boolean().optional()
|
|
344
|
+
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
345
|
+
var zMCampBooking = extendZodObjectForMongoose(zCampBooking);
|
|
346
|
+
|
|
347
|
+
// src/interface/public/aurora.ts
|
|
348
|
+
import { z as z16 } from "zod";
|
|
349
|
+
var zTeacherDisplay = z16.object({
|
|
350
|
+
name: z16.string(),
|
|
351
|
+
email: z16.string().email(),
|
|
352
|
+
title: z16.string(),
|
|
353
|
+
imageUrl: z16.string(),
|
|
354
|
+
bio: z16.string()
|
|
355
|
+
});
|
|
356
|
+
var zCourseTable = z16.object({
|
|
357
|
+
id: z16.string(),
|
|
358
|
+
name: z16.string(),
|
|
359
|
+
duration: z16.number(),
|
|
360
|
+
dateAndTime: z16.string(),
|
|
361
|
+
recommendedLevel: z16.string(),
|
|
362
|
+
tuition: z16.string()
|
|
363
|
+
});
|
|
364
|
+
|
|
365
|
+
// src/interface/public/imageDef.ts
|
|
366
|
+
import { z as z17 } from "zod";
|
|
367
|
+
var zImageDef = z17.object({
|
|
368
|
+
url: z17.string(),
|
|
369
|
+
height: z17.number(),
|
|
370
|
+
width: z17.number()
|
|
371
|
+
});
|
|
372
|
+
|
|
373
|
+
// src/interface/reporting/reportTicket.ts
|
|
374
|
+
import { z as z18 } from "zod";
|
|
375
|
+
var TicketStatus = /* @__PURE__ */ ((TicketStatus2) => {
|
|
376
|
+
TicketStatus2["REQUESTED"] = "Requested";
|
|
377
|
+
TicketStatus2["IN_PROGRESS"] = "In-progress";
|
|
378
|
+
TicketStatus2["SIGN_OFF"] = "Sign-off";
|
|
379
|
+
TicketStatus2["COMPLETED"] = "Completed";
|
|
380
|
+
return TicketStatus2;
|
|
381
|
+
})(TicketStatus || {});
|
|
382
|
+
var zReportTicket = z18.object({
|
|
383
|
+
requester: z18.string(),
|
|
384
|
+
resolver: z18.string(),
|
|
385
|
+
status: z18.nativeEnum(TicketStatus),
|
|
386
|
+
title: z18.string(),
|
|
387
|
+
description: z18.string()
|
|
388
|
+
});
|
|
389
|
+
var zMReportTicket = extendZodObjectForMongoose(zReportTicket);
|
|
390
|
+
|
|
391
|
+
// src/interface/semester/season.ts
|
|
392
|
+
var Season = /* @__PURE__ */ ((Season2) => {
|
|
393
|
+
Season2["FALL"] = "fall";
|
|
394
|
+
Season2["SPRING"] = "spring";
|
|
395
|
+
Season2["SUMMER"] = "summer";
|
|
396
|
+
return Season2;
|
|
397
|
+
})(Season || {});
|
|
398
|
+
|
|
399
|
+
// src/interface/semester/semester.ts
|
|
400
|
+
import { z as z19 } from "zod";
|
|
401
|
+
var zSemester = z19.object({
|
|
402
|
+
season: z19.nativeEnum(Season),
|
|
403
|
+
year: z19.number().min(2022).max(2999),
|
|
404
|
+
startDate: z19.coerce.date(),
|
|
405
|
+
endDate: z19.coerce.date(),
|
|
406
|
+
/**
|
|
407
|
+
* Format: start, end, start, end, ...
|
|
408
|
+
*/
|
|
409
|
+
blackoutDates: z19.array(z19.coerce.date()),
|
|
410
|
+
/**
|
|
411
|
+
* List of names of some break: date range
|
|
412
|
+
*/
|
|
413
|
+
importantDates: z19.array(z19.string())
|
|
414
|
+
});
|
|
415
|
+
var zMSemester = extendZodObjectForMongoose(zSemester);
|
|
416
|
+
|
|
417
|
+
// src/interface/tournament/tConfig.ts
|
|
418
|
+
import { z as z21 } from "zod";
|
|
419
|
+
|
|
420
|
+
// src/interface/tournament/table.ts
|
|
421
|
+
import { z as z20 } from "zod";
|
|
422
|
+
var zTable = z20.array(z20.object({}));
|
|
423
|
+
var zDetailsTable = z20.object({
|
|
424
|
+
fields: z20.array(z20.string()).length(2),
|
|
425
|
+
data: zTable
|
|
426
|
+
});
|
|
427
|
+
var zScheduleTable = z20.object({
|
|
428
|
+
fields: z20.array(z20.string()).length(2),
|
|
429
|
+
data: z20.map(z20.string(), zTable)
|
|
430
|
+
});
|
|
431
|
+
|
|
432
|
+
// src/interface/tournament/tConfig.ts
|
|
433
|
+
var zTConfig = z21.object({
|
|
434
|
+
/**
|
|
435
|
+
* Location of the event
|
|
436
|
+
*/
|
|
437
|
+
location: z21.string().optional(),
|
|
438
|
+
/**
|
|
439
|
+
* URL of the tournament on the official website
|
|
440
|
+
* Must be a valid URL link
|
|
441
|
+
*/
|
|
442
|
+
url: z21.string(),
|
|
443
|
+
/**
|
|
444
|
+
* Full name of the tournament
|
|
445
|
+
*/
|
|
446
|
+
title: z21.string(),
|
|
447
|
+
/**
|
|
448
|
+
* Abbreviated title of the tournament
|
|
449
|
+
*/
|
|
450
|
+
shortTitle: z21.string(),
|
|
451
|
+
/**
|
|
452
|
+
* Tournament start date and time
|
|
453
|
+
*/
|
|
454
|
+
tStart: z21.coerce.date(),
|
|
455
|
+
/**
|
|
456
|
+
* Tournament end date and time
|
|
457
|
+
*/
|
|
458
|
+
tEnd: z21.coerce.date(),
|
|
459
|
+
/**
|
|
460
|
+
* Short description for tournament card
|
|
461
|
+
*/
|
|
462
|
+
shortDescription: z21.string(),
|
|
463
|
+
/**
|
|
464
|
+
* Full description
|
|
465
|
+
*/
|
|
466
|
+
description: z21.string(),
|
|
467
|
+
/**
|
|
468
|
+
* Defines the tournament details table with 2 columns
|
|
469
|
+
* typically Time and Event
|
|
470
|
+
*/
|
|
471
|
+
details: zDetailsTable,
|
|
472
|
+
/**
|
|
473
|
+
* Defines the tournament schedule.
|
|
474
|
+
* data is a map of tab title -> 2 column table rows.
|
|
475
|
+
*/
|
|
476
|
+
schedule: zScheduleTable,
|
|
477
|
+
/**
|
|
478
|
+
* List of ticket object IDs for this tournament
|
|
479
|
+
*/
|
|
480
|
+
tickets: z21.array(z21.string()),
|
|
481
|
+
/**
|
|
482
|
+
* If false, the tournament registration is closed
|
|
483
|
+
*/
|
|
484
|
+
canRegister: z21.boolean(),
|
|
485
|
+
/**
|
|
486
|
+
* If true, free form donation amounts are disabled.
|
|
487
|
+
*/
|
|
488
|
+
donationsDisabled: z21.boolean().optional(),
|
|
489
|
+
/**
|
|
490
|
+
* Defines URL, height, width of the image
|
|
491
|
+
*/
|
|
492
|
+
image: zImageDef.optional()
|
|
493
|
+
});
|
|
494
|
+
var zMTConfig = extendZodObjectForMongoose(zTConfig);
|
|
495
|
+
|
|
496
|
+
// src/interface/tournament/tReg.ts
|
|
497
|
+
import { z as z23 } from "zod";
|
|
498
|
+
|
|
499
|
+
// src/interface/tournament/tTicketReg.ts
|
|
500
|
+
import { z as z22 } from "zod";
|
|
501
|
+
var zTTicketReg = z22.object({
|
|
502
|
+
/**
|
|
503
|
+
* Mongoose ID of the ticket
|
|
504
|
+
*/
|
|
505
|
+
ticket: z22.string(),
|
|
506
|
+
/**
|
|
507
|
+
* integer minimum 1, otherwise no ticket is being bought
|
|
508
|
+
*/
|
|
509
|
+
amount: z22.number().int().min(1)
|
|
510
|
+
});
|
|
511
|
+
|
|
512
|
+
// src/interface/tournament/tReg.ts
|
|
513
|
+
var zTReg = z23.object({
|
|
514
|
+
agaId: z23.string(),
|
|
515
|
+
/**
|
|
516
|
+
* Mongoose ID of the tournament that the participant is registering for
|
|
517
|
+
*/
|
|
518
|
+
tournamentId: z23.string(),
|
|
519
|
+
tickets: z23.array(zTTicketReg),
|
|
520
|
+
/**
|
|
521
|
+
* @units CENTS - Donation in cents
|
|
522
|
+
*/
|
|
523
|
+
donation: z23.number().optional(),
|
|
524
|
+
/**
|
|
525
|
+
* How the registration was created, namely through public endpoint or admin
|
|
526
|
+
*/
|
|
527
|
+
createMethod: z23.string().optional(),
|
|
528
|
+
/**
|
|
529
|
+
* Mongoose ID of the admin that edited the registration
|
|
530
|
+
*/
|
|
531
|
+
edited: z23.string().optional()
|
|
532
|
+
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
533
|
+
var zMTReg = extendZodObjectForMongoose(zTReg);
|
|
534
|
+
|
|
535
|
+
// src/interface/tournament/tTicket.ts
|
|
536
|
+
import { z as z24 } from "zod";
|
|
537
|
+
var zTTicket = z24.object({
|
|
538
|
+
name: z24.string(),
|
|
539
|
+
/**
|
|
540
|
+
* Price in cents
|
|
541
|
+
*/
|
|
542
|
+
price: z24.number(),
|
|
543
|
+
/**
|
|
544
|
+
* @optional description of the ticket
|
|
545
|
+
*/
|
|
546
|
+
description: z24.string().optional(),
|
|
547
|
+
/**
|
|
548
|
+
* @optional The ticket cannot be purchased if true
|
|
549
|
+
*/
|
|
550
|
+
isNotBuyable: z24.boolean().optional(),
|
|
551
|
+
/**
|
|
552
|
+
* @optional If date is provided and in the past, ticket cannot be purchased
|
|
553
|
+
*/
|
|
554
|
+
lastBuytableDate: z24.coerce.date().optional()
|
|
555
|
+
});
|
|
556
|
+
var zMTTicket = extendZodObjectForMongoose(zTTicket);
|
|
557
|
+
|
|
558
|
+
// src/interface/user/goRank.ts
|
|
559
|
+
var GoRank = /* @__PURE__ */ ((GoRank2) => {
|
|
560
|
+
GoRank2["KYU1"] = "1k";
|
|
561
|
+
GoRank2["KYU2"] = "2k";
|
|
562
|
+
GoRank2["KYU3"] = "3k";
|
|
563
|
+
GoRank2["KYU4"] = "4k";
|
|
564
|
+
GoRank2["KYU5"] = "5k";
|
|
565
|
+
GoRank2["KYU6"] = "6k";
|
|
566
|
+
GoRank2["KYU7"] = "7k";
|
|
567
|
+
GoRank2["KYU8"] = "8k";
|
|
568
|
+
GoRank2["KYU9"] = "9k";
|
|
569
|
+
GoRank2["KYU10"] = "10k";
|
|
570
|
+
GoRank2["KYU11"] = "11k";
|
|
571
|
+
GoRank2["KYU12"] = "12k";
|
|
572
|
+
GoRank2["KYU13"] = "13k";
|
|
573
|
+
GoRank2["KYU14"] = "14k";
|
|
574
|
+
GoRank2["KYU15"] = "15k";
|
|
575
|
+
GoRank2["KYU16"] = "16k";
|
|
576
|
+
GoRank2["KYU17"] = "17k";
|
|
577
|
+
GoRank2["KYU18"] = "18k";
|
|
578
|
+
GoRank2["KYU19"] = "19k";
|
|
579
|
+
GoRank2["KYU20"] = "20k";
|
|
580
|
+
GoRank2["KYU21"] = "21k";
|
|
581
|
+
GoRank2["KYU22"] = "22k";
|
|
582
|
+
GoRank2["KYU23"] = "23k";
|
|
583
|
+
GoRank2["KYU24"] = "24k";
|
|
584
|
+
GoRank2["KYU25"] = "25k";
|
|
585
|
+
GoRank2["DAN1"] = "1d";
|
|
586
|
+
GoRank2["DAN2"] = "2d";
|
|
587
|
+
GoRank2["DAN3"] = "3d";
|
|
588
|
+
GoRank2["DAN4"] = "4d";
|
|
589
|
+
GoRank2["DAN5"] = "5d";
|
|
590
|
+
GoRank2["DAN6"] = "6d";
|
|
591
|
+
GoRank2["DAN7"] = "7d";
|
|
592
|
+
GoRank2["PRO1"] = "1p";
|
|
593
|
+
GoRank2["PRO2"] = "2p";
|
|
594
|
+
GoRank2["PRO3"] = "3p";
|
|
595
|
+
GoRank2["PRO4"] = "4p";
|
|
596
|
+
GoRank2["PRO5"] = "5p";
|
|
597
|
+
GoRank2["PRO6"] = "6p";
|
|
598
|
+
GoRank2["PRO7"] = "7p";
|
|
599
|
+
GoRank2["PRO8"] = "8p";
|
|
600
|
+
GoRank2["PRO9"] = "9p";
|
|
601
|
+
return GoRank2;
|
|
602
|
+
})(GoRank || {});
|
|
603
|
+
|
|
604
|
+
// src/interface/user/user.ts
|
|
605
|
+
import { z as z26 } from "zod";
|
|
606
|
+
|
|
607
|
+
// src/interface/user/userRoles.ts
|
|
608
|
+
import { z as z25 } from "zod";
|
|
609
|
+
var zUserRoles = z25.object({
|
|
610
|
+
user: z25.number().int(),
|
|
611
|
+
admin: z25.number().int(),
|
|
612
|
+
superadmin: z25.number().int()
|
|
613
|
+
});
|
|
614
|
+
|
|
615
|
+
// src/interface/user/user.ts
|
|
616
|
+
var zUser = z26.object({
|
|
617
|
+
name: z26.string().min(2).max(100),
|
|
618
|
+
username: z26.string().optional(),
|
|
619
|
+
password: z26.string().optional(),
|
|
620
|
+
roles: zUserRoles.optional(),
|
|
621
|
+
email: z26.string().email().max(100).optional(),
|
|
622
|
+
address: z26.string().optional(),
|
|
623
|
+
country: z26.string().optional(),
|
|
624
|
+
phoneNumber: z26.string().optional(),
|
|
625
|
+
birthDate: z26.string().optional()
|
|
626
|
+
});
|
|
627
|
+
var zMUser = extendZodObjectForMongoose(zUser);
|
|
628
|
+
var zStudent = zUser.extend({
|
|
629
|
+
rank: z26.nativeEnum(GoRank),
|
|
630
|
+
// Object ID in mongoose linked to a user
|
|
631
|
+
guardian: z26.string().optional()
|
|
632
|
+
});
|
|
633
|
+
var zMStudent = extendZodObjectForMongoose(zStudent);
|
|
634
|
+
var zTeacher = zUser.extend({
|
|
635
|
+
rank: z26.nativeEnum(GoRank),
|
|
636
|
+
/**
|
|
637
|
+
* Inactive teachers are not shown on public endpoints
|
|
638
|
+
*/
|
|
639
|
+
isInactive: z26.boolean().optional(),
|
|
640
|
+
/**
|
|
641
|
+
* Teacher's position, e.g., instructor, president
|
|
642
|
+
*/
|
|
643
|
+
title: z26.string().optional(),
|
|
644
|
+
/**
|
|
645
|
+
* Teacher's bio text describing experience
|
|
646
|
+
* new lines will be rendered as paragraphs
|
|
647
|
+
*/
|
|
648
|
+
bio: z26.string().optional(),
|
|
649
|
+
/** Format is illustrated below, where teacher is available
|
|
650
|
+
* Mon 9-12am 3-6pm & Tue 10-12am 6-10pm
|
|
651
|
+
* [
|
|
652
|
+
* [[9, 12], [15, 18]],
|
|
653
|
+
* [[10, 12], [18, 20]],
|
|
654
|
+
* [],
|
|
655
|
+
* [],
|
|
656
|
+
* [],
|
|
657
|
+
* [],
|
|
658
|
+
* [],
|
|
659
|
+
* ]
|
|
660
|
+
*/
|
|
661
|
+
available: z26.array(z26.array(z26.array(z26.number()))).optional()
|
|
662
|
+
});
|
|
663
|
+
var zMTeacher = extendZodObjectForMongoose(zTeacher);
|
|
7
664
|
export {
|
|
8
|
-
|
|
665
|
+
AgeGroup,
|
|
666
|
+
AttendState,
|
|
667
|
+
CampOption,
|
|
668
|
+
CourseCategory,
|
|
669
|
+
GoRank,
|
|
670
|
+
NYIGSchool,
|
|
671
|
+
PaymentMethod,
|
|
672
|
+
Season,
|
|
673
|
+
zAttendance,
|
|
674
|
+
zBPaymentInfo,
|
|
675
|
+
zBUserInfo,
|
|
676
|
+
zCampBooking,
|
|
677
|
+
zCampTracker,
|
|
678
|
+
zClassTracker,
|
|
679
|
+
zCourse,
|
|
680
|
+
zCourseTable,
|
|
681
|
+
zDetailsTable,
|
|
682
|
+
zDiscount,
|
|
683
|
+
zGroupBooking,
|
|
684
|
+
zGroupTracker,
|
|
685
|
+
zImageDef,
|
|
686
|
+
zInvoice,
|
|
687
|
+
zInvoiceItem,
|
|
688
|
+
zInvoicePackage,
|
|
689
|
+
zMAttendance,
|
|
690
|
+
zMCampBooking,
|
|
691
|
+
zMCampTracker,
|
|
692
|
+
zMClassTracker,
|
|
693
|
+
zMCourse,
|
|
694
|
+
zMGroupBooking,
|
|
695
|
+
zMGroupTracker,
|
|
696
|
+
zMInvoice,
|
|
697
|
+
zMPrivateBooking,
|
|
698
|
+
zMReportTicket,
|
|
699
|
+
zMSemester,
|
|
700
|
+
zMStudent,
|
|
701
|
+
zMTConfig,
|
|
702
|
+
zMTReg,
|
|
703
|
+
zMTTicket,
|
|
704
|
+
zMTeacher,
|
|
705
|
+
zMTeacherPayment,
|
|
706
|
+
zMUser,
|
|
707
|
+
zPrivateBooking,
|
|
708
|
+
zReportTicket,
|
|
709
|
+
zScheduleData,
|
|
710
|
+
zScheduleTable,
|
|
711
|
+
zSemester,
|
|
712
|
+
zStudent,
|
|
713
|
+
zTConfig,
|
|
714
|
+
zTReg,
|
|
715
|
+
zTTicket,
|
|
716
|
+
zTTicketReg,
|
|
717
|
+
zTeacher,
|
|
718
|
+
zTeacherDisplay,
|
|
719
|
+
zTeacherPayment,
|
|
720
|
+
zTeacherPaymentRow,
|
|
721
|
+
zTuition,
|
|
722
|
+
zUser,
|
|
723
|
+
zUserRoles
|
|
9
724
|
};
|