@nyig/models 0.2.37 → 0.2.39

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 +785 -270
  2. package/index.d.ts +785 -270
  3. package/index.js +67 -57
  4. package/index.mjs +65 -57
  5. package/package.json +1 -1
package/index.js CHANGED
@@ -69,6 +69,8 @@ __export(src_exports, {
69
69
  zInvoice: () => zInvoice,
70
70
  zInvoiceItem: () => zInvoiceItem,
71
71
  zInvoicePackage: () => zInvoicePackage,
72
+ zInvoicePackageResponse: () => zInvoicePackageResponse,
73
+ zInvoiceResponse: () => zInvoiceResponse,
72
74
  zPrivateBooking: () => zPrivateBooking,
73
75
  zReportTicket: () => zReportTicket,
74
76
  zScheduleData: () => zScheduleData,
@@ -201,7 +203,7 @@ var zCampTracker = addAutoProps(zBCampTracker);
201
203
  var import_zod11 = require("zod");
202
204
 
203
205
  // src/interface/payment/invoice.ts
204
- var import_zod7 = require("zod");
206
+ var import_zod9 = require("zod");
205
207
 
206
208
  // src/interface/payment/paymentMethod.ts
207
209
  var PaymentMethod = /* @__PURE__ */ ((PaymentMethod2) => {
@@ -212,36 +214,6 @@ var PaymentMethod = /* @__PURE__ */ ((PaymentMethod2) => {
212
214
  return PaymentMethod2;
213
215
  })(PaymentMethod || {});
214
216
 
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
217
  // src/interface/user/goRank.ts
246
218
  var GoRank = /* @__PURE__ */ ((GoRank2) => {
247
219
  GoRank2["KYU1"] = "1k";
@@ -289,44 +261,44 @@ var GoRank = /* @__PURE__ */ ((GoRank2) => {
289
261
  })(GoRank || {});
290
262
 
291
263
  // 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, {
264
+ var import_zod7 = require("zod");
265
+ var zBUser = import_zod7.z.object({
266
+ name: import_zod7.z.string().min(2).max(100),
267
+ username: import_zod7.z.string().optional(),
268
+ password: import_zod7.z.string().optional(),
269
+ roles: import_zod7.z.array(import_zod7.z.number().int()).optional(),
270
+ email: import_zod7.z.string().max(100).email().or(import_zod7.z.literal("")).optional(),
271
+ address: import_zod7.z.string().or(import_zod7.z.literal("")).optional(),
272
+ country: import_zod7.z.string().length(2, {
301
273
  message: "Enter the 2-letter country code"
302
- }).or(import_zod8.z.literal("")).optional(),
303
- phoneNumber: import_zod8.z.string().regex(/^\d{10}/, {
274
+ }).or(import_zod7.z.literal("")).optional(),
275
+ phoneNumber: import_zod7.z.string().regex(/^\d{10}/, {
304
276
  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])$/, {
277
+ }).or(import_zod7.z.literal("")).optional(),
278
+ birthDate: import_zod7.z.string().regex(/^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/, {
307
279
  message: "Enter a valid date in yyyy-mm-dd format"
308
- }).or(import_zod8.z.literal("")).optional()
280
+ }).or(import_zod7.z.literal("")).optional()
309
281
  });
310
282
  var zUser = addAutoProps(zBUser);
311
283
  var zStudent = zUser.extend({
312
- rank: import_zod8.z.nativeEnum(GoRank),
313
- guardian: import_zod8.z.string().optional()
284
+ rank: import_zod7.z.nativeEnum(GoRank),
285
+ guardian: import_zod7.z.string().optional()
314
286
  });
315
287
  var zTeacher = zUser.extend({
316
- rank: import_zod8.z.nativeEnum(GoRank),
288
+ rank: import_zod7.z.nativeEnum(GoRank),
317
289
  /**
318
290
  * Inactive teachers are not shown on public endpoints
319
291
  */
320
- isInactive: import_zod8.z.boolean().optional(),
292
+ isInactive: import_zod7.z.boolean().optional(),
321
293
  /**
322
294
  * Teacher's position, e.g., instructor, president
323
295
  */
324
- title: import_zod8.z.string().optional(),
296
+ title: import_zod7.z.string().optional(),
325
297
  /**
326
298
  * Teacher's bio text describing experience
327
299
  * new lines will be rendered as paragraphs
328
300
  */
329
- bio: import_zod8.z.string().optional(),
301
+ bio: import_zod7.z.string().optional(),
330
302
  /** Format is illustrated below, where teacher is available
331
303
  * Mon 9-12am 3-6pm & Tue 10-12am 6-10pm
332
304
  * [
@@ -339,18 +311,54 @@ var zTeacher = zUser.extend({
339
311
  * [],
340
312
  * ]
341
313
  */
342
- available: import_zod8.z.array(import_zod8.z.array(import_zod8.z.array(import_zod8.z.number()))).optional()
314
+ available: import_zod7.z.array(import_zod7.z.array(import_zod7.z.array(import_zod7.z.number()))).optional()
343
315
  });
344
316
 
345
317
  // 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()
318
+ var import_zod8 = require("zod");
319
+ var zUserRoles = import_zod8.z.object({
320
+ user: import_zod8.z.number().int(),
321
+ admin: import_zod8.z.number().int(),
322
+ superadmin: import_zod8.z.number().int()
323
+ });
324
+
325
+ // src/interface/payment/invoice.ts
326
+ var zDiscount = import_zod9.z.object({
327
+ desc: import_zod9.z.string().min(1, "Discount description cannot be empty"),
328
+ amount: import_zod9.z.coerce.number()
329
+ });
330
+ var zInvoiceItem = import_zod9.z.object({
331
+ course: import_zod9.z.string().min(1, "Course description cannot be empty"),
332
+ price: import_zod9.z.coerce.number(),
333
+ units: import_zod9.z.coerce.number()
334
+ });
335
+ var zInvoicePackage = import_zod9.z.object({
336
+ student: import_zod9.z.string(),
337
+ items: import_zod9.z.array(zInvoiceItem).min(1, "Package must contain at least one item")
338
+ });
339
+ var zInvoicePackageResponse = zInvoicePackage.extend({
340
+ student: zStudent
341
+ });
342
+ var zBInvoice = import_zod9.z.object({
343
+ billTo: import_zod9.z.string().min(1, "The 'Bill To' field must not be empty"),
344
+ packages: import_zod9.z.array(zInvoicePackage).min(1, "Invoice must include at least one package"),
345
+ discounts: import_zod9.z.array(zDiscount),
346
+ textbook: import_zod9.z.coerce.number().int().min(0).optional(),
347
+ shipping: import_zod9.z.coerce.number().int().min(0).optional(),
348
+ paid: import_zod9.z.nativeEnum(PaymentMethod).optional(),
349
+ notes: import_zod9.z.string().or(import_zod9.z.literal("")).optional(),
350
+ createdBy: import_zod9.z.string(),
351
+ lastEditBy: import_zod9.z.string().optional()
352
+ });
353
+ var zInvoice = addAutoProps(zBInvoice);
354
+ var zInvoiceResponse = zInvoice.extend({
355
+ createdBy: zTeacher,
356
+ lastEditBy: zTeacher.optional(),
357
+ packages: import_zod9.z.array(zInvoicePackageResponse)
351
358
  });
352
359
 
353
360
  // src/interface/payment/teacherPayment.ts
361
+ var import_zod10 = require("zod");
354
362
  var zTeacherPaymentRow = import_zod10.z.object({
355
363
  course: import_zod10.z.string().min(1, "select or enter a course"),
356
364
  length: import_zod10.z.coerce.number().gt(0, "must be > 0"),
@@ -778,6 +786,8 @@ var zEventRegResponse = zEventReg.extend({
778
786
  zInvoice,
779
787
  zInvoiceItem,
780
788
  zInvoicePackage,
789
+ zInvoicePackageResponse,
790
+ zInvoiceResponse,
781
791
  zPrivateBooking,
782
792
  zReportTicket,
783
793
  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,54 @@ 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 zInvoicePackageResponse = zInvoicePackage.extend({
250
+ student: zStudent
251
+ });
252
+ var zBInvoice = z9.object({
253
+ billTo: z9.string().min(1, "The 'Bill To' field must not be empty"),
254
+ packages: z9.array(zInvoicePackage).min(1, "Invoice must include at least one package"),
255
+ discounts: z9.array(zDiscount),
256
+ textbook: z9.coerce.number().int().min(0).optional(),
257
+ shipping: z9.coerce.number().int().min(0).optional(),
258
+ paid: z9.nativeEnum(PaymentMethod).optional(),
259
+ notes: z9.string().or(z9.literal("")).optional(),
260
+ createdBy: z9.string(),
261
+ lastEditBy: z9.string().optional()
262
+ });
263
+ var zInvoice = addAutoProps(zBInvoice);
264
+ var zInvoiceResponse = zInvoice.extend({
265
+ createdBy: zTeacher,
266
+ lastEditBy: zTeacher.optional(),
267
+ packages: z9.array(zInvoicePackageResponse)
263
268
  });
264
269
 
265
270
  // src/interface/payment/teacherPayment.ts
271
+ import { z as z10 } from "zod";
266
272
  var zTeacherPaymentRow = z10.object({
267
273
  course: z10.string().min(1, "select or enter a course"),
268
274
  length: z10.coerce.number().gt(0, "must be > 0"),
@@ -689,6 +695,8 @@ export {
689
695
  zInvoice,
690
696
  zInvoiceItem,
691
697
  zInvoicePackage,
698
+ zInvoicePackageResponse,
699
+ zInvoiceResponse,
692
700
  zPrivateBooking,
693
701
  zReportTicket,
694
702
  zScheduleData,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nyig/models",
3
- "version": "0.2.37",
3
+ "version": "0.2.39",
4
4
  "license": "MIT",
5
5
  "main": "index.js",
6
6
  "module": "index.mjs",