@nyig/models 0.2.10 → 0.2.11
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 +1046 -394
- package/index.d.ts +1046 -394
- package/index.js +153 -144
- package/index.mjs +152 -144
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1,70 +1,55 @@
|
|
|
1
|
-
// src/interface/booking/bUserInfo.ts
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
var zBUserInfo = z.object({
|
|
4
|
-
firstName: z.string(),
|
|
5
|
-
lastName: z.string(),
|
|
6
|
-
rank: z.string(),
|
|
7
|
-
email: z.string(),
|
|
8
|
-
phone: z.string().optional(),
|
|
9
|
-
address: z.string().optional(),
|
|
10
|
-
notes: z.string().optional()
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
// src/interface/booking/privateBooking.ts
|
|
14
|
-
import { z as z4 } from "zod";
|
|
15
|
-
|
|
16
|
-
// src/mongoose.ts
|
|
17
|
-
import { z as z2 } from "zod";
|
|
18
|
-
function extendZodObjectForMongoose(original) {
|
|
19
|
-
return original.extend({
|
|
20
|
-
_id: z2.string(),
|
|
21
|
-
createdAt: z2.coerce.date().optional(),
|
|
22
|
-
updatedAt: z2.coerce.date().optional()
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
|
|
26
1
|
// src/interface/booking/bPaymentInfo.ts
|
|
27
|
-
import { z
|
|
28
|
-
var zBPaymentInfo =
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var zBPaymentInfo = z.object({
|
|
29
4
|
/**
|
|
30
5
|
* @units CENTS - Proposed payment amount in cents of the booking
|
|
31
6
|
*/
|
|
32
|
-
paymentAmount:
|
|
7
|
+
paymentAmount: z.number().int().min(1),
|
|
33
8
|
/**
|
|
34
9
|
* True if the payment has been received. Populated by webhook.
|
|
35
10
|
*/
|
|
36
|
-
paymentReceived:
|
|
11
|
+
paymentReceived: z.boolean().optional(),
|
|
37
12
|
/**
|
|
38
13
|
* When Date is reached, document is deleted by MongoDB sweeper.
|
|
39
14
|
* Creation typically marks one to two weeks.
|
|
40
15
|
* After payment, webhook should extend this date to essentially infinite.
|
|
41
16
|
*/
|
|
42
|
-
expireAt:
|
|
17
|
+
expireAt: z.coerce.date().optional()
|
|
43
18
|
});
|
|
44
19
|
|
|
45
|
-
// src/interface/booking/
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
20
|
+
// src/interface/booking/bUserInfo.ts
|
|
21
|
+
import { z as z2 } from "zod";
|
|
22
|
+
var zBUserInfo = z2.object({
|
|
23
|
+
firstName: z2.string(),
|
|
24
|
+
lastName: z2.string(),
|
|
25
|
+
rank: z2.string(),
|
|
26
|
+
email: z2.string(),
|
|
27
|
+
phone: z2.string().optional(),
|
|
28
|
+
address: z2.string().optional(),
|
|
29
|
+
notes: z2.string().optional()
|
|
30
|
+
});
|
|
53
31
|
|
|
54
|
-
// src/interface/booking/
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
shipping: z5.boolean().optional()
|
|
63
|
-
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
64
|
-
var zMGroupBooking = extendZodObjectForMongoose(zGroupBooking);
|
|
32
|
+
// src/interface/booking/bookingType.ts
|
|
33
|
+
var BookingType = /* @__PURE__ */ ((BookingType2) => {
|
|
34
|
+
BookingType2["GROUP"] = "group";
|
|
35
|
+
BookingType2["PRIVATE"] = "private";
|
|
36
|
+
BookingType2["TOURNAMENT"] = "tournament";
|
|
37
|
+
BookingType2["CAMP"] = "camp";
|
|
38
|
+
return BookingType2;
|
|
39
|
+
})(BookingType || {});
|
|
65
40
|
|
|
66
41
|
// src/interface/booking/campBooking.ts
|
|
67
|
-
import { z as
|
|
42
|
+
import { z as z13 } from "zod";
|
|
43
|
+
|
|
44
|
+
// src/mongoose.ts
|
|
45
|
+
import { z as z3 } from "zod";
|
|
46
|
+
function extendZodObjectForMongoose(original) {
|
|
47
|
+
return original.extend({
|
|
48
|
+
_id: z3.string(),
|
|
49
|
+
createdAt: z3.coerce.date().optional(),
|
|
50
|
+
updatedAt: z3.coerce.date().optional()
|
|
51
|
+
});
|
|
52
|
+
}
|
|
68
53
|
|
|
69
54
|
// src/interface/tracking/attendState.ts
|
|
70
55
|
var AttendState = /* @__PURE__ */ ((AttendState2) => {
|
|
@@ -75,14 +60,14 @@ var AttendState = /* @__PURE__ */ ((AttendState2) => {
|
|
|
75
60
|
})(AttendState || {});
|
|
76
61
|
|
|
77
62
|
// src/interface/tracking/attendance.ts
|
|
78
|
-
import { z as
|
|
63
|
+
import { z as z5 } from "zod";
|
|
79
64
|
|
|
80
65
|
// src/interface/payment/tuition.ts
|
|
81
|
-
import { z as
|
|
82
|
-
var zTuition =
|
|
83
|
-
primary:
|
|
84
|
-
textbook:
|
|
85
|
-
shipping:
|
|
66
|
+
import { z as z4 } from "zod";
|
|
67
|
+
var zTuition = z4.object({
|
|
68
|
+
primary: z4.number().int().min(1),
|
|
69
|
+
textbook: z4.boolean().optional(),
|
|
70
|
+
shipping: z4.boolean().optional()
|
|
86
71
|
});
|
|
87
72
|
|
|
88
73
|
// src/interface/tracking/campOption.ts
|
|
@@ -94,47 +79,47 @@ var CampOption = /* @__PURE__ */ ((CampOption2) => {
|
|
|
94
79
|
})(CampOption || {});
|
|
95
80
|
|
|
96
81
|
// src/interface/tracking/attendance.ts
|
|
97
|
-
var zAttendance =
|
|
98
|
-
student:
|
|
99
|
-
states:
|
|
82
|
+
var zAttendance = z5.object({
|
|
83
|
+
student: z5.string(),
|
|
84
|
+
states: z5.array(z5.nativeEnum(AttendState)),
|
|
100
85
|
tuition: zTuition,
|
|
101
|
-
paid:
|
|
102
|
-
campOption:
|
|
86
|
+
paid: z5.boolean().optional(),
|
|
87
|
+
campOption: z5.nativeEnum(CampOption)
|
|
103
88
|
});
|
|
104
89
|
var zMAttendance = extendZodObjectForMongoose(zAttendance);
|
|
105
90
|
|
|
106
91
|
// src/interface/tracking/campTracker.ts
|
|
107
|
-
import { z as
|
|
108
|
-
var zCampTracker =
|
|
92
|
+
import { z as z6 } from "zod";
|
|
93
|
+
var zCampTracker = z6.object({
|
|
109
94
|
/**
|
|
110
95
|
* Mongoose object ID
|
|
111
96
|
*/
|
|
112
|
-
course:
|
|
97
|
+
course: z6.string(),
|
|
113
98
|
/**
|
|
114
99
|
* Mongoose object ID
|
|
115
100
|
*/
|
|
116
|
-
teacher:
|
|
101
|
+
teacher: z6.string(),
|
|
117
102
|
/**
|
|
118
103
|
* Mongoose object ID
|
|
119
104
|
*/
|
|
120
|
-
semester:
|
|
105
|
+
semester: z6.string(),
|
|
121
106
|
/**
|
|
122
107
|
* occurrences are tracked by week for camps
|
|
123
108
|
*/
|
|
124
|
-
occurrences:
|
|
109
|
+
occurrences: z6.array(z6.string()),
|
|
125
110
|
/**
|
|
126
111
|
* attendances are tracked by week for camps
|
|
127
112
|
*/
|
|
128
|
-
attendances:
|
|
129
|
-
notes:
|
|
113
|
+
attendances: z6.array(z6.string()),
|
|
114
|
+
notes: z6.string().optional()
|
|
130
115
|
});
|
|
131
116
|
var zMCampTracker = extendZodObjectForMongoose(zCampTracker);
|
|
132
117
|
|
|
133
118
|
// src/interface/tracking/classTracker.ts
|
|
134
|
-
import { z as
|
|
119
|
+
import { z as z9 } from "zod";
|
|
135
120
|
|
|
136
121
|
// src/interface/payment/invoice.ts
|
|
137
|
-
import { z as
|
|
122
|
+
import { z as z7 } from "zod";
|
|
138
123
|
|
|
139
124
|
// src/interface/payment/paymentMethod.ts
|
|
140
125
|
var PaymentMethod = /* @__PURE__ */ ((PaymentMethod2) => {
|
|
@@ -146,94 +131,94 @@ var PaymentMethod = /* @__PURE__ */ ((PaymentMethod2) => {
|
|
|
146
131
|
})(PaymentMethod || {});
|
|
147
132
|
|
|
148
133
|
// src/interface/payment/invoice.ts
|
|
149
|
-
var zDiscount =
|
|
150
|
-
desc:
|
|
151
|
-
amount:
|
|
134
|
+
var zDiscount = z7.object({
|
|
135
|
+
desc: z7.string(),
|
|
136
|
+
amount: z7.number()
|
|
152
137
|
});
|
|
153
|
-
var zInvoiceItem =
|
|
138
|
+
var zInvoiceItem = z7.object({
|
|
154
139
|
/**
|
|
155
140
|
* Mongoose object ID
|
|
156
141
|
*/
|
|
157
|
-
course:
|
|
158
|
-
price:
|
|
159
|
-
units:
|
|
142
|
+
course: z7.string(),
|
|
143
|
+
price: z7.number(),
|
|
144
|
+
units: z7.number()
|
|
160
145
|
});
|
|
161
|
-
var zInvoicePackage =
|
|
146
|
+
var zInvoicePackage = z7.object({
|
|
162
147
|
/**
|
|
163
148
|
* Mongoose object ID
|
|
164
149
|
*/
|
|
165
|
-
student:
|
|
166
|
-
items:
|
|
150
|
+
student: z7.string(),
|
|
151
|
+
items: z7.array(zInvoiceItem)
|
|
167
152
|
});
|
|
168
|
-
var zInvoice =
|
|
169
|
-
billTo:
|
|
170
|
-
packages:
|
|
171
|
-
discounts:
|
|
172
|
-
textbook:
|
|
173
|
-
shipping:
|
|
174
|
-
paid:
|
|
175
|
-
notes:
|
|
153
|
+
var zInvoice = z7.object({
|
|
154
|
+
billTo: z7.string(),
|
|
155
|
+
packages: z7.array(zInvoicePackage),
|
|
156
|
+
discounts: z7.array(zDiscount),
|
|
157
|
+
textbook: z7.number().int().min(1).optional(),
|
|
158
|
+
shipping: z7.number().int().min(1).optional(),
|
|
159
|
+
paid: z7.nativeEnum(PaymentMethod).optional(),
|
|
160
|
+
notes: z7.string().optional(),
|
|
176
161
|
/**
|
|
177
162
|
* Mongoose object ID
|
|
178
163
|
*/
|
|
179
|
-
createdBy:
|
|
164
|
+
createdBy: z7.string(),
|
|
180
165
|
/**
|
|
181
166
|
* Mongoose object ID
|
|
182
167
|
*/
|
|
183
|
-
lastEditBy:
|
|
168
|
+
lastEditBy: z7.string().optional()
|
|
184
169
|
});
|
|
185
170
|
var zMInvoice = extendZodObjectForMongoose(zInvoice);
|
|
186
171
|
|
|
187
172
|
// src/interface/payment/teacherPayment.ts
|
|
188
|
-
import { z as
|
|
189
|
-
var zTeacherPaymentRow =
|
|
190
|
-
course:
|
|
191
|
-
length:
|
|
192
|
-
count:
|
|
193
|
-
wage:
|
|
173
|
+
import { z as z8 } from "zod";
|
|
174
|
+
var zTeacherPaymentRow = z8.object({
|
|
175
|
+
course: z8.string(),
|
|
176
|
+
length: z8.number(),
|
|
177
|
+
count: z8.number(),
|
|
178
|
+
wage: z8.number()
|
|
194
179
|
});
|
|
195
|
-
var zTeacherPayment =
|
|
196
|
-
teacher:
|
|
197
|
-
rows:
|
|
198
|
-
paid:
|
|
180
|
+
var zTeacherPayment = z8.object({
|
|
181
|
+
teacher: z8.string(),
|
|
182
|
+
rows: z8.array(zTeacherPaymentRow),
|
|
183
|
+
paid: z8.boolean().optional()
|
|
199
184
|
});
|
|
200
185
|
var zMTeacherPayment = extendZodObjectForMongoose(zTeacherPayment);
|
|
201
186
|
|
|
202
187
|
// src/interface/tracking/classTracker.ts
|
|
203
|
-
var zClassTracker =
|
|
188
|
+
var zClassTracker = z9.object({
|
|
204
189
|
/**
|
|
205
190
|
* Mongoose object ID
|
|
206
191
|
*/
|
|
207
|
-
course:
|
|
192
|
+
course: z9.string(),
|
|
208
193
|
/**
|
|
209
194
|
* Mongoose object ID
|
|
210
195
|
*/
|
|
211
|
-
teacher:
|
|
196
|
+
teacher: z9.string(),
|
|
212
197
|
/**
|
|
213
198
|
* Mongoose object ID
|
|
214
199
|
*/
|
|
215
|
-
semester:
|
|
216
|
-
classTimes:
|
|
217
|
-
completedList:
|
|
200
|
+
semester: z9.string(),
|
|
201
|
+
classTimes: z9.array(z9.coerce.date()),
|
|
202
|
+
completedList: z9.array(z9.boolean()),
|
|
218
203
|
/**
|
|
219
204
|
* Virtual mongoose field when all values in completedList is true
|
|
220
205
|
*/
|
|
221
|
-
completed:
|
|
206
|
+
completed: z9.boolean().optional(),
|
|
222
207
|
tuition: zTuition.optional(),
|
|
223
|
-
paid:
|
|
224
|
-
notes:
|
|
208
|
+
paid: z9.boolean().optional(),
|
|
209
|
+
notes: z9.string().optional()
|
|
225
210
|
});
|
|
226
211
|
var zMClassTracker = extendZodObjectForMongoose(zClassTracker);
|
|
227
212
|
|
|
228
213
|
// src/interface/tracking/groupTracker.ts
|
|
229
|
-
import { z as
|
|
214
|
+
import { z as z12 } from "zod";
|
|
230
215
|
|
|
231
216
|
// src/interface/tracking/scheduleData.ts
|
|
232
|
-
import { z as
|
|
233
|
-
var zScheduleData =
|
|
234
|
-
startTime:
|
|
217
|
+
import { z as z10 } from "zod";
|
|
218
|
+
var zScheduleData = z10.object({
|
|
219
|
+
startTime: z10.string(),
|
|
235
220
|
// String in 24 hour "HH:mm" format
|
|
236
|
-
dayOfWeek:
|
|
221
|
+
dayOfWeek: z10.number().int().min(0).max(6)
|
|
237
222
|
// integeters in 0 - 6
|
|
238
223
|
});
|
|
239
224
|
|
|
@@ -262,88 +247,110 @@ var NYIGSchool = /* @__PURE__ */ ((NYIGSchool2) => {
|
|
|
262
247
|
})(NYIGSchool || {});
|
|
263
248
|
|
|
264
249
|
// src/interface/course/course.ts
|
|
265
|
-
import { z as
|
|
266
|
-
var zCourse =
|
|
267
|
-
name:
|
|
268
|
-
category:
|
|
250
|
+
import { z as z11 } from "zod";
|
|
251
|
+
var zCourse = z11.object({
|
|
252
|
+
name: z11.string(),
|
|
253
|
+
category: z11.nativeEnum(CourseCategory),
|
|
269
254
|
/**
|
|
270
255
|
* @unit SECONDS - Duration of the course in seconds
|
|
271
256
|
*/
|
|
272
|
-
duration:
|
|
257
|
+
duration: z11.number(),
|
|
273
258
|
/**
|
|
274
259
|
* @unit CENTS - Price of the course in cents
|
|
275
260
|
*/
|
|
276
|
-
price:
|
|
277
|
-
description:
|
|
261
|
+
price: z11.number(),
|
|
262
|
+
description: z11.string().optional(),
|
|
278
263
|
/**
|
|
279
264
|
* NYIG School locations
|
|
280
265
|
*/
|
|
281
|
-
nyigSchool:
|
|
266
|
+
nyigSchool: z11.nativeEnum(NYIGSchool),
|
|
282
267
|
/**
|
|
283
268
|
* Recommended level before taking this course
|
|
284
269
|
*/
|
|
285
|
-
recLevel:
|
|
270
|
+
recLevel: z11.string(),
|
|
286
271
|
/**
|
|
287
272
|
* Camp tuition for half-day option
|
|
288
273
|
*/
|
|
289
|
-
halfCampTuition:
|
|
274
|
+
halfCampTuition: z11.number(),
|
|
290
275
|
/**
|
|
291
276
|
* Camp tuition for full-day option
|
|
292
277
|
*/
|
|
293
|
-
fullCampTuition:
|
|
278
|
+
fullCampTuition: z11.number()
|
|
294
279
|
});
|
|
295
280
|
var zMCourse = extendZodObjectForMongoose(zCourse);
|
|
296
281
|
|
|
297
282
|
// src/interface/tracking/groupTracker.ts
|
|
298
|
-
var zGroupTracker =
|
|
283
|
+
var zGroupTracker = z12.object({
|
|
299
284
|
/**
|
|
300
285
|
* Mongoose object ID
|
|
301
286
|
*/
|
|
302
|
-
course:
|
|
287
|
+
course: z12.string(),
|
|
303
288
|
/**
|
|
304
289
|
* Mongoose object ID
|
|
305
290
|
*/
|
|
306
|
-
teacher:
|
|
291
|
+
teacher: z12.string(),
|
|
307
292
|
/**
|
|
308
293
|
* Mongoose object ID
|
|
309
294
|
*/
|
|
310
|
-
semester:
|
|
295
|
+
semester: z12.string(),
|
|
311
296
|
scheduleData: zScheduleData,
|
|
312
297
|
/**
|
|
313
298
|
* occurrences are tracked by week for Groups
|
|
314
299
|
*/
|
|
315
|
-
occurrences:
|
|
300
|
+
occurrences: z12.array(z12.coerce.date()),
|
|
316
301
|
/**
|
|
317
302
|
* attendances are tracked by week for Groups
|
|
318
303
|
*/
|
|
319
|
-
attendances:
|
|
304
|
+
attendances: z12.array(z12.string()),
|
|
320
305
|
/**
|
|
321
306
|
* ID of the course instance, e.g., 101
|
|
322
307
|
*/
|
|
323
|
-
courseId:
|
|
308
|
+
courseId: z12.string().optional(),
|
|
324
309
|
/**
|
|
325
310
|
* Age group of the class instance, e.g. "adult", "youth"
|
|
326
311
|
*/
|
|
327
|
-
ageGroup:
|
|
312
|
+
ageGroup: z12.nativeEnum(AgeGroup).optional(),
|
|
328
313
|
/**
|
|
329
314
|
* If true, the course is hidden from public view
|
|
330
315
|
*/
|
|
331
|
-
isNonPublic:
|
|
332
|
-
notes:
|
|
316
|
+
isNonPublic: z12.boolean().optional(),
|
|
317
|
+
notes: z12.string().optional()
|
|
333
318
|
});
|
|
334
319
|
var zMGroupTracker = extendZodObjectForMongoose(zGroupTracker);
|
|
335
320
|
|
|
336
321
|
// src/interface/booking/campBooking.ts
|
|
337
|
-
var zCampBooking =
|
|
338
|
-
userId:
|
|
339
|
-
ctId:
|
|
340
|
-
isOnline:
|
|
341
|
-
classDates:
|
|
342
|
-
campOption:
|
|
343
|
-
shipping:
|
|
322
|
+
var zCampBooking = z13.object({
|
|
323
|
+
userId: z13.string().optional(),
|
|
324
|
+
ctId: z13.string().optional(),
|
|
325
|
+
isOnline: z13.boolean(),
|
|
326
|
+
classDates: z13.string(),
|
|
327
|
+
campOption: z13.nativeEnum(CampOption),
|
|
328
|
+
shipping: z13.boolean().optional()
|
|
344
329
|
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
345
330
|
var zMCampBooking = extendZodObjectForMongoose(zCampBooking);
|
|
346
331
|
|
|
332
|
+
// src/interface/booking/groupBooking.ts
|
|
333
|
+
import { z as z14 } from "zod";
|
|
334
|
+
var zGroupBooking = z14.object({
|
|
335
|
+
userId: z14.string().optional(),
|
|
336
|
+
gtId: z14.string().optional(),
|
|
337
|
+
isTrial: z14.boolean().optional(),
|
|
338
|
+
isOnline: z14.boolean(),
|
|
339
|
+
classDate: z14.string().optional(),
|
|
340
|
+
shipping: z14.boolean().optional()
|
|
341
|
+
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
342
|
+
var zMGroupBooking = extendZodObjectForMongoose(zGroupBooking);
|
|
343
|
+
|
|
344
|
+
// src/interface/booking/privateBooking.ts
|
|
345
|
+
import { z as z15 } from "zod";
|
|
346
|
+
var zPrivateBooking = z15.object({
|
|
347
|
+
userId: z15.string().optional(),
|
|
348
|
+
courseId: z15.string(),
|
|
349
|
+
teacherId: z15.string(),
|
|
350
|
+
classDate: z15.string().optional()
|
|
351
|
+
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
352
|
+
var zMPrivateBooking = extendZodObjectForMongoose(zPrivateBooking);
|
|
353
|
+
|
|
347
354
|
// src/interface/public/aurora.ts
|
|
348
355
|
import { z as z16 } from "zod";
|
|
349
356
|
var zTeacherDisplay = z16.object({
|
|
@@ -555,7 +562,7 @@ var zTTicket = z24.object({
|
|
|
555
562
|
/**
|
|
556
563
|
* @optional If date is provided and in the past, ticket cannot be purchased
|
|
557
564
|
*/
|
|
558
|
-
|
|
565
|
+
lastBuyableDate: z24.coerce.date().optional()
|
|
559
566
|
});
|
|
560
567
|
var zMTTicket = extendZodObjectForMongoose(zTTicket);
|
|
561
568
|
|
|
@@ -668,6 +675,7 @@ var zMTeacher = extendZodObjectForMongoose(zTeacher);
|
|
|
668
675
|
export {
|
|
669
676
|
AgeGroup,
|
|
670
677
|
AttendState,
|
|
678
|
+
BookingType,
|
|
671
679
|
CampOption,
|
|
672
680
|
CourseCategory,
|
|
673
681
|
GoRank,
|