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