@nyig/models 0.2.12 → 0.2.13
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 +186 -260
- package/index.d.ts +186 -260
- package/index.js +204 -242
- package/index.mjs +204 -242
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -39,7 +39,7 @@ var BookingType = /* @__PURE__ */ ((BookingType2) => {
|
|
|
39
39
|
})(BookingType || {});
|
|
40
40
|
|
|
41
41
|
// src/interface/booking/campBooking.ts
|
|
42
|
-
import { z as
|
|
42
|
+
import { z as z14 } from "zod";
|
|
43
43
|
|
|
44
44
|
// src/interface/mongoose/mongoose.ts
|
|
45
45
|
import { z as z3 } from "zod";
|
|
@@ -80,8 +80,9 @@ var CampOption = /* @__PURE__ */ ((CampOption2) => {
|
|
|
80
80
|
})(CampOption || {});
|
|
81
81
|
|
|
82
82
|
// src/interface/tracking/attendance.ts
|
|
83
|
+
import { Types as Types2 } from "mongoose";
|
|
83
84
|
var zAttendance = z5.object({
|
|
84
|
-
student: z5.
|
|
85
|
+
student: z5.instanceof(Types2.ObjectId),
|
|
85
86
|
states: z5.array(z5.nativeEnum(AttendState)),
|
|
86
87
|
tuition: zTuition,
|
|
87
88
|
paid: z5.boolean().optional(),
|
|
@@ -90,37 +91,37 @@ var zAttendance = z5.object({
|
|
|
90
91
|
var zMAttendance = extendZodObjectForMongoose(zAttendance);
|
|
91
92
|
|
|
92
93
|
// src/interface/tracking/campTracker.ts
|
|
94
|
+
import { z as z7 } from "zod";
|
|
95
|
+
|
|
96
|
+
// src/interface/tracking/tracker.ts
|
|
97
|
+
import { Types as Types3 } from "mongoose";
|
|
93
98
|
import { z as z6 } from "zod";
|
|
94
|
-
var
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
teacher: z6.string(),
|
|
103
|
-
/**
|
|
104
|
-
* Mongoose object ID
|
|
105
|
-
*/
|
|
106
|
-
semester: z6.string(),
|
|
99
|
+
var zTracker = z6.object({
|
|
100
|
+
course: z6.instanceof(Types3.ObjectId),
|
|
101
|
+
teacher: z6.instanceof(Types3.ObjectId),
|
|
102
|
+
semester: z6.instanceof(Types3.ObjectId)
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
// src/interface/tracking/campTracker.ts
|
|
106
|
+
var zCampTracker = z7.object({
|
|
107
107
|
/**
|
|
108
108
|
* occurrences are tracked by week for camps
|
|
109
109
|
*/
|
|
110
|
-
occurrences:
|
|
110
|
+
occurrences: z7.array(z7.string()),
|
|
111
111
|
/**
|
|
112
112
|
* attendances are tracked by week for camps
|
|
113
113
|
*/
|
|
114
|
-
attendances:
|
|
115
|
-
notes:
|
|
116
|
-
});
|
|
114
|
+
attendances: z7.array(z7.string()),
|
|
115
|
+
notes: z7.string().optional()
|
|
116
|
+
}).merge(zTracker);
|
|
117
117
|
var zMCampTracker = extendZodObjectForMongoose(zCampTracker);
|
|
118
118
|
|
|
119
119
|
// src/interface/tracking/classTracker.ts
|
|
120
|
-
import { z as
|
|
120
|
+
import { z as z10 } from "zod";
|
|
121
121
|
|
|
122
122
|
// src/interface/payment/invoice.ts
|
|
123
|
-
import {
|
|
123
|
+
import { Types as Types4 } from "mongoose";
|
|
124
|
+
import { z as z8 } from "zod";
|
|
124
125
|
|
|
125
126
|
// src/interface/payment/paymentMethod.ts
|
|
126
127
|
var PaymentMethod = /* @__PURE__ */ ((PaymentMethod2) => {
|
|
@@ -132,94 +133,70 @@ var PaymentMethod = /* @__PURE__ */ ((PaymentMethod2) => {
|
|
|
132
133
|
})(PaymentMethod || {});
|
|
133
134
|
|
|
134
135
|
// src/interface/payment/invoice.ts
|
|
135
|
-
var zDiscount =
|
|
136
|
-
desc:
|
|
137
|
-
amount:
|
|
136
|
+
var zDiscount = z8.object({
|
|
137
|
+
desc: z8.string(),
|
|
138
|
+
amount: z8.number()
|
|
138
139
|
});
|
|
139
|
-
var zInvoiceItem =
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
course: z7.string(),
|
|
144
|
-
price: z7.number(),
|
|
145
|
-
units: z7.number()
|
|
140
|
+
var zInvoiceItem = z8.object({
|
|
141
|
+
course: z8.instanceof(Types4.ObjectId),
|
|
142
|
+
price: z8.number(),
|
|
143
|
+
units: z8.number()
|
|
146
144
|
});
|
|
147
|
-
var zInvoicePackage =
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
*/
|
|
151
|
-
student: z7.string(),
|
|
152
|
-
items: z7.array(zInvoiceItem)
|
|
145
|
+
var zInvoicePackage = z8.object({
|
|
146
|
+
student: z8.instanceof(Types4.ObjectId),
|
|
147
|
+
items: z8.array(zInvoiceItem)
|
|
153
148
|
});
|
|
154
|
-
var zInvoice =
|
|
155
|
-
billTo:
|
|
156
|
-
packages:
|
|
157
|
-
discounts:
|
|
158
|
-
textbook:
|
|
159
|
-
shipping:
|
|
160
|
-
paid:
|
|
161
|
-
notes:
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
*/
|
|
165
|
-
createdBy: z7.string(),
|
|
166
|
-
/**
|
|
167
|
-
* Mongoose object ID
|
|
168
|
-
*/
|
|
169
|
-
lastEditBy: z7.string().optional()
|
|
149
|
+
var zInvoice = z8.object({
|
|
150
|
+
billTo: z8.string(),
|
|
151
|
+
packages: z8.array(zInvoicePackage),
|
|
152
|
+
discounts: z8.array(zDiscount),
|
|
153
|
+
textbook: z8.number().int().min(1).optional(),
|
|
154
|
+
shipping: z8.number().int().min(1).optional(),
|
|
155
|
+
paid: z8.nativeEnum(PaymentMethod).optional(),
|
|
156
|
+
notes: z8.string().optional(),
|
|
157
|
+
createdBy: z8.instanceof(Types4.ObjectId),
|
|
158
|
+
lastEditBy: z8.instanceof(Types4.ObjectId).optional()
|
|
170
159
|
});
|
|
171
160
|
var zMInvoice = extendZodObjectForMongoose(zInvoice);
|
|
172
161
|
|
|
173
162
|
// src/interface/payment/teacherPayment.ts
|
|
174
|
-
import { z as
|
|
175
|
-
var zTeacherPaymentRow =
|
|
176
|
-
course:
|
|
177
|
-
length:
|
|
178
|
-
count:
|
|
179
|
-
wage:
|
|
163
|
+
import { z as z9 } from "zod";
|
|
164
|
+
var zTeacherPaymentRow = z9.object({
|
|
165
|
+
course: z9.string(),
|
|
166
|
+
length: z9.number(),
|
|
167
|
+
count: z9.number(),
|
|
168
|
+
wage: z9.number()
|
|
180
169
|
});
|
|
181
|
-
var zTeacherPayment =
|
|
182
|
-
teacher:
|
|
183
|
-
rows:
|
|
184
|
-
paid:
|
|
170
|
+
var zTeacherPayment = z9.object({
|
|
171
|
+
teacher: z9.string(),
|
|
172
|
+
rows: z9.array(zTeacherPaymentRow),
|
|
173
|
+
paid: z9.boolean().optional()
|
|
185
174
|
});
|
|
186
175
|
var zMTeacherPayment = extendZodObjectForMongoose(zTeacherPayment);
|
|
187
176
|
|
|
188
177
|
// src/interface/tracking/classTracker.ts
|
|
189
|
-
var zClassTracker =
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
*/
|
|
193
|
-
course: z9.string(),
|
|
194
|
-
/**
|
|
195
|
-
* Mongoose object ID
|
|
196
|
-
*/
|
|
197
|
-
teacher: z9.string(),
|
|
198
|
-
/**
|
|
199
|
-
* Mongoose object ID
|
|
200
|
-
*/
|
|
201
|
-
semester: z9.string(),
|
|
202
|
-
classTimes: z9.array(z9.coerce.date()),
|
|
203
|
-
completedList: z9.array(z9.boolean()),
|
|
178
|
+
var zClassTracker = z10.object({
|
|
179
|
+
classTimes: z10.array(z10.coerce.date()),
|
|
180
|
+
completedList: z10.array(z10.boolean()),
|
|
204
181
|
/**
|
|
205
182
|
* Virtual mongoose field when all values in completedList is true
|
|
206
183
|
*/
|
|
207
|
-
completed:
|
|
184
|
+
completed: z10.boolean().optional(),
|
|
208
185
|
tuition: zTuition.optional(),
|
|
209
|
-
paid:
|
|
210
|
-
notes:
|
|
211
|
-
});
|
|
186
|
+
paid: z10.boolean().optional(),
|
|
187
|
+
notes: z10.string().optional()
|
|
188
|
+
}).merge(zTracker);
|
|
212
189
|
var zMClassTracker = extendZodObjectForMongoose(zClassTracker);
|
|
213
190
|
|
|
214
191
|
// src/interface/tracking/groupTracker.ts
|
|
215
|
-
import { z as
|
|
192
|
+
import { z as z13 } from "zod";
|
|
216
193
|
|
|
217
194
|
// src/interface/tracking/scheduleData.ts
|
|
218
|
-
import { z as
|
|
219
|
-
var zScheduleData =
|
|
220
|
-
startTime:
|
|
195
|
+
import { z as z11 } from "zod";
|
|
196
|
+
var zScheduleData = z11.object({
|
|
197
|
+
startTime: z11.string(),
|
|
221
198
|
// String in 24 hour "HH:mm" format
|
|
222
|
-
dayOfWeek:
|
|
199
|
+
dayOfWeek: z11.number().int().min(0).max(6)
|
|
223
200
|
// integeters in 0 - 6
|
|
224
201
|
});
|
|
225
202
|
|
|
@@ -248,138 +225,126 @@ var NYIGSchool = /* @__PURE__ */ ((NYIGSchool2) => {
|
|
|
248
225
|
})(NYIGSchool || {});
|
|
249
226
|
|
|
250
227
|
// src/interface/course/course.ts
|
|
251
|
-
import { z as
|
|
252
|
-
var zCourse =
|
|
253
|
-
name:
|
|
254
|
-
category:
|
|
228
|
+
import { z as z12 } from "zod";
|
|
229
|
+
var zCourse = z12.object({
|
|
230
|
+
name: z12.string(),
|
|
231
|
+
category: z12.nativeEnum(CourseCategory),
|
|
255
232
|
/**
|
|
256
233
|
* @unit SECONDS - Duration of the course in seconds
|
|
257
234
|
*/
|
|
258
|
-
duration:
|
|
235
|
+
duration: z12.number(),
|
|
259
236
|
/**
|
|
260
237
|
* @unit CENTS - Price of the course in cents
|
|
261
238
|
*/
|
|
262
|
-
price:
|
|
263
|
-
description:
|
|
239
|
+
price: z12.number(),
|
|
240
|
+
description: z12.string().optional(),
|
|
264
241
|
/**
|
|
265
242
|
* NYIG School locations
|
|
266
243
|
*/
|
|
267
|
-
nyigSchool:
|
|
244
|
+
nyigSchool: z12.nativeEnum(NYIGSchool),
|
|
268
245
|
/**
|
|
269
246
|
* Recommended level before taking this course
|
|
270
247
|
*/
|
|
271
|
-
recLevel:
|
|
248
|
+
recLevel: z12.string(),
|
|
272
249
|
/**
|
|
273
250
|
* Camp tuition for half-day option
|
|
274
251
|
*/
|
|
275
|
-
halfCampTuition:
|
|
252
|
+
halfCampTuition: z12.number(),
|
|
276
253
|
/**
|
|
277
254
|
* Camp tuition for full-day option
|
|
278
255
|
*/
|
|
279
|
-
fullCampTuition:
|
|
256
|
+
fullCampTuition: z12.number()
|
|
280
257
|
});
|
|
281
258
|
var zMCourse = extendZodObjectForMongoose(zCourse);
|
|
282
259
|
|
|
283
260
|
// src/interface/tracking/groupTracker.ts
|
|
284
|
-
var zGroupTracker =
|
|
285
|
-
/**
|
|
286
|
-
* Mongoose object ID
|
|
287
|
-
*/
|
|
288
|
-
course: z12.string(),
|
|
289
|
-
/**
|
|
290
|
-
* Mongoose object ID
|
|
291
|
-
*/
|
|
292
|
-
teacher: z12.string(),
|
|
293
|
-
/**
|
|
294
|
-
* Mongoose object ID
|
|
295
|
-
*/
|
|
296
|
-
semester: z12.string(),
|
|
261
|
+
var zGroupTracker = z13.object({
|
|
297
262
|
scheduleData: zScheduleData,
|
|
298
263
|
/**
|
|
299
264
|
* occurrences are tracked by week for Groups
|
|
300
265
|
*/
|
|
301
|
-
occurrences:
|
|
266
|
+
occurrences: z13.array(z13.coerce.date()),
|
|
302
267
|
/**
|
|
303
268
|
* attendances are tracked by week for Groups
|
|
304
269
|
*/
|
|
305
|
-
attendances:
|
|
270
|
+
attendances: z13.array(z13.string()),
|
|
306
271
|
/**
|
|
307
|
-
* ID of the course instance, e.g., 101
|
|
272
|
+
* public-facing ID of the course instance, e.g., 101
|
|
308
273
|
*/
|
|
309
|
-
courseId:
|
|
274
|
+
courseId: z13.string().optional(),
|
|
310
275
|
/**
|
|
311
276
|
* Age group of the class instance, e.g. "adult", "youth"
|
|
312
277
|
*/
|
|
313
|
-
ageGroup:
|
|
278
|
+
ageGroup: z13.nativeEnum(AgeGroup).optional(),
|
|
314
279
|
/**
|
|
315
280
|
* If true, the course is hidden from public view
|
|
316
281
|
*/
|
|
317
|
-
isNonPublic:
|
|
318
|
-
notes:
|
|
319
|
-
});
|
|
282
|
+
isNonPublic: z13.boolean().optional(),
|
|
283
|
+
notes: z13.string().optional()
|
|
284
|
+
}).merge(zTracker);
|
|
320
285
|
var zMGroupTracker = extendZodObjectForMongoose(zGroupTracker);
|
|
321
286
|
|
|
322
287
|
// src/interface/booking/campBooking.ts
|
|
323
|
-
var zCampBooking =
|
|
324
|
-
userId:
|
|
325
|
-
ctId:
|
|
326
|
-
isOnline:
|
|
327
|
-
classDates:
|
|
328
|
-
campOption:
|
|
329
|
-
shipping:
|
|
288
|
+
var zCampBooking = z14.object({
|
|
289
|
+
userId: z14.string().optional(),
|
|
290
|
+
ctId: z14.string().optional(),
|
|
291
|
+
isOnline: z14.boolean(),
|
|
292
|
+
classDates: z14.string(),
|
|
293
|
+
campOption: z14.nativeEnum(CampOption),
|
|
294
|
+
shipping: z14.boolean().optional()
|
|
330
295
|
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
331
296
|
var zMCampBooking = extendZodObjectForMongoose(zCampBooking);
|
|
332
297
|
|
|
333
298
|
// src/interface/booking/groupBooking.ts
|
|
334
|
-
import { z as
|
|
335
|
-
var zGroupBooking =
|
|
336
|
-
userId:
|
|
337
|
-
gtId:
|
|
338
|
-
isTrial:
|
|
339
|
-
isOnline:
|
|
340
|
-
classDate:
|
|
341
|
-
shipping:
|
|
299
|
+
import { z as z15 } from "zod";
|
|
300
|
+
var zGroupBooking = z15.object({
|
|
301
|
+
userId: z15.string().optional(),
|
|
302
|
+
gtId: z15.string().optional(),
|
|
303
|
+
isTrial: z15.boolean().optional(),
|
|
304
|
+
isOnline: z15.boolean(),
|
|
305
|
+
classDate: z15.string().optional(),
|
|
306
|
+
shipping: z15.boolean().optional()
|
|
342
307
|
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
343
308
|
var zMGroupBooking = extendZodObjectForMongoose(zGroupBooking);
|
|
344
309
|
|
|
345
310
|
// src/interface/booking/privateBooking.ts
|
|
346
|
-
import { z as
|
|
347
|
-
var zPrivateBooking =
|
|
348
|
-
userId:
|
|
349
|
-
courseId:
|
|
350
|
-
teacherId:
|
|
351
|
-
classDate:
|
|
311
|
+
import { z as z16 } from "zod";
|
|
312
|
+
var zPrivateBooking = z16.object({
|
|
313
|
+
userId: z16.string().optional(),
|
|
314
|
+
courseId: z16.string(),
|
|
315
|
+
teacherId: z16.string(),
|
|
316
|
+
classDate: z16.string().optional()
|
|
352
317
|
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
353
318
|
var zMPrivateBooking = extendZodObjectForMongoose(zPrivateBooking);
|
|
354
319
|
|
|
355
320
|
// src/interface/public/aurora.ts
|
|
356
|
-
import { z as
|
|
357
|
-
var zTeacherDisplay =
|
|
358
|
-
name:
|
|
359
|
-
email:
|
|
360
|
-
title:
|
|
361
|
-
imageUrl:
|
|
362
|
-
bio:
|
|
321
|
+
import { z as z17 } from "zod";
|
|
322
|
+
var zTeacherDisplay = z17.object({
|
|
323
|
+
name: z17.string(),
|
|
324
|
+
email: z17.string().email(),
|
|
325
|
+
title: z17.string(),
|
|
326
|
+
imageUrl: z17.string(),
|
|
327
|
+
bio: z17.string()
|
|
363
328
|
});
|
|
364
|
-
var zCourseTable =
|
|
365
|
-
id:
|
|
366
|
-
name:
|
|
367
|
-
duration:
|
|
368
|
-
dateAndTime:
|
|
369
|
-
recommendedLevel:
|
|
370
|
-
tuition:
|
|
329
|
+
var zCourseTable = z17.object({
|
|
330
|
+
id: z17.string(),
|
|
331
|
+
name: z17.string(),
|
|
332
|
+
duration: z17.number(),
|
|
333
|
+
dateAndTime: z17.string(),
|
|
334
|
+
recommendedLevel: z17.string(),
|
|
335
|
+
tuition: z17.string()
|
|
371
336
|
});
|
|
372
337
|
|
|
373
338
|
// src/interface/public/imageDef.ts
|
|
374
|
-
import { z as
|
|
375
|
-
var zImageDef =
|
|
376
|
-
url:
|
|
377
|
-
height:
|
|
378
|
-
width:
|
|
339
|
+
import { z as z18 } from "zod";
|
|
340
|
+
var zImageDef = z18.object({
|
|
341
|
+
url: z18.string(),
|
|
342
|
+
height: z18.number(),
|
|
343
|
+
width: z18.number()
|
|
379
344
|
});
|
|
380
345
|
|
|
381
346
|
// src/interface/reporting/reportTicket.ts
|
|
382
|
-
import { z as
|
|
347
|
+
import { z as z19 } from "zod";
|
|
383
348
|
|
|
384
349
|
// src/interface/reporting/ticketStatus.ts
|
|
385
350
|
var TicketStatus = /* @__PURE__ */ ((TicketStatus2) => {
|
|
@@ -391,12 +356,12 @@ var TicketStatus = /* @__PURE__ */ ((TicketStatus2) => {
|
|
|
391
356
|
})(TicketStatus || {});
|
|
392
357
|
|
|
393
358
|
// src/interface/reporting/reportTicket.ts
|
|
394
|
-
var zReportTicket =
|
|
395
|
-
requester:
|
|
396
|
-
resolver:
|
|
397
|
-
status:
|
|
398
|
-
title:
|
|
399
|
-
description:
|
|
359
|
+
var zReportTicket = z19.object({
|
|
360
|
+
requester: z19.string(),
|
|
361
|
+
resolver: z19.string(),
|
|
362
|
+
status: z19.nativeEnum(TicketStatus),
|
|
363
|
+
title: z19.string(),
|
|
364
|
+
description: z19.string()
|
|
400
365
|
});
|
|
401
366
|
var zMReportTicket = extendZodObjectForMongoose(zReportTicket);
|
|
402
367
|
|
|
@@ -409,73 +374,74 @@ var Season = /* @__PURE__ */ ((Season2) => {
|
|
|
409
374
|
})(Season || {});
|
|
410
375
|
|
|
411
376
|
// src/interface/semester/semester.ts
|
|
412
|
-
import { z as
|
|
413
|
-
var zSemester =
|
|
414
|
-
season:
|
|
415
|
-
year:
|
|
416
|
-
startDate:
|
|
417
|
-
endDate:
|
|
377
|
+
import { z as z20 } from "zod";
|
|
378
|
+
var zSemester = z20.object({
|
|
379
|
+
season: z20.nativeEnum(Season),
|
|
380
|
+
year: z20.number().min(2022).max(2999),
|
|
381
|
+
startDate: z20.coerce.date(),
|
|
382
|
+
endDate: z20.coerce.date(),
|
|
418
383
|
/**
|
|
419
384
|
* Format: start, end, start, end, ...
|
|
420
385
|
*/
|
|
421
|
-
blackoutDates:
|
|
386
|
+
blackoutDates: z20.array(z20.coerce.date()),
|
|
422
387
|
/**
|
|
423
388
|
* List of names of some break: date range
|
|
424
389
|
*/
|
|
425
|
-
importantDates:
|
|
390
|
+
importantDates: z20.array(z20.string())
|
|
426
391
|
});
|
|
427
392
|
var zMSemester = extendZodObjectForMongoose(zSemester);
|
|
428
393
|
|
|
429
394
|
// src/interface/tournament/tConfig.ts
|
|
430
|
-
import {
|
|
395
|
+
import { Types as Types5 } from "mongoose";
|
|
396
|
+
import { z as z22 } from "zod";
|
|
431
397
|
|
|
432
398
|
// src/interface/tournament/table.ts
|
|
433
|
-
import { z as
|
|
434
|
-
var zTable =
|
|
435
|
-
var zDetailsTable =
|
|
436
|
-
fields:
|
|
399
|
+
import { z as z21 } from "zod";
|
|
400
|
+
var zTable = z21.array(z21.object({}));
|
|
401
|
+
var zDetailsTable = z21.object({
|
|
402
|
+
fields: z21.array(z21.string()).length(2),
|
|
437
403
|
data: zTable
|
|
438
404
|
});
|
|
439
|
-
var zScheduleTable =
|
|
440
|
-
fields:
|
|
441
|
-
data:
|
|
405
|
+
var zScheduleTable = z21.object({
|
|
406
|
+
fields: z21.array(z21.string()).length(2),
|
|
407
|
+
data: z21.map(z21.string(), zTable)
|
|
442
408
|
});
|
|
443
409
|
|
|
444
410
|
// src/interface/tournament/tConfig.ts
|
|
445
|
-
var zTConfig =
|
|
411
|
+
var zTConfig = z22.object({
|
|
446
412
|
/**
|
|
447
413
|
* Location of the event
|
|
448
414
|
*/
|
|
449
|
-
location:
|
|
415
|
+
location: z22.string().optional(),
|
|
450
416
|
/**
|
|
451
417
|
* URL of the tournament on the official website
|
|
452
418
|
* Must be a valid URL link
|
|
453
419
|
*/
|
|
454
|
-
url:
|
|
420
|
+
url: z22.string(),
|
|
455
421
|
/**
|
|
456
422
|
* Full name of the tournament
|
|
457
423
|
*/
|
|
458
|
-
title:
|
|
424
|
+
title: z22.string(),
|
|
459
425
|
/**
|
|
460
426
|
* Abbreviated title of the tournament
|
|
461
427
|
*/
|
|
462
|
-
shortTitle:
|
|
428
|
+
shortTitle: z22.string(),
|
|
463
429
|
/**
|
|
464
430
|
* Tournament start date and time
|
|
465
431
|
*/
|
|
466
|
-
tStart:
|
|
432
|
+
tStart: z22.coerce.date(),
|
|
467
433
|
/**
|
|
468
434
|
* Tournament end date and time
|
|
469
435
|
*/
|
|
470
|
-
tEnd:
|
|
436
|
+
tEnd: z22.coerce.date(),
|
|
471
437
|
/**
|
|
472
438
|
* Short description for tournament card
|
|
473
439
|
*/
|
|
474
|
-
shortDescription:
|
|
440
|
+
shortDescription: z22.string(),
|
|
475
441
|
/**
|
|
476
442
|
* Full description
|
|
477
443
|
*/
|
|
478
|
-
description:
|
|
444
|
+
description: z22.string(),
|
|
479
445
|
/**
|
|
480
446
|
* Defines the tournament details table with 2 columns
|
|
481
447
|
* typically Time and Event
|
|
@@ -489,15 +455,15 @@ var zTConfig = z21.object({
|
|
|
489
455
|
/**
|
|
490
456
|
* List of ticket object IDs for this tournament
|
|
491
457
|
*/
|
|
492
|
-
tickets:
|
|
458
|
+
tickets: z22.array(z22.instanceof(Types5.ObjectId)),
|
|
493
459
|
/**
|
|
494
460
|
* If false, the tournament registration is closed
|
|
495
461
|
*/
|
|
496
|
-
canRegister:
|
|
462
|
+
canRegister: z22.boolean(),
|
|
497
463
|
/**
|
|
498
464
|
* If true, free form donation amounts are disabled.
|
|
499
465
|
*/
|
|
500
|
-
donationsDisabled:
|
|
466
|
+
donationsDisabled: z22.boolean().optional(),
|
|
501
467
|
/**
|
|
502
468
|
* Defines URL, height, width of the image
|
|
503
469
|
*/
|
|
@@ -506,64 +472,60 @@ var zTConfig = z21.object({
|
|
|
506
472
|
var zMTConfig = extendZodObjectForMongoose(zTConfig);
|
|
507
473
|
|
|
508
474
|
// src/interface/tournament/tReg.ts
|
|
509
|
-
import {
|
|
475
|
+
import { Types as Types7 } from "mongoose";
|
|
476
|
+
import { z as z24 } from "zod";
|
|
510
477
|
|
|
511
478
|
// src/interface/tournament/tTicketReg.ts
|
|
512
|
-
import { z as
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
*/
|
|
517
|
-
ticket: z22.string(),
|
|
479
|
+
import { z as z23 } from "zod";
|
|
480
|
+
import { Types as Types6 } from "mongoose";
|
|
481
|
+
var zTTicketReg = z23.object({
|
|
482
|
+
ticket: z23.instanceof(Types6.ObjectId),
|
|
518
483
|
/**
|
|
519
484
|
* integer minimum 1, otherwise no ticket is being bought
|
|
520
485
|
*/
|
|
521
|
-
amount:
|
|
486
|
+
amount: z23.number().int().min(1)
|
|
522
487
|
});
|
|
523
488
|
|
|
524
489
|
// src/interface/tournament/tReg.ts
|
|
525
|
-
var zTReg =
|
|
526
|
-
agaId:
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
*/
|
|
530
|
-
tournamentId: z23.string(),
|
|
531
|
-
tickets: z23.array(zTTicketReg),
|
|
490
|
+
var zTReg = z24.object({
|
|
491
|
+
agaId: z24.string(),
|
|
492
|
+
tournamentId: z24.instanceof(Types7.ObjectId),
|
|
493
|
+
tickets: z24.array(zTTicketReg),
|
|
532
494
|
/**
|
|
533
495
|
* @units CENTS - Donation in cents
|
|
534
496
|
*/
|
|
535
|
-
donation:
|
|
497
|
+
donation: z24.number().optional(),
|
|
536
498
|
/**
|
|
537
499
|
* How the registration was created, namely through public endpoint or admin
|
|
538
500
|
*/
|
|
539
|
-
createMethod:
|
|
501
|
+
createMethod: z24.string().optional(),
|
|
540
502
|
/**
|
|
541
503
|
* Mongoose ID of the admin that edited the registration
|
|
542
504
|
*/
|
|
543
|
-
edited:
|
|
505
|
+
edited: z24.instanceof(Types7.ObjectId).optional()
|
|
544
506
|
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
545
507
|
var zMTReg = extendZodObjectForMongoose(zTReg);
|
|
546
508
|
|
|
547
509
|
// src/interface/tournament/tTicket.ts
|
|
548
|
-
import { z as
|
|
549
|
-
var zTTicket =
|
|
550
|
-
name:
|
|
510
|
+
import { z as z25 } from "zod";
|
|
511
|
+
var zTTicket = z25.object({
|
|
512
|
+
name: z25.string(),
|
|
551
513
|
/**
|
|
552
514
|
* Price in cents
|
|
553
515
|
*/
|
|
554
|
-
price:
|
|
516
|
+
price: z25.number(),
|
|
555
517
|
/**
|
|
556
518
|
* @optional description of the ticket
|
|
557
519
|
*/
|
|
558
|
-
description:
|
|
520
|
+
description: z25.string().optional(),
|
|
559
521
|
/**
|
|
560
522
|
* @optional The ticket cannot be purchased if true
|
|
561
523
|
*/
|
|
562
|
-
isNotBuyable:
|
|
524
|
+
isNotBuyable: z25.boolean().optional(),
|
|
563
525
|
/**
|
|
564
526
|
* @optional If date is provided and in the past, ticket cannot be purchased
|
|
565
527
|
*/
|
|
566
|
-
lastBuyableDate:
|
|
528
|
+
lastBuyableDate: z25.coerce.date().optional()
|
|
567
529
|
});
|
|
568
530
|
var zMTTicket = extendZodObjectForMongoose(zTTicket);
|
|
569
531
|
|
|
@@ -614,50 +576,50 @@ var GoRank = /* @__PURE__ */ ((GoRank2) => {
|
|
|
614
576
|
})(GoRank || {});
|
|
615
577
|
|
|
616
578
|
// src/interface/user/user.ts
|
|
617
|
-
import { z as
|
|
579
|
+
import { z as z27 } from "zod";
|
|
618
580
|
|
|
619
581
|
// src/interface/user/userRoles.ts
|
|
620
|
-
import { z as
|
|
621
|
-
var zUserRoles =
|
|
622
|
-
user:
|
|
623
|
-
admin:
|
|
624
|
-
superadmin:
|
|
582
|
+
import { z as z26 } from "zod";
|
|
583
|
+
var zUserRoles = z26.object({
|
|
584
|
+
user: z26.number().int(),
|
|
585
|
+
admin: z26.number().int(),
|
|
586
|
+
superadmin: z26.number().int()
|
|
625
587
|
});
|
|
626
588
|
|
|
627
589
|
// src/interface/user/user.ts
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
590
|
+
import { Types as Types8 } from "mongoose";
|
|
591
|
+
var zUser = z27.object({
|
|
592
|
+
name: z27.string().min(2).max(100),
|
|
593
|
+
username: z27.string().optional(),
|
|
594
|
+
password: z27.string().optional(),
|
|
632
595
|
roles: zUserRoles.optional(),
|
|
633
|
-
email:
|
|
634
|
-
address:
|
|
635
|
-
country:
|
|
636
|
-
phoneNumber:
|
|
637
|
-
birthDate:
|
|
596
|
+
email: z27.string().email().max(100).optional(),
|
|
597
|
+
address: z27.string().optional(),
|
|
598
|
+
country: z27.string().optional(),
|
|
599
|
+
phoneNumber: z27.string().optional(),
|
|
600
|
+
birthDate: z27.string().optional()
|
|
638
601
|
});
|
|
639
602
|
var zMUser = extendZodObjectForMongoose(zUser);
|
|
640
603
|
var zStudent = zUser.extend({
|
|
641
|
-
rank:
|
|
642
|
-
|
|
643
|
-
guardian: z26.string().optional()
|
|
604
|
+
rank: z27.nativeEnum(GoRank),
|
|
605
|
+
guardian: z27.instanceof(Types8.ObjectId).optional()
|
|
644
606
|
});
|
|
645
607
|
var zMStudent = extendZodObjectForMongoose(zStudent);
|
|
646
608
|
var zTeacher = zUser.extend({
|
|
647
|
-
rank:
|
|
609
|
+
rank: z27.nativeEnum(GoRank),
|
|
648
610
|
/**
|
|
649
611
|
* Inactive teachers are not shown on public endpoints
|
|
650
612
|
*/
|
|
651
|
-
isInactive:
|
|
613
|
+
isInactive: z27.boolean().optional(),
|
|
652
614
|
/**
|
|
653
615
|
* Teacher's position, e.g., instructor, president
|
|
654
616
|
*/
|
|
655
|
-
title:
|
|
617
|
+
title: z27.string().optional(),
|
|
656
618
|
/**
|
|
657
619
|
* Teacher's bio text describing experience
|
|
658
620
|
* new lines will be rendered as paragraphs
|
|
659
621
|
*/
|
|
660
|
-
bio:
|
|
622
|
+
bio: z27.string().optional(),
|
|
661
623
|
/** Format is illustrated below, where teacher is available
|
|
662
624
|
* Mon 9-12am 3-6pm & Tue 10-12am 6-10pm
|
|
663
625
|
* [
|
|
@@ -670,7 +632,7 @@ var zTeacher = zUser.extend({
|
|
|
670
632
|
* [],
|
|
671
633
|
* ]
|
|
672
634
|
*/
|
|
673
|
-
available:
|
|
635
|
+
available: z27.array(z27.array(z27.array(z27.number()))).optional()
|
|
674
636
|
});
|
|
675
637
|
var zMTeacher = extendZodObjectForMongoose(zTeacher);
|
|
676
638
|
export {
|