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