@sellout/models 0.0.64 → 0.0.66
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/.dist/enums/CustomFieldTypeEnum.d.ts +6 -0
- package/.dist/enums/CustomFieldTypeEnum.js +11 -0
- package/.dist/enums/CustomFieldTypeEnum.js.map +1 -0
- package/.dist/enums/OrderChannelEnum.d.ts +4 -0
- package/.dist/enums/OrderChannelEnum.js +10 -0
- package/.dist/enums/OrderChannelEnum.js.map +1 -0
- package/.dist/enums/PaymentMethodEnum.d.ts +5 -0
- package/.dist/enums/PaymentMethodEnum.js +10 -0
- package/.dist/enums/PaymentMethodEnum.js.map +1 -0
- package/.dist/graphql/mutations/createOrder.mutation.js +0 -3
- package/.dist/graphql/mutations/createOrder.mutation.js.map +1 -1
- package/.dist/graphql/mutations/createOrderPaymentIntent.mutation.js +16 -0
- package/.dist/graphql/mutations/createOrderPaymentIntent.mutation.js.map +1 -0
- package/.dist/graphql/mutations/createStripeSetupIntent.d.ts +2 -0
- package/.dist/graphql/mutations/createStripeSetupIntent.js +13 -0
- package/.dist/graphql/mutations/createStripeSetupIntent.js.map +1 -0
- package/.dist/graphql/mutations/deleteUnverifiedUser.mutation.d.ts +2 -2
- package/.dist/graphql/mutations/deleteUnverifiedUser.mutation.js +2 -2
- package/.dist/graphql/mutations/deleteUnverifiedUser.mutation.js.map +1 -1
- package/.dist/graphql/mutations/listStripeTerminalReaders.mutation.d.ts +2 -0
- package/.dist/graphql/mutations/listStripeTerminalReaders.mutation.js +21 -0
- package/.dist/graphql/mutations/listStripeTerminalReaders.mutation.js.map +1 -0
- package/.dist/graphql/mutations/listStripeTerminalReaders.query.d.ts +2 -0
- package/.dist/graphql/mutations/listStripeTerminalReaders.query.js +21 -0
- package/.dist/graphql/mutations/listStripeTerminalReaders.query.js.map +1 -0
- package/.dist/graphql/mutations/registerStripeTermainlReader.mutation.d.ts +2 -0
- package/.dist/graphql/mutations/registerStripeTermainlReader.mutation.js +13 -0
- package/.dist/graphql/mutations/registerStripeTermainlReader.mutation.js.map +1 -0
- package/.dist/graphql/mutations/registerStripeTerminalReader.d.ts +2 -0
- package/.dist/graphql/mutations/registerStripeTerminalReader.js +13 -0
- package/.dist/graphql/mutations/registerStripeTerminalReader.js.map +1 -0
- package/.dist/graphql/mutations/resetUserPassword.mutation.d.ts +2 -0
- package/.dist/graphql/mutations/resetUserPassword.mutation.js +13 -0
- package/.dist/graphql/mutations/resetUserPassword.mutation.js.map +1 -0
- package/.dist/graphql/mutations/resetUserPasswordInApp.mutation.d.ts +2 -0
- package/.dist/graphql/mutations/resetUserPasswordInApp.mutation.js +13 -0
- package/.dist/graphql/mutations/resetUserPasswordInApp.mutation.js.map +1 -0
- package/.dist/graphql/mutations/sendUserEmailVerification.mutation.js +15 -0
- package/.dist/graphql/mutations/sendUserEmailVerification.mutation.js.map +1 -0
- package/.dist/graphql/mutations/sendUserPhoneVerification.mutation.d.ts +2 -0
- package/.dist/graphql/mutations/{setUserOrgContextId.js → sendUserPhoneVerification.mutation.js} +4 -4
- package/.dist/graphql/mutations/sendUserPhoneVerification.mutation.js.map +1 -0
- package/.dist/graphql/mutations/updateBasicUserInfo.mutation.d.ts +2 -0
- package/.dist/graphql/mutations/updateBasicUserInfo.mutation.js +15 -0
- package/.dist/graphql/mutations/updateBasicUserInfo.mutation.js.map +1 -0
- package/.dist/graphql/mutations/updateOrganization.mutation.d.ts +2 -0
- package/.dist/graphql/mutations/updateOrganization.mutation.js +15 -0
- package/.dist/graphql/mutations/updateOrganization.mutation.js.map +1 -0
- package/.dist/graphql/mutations/updateUserPhoneNumber.mutation.d.ts +2 -0
- package/.dist/graphql/mutations/updateUserPhoneNumber.mutation.js +27 -0
- package/.dist/graphql/mutations/updateUserPhoneNumber.mutation.js.map +1 -0
- package/.dist/graphql/mutations/verifyPhoneAuthentication.mutation.js +15 -0
- package/.dist/graphql/mutations/verifyPhoneAuthentication.mutation.js.map +1 -0
- package/.dist/graphql/mutations/verifyUserEmail.mutation.d.ts +2 -0
- package/.dist/graphql/mutations/verifyUserEmail.mutation.js +15 -0
- package/.dist/graphql/mutations/verifyUserEmail.mutation.js.map +1 -0
- package/.dist/graphql/mutations/verifyUserPhoneAuthentication.js +15 -0
- package/.dist/graphql/mutations/verifyUserPhoneAuthentication.js.map +1 -0
- package/.dist/graphql/mutations/verifyUserPhoneNumber.mutation.d.ts +2 -0
- package/.dist/graphql/mutations/verifyUserPhoneNumber.mutation.js +15 -0
- package/.dist/graphql/mutations/verifyUserPhoneNumber.mutation.js.map +1 -0
- package/.dist/graphql/queries/customerProfile.query.js +12 -0
- package/.dist/graphql/queries/customerProfile.query.js.map +1 -1
- package/.dist/graphql/queries/metrics.query.d.ts +2 -0
- package/.dist/graphql/queries/metrics.query.js +29 -0
- package/.dist/graphql/queries/metrics.query.js.map +1 -0
- package/.dist/graphql/queries/metricsData.query.d.ts +2 -0
- package/.dist/graphql/queries/metricsData.query.js +29 -0
- package/.dist/graphql/queries/metricsData.query.js.map +1 -0
- package/.dist/interfaces/ICreateOrderParams.d.ts +3 -1
- package/.dist/interfaces/IEventCustomField.d.ts +2 -7
- package/.dist/interfaces/IEventCustomField.js +0 -8
- package/.dist/interfaces/IEventCustomField.js.map +1 -1
- package/.dist/interfaces/IMetricData.d.ts +57 -0
- package/.dist/interfaces/IMetricData.js +70 -0
- package/.dist/interfaces/IMetricData.js.map +1 -0
- package/.dist/interfaces/IOrder.d.ts +2 -0
- package/.dist/interfaces/IOrder.js.map +1 -1
- package/.dist/interfaces/IOrderCustomField.d.ts +3 -2
- package/.dist/interfaces/IOrderCustomField.js.map +1 -1
- package/.dist/interfaces/IStripe.d.ts +9 -0
- package/.dist/interfaces/{ISecondaryEmail.js → IStripe.js} +1 -1
- package/.dist/interfaces/IStripe.js.map +1 -0
- package/.dist/interfaces/IStripeSource.d.ts +1 -1
- package/.dist/schemas/Order.d.ts +4 -0
- package/.dist/schemas/Order.js +4 -0
- package/.dist/schemas/Order.js.map +1 -1
- package/.dist/sellout-proto.js +14186 -12066
- package/.dist/utils/EventUtil.d.ts +10 -3
- package/.dist/utils/EventUtil.js +37 -19
- package/.dist/utils/EventUtil.js.map +1 -1
- package/.dist/utils/MetricsUtil.d.ts +7 -0
- package/.dist/utils/MetricsUtil.js +29 -0
- package/.dist/utils/MetricsUtil.js.map +1 -0
- package/.dist/utils/OrderUtil.d.ts +7 -0
- package/.dist/utils/OrderUtil.js +7 -0
- package/.dist/utils/OrderUtil.js.map +1 -1
- package/.dist/utils/PaymentUtil.js.map +1 -1
- package/.dist/utils/fee-util-broken-but-why.d.ts +8 -0
- package/.dist/utils/fee-util-broken-but-why.js +38 -0
- package/.dist/utils/fee-util-broken-but-why.js.map +1 -0
- package/package.json +4 -4
- package/src/enums/CustomFieldTypeEnum.ts +6 -0
- package/src/enums/OrderChannelEnum.ts +4 -0
- package/src/graphql/mutations/createOrder.mutation.ts +0 -3
- package/src/graphql/mutations/createOrderPaymentIntent.mutation.ts +12 -0
- package/src/graphql/mutations/deleteUnverifiedUser.mutation.ts +2 -2
- package/src/graphql/mutations/resetUserPassword.mutation.ts +9 -0
- package/src/graphql/mutations/resetUserPasswordInApp.mutation.ts +9 -0
- package/src/graphql/mutations/sendUserPhoneVerification.mutation.ts +11 -0
- package/src/graphql/mutations/updateBasicUserInfo.mutation.ts +11 -0
- package/src/graphql/mutations/updateOrganization.mutation.ts +11 -0
- package/src/graphql/mutations/updateUserPhoneNumber.mutation.ts +23 -0
- package/src/graphql/mutations/verifyUserEmail.mutation.ts +11 -0
- package/src/graphql/mutations/verifyUserPhoneNumber.mutation.ts +11 -0
- package/src/graphql/queries/customerProfile.query.ts +12 -0
- package/src/interfaces/ICreateOrderParams.ts +3 -1
- package/src/interfaces/IEventCustomField.ts +2 -7
- package/src/interfaces/IOrder.ts +2 -0
- package/src/interfaces/IOrderCustomField.ts +3 -2
- package/src/proto/email.proto +1 -1
- package/src/proto/event.proto +4 -4
- package/src/proto/order.proto +44 -12
- package/src/proto/stripe.proto +24 -0
- package/src/schemas/Order.ts +4 -0
- package/src/utils/EventUtil.ts +43 -25
- package/src/utils/OrderUtil.ts +11 -0
- package/src/utils/PaymentUtil.ts +0 -1
- package/.dist/graphql/mutations/setUserOrgContextId.js.map +0 -1
- package/.dist/graphql/queries/customerProfile.js +0 -42
- package/.dist/graphql/queries/customerProfile.js.map +0 -1
- package/.dist/graphql/queries/organization.query.js +0 -49
- package/.dist/graphql/queries/organization.query.js.map +0 -1
- package/.dist/graphql/queries/organizations.js +0 -49
- package/.dist/graphql/queries/organizations.js.map +0 -1
- package/.dist/interfaces/ISecondaryEmail.d.ts +0 -4
- package/.dist/interfaces/ISecondaryEmail.js.map +0 -1
- package/.dist/schemas/SecondaryEmail.d.ts +0 -12
- package/.dist/schemas/SecondaryEmail.js +0 -14
- package/.dist/schemas/SecondaryEmail.js.map +0 -1
- /package/.dist/graphql/mutations/{setUserOrgContextId.d.ts → createOrderPaymentIntent.mutation.d.ts} +0 -0
- /package/.dist/graphql/{queries/customerProfile.d.ts → mutations/sendUserEmailVerification.mutation.d.ts} +0 -0
- /package/.dist/graphql/{queries/organization.query.d.ts → mutations/verifyPhoneAuthentication.mutation.d.ts} +0 -0
- /package/.dist/graphql/{queries/organizations.d.ts → mutations/verifyUserPhoneAuthentication.d.ts} +0 -0
- /package/src/graphql/mutations/{sendUserEmailVerification.ts → sendUserEmailVerification.mutation.ts} +0 -0
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
Text = 'Text',
|
|
3
|
-
Number = 'Number',
|
|
4
|
-
Address = 'Address',
|
|
5
|
-
Dropdown = 'Dropdown',
|
|
6
|
-
}
|
|
1
|
+
import { CustomFieldTypeEnum } from '../enums/CustomFieldTypeEnum';
|
|
7
2
|
|
|
8
3
|
export default interface IEventCustomField {
|
|
9
4
|
_id?: string;
|
|
10
5
|
label?: string;
|
|
11
|
-
type:
|
|
6
|
+
type: CustomFieldTypeEnum;
|
|
12
7
|
minLength: number;
|
|
13
8
|
maxLength: number;
|
|
14
9
|
maxValue: number;
|
package/src/interfaces/IOrder.ts
CHANGED
|
@@ -5,6 +5,7 @@ import IOrderUpgrade from './IOrderUpgrade';
|
|
|
5
5
|
import IOrderCustomField from './IOrderCustomField'
|
|
6
6
|
import { OrderStateEnum } from './IOrderState';
|
|
7
7
|
import { OrderTypeEnum } from './IOrderType';
|
|
8
|
+
import { OrderChannelEnum } from '../enums/OrderChannelEnum';
|
|
8
9
|
|
|
9
10
|
export default interface IOrder {
|
|
10
11
|
_id?: string;
|
|
@@ -24,6 +25,7 @@ export default interface IOrder {
|
|
|
24
25
|
state?: OrderStateEnum,
|
|
25
26
|
refundedAmount?: number; // BACKFILL
|
|
26
27
|
type?: OrderTypeEnum;
|
|
28
|
+
channel: OrderChannelEnum,
|
|
27
29
|
createdAt?: number;
|
|
28
30
|
createdBy?: string;
|
|
29
31
|
promotionCode?: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { CustomFieldTypeEnum } from '../enums/CustomFieldTypeEnum';
|
|
1
2
|
export default interface IOrderCustomField {
|
|
2
3
|
_id?: string;
|
|
3
4
|
label: string;
|
|
4
|
-
value: string;
|
|
5
|
+
value: string | number;
|
|
5
6
|
customFieldId: string;
|
|
6
|
-
type:
|
|
7
|
+
type: CustomFieldTypeEnum,
|
|
7
8
|
};
|
package/src/proto/email.proto
CHANGED
package/src/proto/event.proto
CHANGED
|
@@ -125,10 +125,10 @@ message EventCustomFields {
|
|
|
125
125
|
string _id = 0;
|
|
126
126
|
string label = 1;
|
|
127
127
|
string type = 2;
|
|
128
|
-
int32 minLength = 3;
|
|
129
|
-
int32 maxLength = 4;
|
|
130
|
-
int32 minValue = 5;
|
|
131
|
-
int32 maxValue = 6;
|
|
128
|
+
optional int32 minLength = 3;
|
|
129
|
+
optional int32 maxLength = 4;
|
|
130
|
+
optional int32 minValue = 5;
|
|
131
|
+
optional int32 maxValue = 6;
|
|
132
132
|
bool required = 7;
|
|
133
133
|
repeated string options = 8;
|
|
134
134
|
bool active = 9;
|
package/src/proto/order.proto
CHANGED
|
@@ -25,13 +25,14 @@ message Order {
|
|
|
25
25
|
string state = 14;
|
|
26
26
|
int32 refundedAmount = 15;
|
|
27
27
|
string type = 16;
|
|
28
|
-
string
|
|
29
|
-
string
|
|
30
|
-
string
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
string channel = 17;
|
|
29
|
+
string createdBy = 18;
|
|
30
|
+
string promotionCode = 19;
|
|
31
|
+
string ipAddress = 20;
|
|
32
|
+
Address address = 21;
|
|
33
|
+
repeated OrderCustomField customFields = 22;
|
|
34
|
+
string refundReason = 23;
|
|
35
|
+
repeated Payment payments = 24;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
message OrderTicket {
|
|
@@ -107,11 +108,13 @@ message CreateOrderParams {
|
|
|
107
108
|
repeated CreateOrderTicketParams tickets = 3;
|
|
108
109
|
repeated CreateOrderUpgradeParams upgrades = 4;
|
|
109
110
|
string type = 5;
|
|
110
|
-
string
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
string
|
|
114
|
-
string
|
|
111
|
+
string channel = 6;
|
|
112
|
+
string promotionCode = 7;
|
|
113
|
+
repeated OrderCustomField customFields = 8;
|
|
114
|
+
string paymentMethodType = 9;
|
|
115
|
+
string paymentIntentId = 10;
|
|
116
|
+
string holdToken = 11;
|
|
117
|
+
string ipAddress = 12;
|
|
115
118
|
}
|
|
116
119
|
|
|
117
120
|
message CreateOrderTicketParams {
|
|
@@ -139,6 +142,34 @@ message CreateOrderResponse {
|
|
|
139
142
|
StatusCode status = 1;
|
|
140
143
|
repeated Error errors = 2;
|
|
141
144
|
Order order = 3;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/****************************************************************************************
|
|
148
|
+
Create Order Payment Intent
|
|
149
|
+
****************************************************************************************/
|
|
150
|
+
|
|
151
|
+
message CreateOrderPaymentIntentParams {
|
|
152
|
+
string userId = 0;
|
|
153
|
+
string orgId = 1;
|
|
154
|
+
string eventId = 2;
|
|
155
|
+
repeated CreateOrderTicketParams tickets = 3;
|
|
156
|
+
repeated CreateOrderUpgradeParams upgrades = 4;
|
|
157
|
+
string promotionCode = 5;
|
|
158
|
+
string paymentMethodType = 6;
|
|
159
|
+
string paymentMethodId = 7;
|
|
160
|
+
string stalePaymentIntentId = 8;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
message CreateOrderPaymentIntentRequest {
|
|
164
|
+
string spanContext = 0;
|
|
165
|
+
string requestorId = 1;
|
|
166
|
+
CreateOrderPaymentIntentParams params = 2;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
message CreateOrderPaymentIntentResponse {
|
|
170
|
+
StatusCode status = 1;
|
|
171
|
+
repeated Error errors = 2;
|
|
172
|
+
string paymentIntentId = 3;
|
|
142
173
|
string clientSecret = 4;
|
|
143
174
|
}
|
|
144
175
|
|
|
@@ -345,6 +376,7 @@ message BreakApartOrderResponse {
|
|
|
345
376
|
service OrderService {
|
|
346
377
|
// Create
|
|
347
378
|
rpc createOrder(CreateOrderRequest) returns (CreateOrderResponse) {}
|
|
379
|
+
rpc createOrderPaymentIntent(CreateOrderPaymentIntentRequest) returns (CreateOrderPaymentIntentResponse) {}
|
|
348
380
|
// QR Code
|
|
349
381
|
rpc sendOrderQRCodeEmail(SendOrderQRCodeEmailRequest) returns (SendOrderQRCodeEmailResponse) {}
|
|
350
382
|
rpc sendOrderReceiptEmail(SendOrderReceiptEmailRequest) returns (SendOrderReceiptEmailResponse) {}
|
package/src/proto/stripe.proto
CHANGED
|
@@ -230,6 +230,28 @@ message CreateStripePaymentIntentResponse {
|
|
|
230
230
|
string clientSecret = 3;
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
+
message CaptureStripePaymentIntentRequest {
|
|
234
|
+
string spanContext = 0;
|
|
235
|
+
string orgId = 1;
|
|
236
|
+
string paymentIntentId = 2;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
message CaptureStripePaymentIntentResponse {
|
|
240
|
+
StatusCode status = 0;
|
|
241
|
+
repeated Error errors = 1;
|
|
242
|
+
bool success = 2;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
message CancelStripePaymentIntentRequest {
|
|
246
|
+
string spanContext = 0;
|
|
247
|
+
string paymentIntentId = 1;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
message CancelStripePaymentIntentResponse {
|
|
251
|
+
StatusCode status = 0;
|
|
252
|
+
repeated Error errors = 1;
|
|
253
|
+
}
|
|
254
|
+
|
|
233
255
|
/***************************************************************************************
|
|
234
256
|
Terminal
|
|
235
257
|
****************************************************************************************/
|
|
@@ -315,6 +337,8 @@ service StripeService {
|
|
|
315
337
|
rpc deleteStripeSource(DeleteStripeSourceRequest) returns (DeleteStripeSourceResponse) {}
|
|
316
338
|
// Payment Intent
|
|
317
339
|
rpc createStripePaymentIntent(CreateStripePaymentIntentRequest) returns (CreateStripePaymentIntentResponse) {}
|
|
340
|
+
rpc captureStripePaymentIntent(CaptureStripePaymentIntentRequest) returns (CaptureStripePaymentIntentResponse) {}
|
|
341
|
+
rpc cancelStripePaymentIntent(CancelStripePaymentIntentRequest) returns (CancelStripePaymentIntentResponse) {}
|
|
318
342
|
// Payment Method
|
|
319
343
|
rpc createStripeSetupIntent(CreateStripeSetupIntentRequest) returns (CreateStripeSetupIntentResponse) {}
|
|
320
344
|
rpc attachStripePaymentMethod(AttachStripePaymentMethodRequest) returns (AttachStripePaymentMethodResponse) {}
|
package/src/schemas/Order.ts
CHANGED
package/src/utils/EventUtil.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import * as Time from "@sellout/utils/.dist/time";
|
|
2
|
+
import IEventCustomField from "../interfaces/IEventCustomField";
|
|
2
3
|
import IEvent, { EventProcessAsEnum } from "../interfaces/IEvent";
|
|
4
|
+
import { CustomFieldTypeEnum } from '../enums/CustomFieldTypeEnum';
|
|
5
|
+
import IOrderCustomField from "src/interfaces/IOrderCustomField";
|
|
6
|
+
import IEventUpgrade from "src/interfaces/IEventUpgrade";
|
|
7
|
+
import ITicketType from "src/interfaces/ITicketType";
|
|
3
8
|
|
|
4
9
|
export default {
|
|
5
10
|
/****************************************************************************************
|
|
@@ -161,6 +166,9 @@ export default {
|
|
|
161
166
|
(ticketType) => ticketType._id === ticketTypeId
|
|
162
167
|
);
|
|
163
168
|
},
|
|
169
|
+
activeTicketTypes(event: IEvent): ITicketType[] {
|
|
170
|
+
return event.ticketTypes?.filter(ticketType => ticketType.visible) ?? [];
|
|
171
|
+
},
|
|
164
172
|
remainingTicketQty(event, ticketTypeId: string | null = null): number {
|
|
165
173
|
if (ticketTypeId) {
|
|
166
174
|
let ticketType = event.ticketTypes.find(
|
|
@@ -202,6 +210,9 @@ export default {
|
|
|
202
210
|
upgrade(event, upgradeId): any {
|
|
203
211
|
return event.upgrades.find((upgrades) => upgrades._id === upgradeId);
|
|
204
212
|
},
|
|
213
|
+
activeUpgrades(event: IEvent): IEventUpgrade[] {
|
|
214
|
+
return event.upgrades?.filter(upgrade => upgrade.visible) ?? [];
|
|
215
|
+
},
|
|
205
216
|
remainingUpgradeQty(event, upgradeId: string | null = null): number {
|
|
206
217
|
if (upgradeId) {
|
|
207
218
|
let upgrade = event.upgrades.find((upgrade) => upgrade._id === upgradeId);
|
|
@@ -233,31 +244,34 @@ export default {
|
|
|
233
244
|
(promotions) => promotions._id === promotionId
|
|
234
245
|
);
|
|
235
246
|
},
|
|
247
|
+
hasActivePreSalePromotions(event): boolean {
|
|
248
|
+
return (
|
|
249
|
+
event.promotions
|
|
250
|
+
.filter((promotion) => promotion.type === "Pre-Sale Code")
|
|
251
|
+
.filter((promotion) => promotion.active).length > 0
|
|
252
|
+
);
|
|
253
|
+
},
|
|
236
254
|
/****************************************************************************************
|
|
237
255
|
* Custom Fields
|
|
238
256
|
****************************************************************************************/
|
|
239
|
-
customField(event, customFieldId: string):
|
|
240
|
-
return event
|
|
257
|
+
customField(event: IEvent, customFieldId: string): IEventCustomField | null {
|
|
258
|
+
return event?.customFields?.find(
|
|
241
259
|
(customField) => customField._id === customFieldId
|
|
242
|
-
);
|
|
260
|
+
) ?? null;
|
|
261
|
+
},
|
|
262
|
+
activeCustomFields(event: IEvent): IEventCustomField[] {
|
|
263
|
+
return event.customFields?.filter(customField => customField.active) ?? [];
|
|
243
264
|
},
|
|
244
265
|
hasCustomFields(event) {
|
|
245
266
|
return (
|
|
246
267
|
event.customFields.filter((customField) => customField.active).length > 0
|
|
247
268
|
);
|
|
248
269
|
},
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
event.promotions
|
|
252
|
-
.filter((promotion) => promotion.type === "Pre-Sale Code")
|
|
253
|
-
.filter((promotion) => promotion.active).length > 0
|
|
254
|
-
);
|
|
255
|
-
},
|
|
256
|
-
customFieldsAreValid(event, order): boolean {
|
|
257
|
-
const { customFields: orderCustomFields } = order;
|
|
258
|
-
const activeFields = event.customFields.filter(
|
|
270
|
+
customFieldsAreValid(eventCustomFields: IEventCustomField[], orderCustomFields: IOrderCustomField[] ): boolean {
|
|
271
|
+
const activeFields = eventCustomFields?.filter(
|
|
259
272
|
(eventCustomField) => eventCustomField.active
|
|
260
|
-
);
|
|
273
|
+
) ?? [];
|
|
274
|
+
|
|
261
275
|
const validFields = activeFields?.filter((eventCustomField) => {
|
|
262
276
|
const {
|
|
263
277
|
_id,
|
|
@@ -275,9 +289,10 @@ export default {
|
|
|
275
289
|
// Field has not been filled out
|
|
276
290
|
if (!orderCustomField) return false;
|
|
277
291
|
|
|
278
|
-
|
|
292
|
+
let { value } = orderCustomField;
|
|
279
293
|
|
|
280
|
-
if (eventCustomField.type ===
|
|
294
|
+
if (eventCustomField.type === CustomFieldTypeEnum.Text) {
|
|
295
|
+
value = <string>value;
|
|
281
296
|
if (minLength === 0 && maxLength === 0) {
|
|
282
297
|
return !(required && value.length === 0);
|
|
283
298
|
}
|
|
@@ -287,17 +302,20 @@ export default {
|
|
|
287
302
|
}
|
|
288
303
|
|
|
289
304
|
return false;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
305
|
+
} else {
|
|
306
|
+
value = <number>value;
|
|
307
|
+
if (minValue === 0 && maxValue === 0) {
|
|
308
|
+
return !(required && value === 0);
|
|
309
|
+
}
|
|
294
310
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
311
|
+
if (minValue <= value && value <= maxValue) {
|
|
312
|
+
return true;
|
|
313
|
+
}
|
|
298
314
|
|
|
299
|
-
|
|
300
|
-
|
|
315
|
+
return false;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
}) ?? [];
|
|
301
319
|
|
|
302
320
|
return validFields.length === activeFields.length;
|
|
303
321
|
},
|
package/src/utils/OrderUtil.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import FeeUtil from './FeeUtil';
|
|
2
|
+
import IOrder from "../interfaces/IOrder";
|
|
2
3
|
import { OrderTypeEnum } from "../interfaces/IOrderType";
|
|
4
|
+
import IOrderCustomField from '../interfaces/IOrderCustomField';
|
|
5
|
+
import ICreateOrderParams from '../interfaces/ICreateOrderParams';
|
|
3
6
|
|
|
4
7
|
export default {
|
|
5
8
|
isComp(order) {
|
|
@@ -262,4 +265,12 @@ export default {
|
|
|
262
265
|
if (refund.refunded && refund.refundedAt > 0) return false;
|
|
263
266
|
return true;
|
|
264
267
|
},
|
|
268
|
+
/*****************************************************************************************
|
|
269
|
+
Custom Field
|
|
270
|
+
*****************************************************************************************/
|
|
271
|
+
customField(order: IOrder | ICreateOrderParams, eventCustomFieldId: string): IOrderCustomField | null {
|
|
272
|
+
return order?.customFields?.find(
|
|
273
|
+
(customField) => customField.customFieldId === eventCustomFieldId
|
|
274
|
+
) ?? null;
|
|
275
|
+
}
|
|
265
276
|
};
|
package/src/utils/PaymentUtil.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setUserOrgContextId.js","sourceRoot":"","sources":["../../../src/graphql/mutations/setUserOrgContextId.ts"],"names":[],"mappings":";;;;;AAAA,8DAA8B;AAE9B,MAAM,QAAQ,GAAG,qBAAG,CAAA;;;;;;CAMnB,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
7
|
-
const query = graphql_tag_1.default `
|
|
8
|
-
query userProfiles($query: UserProfileQueryInput) {
|
|
9
|
-
userProfiles(query: $query) {
|
|
10
|
-
_id
|
|
11
|
-
imageUrl
|
|
12
|
-
user {
|
|
13
|
-
_id
|
|
14
|
-
email
|
|
15
|
-
firstName
|
|
16
|
-
lastName
|
|
17
|
-
phoneNumber
|
|
18
|
-
phoneNumberVerifiedAt
|
|
19
|
-
}
|
|
20
|
-
metrics {
|
|
21
|
-
orgId
|
|
22
|
-
yearToDateValue
|
|
23
|
-
lifeTimeValue
|
|
24
|
-
createdAt
|
|
25
|
-
lifeTimeTicketsPurchased
|
|
26
|
-
lifeTimeUpgradesPurchased
|
|
27
|
-
}
|
|
28
|
-
stripeCustomerId
|
|
29
|
-
address {
|
|
30
|
-
address1
|
|
31
|
-
address2
|
|
32
|
-
city
|
|
33
|
-
state
|
|
34
|
-
zip
|
|
35
|
-
country
|
|
36
|
-
phone
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
`;
|
|
41
|
-
exports.default = query;
|
|
42
|
-
//# sourceMappingURL=customerProfile.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"customerProfile.js","sourceRoot":"","sources":["../../../src/graphql/queries/customerProfile.ts"],"names":[],"mappings":";;;;;AAAA,8DAA8B;AAE9B,MAAM,KAAK,GAAG,qBAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiChB,CAAC;AAEF,kBAAe,KAAK,CAAC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
7
|
-
const query = graphql_tag_1.default `
|
|
8
|
-
query organizations {
|
|
9
|
-
organizations {
|
|
10
|
-
_id
|
|
11
|
-
orgName
|
|
12
|
-
orgUrls
|
|
13
|
-
orgLogoUrl
|
|
14
|
-
createdAt
|
|
15
|
-
address {
|
|
16
|
-
address1
|
|
17
|
-
address2
|
|
18
|
-
city
|
|
19
|
-
state
|
|
20
|
-
zip
|
|
21
|
-
country
|
|
22
|
-
}
|
|
23
|
-
user {
|
|
24
|
-
email
|
|
25
|
-
}
|
|
26
|
-
seating {
|
|
27
|
-
publicKey
|
|
28
|
-
secretKey
|
|
29
|
-
designerKey
|
|
30
|
-
}
|
|
31
|
-
webFlow {
|
|
32
|
-
sites {
|
|
33
|
-
name
|
|
34
|
-
webFlowId
|
|
35
|
-
enabled
|
|
36
|
-
createdAt
|
|
37
|
-
updatedAt
|
|
38
|
-
previewUrl
|
|
39
|
-
domains {
|
|
40
|
-
lastPublishedAt
|
|
41
|
-
name
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
`;
|
|
48
|
-
exports.default = query;
|
|
49
|
-
//# sourceMappingURL=organization.query.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"organization.query.js","sourceRoot":"","sources":["../../../src/graphql/queries/organization.query.ts"],"names":[],"mappings":";;;;;AAAA,8DAA8B;AAE9B,MAAM,KAAK,GAAG,qBAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwChB,CAAC;AAEF,kBAAe,KAAK,CAAC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
7
|
-
const query = graphql_tag_1.default `
|
|
8
|
-
query organizations {
|
|
9
|
-
organizations {
|
|
10
|
-
_id
|
|
11
|
-
orgName
|
|
12
|
-
orgUrls
|
|
13
|
-
orgLogoUrl
|
|
14
|
-
createdAt
|
|
15
|
-
address {
|
|
16
|
-
address1
|
|
17
|
-
address2
|
|
18
|
-
city
|
|
19
|
-
state
|
|
20
|
-
zip
|
|
21
|
-
country
|
|
22
|
-
}
|
|
23
|
-
user {
|
|
24
|
-
email
|
|
25
|
-
}
|
|
26
|
-
seating {
|
|
27
|
-
publicKey
|
|
28
|
-
secretKey
|
|
29
|
-
designerKey
|
|
30
|
-
}
|
|
31
|
-
webFlow {
|
|
32
|
-
sites {
|
|
33
|
-
name
|
|
34
|
-
webFlowId
|
|
35
|
-
enabled
|
|
36
|
-
createdAt
|
|
37
|
-
updatedAt
|
|
38
|
-
previewUrl
|
|
39
|
-
domains {
|
|
40
|
-
lastPublishedAt
|
|
41
|
-
name
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
`;
|
|
48
|
-
exports.default = query;
|
|
49
|
-
//# sourceMappingURL=organizations.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"organizations.js","sourceRoot":"","sources":["../../../src/graphql/queries/organizations.ts"],"names":[],"mappings":";;;;;AAAA,8DAA8B;AAE9B,MAAM,KAAK,GAAG,qBAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwChB,CAAC;AAEF,kBAAe,KAAK,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ISecondaryEmail.js","sourceRoot":"","sources":["../../src/interfaces/ISecondaryEmail.ts"],"names":[],"mappings":""}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = {
|
|
4
|
-
email: {
|
|
5
|
-
type: String,
|
|
6
|
-
required: true,
|
|
7
|
-
},
|
|
8
|
-
verifiedAt: {
|
|
9
|
-
type: Number,
|
|
10
|
-
required: false,
|
|
11
|
-
default: 0,
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=SecondaryEmail.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SecondaryEmail.js","sourceRoot":"","sources":["../../src/schemas/SecondaryEmail.ts"],"names":[],"mappings":";;AAAA,kBAAe;IACb,KAAK,EAAE;QACL,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACf;IACD,UAAU,EAAE;QACV,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,CAAC;KACX;CACF,CAAC"}
|
/package/.dist/graphql/mutations/{setUserOrgContextId.d.ts → createOrderPaymentIntent.mutation.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/.dist/graphql/{queries/organizations.d.ts → mutations/verifyUserPhoneAuthentication.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|