@nyig/models 0.4.3 → 0.4.5

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 +1495 -806
  2. package/index.d.ts +1495 -806
  3. package/index.js +23 -3
  4. package/index.mjs +22 -3
  5. package/package.json +7 -7
package/index.js CHANGED
@@ -27,6 +27,7 @@ __export(src_exports, {
27
27
  CourseCategory: () => CourseCategory,
28
28
  DayOfWeek: () => DayOfWeek,
29
29
  GoRank: () => GoRank,
30
+ HearAboutUs: () => HearAboutUs,
30
31
  NYIGSchool: () => NYIGSchool,
31
32
  PaymentMethod: () => PaymentMethod,
32
33
  Role: () => Role,
@@ -110,7 +111,7 @@ var zBPaymentInfo = import_zod.z.object({
110
111
  /**
111
112
  * @units CENTS - Proposed payment amount in cents of the booking
112
113
  */
113
- paymentAmount: import_zod.z.number().int().min(1),
114
+ paymentAmount: import_zod.z.number().int().min(0),
114
115
  /**
115
116
  * True if the payment has been received. Populated by webhook.
116
117
  */
@@ -125,6 +126,18 @@ var zBPaymentInfo = import_zod.z.object({
125
126
 
126
127
  // src/interface/booking/bUserInfo.ts
127
128
  var import_zod2 = require("zod");
129
+
130
+ // src/interface/booking/hearAboutUs.ts
131
+ var HearAboutUs = /* @__PURE__ */ ((HearAboutUs2) => {
132
+ HearAboutUs2["SEARCH_ENGINE"] = "Search engine";
133
+ HearAboutUs2["FRIENDS_FAMILY"] = "Friends or family";
134
+ HearAboutUs2["WECHAT"] = "Wechat";
135
+ HearAboutUs2["POSTER"] = "Poster ad";
136
+ HearAboutUs2["EMAIL"] = "Email";
137
+ return HearAboutUs2;
138
+ })(HearAboutUs || {});
139
+
140
+ // src/interface/booking/bUserInfo.ts
128
141
  var zBUserInfo = import_zod2.z.object({
129
142
  userId: import_zod2.z.string().optional(),
130
143
  firstName: import_zod2.z.string(),
@@ -133,7 +146,13 @@ var zBUserInfo = import_zod2.z.object({
133
146
  email: import_zod2.z.string(),
134
147
  phone: import_zod2.z.string().optional(),
135
148
  address: import_zod2.z.string().optional(),
136
- notes: import_zod2.z.string().optional()
149
+ notes: import_zod2.z.string().optional(),
150
+ // Optional for backwards compatibility, required field on UI
151
+ hearAboutUs: import_zod2.z.nativeEnum(HearAboutUs).optional(),
152
+ // Additional info such as friend/family referer
153
+ hearAboutUsDetails: import_zod2.z.string().optional(),
154
+ // show/hide on Aurora event page "who is coming" list
155
+ showOnWhoIsComing: import_zod2.z.boolean().optional()
137
156
  });
138
157
 
139
158
  // src/interface/booking/bookingType.ts
@@ -735,7 +754,7 @@ var zBEventTicket = import_zod27.z.object({
735
754
  /**
736
755
  * Price in cents
737
756
  */
738
- price: import_zod27.z.number().min(0, "Price must not be negative"),
757
+ price: import_zod27.z.coerce.number().min(0, "Price must not be negative"),
739
758
  /**
740
759
  * @optional description of the ticket
741
760
  */
@@ -873,6 +892,7 @@ var zEventRegResponse = zEventReg.extend({
873
892
  CourseCategory,
874
893
  DayOfWeek,
875
894
  GoRank,
895
+ HearAboutUs,
876
896
  NYIGSchool,
877
897
  PaymentMethod,
878
898
  Role,
package/index.mjs CHANGED
@@ -4,7 +4,7 @@ var zBPaymentInfo = z.object({
4
4
  /**
5
5
  * @units CENTS - Proposed payment amount in cents of the booking
6
6
  */
7
- paymentAmount: z.number().int().min(1),
7
+ paymentAmount: z.number().int().min(0),
8
8
  /**
9
9
  * True if the payment has been received. Populated by webhook.
10
10
  */
@@ -19,6 +19,18 @@ var zBPaymentInfo = z.object({
19
19
 
20
20
  // src/interface/booking/bUserInfo.ts
21
21
  import { z as z2 } from "zod";
22
+
23
+ // src/interface/booking/hearAboutUs.ts
24
+ var HearAboutUs = /* @__PURE__ */ ((HearAboutUs2) => {
25
+ HearAboutUs2["SEARCH_ENGINE"] = "Search engine";
26
+ HearAboutUs2["FRIENDS_FAMILY"] = "Friends or family";
27
+ HearAboutUs2["WECHAT"] = "Wechat";
28
+ HearAboutUs2["POSTER"] = "Poster ad";
29
+ HearAboutUs2["EMAIL"] = "Email";
30
+ return HearAboutUs2;
31
+ })(HearAboutUs || {});
32
+
33
+ // src/interface/booking/bUserInfo.ts
22
34
  var zBUserInfo = z2.object({
23
35
  userId: z2.string().optional(),
24
36
  firstName: z2.string(),
@@ -27,7 +39,13 @@ var zBUserInfo = z2.object({
27
39
  email: z2.string(),
28
40
  phone: z2.string().optional(),
29
41
  address: z2.string().optional(),
30
- notes: z2.string().optional()
42
+ notes: z2.string().optional(),
43
+ // Optional for backwards compatibility, required field on UI
44
+ hearAboutUs: z2.nativeEnum(HearAboutUs).optional(),
45
+ // Additional info such as friend/family referer
46
+ hearAboutUsDetails: z2.string().optional(),
47
+ // show/hide on Aurora event page "who is coming" list
48
+ showOnWhoIsComing: z2.boolean().optional()
31
49
  });
32
50
 
33
51
  // src/interface/booking/bookingType.ts
@@ -629,7 +647,7 @@ var zBEventTicket = z27.object({
629
647
  /**
630
648
  * Price in cents
631
649
  */
632
- price: z27.number().min(0, "Price must not be negative"),
650
+ price: z27.coerce.number().min(0, "Price must not be negative"),
633
651
  /**
634
652
  * @optional description of the ticket
635
653
  */
@@ -766,6 +784,7 @@ export {
766
784
  CourseCategory,
767
785
  DayOfWeek,
768
786
  GoRank,
787
+ HearAboutUs,
769
788
  NYIGSchool,
770
789
  PaymentMethod,
771
790
  Role,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nyig/models",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "license": "MIT",
5
5
  "main": "index.js",
6
6
  "module": "index.mjs",
@@ -9,12 +9,12 @@
9
9
  "zod": ">=3.22.4"
10
10
  },
11
11
  "devDependencies": {
12
- "@changesets/cli": "^2.27.1",
13
- "husky": "^9.0.10",
14
- "lint-staged": "^15.2.2",
15
- "prettier": "^3.2.5",
16
- "tsup": "^8.0.2",
17
- "typescript": "^5.3.3"
12
+ "@changesets/cli": "^2.27.7",
13
+ "husky": "^9.1.5",
14
+ "lint-staged": "^15.2.9",
15
+ "prettier": "^3.3.3",
16
+ "tsup": "^8.2.4",
17
+ "typescript": "^5.5.4"
18
18
  },
19
19
  "lint-staged": {
20
20
  "*.{js,ts,md}": "prettier --write"