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