@nyig/models 0.2.36 → 0.2.38

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.
Files changed (5) hide show
  1. package/index.d.mts +591 -287
  2. package/index.d.ts +591 -287
  3. package/index.js +63 -61
  4. package/index.mjs +62 -61
  5. package/package.json +1 -1
package/index.js CHANGED
@@ -69,6 +69,7 @@ __export(src_exports, {
69
69
  zInvoice: () => zInvoice,
70
70
  zInvoiceItem: () => zInvoiceItem,
71
71
  zInvoicePackage: () => zInvoicePackage,
72
+ zInvoiceResponse: () => zInvoiceResponse,
72
73
  zPrivateBooking: () => zPrivateBooking,
73
74
  zReportTicket: () => zReportTicket,
74
75
  zScheduleData: () => zScheduleData,
@@ -201,7 +202,7 @@ var zCampTracker = addAutoProps(zBCampTracker);
201
202
  var import_zod11 = require("zod");
202
203
 
203
204
  // src/interface/payment/invoice.ts
204
- var import_zod7 = require("zod");
205
+ var import_zod9 = require("zod");
205
206
 
206
207
  // src/interface/payment/paymentMethod.ts
207
208
  var PaymentMethod = /* @__PURE__ */ ((PaymentMethod2) => {
@@ -212,36 +213,6 @@ var PaymentMethod = /* @__PURE__ */ ((PaymentMethod2) => {
212
213
  return PaymentMethod2;
213
214
  })(PaymentMethod || {});
214
215
 
215
- // src/interface/payment/invoice.ts
216
- var zDiscount = import_zod7.z.object({
217
- desc: import_zod7.z.string(),
218
- amount: import_zod7.z.number()
219
- });
220
- var zInvoiceItem = import_zod7.z.object({
221
- course: import_zod7.z.string().min(1),
222
- price: import_zod7.z.number(),
223
- units: import_zod7.z.number()
224
- });
225
- var zInvoicePackage = import_zod7.z.object({
226
- student: import_zod7.z.string(),
227
- items: import_zod7.z.array(zInvoiceItem).min(1, "Package must contain at least one item")
228
- });
229
- var zBInvoice = import_zod7.z.object({
230
- billTo: import_zod7.z.string().min(1, "The 'Bill To' field must not be empty"),
231
- packages: import_zod7.z.array(zInvoicePackage).min(1, "Invoice must include at least one package"),
232
- discounts: import_zod7.z.array(zDiscount),
233
- textbook: import_zod7.z.number().int().min(0).optional(),
234
- shipping: import_zod7.z.number().int().min(0).optional(),
235
- paid: import_zod7.z.nativeEnum(PaymentMethod).optional(),
236
- notes: import_zod7.z.string().optional(),
237
- createdBy: import_zod7.z.string(),
238
- lastEditBy: import_zod7.z.string().optional()
239
- });
240
- var zInvoice = addAutoProps(zBInvoice);
241
-
242
- // src/interface/payment/teacherPayment.ts
243
- var import_zod10 = require("zod");
244
-
245
216
  // src/interface/user/goRank.ts
246
217
  var GoRank = /* @__PURE__ */ ((GoRank2) => {
247
218
  GoRank2["KYU1"] = "1k";
@@ -289,44 +260,44 @@ var GoRank = /* @__PURE__ */ ((GoRank2) => {
289
260
  })(GoRank || {});
290
261
 
291
262
  // src/interface/user/user.ts
292
- var import_zod8 = require("zod");
293
- var zBUser = import_zod8.z.object({
294
- name: import_zod8.z.string().min(2).max(100),
295
- username: import_zod8.z.string().optional(),
296
- password: import_zod8.z.string().optional(),
297
- roles: import_zod8.z.array(import_zod8.z.number().int()).optional(),
298
- email: import_zod8.z.string().max(100).email().or(import_zod8.z.literal("")).optional(),
299
- address: import_zod8.z.string().or(import_zod8.z.literal("")).optional(),
300
- country: import_zod8.z.string().length(2, {
263
+ var import_zod7 = require("zod");
264
+ var zBUser = import_zod7.z.object({
265
+ name: import_zod7.z.string().min(2).max(100),
266
+ username: import_zod7.z.string().optional(),
267
+ password: import_zod7.z.string().optional(),
268
+ roles: import_zod7.z.array(import_zod7.z.number().int()).optional(),
269
+ email: import_zod7.z.string().max(100).email().or(import_zod7.z.literal("")).optional(),
270
+ address: import_zod7.z.string().or(import_zod7.z.literal("")).optional(),
271
+ country: import_zod7.z.string().length(2, {
301
272
  message: "Enter the 2-letter country code"
302
- }).or(import_zod8.z.literal("")).optional(),
303
- phoneNumber: import_zod8.z.string().regex(/^\d{10}/, {
273
+ }).or(import_zod7.z.literal("")).optional(),
274
+ phoneNumber: import_zod7.z.string().regex(/^\d{10}/, {
304
275
  message: `Please enter a valid 10-digit US phone number with numbers only`
305
- }).or(import_zod8.z.literal("")).optional(),
306
- birthDate: import_zod8.z.string().regex(/^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/, {
276
+ }).or(import_zod7.z.literal("")).optional(),
277
+ birthDate: import_zod7.z.string().regex(/^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/, {
307
278
  message: "Enter a valid date in yyyy-mm-dd format"
308
- }).or(import_zod8.z.literal("")).optional()
279
+ }).or(import_zod7.z.literal("")).optional()
309
280
  });
310
281
  var zUser = addAutoProps(zBUser);
311
282
  var zStudent = zUser.extend({
312
- rank: import_zod8.z.nativeEnum(GoRank),
313
- guardian: import_zod8.z.string().optional()
283
+ rank: import_zod7.z.nativeEnum(GoRank),
284
+ guardian: import_zod7.z.string().optional()
314
285
  });
315
286
  var zTeacher = zUser.extend({
316
- rank: import_zod8.z.nativeEnum(GoRank),
287
+ rank: import_zod7.z.nativeEnum(GoRank),
317
288
  /**
318
289
  * Inactive teachers are not shown on public endpoints
319
290
  */
320
- isInactive: import_zod8.z.boolean().optional(),
291
+ isInactive: import_zod7.z.boolean().optional(),
321
292
  /**
322
293
  * Teacher's position, e.g., instructor, president
323
294
  */
324
- title: import_zod8.z.string().optional(),
295
+ title: import_zod7.z.string().optional(),
325
296
  /**
326
297
  * Teacher's bio text describing experience
327
298
  * new lines will be rendered as paragraphs
328
299
  */
329
- bio: import_zod8.z.string().optional(),
300
+ bio: import_zod7.z.string().optional(),
330
301
  /** Format is illustrated below, where teacher is available
331
302
  * Mon 9-12am 3-6pm & Tue 10-12am 6-10pm
332
303
  * [
@@ -339,18 +310,50 @@ var zTeacher = zUser.extend({
339
310
  * [],
340
311
  * ]
341
312
  */
342
- available: import_zod8.z.array(import_zod8.z.array(import_zod8.z.array(import_zod8.z.number()))).optional()
313
+ available: import_zod7.z.array(import_zod7.z.array(import_zod7.z.array(import_zod7.z.number()))).optional()
343
314
  });
344
315
 
345
316
  // src/interface/user/userRoles.ts
346
- var import_zod9 = require("zod");
347
- var zUserRoles = import_zod9.z.object({
348
- user: import_zod9.z.number().int(),
349
- admin: import_zod9.z.number().int(),
350
- superadmin: import_zod9.z.number().int()
317
+ var import_zod8 = require("zod");
318
+ var zUserRoles = import_zod8.z.object({
319
+ user: import_zod8.z.number().int(),
320
+ admin: import_zod8.z.number().int(),
321
+ superadmin: import_zod8.z.number().int()
322
+ });
323
+
324
+ // src/interface/payment/invoice.ts
325
+ var zDiscount = import_zod9.z.object({
326
+ desc: import_zod9.z.string().min(1, "Discount description cannot be empty"),
327
+ amount: import_zod9.z.coerce.number()
328
+ });
329
+ var zInvoiceItem = import_zod9.z.object({
330
+ course: import_zod9.z.string().min(1, "Course description cannot be empty"),
331
+ price: import_zod9.z.coerce.number(),
332
+ units: import_zod9.z.coerce.number()
333
+ });
334
+ var zInvoicePackage = import_zod9.z.object({
335
+ student: import_zod9.z.string(),
336
+ items: import_zod9.z.array(zInvoiceItem).min(1, "Package must contain at least one item")
337
+ });
338
+ var zBInvoice = import_zod9.z.object({
339
+ billTo: import_zod9.z.string().min(1, "The 'Bill To' field must not be empty"),
340
+ packages: import_zod9.z.array(zInvoicePackage).min(1, "Invoice must include at least one package"),
341
+ discounts: import_zod9.z.array(zDiscount),
342
+ textbook: import_zod9.z.coerce.number().int().min(0).optional(),
343
+ shipping: import_zod9.z.coerce.number().int().min(0).optional(),
344
+ paid: import_zod9.z.nativeEnum(PaymentMethod).optional(),
345
+ notes: import_zod9.z.string().or(import_zod9.z.literal("")).optional(),
346
+ createdBy: import_zod9.z.string(),
347
+ lastEditBy: import_zod9.z.string().optional()
348
+ });
349
+ var zInvoice = addAutoProps(zBInvoice);
350
+ var zInvoiceResponse = zInvoice.extend({
351
+ createdBy: zTeacher,
352
+ lastEditBy: zTeacher.optional()
351
353
  });
352
354
 
353
355
  // src/interface/payment/teacherPayment.ts
356
+ var import_zod10 = require("zod");
354
357
  var zTeacherPaymentRow = import_zod10.z.object({
355
358
  course: import_zod10.z.string().min(1, "select or enter a course"),
356
359
  length: import_zod10.z.coerce.number().gt(0, "must be > 0"),
@@ -363,10 +366,8 @@ var zBTeacherPayment = import_zod10.z.object({
363
366
  paid: import_zod10.z.boolean().optional()
364
367
  });
365
368
  var zTeacherPayment = addAutoProps(zBTeacherPayment);
366
- var zTeacherPaymentResponse = import_zod10.z.object({
367
- teacher: zTeacher,
368
- rows: import_zod10.z.array(zTeacherPaymentRow),
369
- paid: import_zod10.z.boolean().optional()
369
+ var zTeacherPaymentResponse = zTeacherPayment.extend({
370
+ teacher: zTeacher
370
371
  });
371
372
 
372
373
  // src/interface/tracking/classTracker.ts
@@ -780,6 +781,7 @@ var zEventRegResponse = zEventReg.extend({
780
781
  zInvoice,
781
782
  zInvoiceItem,
782
783
  zInvoicePackage,
784
+ zInvoiceResponse,
783
785
  zPrivateBooking,
784
786
  zReportTicket,
785
787
  zScheduleData,
package/index.mjs CHANGED
@@ -113,7 +113,7 @@ var zCampTracker = addAutoProps(zBCampTracker);
113
113
  import { z as z11 } from "zod";
114
114
 
115
115
  // src/interface/payment/invoice.ts
116
- import { z as z7 } from "zod";
116
+ import { z as z9 } from "zod";
117
117
 
118
118
  // src/interface/payment/paymentMethod.ts
119
119
  var PaymentMethod = /* @__PURE__ */ ((PaymentMethod2) => {
@@ -124,36 +124,6 @@ var PaymentMethod = /* @__PURE__ */ ((PaymentMethod2) => {
124
124
  return PaymentMethod2;
125
125
  })(PaymentMethod || {});
126
126
 
127
- // src/interface/payment/invoice.ts
128
- var zDiscount = z7.object({
129
- desc: z7.string(),
130
- amount: z7.number()
131
- });
132
- var zInvoiceItem = z7.object({
133
- course: z7.string().min(1),
134
- price: z7.number(),
135
- units: z7.number()
136
- });
137
- var zInvoicePackage = z7.object({
138
- student: z7.string(),
139
- items: z7.array(zInvoiceItem).min(1, "Package must contain at least one item")
140
- });
141
- var zBInvoice = z7.object({
142
- billTo: z7.string().min(1, "The 'Bill To' field must not be empty"),
143
- packages: z7.array(zInvoicePackage).min(1, "Invoice must include at least one package"),
144
- discounts: z7.array(zDiscount),
145
- textbook: z7.number().int().min(0).optional(),
146
- shipping: z7.number().int().min(0).optional(),
147
- paid: z7.nativeEnum(PaymentMethod).optional(),
148
- notes: z7.string().optional(),
149
- createdBy: z7.string(),
150
- lastEditBy: z7.string().optional()
151
- });
152
- var zInvoice = addAutoProps(zBInvoice);
153
-
154
- // src/interface/payment/teacherPayment.ts
155
- import { z as z10 } from "zod";
156
-
157
127
  // src/interface/user/goRank.ts
158
128
  var GoRank = /* @__PURE__ */ ((GoRank2) => {
159
129
  GoRank2["KYU1"] = "1k";
@@ -201,44 +171,44 @@ var GoRank = /* @__PURE__ */ ((GoRank2) => {
201
171
  })(GoRank || {});
202
172
 
203
173
  // src/interface/user/user.ts
204
- import { z as z8 } from "zod";
205
- var zBUser = z8.object({
206
- name: z8.string().min(2).max(100),
207
- username: z8.string().optional(),
208
- password: z8.string().optional(),
209
- roles: z8.array(z8.number().int()).optional(),
210
- email: z8.string().max(100).email().or(z8.literal("")).optional(),
211
- address: z8.string().or(z8.literal("")).optional(),
212
- country: z8.string().length(2, {
174
+ import { z as z7 } from "zod";
175
+ var zBUser = z7.object({
176
+ name: z7.string().min(2).max(100),
177
+ username: z7.string().optional(),
178
+ password: z7.string().optional(),
179
+ roles: z7.array(z7.number().int()).optional(),
180
+ email: z7.string().max(100).email().or(z7.literal("")).optional(),
181
+ address: z7.string().or(z7.literal("")).optional(),
182
+ country: z7.string().length(2, {
213
183
  message: "Enter the 2-letter country code"
214
- }).or(z8.literal("")).optional(),
215
- phoneNumber: z8.string().regex(/^\d{10}/, {
184
+ }).or(z7.literal("")).optional(),
185
+ phoneNumber: z7.string().regex(/^\d{10}/, {
216
186
  message: `Please enter a valid 10-digit US phone number with numbers only`
217
- }).or(z8.literal("")).optional(),
218
- birthDate: z8.string().regex(/^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/, {
187
+ }).or(z7.literal("")).optional(),
188
+ birthDate: z7.string().regex(/^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/, {
219
189
  message: "Enter a valid date in yyyy-mm-dd format"
220
- }).or(z8.literal("")).optional()
190
+ }).or(z7.literal("")).optional()
221
191
  });
222
192
  var zUser = addAutoProps(zBUser);
223
193
  var zStudent = zUser.extend({
224
- rank: z8.nativeEnum(GoRank),
225
- guardian: z8.string().optional()
194
+ rank: z7.nativeEnum(GoRank),
195
+ guardian: z7.string().optional()
226
196
  });
227
197
  var zTeacher = zUser.extend({
228
- rank: z8.nativeEnum(GoRank),
198
+ rank: z7.nativeEnum(GoRank),
229
199
  /**
230
200
  * Inactive teachers are not shown on public endpoints
231
201
  */
232
- isInactive: z8.boolean().optional(),
202
+ isInactive: z7.boolean().optional(),
233
203
  /**
234
204
  * Teacher's position, e.g., instructor, president
235
205
  */
236
- title: z8.string().optional(),
206
+ title: z7.string().optional(),
237
207
  /**
238
208
  * Teacher's bio text describing experience
239
209
  * new lines will be rendered as paragraphs
240
210
  */
241
- bio: z8.string().optional(),
211
+ bio: z7.string().optional(),
242
212
  /** Format is illustrated below, where teacher is available
243
213
  * Mon 9-12am 3-6pm & Tue 10-12am 6-10pm
244
214
  * [
@@ -251,18 +221,50 @@ var zTeacher = zUser.extend({
251
221
  * [],
252
222
  * ]
253
223
  */
254
- available: z8.array(z8.array(z8.array(z8.number()))).optional()
224
+ available: z7.array(z7.array(z7.array(z7.number()))).optional()
255
225
  });
256
226
 
257
227
  // src/interface/user/userRoles.ts
258
- import { z as z9 } from "zod";
259
- var zUserRoles = z9.object({
260
- user: z9.number().int(),
261
- admin: z9.number().int(),
262
- superadmin: z9.number().int()
228
+ import { z as z8 } from "zod";
229
+ var zUserRoles = z8.object({
230
+ user: z8.number().int(),
231
+ admin: z8.number().int(),
232
+ superadmin: z8.number().int()
233
+ });
234
+
235
+ // src/interface/payment/invoice.ts
236
+ var zDiscount = z9.object({
237
+ desc: z9.string().min(1, "Discount description cannot be empty"),
238
+ amount: z9.coerce.number()
239
+ });
240
+ var zInvoiceItem = z9.object({
241
+ course: z9.string().min(1, "Course description cannot be empty"),
242
+ price: z9.coerce.number(),
243
+ units: z9.coerce.number()
244
+ });
245
+ var zInvoicePackage = z9.object({
246
+ student: z9.string(),
247
+ items: z9.array(zInvoiceItem).min(1, "Package must contain at least one item")
248
+ });
249
+ var zBInvoice = z9.object({
250
+ billTo: z9.string().min(1, "The 'Bill To' field must not be empty"),
251
+ packages: z9.array(zInvoicePackage).min(1, "Invoice must include at least one package"),
252
+ discounts: z9.array(zDiscount),
253
+ textbook: z9.coerce.number().int().min(0).optional(),
254
+ shipping: z9.coerce.number().int().min(0).optional(),
255
+ paid: z9.nativeEnum(PaymentMethod).optional(),
256
+ notes: z9.string().or(z9.literal("")).optional(),
257
+ createdBy: z9.string(),
258
+ lastEditBy: z9.string().optional()
259
+ });
260
+ var zInvoice = addAutoProps(zBInvoice);
261
+ var zInvoiceResponse = zInvoice.extend({
262
+ createdBy: zTeacher,
263
+ lastEditBy: zTeacher.optional()
263
264
  });
264
265
 
265
266
  // src/interface/payment/teacherPayment.ts
267
+ import { z as z10 } from "zod";
266
268
  var zTeacherPaymentRow = z10.object({
267
269
  course: z10.string().min(1, "select or enter a course"),
268
270
  length: z10.coerce.number().gt(0, "must be > 0"),
@@ -275,10 +277,8 @@ var zBTeacherPayment = z10.object({
275
277
  paid: z10.boolean().optional()
276
278
  });
277
279
  var zTeacherPayment = addAutoProps(zBTeacherPayment);
278
- var zTeacherPaymentResponse = z10.object({
279
- teacher: zTeacher,
280
- rows: z10.array(zTeacherPaymentRow),
281
- paid: z10.boolean().optional()
280
+ var zTeacherPaymentResponse = zTeacherPayment.extend({
281
+ teacher: zTeacher
282
282
  });
283
283
 
284
284
  // src/interface/tracking/classTracker.ts
@@ -691,6 +691,7 @@ export {
691
691
  zInvoice,
692
692
  zInvoiceItem,
693
693
  zInvoicePackage,
694
+ zInvoiceResponse,
694
695
  zPrivateBooking,
695
696
  zReportTicket,
696
697
  zScheduleData,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nyig/models",
3
- "version": "0.2.36",
3
+ "version": "0.2.38",
4
4
  "license": "MIT",
5
5
  "main": "index.js",
6
6
  "module": "index.mjs",