@sellout/models 0.0.396 → 0.0.397
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/graphql/queries/eventsAdminCalender.query.js +0 -3
- package/.dist/graphql/queries/eventsAdminCalender.query.js.map +1 -1
- package/.dist/graphql/queries/eventsListOptimized.query.js +1 -4
- package/.dist/graphql/queries/eventsListOptimized.query.js.map +1 -1
- package/.dist/interfaces/IAnalytics.d.ts +0 -1
- package/.dist/interfaces/IAnalytics.js.map +1 -1
- package/.dist/interfaces/IEvent.d.ts +0 -1
- package/.dist/interfaces/IOrder.d.ts +0 -12
- package/.dist/interfaces/IOrder.js.map +1 -1
- package/.dist/interfaces/ITask.d.ts +1 -2
- package/.dist/interfaces/ITask.js +0 -1
- package/.dist/interfaces/ITask.js.map +1 -1
- package/.dist/schemas/Event.d.ts +0 -5
- package/.dist/schemas/Event.js +0 -5
- package/.dist/schemas/Event.js.map +1 -1
- package/.dist/schemas/Order.d.ts +0 -34
- package/.dist/schemas/Order.js +0 -36
- package/.dist/schemas/Order.js.map +1 -1
- package/.dist/sellout-proto.js +341 -5771
- package/.dist/utils/AnalyticsUtil.d.ts +1 -1
- package/.dist/utils/AnalyticsUtil.js +3 -4
- package/.dist/utils/AnalyticsUtil.js.map +1 -1
- package/.dist/utils/OrderUtil.js +79 -0
- package/.dist/utils/OrderUtil.js.map +1 -1
- package/.dist/utils/PaymentUtil.js +12 -0
- package/.dist/utils/PaymentUtil.js.map +1 -1
- package/package.json +3 -4
- package/src/graphql/queries/eventsAdminCalender.query.ts +0 -3
- package/src/graphql/queries/eventsListOptimized.query.ts +1 -4
- package/src/interfaces/IAnalytics.ts +0 -1
- package/src/interfaces/IEvent.ts +0 -1
- package/src/interfaces/IOrder.ts +7 -21
- package/src/interfaces/ITask.ts +0 -1
- package/src/proto/broadcast.proto +0 -14
- package/src/proto/email.proto +0 -2
- package/src/proto/event.proto +0 -30
- package/src/proto/file-upload.proto +1 -16
- package/src/proto/order.proto +0 -77
- package/src/schemas/Event.ts +0 -5
- package/src/schemas/Order.ts +1 -39
- package/src/utils/AnalyticsUtil.ts +3 -4
- package/src/utils/OrderUtil.ts +93 -0
- package/src/utils/PaymentUtil.ts +15 -0
- package/.dist/interfaces/IPassKitDeviceRegistration.d.ts +0 -11
- package/.dist/interfaces/IPassKitDeviceRegistration.js +0 -3
- package/.dist/interfaces/IPassKitDeviceRegistration.js.map +0 -1
- package/.dist/schemas/WalletPassDevice.d.ts +0 -45
- package/.dist/schemas/WalletPassDevice.js +0 -51
- package/.dist/schemas/WalletPassDevice.js.map +0 -1
- package/src/interfaces/IPassKitDeviceRegistration.ts +0 -11
- package/src/schemas/WalletPassDevice.ts +0 -46
|
@@ -32,12 +32,6 @@ message OrderRefundedNotification {
|
|
|
32
32
|
repeated string refundedUpgrades = 13;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
message OrderApplePassUpdateNotification {
|
|
36
|
-
string spanContext = 0;
|
|
37
|
-
Order order = 1;
|
|
38
|
-
string reason = 2;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
35
|
message Ticket {
|
|
42
36
|
string ticketId = 0;
|
|
43
37
|
int32 qty = 1;
|
|
@@ -86,12 +80,6 @@ message EventUpdatedNotification {
|
|
|
86
80
|
string eventId = 2;
|
|
87
81
|
}
|
|
88
82
|
|
|
89
|
-
message EventGoogleWalletClassUpdateNotification {
|
|
90
|
-
string spanContext = 0;
|
|
91
|
-
string orgId = 1;
|
|
92
|
-
string eventId = 2;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
83
|
|
|
96
84
|
/****************************************************************************************
|
|
97
85
|
* Season
|
|
@@ -180,12 +168,10 @@ service Publisher {
|
|
|
180
168
|
rpc orderCreated(OrderCreatedNotification) returns (google.protobuf.Empty) {}
|
|
181
169
|
rpc orderSeasonCreated(OrderCreatedNotification) returns (google.protobuf.Empty) {}
|
|
182
170
|
rpc orderRefunded(OrderRefundedNotification) returns (google.protobuf.Empty) {}
|
|
183
|
-
rpc orderWalletPassUpdate(OrderApplePassUpdateNotification) returns (google.protobuf.Empty) {}
|
|
184
171
|
// Event
|
|
185
172
|
rpc eventCreated(EventCreatedNotification) returns (google.protobuf.Empty) {}
|
|
186
173
|
rpc eventPublished(EventPublishedNotification) returns (google.protobuf.Empty) {}
|
|
187
174
|
rpc eventUpdated(EventUpdatedNotification) returns (google.protobuf.Empty) {}
|
|
188
|
-
rpc eventGoogleWalletClassUpdate(EventGoogleWalletClassUpdateNotification) returns (google.protobuf.Empty) {}
|
|
189
175
|
rpc duplicateEventCreated(EventCreatedNotification) returns (google.protobuf.Empty) {}
|
|
190
176
|
// Season
|
|
191
177
|
rpc seasonCreated(SeasonCreatedNotification) returns (google.protobuf.Empty) {}
|
package/src/proto/email.proto
CHANGED
|
@@ -234,8 +234,6 @@ message QueueOrderQRCodeEmailRequest {
|
|
|
234
234
|
repeated PromoterFeeObj promoterFeeList = 42;
|
|
235
235
|
int32 ticketsAt = 43;
|
|
236
236
|
string redirectURL = 44;
|
|
237
|
-
string appleWalletUrl = 45;
|
|
238
|
-
string googleWalletUrl = 46;
|
|
239
237
|
}
|
|
240
238
|
|
|
241
239
|
message QueueSeasonOrderReceiptEmailRequest {
|
package/src/proto/event.proto
CHANGED
|
@@ -51,7 +51,6 @@ message Event {
|
|
|
51
51
|
string duplicateFeeId = 43;
|
|
52
52
|
string qrCodeUrl = 44;
|
|
53
53
|
string web3Hash = 45;
|
|
54
|
-
string googleWalletClassId = 46;
|
|
55
54
|
}
|
|
56
55
|
|
|
57
56
|
message PublicEvent {
|
|
@@ -85,8 +84,6 @@ message PublicEvent {
|
|
|
85
84
|
string stub = 28;
|
|
86
85
|
EventSchedule schedule = 29;
|
|
87
86
|
repeated EventTaskTypes ticketTypes = 30;
|
|
88
|
-
bool isMultipleDays = 31;
|
|
89
|
-
repeated Performance performances = 32;
|
|
90
87
|
}
|
|
91
88
|
|
|
92
89
|
message EventTaskTypes{
|
|
@@ -131,7 +128,6 @@ message PublicEventDetails {
|
|
|
131
128
|
string stub = 29;
|
|
132
129
|
int32 highestPrice = 30;
|
|
133
130
|
repeated PublicTicketType ticketTypes = 31;
|
|
134
|
-
bool isMultipleDays = 32;
|
|
135
131
|
}
|
|
136
132
|
|
|
137
133
|
message PublicTicketType {
|
|
@@ -738,18 +734,6 @@ message ClearExpiredEventQrCodesResponse {
|
|
|
738
734
|
int32 cleared = 3;
|
|
739
735
|
}
|
|
740
736
|
|
|
741
|
-
message SendAnvilCloseEventRequest {
|
|
742
|
-
string spanContext = 0;
|
|
743
|
-
int32 daysAfterEnd = 1;
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
message SendAnvilCloseEventResponse {
|
|
747
|
-
StatusCode status = 0;
|
|
748
|
-
repeated Error errors = 1;
|
|
749
|
-
int32 processed = 2;
|
|
750
|
-
int32 sent = 3;
|
|
751
|
-
}
|
|
752
|
-
|
|
753
737
|
message PosterImageUrl {
|
|
754
738
|
string original = 0;
|
|
755
739
|
string medium = 1;
|
|
@@ -767,18 +751,6 @@ message CheckStubUniquenessResponse {
|
|
|
767
751
|
bool isUnique = 3;
|
|
768
752
|
}
|
|
769
753
|
|
|
770
|
-
message CreateGoogleWalletEventClassRequest {
|
|
771
|
-
string spanContext = 0;
|
|
772
|
-
string eventId = 1;
|
|
773
|
-
string orgId = 2;
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
message CreateGoogleWalletEventClassResponse {
|
|
777
|
-
StatusCode status = 0;
|
|
778
|
-
repeated Error errors = 1;
|
|
779
|
-
string googleWalletClassId = 2;
|
|
780
|
-
}
|
|
781
|
-
|
|
782
754
|
service EventService {
|
|
783
755
|
// Create
|
|
784
756
|
rpc createEvent(CreateEventRequest) returns (CreateEventResponse) {}
|
|
@@ -832,9 +804,7 @@ service EventService {
|
|
|
832
804
|
rpc updateTicketTierInventory(UpdateTicketTierInventoryRequest) returns (UpdateTicketTierInventoryResponse) {}
|
|
833
805
|
rpc deleteTicketHold(DeleteTicketHoldRequest) returns (DeleteTicketHoldResponse) {}
|
|
834
806
|
rpc clearExpiredEventQrCodes(ClearExpiredEventQrCodesRequest) returns (ClearExpiredEventQrCodesResponse) {}
|
|
835
|
-
rpc sendAnvilCloseEvent(SendAnvilCloseEventRequest) returns (SendAnvilCloseEventResponse) {}
|
|
836
807
|
rpc generateEventQRCode(GenerateEventQRCodeRequest) returns (GenerateEventQRCodeResponse) {}
|
|
837
808
|
rpc queryEventsAdmin(QueryEventsRequest) returns (QueryEventsResponse) {}
|
|
838
809
|
rpc checkStubUniqueness(CheckStubUniquenessRequest) returns (CheckStubUniquenessResponse) {}
|
|
839
|
-
rpc createGoogleWalletEventClass(CreateGoogleWalletEventClassRequest) returns (CreateGoogleWalletEventClassResponse) {}
|
|
840
810
|
}
|
|
@@ -14,8 +14,7 @@ message UploadFileRequest {
|
|
|
14
14
|
repeated File files = 2;
|
|
15
15
|
string userId = 3;
|
|
16
16
|
bool gzip = 4;
|
|
17
|
-
bool isMultiImage = 5;
|
|
18
|
-
bool isCompressed = 6;
|
|
17
|
+
bool isMultiImage = 5;
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
message UploadFileResponse {
|
|
@@ -24,21 +23,7 @@ message UploadFileResponse {
|
|
|
24
23
|
repeated File files = 2;
|
|
25
24
|
}
|
|
26
25
|
|
|
27
|
-
message OverwriteFileRequest {
|
|
28
|
-
string spanContext = 0;
|
|
29
|
-
string existingUrl = 1;
|
|
30
|
-
bytes fileData = 2;
|
|
31
|
-
string mimetype = 3;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
message OverwriteFileResponse {
|
|
35
|
-
StatusCode status = 0;
|
|
36
|
-
repeated Error errors = 1;
|
|
37
|
-
string url = 2;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
26
|
|
|
41
27
|
service FileUploadService {
|
|
42
28
|
rpc uploadFile(UploadFileRequest) returns (UploadFileResponse) {}
|
|
43
|
-
rpc overwriteFile(OverwriteFileRequest) returns (OverwriteFileResponse) {}
|
|
44
29
|
}
|
package/src/proto/order.proto
CHANGED
|
@@ -48,8 +48,6 @@ message Order {
|
|
|
48
48
|
string parentOrderId = 37;
|
|
49
49
|
repeated SharingOrderInfo sharing = 38;
|
|
50
50
|
ParentOrderDetails parentOrderDetails = 39;
|
|
51
|
-
AppleWallet appleWallet = 40;
|
|
52
|
-
GoogleWallet googleWallet = 41;
|
|
53
51
|
}
|
|
54
52
|
|
|
55
53
|
message ParentOrderDetails {
|
|
@@ -58,18 +56,6 @@ message ParentOrderDetails {
|
|
|
58
56
|
string eventName = 2;
|
|
59
57
|
}
|
|
60
58
|
|
|
61
|
-
message AppleWallet {
|
|
62
|
-
string url = 0;
|
|
63
|
-
string serialNumber = 1;
|
|
64
|
-
string authToken = 2;
|
|
65
|
-
int32 lastModified = 3;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
message GoogleWallet {
|
|
69
|
-
string url = 0;
|
|
70
|
-
string objectId = 1;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
59
|
message OrderIntegrationResponse {
|
|
74
60
|
bool success = 0;
|
|
75
61
|
string title = 1;
|
|
@@ -692,7 +678,6 @@ message OrderAnalyticsQuery {
|
|
|
692
678
|
string interval = 6;
|
|
693
679
|
repeated string types = 7;
|
|
694
680
|
string seasonId = 8;
|
|
695
|
-
bool isEventCalendar = 9;
|
|
696
681
|
}
|
|
697
682
|
|
|
698
683
|
message QueryOrderAnalyticsRequest {
|
|
@@ -861,63 +846,6 @@ message QueryOrgDeletableResponse {
|
|
|
861
846
|
bool isOrgDeletable = 2;
|
|
862
847
|
}
|
|
863
848
|
|
|
864
|
-
/****************************************************************************************
|
|
865
|
-
Apple Wallet PassKit Device Registration
|
|
866
|
-
****************************************************************************************/
|
|
867
|
-
|
|
868
|
-
message RegisterPassKitDeviceRequest {
|
|
869
|
-
string spanContext = 0;
|
|
870
|
-
string deviceLibraryIdentifier = 1;
|
|
871
|
-
string pushToken = 2;
|
|
872
|
-
string passTypeIdentifier = 3;
|
|
873
|
-
string serialNumber = 4;
|
|
874
|
-
string orderId = 5;
|
|
875
|
-
string orgId = 6;
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
message RegisterPassKitDeviceResponse {
|
|
879
|
-
StatusCode status = 0;
|
|
880
|
-
repeated Error errors = 1;
|
|
881
|
-
bool alreadyExists = 2;
|
|
882
|
-
}
|
|
883
|
-
|
|
884
|
-
message UnregisterPassKitDeviceRequest {
|
|
885
|
-
string spanContext = 0;
|
|
886
|
-
string deviceLibraryIdentifier = 1;
|
|
887
|
-
string passTypeIdentifier = 2;
|
|
888
|
-
string serialNumber = 3;
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
message UnregisterPassKitDeviceResponse {
|
|
892
|
-
StatusCode status = 0;
|
|
893
|
-
repeated Error errors = 1;
|
|
894
|
-
bool deleted = 2;
|
|
895
|
-
}
|
|
896
|
-
|
|
897
|
-
message GetPassKitSerialNumbersRequest {
|
|
898
|
-
string spanContext = 0;
|
|
899
|
-
string deviceLibraryIdentifier = 1;
|
|
900
|
-
string passTypeIdentifier = 2;
|
|
901
|
-
int64 passesUpdatedSince = 3;
|
|
902
|
-
}
|
|
903
|
-
|
|
904
|
-
message GetPassKitSerialNumbersResponse {
|
|
905
|
-
StatusCode status = 0;
|
|
906
|
-
repeated Error errors = 1;
|
|
907
|
-
repeated string serialNumbers = 2;
|
|
908
|
-
string lastUpdated = 3;
|
|
909
|
-
}
|
|
910
|
-
|
|
911
|
-
message GetPassKitPushTokensRequest {
|
|
912
|
-
string spanContext = 0;
|
|
913
|
-
string orderId = 1;
|
|
914
|
-
}
|
|
915
|
-
|
|
916
|
-
message GetPassKitPushTokensResponse {
|
|
917
|
-
StatusCode status = 0;
|
|
918
|
-
repeated Error errors = 1;
|
|
919
|
-
repeated string pushTokens = 2;
|
|
920
|
-
}
|
|
921
849
|
|
|
922
850
|
service OrderService {
|
|
923
851
|
// Create
|
|
@@ -969,9 +897,4 @@ service OrderService {
|
|
|
969
897
|
rpc orderIntegrationUpdate(OrderIntegrationUpdateRequest) returns(OrderIntegrationUpdateResponse){}
|
|
970
898
|
rpc emailTicketHolders(EmailTicketHolderRequest) returns(EmailTicketHolderResponse){}
|
|
971
899
|
rpc queryOrgDeletable(QueryOrgDeletableRequest) returns(QueryOrgDeletableResponse){}
|
|
972
|
-
// Apple Wallet PassKit Device Registration
|
|
973
|
-
rpc registerPassKitDevice(RegisterPassKitDeviceRequest) returns(RegisterPassKitDeviceResponse){}
|
|
974
|
-
rpc unregisterPassKitDevice(UnregisterPassKitDeviceRequest) returns(UnregisterPassKitDeviceResponse){}
|
|
975
|
-
rpc getPassKitSerialNumbers(GetPassKitSerialNumbersRequest) returns(GetPassKitSerialNumbersResponse){}
|
|
976
|
-
rpc getPassKitPushTokens(GetPassKitPushTokensRequest) returns(GetPassKitPushTokensResponse){}
|
|
977
900
|
}
|
package/src/schemas/Event.ts
CHANGED
package/src/schemas/Order.ts
CHANGED
|
@@ -218,7 +218,7 @@ const OrderTicket = {
|
|
|
218
218
|
guestTicket: {
|
|
219
219
|
type: Boolean,
|
|
220
220
|
required: false
|
|
221
|
-
},
|
|
221
|
+
},
|
|
222
222
|
isTicketSharing: {
|
|
223
223
|
type: Boolean,
|
|
224
224
|
required: false,
|
|
@@ -453,42 +453,6 @@ const Payment = {
|
|
|
453
453
|
billingAddress: BillingAddress,
|
|
454
454
|
}
|
|
455
455
|
|
|
456
|
-
const AppleWallet = {
|
|
457
|
-
url: {
|
|
458
|
-
type: String,
|
|
459
|
-
required: false,
|
|
460
|
-
default: null,
|
|
461
|
-
},
|
|
462
|
-
serialNumber: {
|
|
463
|
-
type: String,
|
|
464
|
-
required: false,
|
|
465
|
-
default: null,
|
|
466
|
-
},
|
|
467
|
-
authToken: {
|
|
468
|
-
type: String,
|
|
469
|
-
required: false,
|
|
470
|
-
default: null,
|
|
471
|
-
},
|
|
472
|
-
lastModified: {
|
|
473
|
-
type: Number,
|
|
474
|
-
required: false,
|
|
475
|
-
default: null,
|
|
476
|
-
},
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
const GoogleWallet = {
|
|
480
|
-
url: {
|
|
481
|
-
type: String,
|
|
482
|
-
required: false,
|
|
483
|
-
default: null,
|
|
484
|
-
},
|
|
485
|
-
objectId: {
|
|
486
|
-
type: String,
|
|
487
|
-
required: false,
|
|
488
|
-
default: null,
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
|
|
492
456
|
const orderIntegrationResponse = {
|
|
493
457
|
_id: {
|
|
494
458
|
type: String,
|
|
@@ -701,6 +665,4 @@ export default {
|
|
|
701
665
|
required: false,
|
|
702
666
|
default: null,
|
|
703
667
|
},
|
|
704
|
-
appleWallet: AppleWallet,
|
|
705
|
-
googleWallet: GoogleWallet,
|
|
706
668
|
};
|
|
@@ -14,7 +14,6 @@ import { OrderTypeEnum } from "../interfaces/IOrderType";
|
|
|
14
14
|
// import { OrderStateEnum } from "../interfaces/IOrderState";
|
|
15
15
|
import * as Time from "@sellout/utils/.dist/time";
|
|
16
16
|
import * as Price from '@sellout/utils/.dist/price';
|
|
17
|
-
import * as moment from 'moment-timezone';
|
|
18
17
|
// import { number } from "@hapi/joi";
|
|
19
18
|
|
|
20
19
|
interface IDuration {
|
|
@@ -979,7 +978,7 @@ export default {
|
|
|
979
978
|
},
|
|
980
979
|
|
|
981
980
|
// Returns start and end date
|
|
982
|
-
durationToUnix(duration: AnalyticsDurationEnum
|
|
981
|
+
durationToUnix(duration: AnalyticsDurationEnum): IDuration {
|
|
983
982
|
type DurationEnumToDurationMap = Record<
|
|
984
983
|
AnalyticsDurationEnum,
|
|
985
984
|
() => IDuration
|
|
@@ -995,8 +994,8 @@ export default {
|
|
|
995
994
|
},
|
|
996
995
|
[AnalyticsDurationEnum.Today]: () => {
|
|
997
996
|
const duration: IDuration = {
|
|
998
|
-
startsAt:
|
|
999
|
-
endsAt:
|
|
997
|
+
startsAt: Time.getStartOfCurrentDay(),
|
|
998
|
+
endsAt: Time.getEndOfCurrentDay()
|
|
1000
999
|
};
|
|
1001
1000
|
return duration;
|
|
1002
1001
|
},
|
package/src/utils/OrderUtil.ts
CHANGED
|
@@ -44,6 +44,99 @@ export default {
|
|
|
44
44
|
if (!order.tickets) order.tickets = [];
|
|
45
45
|
if (!order.upgrades) order.upgrades = [];
|
|
46
46
|
|
|
47
|
+
|
|
48
|
+
// const ticketFees = fees.filter(f => f.appliedTo === "Ticket");
|
|
49
|
+
// const upgradeFees = fees.filter(f => f.appliedTo === "Upgrade");
|
|
50
|
+
// let orderFees = fees.filter(f => f.appliedTo === "Order");
|
|
51
|
+
|
|
52
|
+
// function applyTicketFee(ticket, fee) {
|
|
53
|
+
// if (fee.filters.includes("Seated") && !ticket.seat) return 0;
|
|
54
|
+
// const noMax = fee.maxAppliedToPrice === 0;
|
|
55
|
+
// if (
|
|
56
|
+
// (fee.minAppliedToPrice <= ticket.price &&
|
|
57
|
+
// ticket.price <= fee.maxAppliedToPrice) ||
|
|
58
|
+
// noMax
|
|
59
|
+
// ) {
|
|
60
|
+
// if (fee.type === "Flat") {
|
|
61
|
+
// return fee.value;
|
|
62
|
+
// }
|
|
63
|
+
// if (fee.type === "Percent") {
|
|
64
|
+
// return (ticket.price * fee.value) / 100;
|
|
65
|
+
// }
|
|
66
|
+
// } else {
|
|
67
|
+
// return 0;
|
|
68
|
+
// }
|
|
69
|
+
// }
|
|
70
|
+
|
|
71
|
+
// function applyUpgradeFee(upgrade, fee) {
|
|
72
|
+
// const noMax = fee.maxAppliedToPrice === 0;
|
|
73
|
+
// if (
|
|
74
|
+
// (fee.minAppliedToPrice <= upgrade.price &&
|
|
75
|
+
// upgrade.price <= fee.minAppliedToPrice) ||
|
|
76
|
+
// noMax
|
|
77
|
+
// ) {
|
|
78
|
+
// if (fee.type === "Flat") {
|
|
79
|
+
// return fee.value;
|
|
80
|
+
// }
|
|
81
|
+
// if (fee.type === "Percent") {
|
|
82
|
+
// return (upgrade.price * fee.value) / 100;
|
|
83
|
+
// }
|
|
84
|
+
// } else {
|
|
85
|
+
// return 0;
|
|
86
|
+
// }
|
|
87
|
+
// }
|
|
88
|
+
|
|
89
|
+
// function applyOrderFee(orderSubtotal, fee) {
|
|
90
|
+
// if (fee.type === "Flat") {
|
|
91
|
+
// return orderSubtotal + fee.value;
|
|
92
|
+
// }
|
|
93
|
+
// if (fee.type === "Percent") {
|
|
94
|
+
// return orderSubtotal / (1 - fee.value / 100);
|
|
95
|
+
// }
|
|
96
|
+
// }
|
|
97
|
+
|
|
98
|
+
// const ticketTotal = order.tickets.reduce(
|
|
99
|
+
// (cur, ticket) => cur + ticket.price,
|
|
100
|
+
// 0
|
|
101
|
+
// );
|
|
102
|
+
|
|
103
|
+
// const ticketFeeTotal = order.tickets.reduce((cur, ticket) => {
|
|
104
|
+
// return (
|
|
105
|
+
// cur +
|
|
106
|
+
// ticketFees.reduce((cur, fee) => cur + applyTicketFee(ticket, fee), 0)
|
|
107
|
+
// );
|
|
108
|
+
// }, 0);
|
|
109
|
+
|
|
110
|
+
// const upgradeTotal = order.upgrades.reduce(
|
|
111
|
+
// (cur, upgrade) => cur + upgrade.price,
|
|
112
|
+
// 0
|
|
113
|
+
// );
|
|
114
|
+
|
|
115
|
+
// const upgradeFeeTotal = order.upgrades.reduce((cur, upgrade) => {
|
|
116
|
+
// return (
|
|
117
|
+
// cur +
|
|
118
|
+
// upgradeFees.reduce((cur, fee) => cur + applyUpgradeFee(upgrade, fee), 0)
|
|
119
|
+
// );
|
|
120
|
+
// }, 0);
|
|
121
|
+
// const orderSubtotal =
|
|
122
|
+
// ticketTotal + ticketFeeTotal + upgradeTotal + upgradeFeeTotal;
|
|
123
|
+
|
|
124
|
+
// // Order matters here. Flat type fees must be
|
|
125
|
+
// // applied before Percent type fees
|
|
126
|
+
// orderFees = orderFees.sort(({ type }) => {
|
|
127
|
+
// if (type === "Flat") return -1;
|
|
128
|
+
// return 1;
|
|
129
|
+
// });
|
|
130
|
+
|
|
131
|
+
// const orderTotal = orderFees.reduce((cur, fee) => {
|
|
132
|
+
// return applyOrderFee(cur, fee);
|
|
133
|
+
// }, orderSubtotal) || 0;
|
|
134
|
+
|
|
135
|
+
// console.log("orderTotal orderTotal+++++>>",orderTotal );
|
|
136
|
+
|
|
137
|
+
// return Math.round(orderTotal);
|
|
138
|
+
|
|
139
|
+
|
|
47
140
|
const ticketTotal = order.tickets.reduce(
|
|
48
141
|
(cur, ticket) => cur + ticket.price,
|
|
49
142
|
0
|
package/src/utils/PaymentUtil.ts
CHANGED
|
@@ -793,6 +793,21 @@ class PaymentUtil {
|
|
|
793
793
|
|
|
794
794
|
//TODO Group by label and sum the amount
|
|
795
795
|
const feeMap = new Map<string, number>();
|
|
796
|
+
|
|
797
|
+
// filteredFees?.forEach((fee) => {
|
|
798
|
+
// const amount =
|
|
799
|
+
// fee?.type === FeeTypeEnum.Flat
|
|
800
|
+
// ? fee.value
|
|
801
|
+
// : (fee.value / 100) * price;
|
|
802
|
+
|
|
803
|
+
// const label =
|
|
804
|
+
// fee?.appliedBy === FeeAppliedByEnum.Sellout
|
|
805
|
+
// ? "Sellout service fees"
|
|
806
|
+
// : fee.name;
|
|
807
|
+
|
|
808
|
+
// const current = feeMap.get(label) || 0;
|
|
809
|
+
// feeMap.set(label, current + amount);
|
|
810
|
+
// });
|
|
796
811
|
filteredFees.forEach((fee) => {
|
|
797
812
|
const amount =
|
|
798
813
|
fee.type === FeeTypeEnum.Flat
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export default interface IPassKitDeviceRegistration {
|
|
2
|
-
_id?: string;
|
|
3
|
-
deviceLibraryIdentifier: string;
|
|
4
|
-
pushToken: string;
|
|
5
|
-
passTypeIdentifier: string;
|
|
6
|
-
serialNumber: string;
|
|
7
|
-
orderId: string;
|
|
8
|
-
orgId: string;
|
|
9
|
-
createdAt: number;
|
|
10
|
-
updatedAt?: number;
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IPassKitDeviceRegistration.js","sourceRoot":"","sources":["../../src/interfaces/IPassKitDeviceRegistration.ts"],"names":[],"mappings":""}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
_id: {
|
|
3
|
-
type: StringConstructor;
|
|
4
|
-
default: () => string;
|
|
5
|
-
};
|
|
6
|
-
deviceLibraryIdentifier: {
|
|
7
|
-
type: StringConstructor;
|
|
8
|
-
required: boolean;
|
|
9
|
-
index: boolean;
|
|
10
|
-
};
|
|
11
|
-
pushToken: {
|
|
12
|
-
type: StringConstructor;
|
|
13
|
-
required: boolean;
|
|
14
|
-
};
|
|
15
|
-
passTypeIdentifier: {
|
|
16
|
-
type: StringConstructor;
|
|
17
|
-
required: boolean;
|
|
18
|
-
index: boolean;
|
|
19
|
-
};
|
|
20
|
-
serialNumber: {
|
|
21
|
-
type: StringConstructor;
|
|
22
|
-
required: boolean;
|
|
23
|
-
index: boolean;
|
|
24
|
-
};
|
|
25
|
-
orderId: {
|
|
26
|
-
type: StringConstructor;
|
|
27
|
-
required: boolean;
|
|
28
|
-
index: boolean;
|
|
29
|
-
};
|
|
30
|
-
orgId: {
|
|
31
|
-
type: StringConstructor;
|
|
32
|
-
required: boolean;
|
|
33
|
-
index: boolean;
|
|
34
|
-
};
|
|
35
|
-
createdAt: {
|
|
36
|
-
type: NumberConstructor;
|
|
37
|
-
required: boolean;
|
|
38
|
-
};
|
|
39
|
-
updatedAt: {
|
|
40
|
-
type: NumberConstructor;
|
|
41
|
-
required: boolean;
|
|
42
|
-
default: null;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
export default _default;
|
|
@@ -1,51 +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 shortid_1 = __importDefault(require("shortid"));
|
|
7
|
-
exports.default = {
|
|
8
|
-
_id: {
|
|
9
|
-
type: String,
|
|
10
|
-
default: shortid_1.default.generate,
|
|
11
|
-
},
|
|
12
|
-
deviceLibraryIdentifier: {
|
|
13
|
-
type: String,
|
|
14
|
-
required: true,
|
|
15
|
-
index: true,
|
|
16
|
-
},
|
|
17
|
-
pushToken: {
|
|
18
|
-
type: String,
|
|
19
|
-
required: true,
|
|
20
|
-
},
|
|
21
|
-
passTypeIdentifier: {
|
|
22
|
-
type: String,
|
|
23
|
-
required: true,
|
|
24
|
-
index: true,
|
|
25
|
-
},
|
|
26
|
-
serialNumber: {
|
|
27
|
-
type: String,
|
|
28
|
-
required: true,
|
|
29
|
-
index: true,
|
|
30
|
-
},
|
|
31
|
-
orderId: {
|
|
32
|
-
type: String,
|
|
33
|
-
required: true,
|
|
34
|
-
index: true,
|
|
35
|
-
},
|
|
36
|
-
orgId: {
|
|
37
|
-
type: String,
|
|
38
|
-
required: true,
|
|
39
|
-
index: true,
|
|
40
|
-
},
|
|
41
|
-
createdAt: {
|
|
42
|
-
type: Number,
|
|
43
|
-
required: true,
|
|
44
|
-
},
|
|
45
|
-
updatedAt: {
|
|
46
|
-
type: Number,
|
|
47
|
-
required: false,
|
|
48
|
-
default: null,
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
//# sourceMappingURL=WalletPassDevice.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WalletPassDevice.js","sourceRoot":"","sources":["../../src/schemas/WalletPassDevice.ts"],"names":[],"mappings":";;;;;AAAA,sDAA8B;AAE9B,kBAAe;IACb,GAAG,EAAE;QACH,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,iBAAO,CAAC,QAAQ;KAC1B;IACD,uBAAuB,EAAE;QACvB,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE,IAAI;KACZ;IACD,SAAS,EAAE;QACT,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACf;IACD,kBAAkB,EAAE;QAClB,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE,IAAI;KACZ;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE,IAAI;KACZ;IACD,OAAO,EAAE;QACP,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE,IAAI;KACZ;IACD,KAAK,EAAE;QACL,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE,IAAI;KACZ;IACD,SAAS,EAAE;QACT,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACf;IACD,SAAS,EAAE;QACT,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,IAAI;KACd;CACF,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export default interface IPassKitDeviceRegistration {
|
|
2
|
-
_id?: string;
|
|
3
|
-
deviceLibraryIdentifier: string;
|
|
4
|
-
pushToken: string;
|
|
5
|
-
passTypeIdentifier: string;
|
|
6
|
-
serialNumber: string;
|
|
7
|
-
orderId: string;
|
|
8
|
-
orgId: string;
|
|
9
|
-
createdAt: number;
|
|
10
|
-
updatedAt?: number;
|
|
11
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import shortid from 'shortid';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
_id: {
|
|
5
|
-
type: String,
|
|
6
|
-
default: shortid.generate,
|
|
7
|
-
},
|
|
8
|
-
deviceLibraryIdentifier: {
|
|
9
|
-
type: String,
|
|
10
|
-
required: true,
|
|
11
|
-
index: true,
|
|
12
|
-
},
|
|
13
|
-
pushToken: {
|
|
14
|
-
type: String,
|
|
15
|
-
required: true,
|
|
16
|
-
},
|
|
17
|
-
passTypeIdentifier: {
|
|
18
|
-
type: String,
|
|
19
|
-
required: true,
|
|
20
|
-
index: true,
|
|
21
|
-
},
|
|
22
|
-
serialNumber: {
|
|
23
|
-
type: String,
|
|
24
|
-
required: true,
|
|
25
|
-
index: true,
|
|
26
|
-
},
|
|
27
|
-
orderId: {
|
|
28
|
-
type: String,
|
|
29
|
-
required: true,
|
|
30
|
-
index: true,
|
|
31
|
-
},
|
|
32
|
-
orgId: {
|
|
33
|
-
type: String,
|
|
34
|
-
required: true,
|
|
35
|
-
index: true,
|
|
36
|
-
},
|
|
37
|
-
createdAt: {
|
|
38
|
-
type: Number,
|
|
39
|
-
required: true,
|
|
40
|
-
},
|
|
41
|
-
updatedAt: {
|
|
42
|
-
type: Number,
|
|
43
|
-
required: false,
|
|
44
|
-
default: null,
|
|
45
|
-
},
|
|
46
|
-
};
|