@sellout/models 0.0.397 → 0.0.399
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 +3 -0
- package/.dist/graphql/queries/eventsAdminCalender.query.js.map +1 -1
- package/.dist/graphql/queries/eventsListOptimized.query.js +4 -1
- package/.dist/graphql/queries/eventsListOptimized.query.js.map +1 -1
- package/.dist/graphql/queries/order.query.js +6 -0
- package/.dist/graphql/queries/order.query.js.map +1 -1
- package/.dist/graphql/queries/orders.query.js +32 -8
- package/.dist/graphql/queries/orders.query.js.map +1 -1
- package/.dist/interfaces/IAnalytics.d.ts +1 -0
- package/.dist/interfaces/IAnalytics.js.map +1 -1
- package/.dist/interfaces/IEvent.d.ts +1 -0
- package/.dist/interfaces/IOrder.d.ts +12 -0
- package/.dist/interfaces/IOrder.js.map +1 -1
- package/.dist/interfaces/IPassKitDeviceRegistration.d.ts +11 -0
- package/.dist/interfaces/IPassKitDeviceRegistration.js +3 -0
- package/.dist/interfaces/IPassKitDeviceRegistration.js.map +1 -0
- package/.dist/interfaces/IRefund.d.ts +4 -0
- package/.dist/interfaces/ITask.d.ts +2 -1
- package/.dist/interfaces/ITask.js +1 -0
- package/.dist/interfaces/ITask.js.map +1 -1
- package/.dist/schemas/Event.d.ts +5 -0
- package/.dist/schemas/Event.js +5 -0
- package/.dist/schemas/Event.js.map +1 -1
- package/.dist/schemas/Order.d.ts +114 -0
- package/.dist/schemas/Order.js +56 -0
- package/.dist/schemas/Order.js.map +1 -1
- package/.dist/schemas/WalletPassDevice.d.ts +45 -0
- package/.dist/schemas/WalletPassDevice.js +51 -0
- package/.dist/schemas/WalletPassDevice.js.map +1 -0
- package/.dist/sellout-proto.js +5875 -335
- package/.dist/utils/AnalyticsUtil.d.ts +1 -1
- package/.dist/utils/AnalyticsUtil.js +4 -3
- package/.dist/utils/AnalyticsUtil.js.map +1 -1
- package/.dist/utils/OrderUtil.js +0 -87
- package/.dist/utils/OrderUtil.js.map +1 -1
- package/.dist/utils/PaymentUtil.js +0 -12
- package/.dist/utils/PaymentUtil.js.map +1 -1
- package/package.json +4 -3
- package/src/graphql/queries/eventsAdminCalender.query.ts +3 -0
- package/src/graphql/queries/eventsListOptimized.query.ts +4 -1
- package/src/graphql/queries/order.query.ts +6 -0
- package/src/graphql/queries/orders.query.ts +32 -8
- package/src/interfaces/IAnalytics.ts +1 -0
- package/src/interfaces/IEvent.ts +1 -0
- package/src/interfaces/IOrder.ts +21 -7
- package/src/interfaces/IPassKitDeviceRegistration.ts +11 -0
- package/src/interfaces/IRefund.ts +4 -0
- package/src/interfaces/ITask.ts +1 -0
- package/src/proto/broadcast.proto +14 -0
- package/src/proto/email.proto +3 -0
- package/src/proto/event.proto +30 -0
- package/src/proto/file-upload.proto +16 -1
- package/src/proto/order.proto +81 -0
- package/src/schemas/Event.ts +5 -0
- package/src/schemas/Order.ts +59 -1
- package/src/schemas/WalletPassDevice.ts +46 -0
- package/src/utils/AnalyticsUtil.ts +4 -3
- package/src/utils/OrderUtil.ts +0 -104
- package/src/utils/PaymentUtil.ts +0 -15
package/src/interfaces/IOrder.ts
CHANGED
|
@@ -33,10 +33,10 @@ export default interface IOrder {
|
|
|
33
33
|
upgrades: IOrderUpgrade[];
|
|
34
34
|
recipientEmails?: string[];
|
|
35
35
|
qrCodeUrl?: string;
|
|
36
|
-
state?: OrderStateEnum
|
|
36
|
+
state?: OrderStateEnum;
|
|
37
37
|
refundedAmount?: number; // BACKFILL
|
|
38
38
|
type?: OrderTypeEnum;
|
|
39
|
-
channel: OrderChannelEnum
|
|
39
|
+
channel: OrderChannelEnum;
|
|
40
40
|
createdAt?: number;
|
|
41
41
|
createdBy?: string;
|
|
42
42
|
promotionCode?: string;
|
|
@@ -48,18 +48,20 @@ export default interface IOrder {
|
|
|
48
48
|
refundReason?: string; // BACKFILL
|
|
49
49
|
payments: IPayment[];
|
|
50
50
|
processingFee?: IProcessingFee;
|
|
51
|
-
email?: string
|
|
51
|
+
email?: string;
|
|
52
52
|
hidden?: boolean;
|
|
53
53
|
printed?: boolean;
|
|
54
54
|
parentSeasonOrderId?: string;
|
|
55
55
|
cancelReason?: string;
|
|
56
56
|
promoterFee?: IProcessingFee;
|
|
57
|
-
discountAmount?: number
|
|
58
|
-
discount?: string
|
|
59
|
-
sharing?: [IOrderShareEnum]
|
|
57
|
+
discountAmount?: number;
|
|
58
|
+
discount?: string;
|
|
59
|
+
sharing?: [IOrderShareEnum];
|
|
60
60
|
orderIntegrationResponse?: IOrderIntegrationResponse[];
|
|
61
61
|
parentOrderId?: string;
|
|
62
|
-
parentOrderDetails?:ParentOrderDetails
|
|
62
|
+
parentOrderDetails?: ParentOrderDetails;
|
|
63
|
+
appleWallet?: IAppleWallet; // Apple Wallet pass data
|
|
64
|
+
googleWallet?: IGoogleWallet; // Google Wallet pass data
|
|
63
65
|
};
|
|
64
66
|
|
|
65
67
|
export interface IEventGraphQL extends IEvent {
|
|
@@ -89,3 +91,15 @@ export interface ITicketRestriction extends IOrder {
|
|
|
89
91
|
teiMemberId?: string[];
|
|
90
92
|
|
|
91
93
|
}
|
|
94
|
+
|
|
95
|
+
export interface IAppleWallet {
|
|
96
|
+
url?: string; // URL to the .pkpass file in GCS
|
|
97
|
+
serialNumber?: string; // Unique serial number for the pass
|
|
98
|
+
authToken?: string; // Authentication token for web service callbacks
|
|
99
|
+
lastModified?: number; // Timestamp for pass update tracking
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface IGoogleWallet {
|
|
103
|
+
url?: string; // "Add to Google Wallet" URL with JWT token
|
|
104
|
+
objectId?: string; // Object ID for REST API updates
|
|
105
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
}
|
package/src/interfaces/ITask.ts
CHANGED
|
@@ -9,6 +9,7 @@ export enum TaskTypes {
|
|
|
9
9
|
sendOrderReceiptEmail = 'sendOrderReceiptEmail',
|
|
10
10
|
SetTicketTierInventory = 'SetTicketTierInventory',
|
|
11
11
|
ClearExpiredEventQrCodes = 'ClearExpiredEventQrCodes',
|
|
12
|
+
SendAnvilCloseEvent = 'SendAnvilCloseEvent',
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
export default interface ITask {
|
|
@@ -32,6 +32,12 @@ 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
|
+
|
|
35
41
|
message Ticket {
|
|
36
42
|
string ticketId = 0;
|
|
37
43
|
int32 qty = 1;
|
|
@@ -80,6 +86,12 @@ message EventUpdatedNotification {
|
|
|
80
86
|
string eventId = 2;
|
|
81
87
|
}
|
|
82
88
|
|
|
89
|
+
message EventGoogleWalletClassUpdateNotification {
|
|
90
|
+
string spanContext = 0;
|
|
91
|
+
string orgId = 1;
|
|
92
|
+
string eventId = 2;
|
|
93
|
+
}
|
|
94
|
+
|
|
83
95
|
|
|
84
96
|
/****************************************************************************************
|
|
85
97
|
* Season
|
|
@@ -168,10 +180,12 @@ service Publisher {
|
|
|
168
180
|
rpc orderCreated(OrderCreatedNotification) returns (google.protobuf.Empty) {}
|
|
169
181
|
rpc orderSeasonCreated(OrderCreatedNotification) returns (google.protobuf.Empty) {}
|
|
170
182
|
rpc orderRefunded(OrderRefundedNotification) returns (google.protobuf.Empty) {}
|
|
183
|
+
rpc orderWalletPassUpdate(OrderApplePassUpdateNotification) returns (google.protobuf.Empty) {}
|
|
171
184
|
// Event
|
|
172
185
|
rpc eventCreated(EventCreatedNotification) returns (google.protobuf.Empty) {}
|
|
173
186
|
rpc eventPublished(EventPublishedNotification) returns (google.protobuf.Empty) {}
|
|
174
187
|
rpc eventUpdated(EventUpdatedNotification) returns (google.protobuf.Empty) {}
|
|
188
|
+
rpc eventGoogleWalletClassUpdate(EventGoogleWalletClassUpdateNotification) returns (google.protobuf.Empty) {}
|
|
175
189
|
rpc duplicateEventCreated(EventCreatedNotification) returns (google.protobuf.Empty) {}
|
|
176
190
|
// Season
|
|
177
191
|
rpc seasonCreated(SeasonCreatedNotification) returns (google.protobuf.Empty) {}
|
package/src/proto/email.proto
CHANGED
|
@@ -86,6 +86,7 @@ message TicketSharingEmailRequest {
|
|
|
86
86
|
int32 ticketsAt = 43;
|
|
87
87
|
string orgName = 44;
|
|
88
88
|
string eventSubtitle = 45;
|
|
89
|
+
string ccAddress = 46;
|
|
89
90
|
}
|
|
90
91
|
|
|
91
92
|
/****************************************************************************************
|
|
@@ -234,6 +235,8 @@ message QueueOrderQRCodeEmailRequest {
|
|
|
234
235
|
repeated PromoterFeeObj promoterFeeList = 42;
|
|
235
236
|
int32 ticketsAt = 43;
|
|
236
237
|
string redirectURL = 44;
|
|
238
|
+
string appleWalletUrl = 45;
|
|
239
|
+
string googleWalletUrl = 46;
|
|
237
240
|
}
|
|
238
241
|
|
|
239
242
|
message QueueSeasonOrderReceiptEmailRequest {
|
package/src/proto/event.proto
CHANGED
|
@@ -51,6 +51,7 @@ message Event {
|
|
|
51
51
|
string duplicateFeeId = 43;
|
|
52
52
|
string qrCodeUrl = 44;
|
|
53
53
|
string web3Hash = 45;
|
|
54
|
+
string googleWalletClassId = 46;
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
message PublicEvent {
|
|
@@ -84,6 +85,8 @@ message PublicEvent {
|
|
|
84
85
|
string stub = 28;
|
|
85
86
|
EventSchedule schedule = 29;
|
|
86
87
|
repeated EventTaskTypes ticketTypes = 30;
|
|
88
|
+
bool isMultipleDays = 31;
|
|
89
|
+
repeated Performance performances = 32;
|
|
87
90
|
}
|
|
88
91
|
|
|
89
92
|
message EventTaskTypes{
|
|
@@ -128,6 +131,7 @@ message PublicEventDetails {
|
|
|
128
131
|
string stub = 29;
|
|
129
132
|
int32 highestPrice = 30;
|
|
130
133
|
repeated PublicTicketType ticketTypes = 31;
|
|
134
|
+
bool isMultipleDays = 32;
|
|
131
135
|
}
|
|
132
136
|
|
|
133
137
|
message PublicTicketType {
|
|
@@ -734,6 +738,18 @@ message ClearExpiredEventQrCodesResponse {
|
|
|
734
738
|
int32 cleared = 3;
|
|
735
739
|
}
|
|
736
740
|
|
|
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
|
+
|
|
737
753
|
message PosterImageUrl {
|
|
738
754
|
string original = 0;
|
|
739
755
|
string medium = 1;
|
|
@@ -751,6 +767,18 @@ message CheckStubUniquenessResponse {
|
|
|
751
767
|
bool isUnique = 3;
|
|
752
768
|
}
|
|
753
769
|
|
|
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
|
+
|
|
754
782
|
service EventService {
|
|
755
783
|
// Create
|
|
756
784
|
rpc createEvent(CreateEventRequest) returns (CreateEventResponse) {}
|
|
@@ -804,7 +832,9 @@ service EventService {
|
|
|
804
832
|
rpc updateTicketTierInventory(UpdateTicketTierInventoryRequest) returns (UpdateTicketTierInventoryResponse) {}
|
|
805
833
|
rpc deleteTicketHold(DeleteTicketHoldRequest) returns (DeleteTicketHoldResponse) {}
|
|
806
834
|
rpc clearExpiredEventQrCodes(ClearExpiredEventQrCodesRequest) returns (ClearExpiredEventQrCodesResponse) {}
|
|
835
|
+
rpc sendAnvilCloseEvent(SendAnvilCloseEventRequest) returns (SendAnvilCloseEventResponse) {}
|
|
807
836
|
rpc generateEventQRCode(GenerateEventQRCodeRequest) returns (GenerateEventQRCodeResponse) {}
|
|
808
837
|
rpc queryEventsAdmin(QueryEventsRequest) returns (QueryEventsResponse) {}
|
|
809
838
|
rpc checkStubUniqueness(CheckStubUniquenessRequest) returns (CheckStubUniquenessResponse) {}
|
|
839
|
+
rpc createGoogleWalletEventClass(CreateGoogleWalletEventClassRequest) returns (CreateGoogleWalletEventClassResponse) {}
|
|
810
840
|
}
|
|
@@ -14,7 +14,8 @@ message UploadFileRequest {
|
|
|
14
14
|
repeated File files = 2;
|
|
15
15
|
string userId = 3;
|
|
16
16
|
bool gzip = 4;
|
|
17
|
-
bool isMultiImage = 5;
|
|
17
|
+
bool isMultiImage = 5;
|
|
18
|
+
bool isCompressed = 6;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
message UploadFileResponse {
|
|
@@ -23,7 +24,21 @@ message UploadFileResponse {
|
|
|
23
24
|
repeated File files = 2;
|
|
24
25
|
}
|
|
25
26
|
|
|
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
|
+
|
|
26
40
|
|
|
27
41
|
service FileUploadService {
|
|
28
42
|
rpc uploadFile(UploadFileRequest) returns (UploadFileResponse) {}
|
|
43
|
+
rpc overwriteFile(OverwriteFileRequest) returns (OverwriteFileResponse) {}
|
|
29
44
|
}
|
package/src/proto/order.proto
CHANGED
|
@@ -48,6 +48,8 @@ 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;
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
message ParentOrderDetails {
|
|
@@ -56,6 +58,18 @@ message ParentOrderDetails {
|
|
|
56
58
|
string eventName = 2;
|
|
57
59
|
}
|
|
58
60
|
|
|
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
|
+
|
|
59
73
|
message OrderIntegrationResponse {
|
|
60
74
|
bool success = 0;
|
|
61
75
|
string title = 1;
|
|
@@ -155,6 +169,10 @@ message Refund {
|
|
|
155
169
|
string refundedBy = 2;
|
|
156
170
|
int32 refundedAmount = 3;
|
|
157
171
|
string refundReason =4;
|
|
172
|
+
int32 selloutFee = 5;
|
|
173
|
+
int32 stripeFee = 6;
|
|
174
|
+
int32 promoterFee = 7;
|
|
175
|
+
int32 salesTaxFee = 8;
|
|
158
176
|
}
|
|
159
177
|
|
|
160
178
|
message OrderCustomField {
|
|
@@ -678,6 +696,7 @@ message OrderAnalyticsQuery {
|
|
|
678
696
|
string interval = 6;
|
|
679
697
|
repeated string types = 7;
|
|
680
698
|
string seasonId = 8;
|
|
699
|
+
bool isEventCalendar = 9;
|
|
681
700
|
}
|
|
682
701
|
|
|
683
702
|
message QueryOrderAnalyticsRequest {
|
|
@@ -846,6 +865,63 @@ message QueryOrgDeletableResponse {
|
|
|
846
865
|
bool isOrgDeletable = 2;
|
|
847
866
|
}
|
|
848
867
|
|
|
868
|
+
/****************************************************************************************
|
|
869
|
+
Apple Wallet PassKit Device Registration
|
|
870
|
+
****************************************************************************************/
|
|
871
|
+
|
|
872
|
+
message RegisterPassKitDeviceRequest {
|
|
873
|
+
string spanContext = 0;
|
|
874
|
+
string deviceLibraryIdentifier = 1;
|
|
875
|
+
string pushToken = 2;
|
|
876
|
+
string passTypeIdentifier = 3;
|
|
877
|
+
string serialNumber = 4;
|
|
878
|
+
string orderId = 5;
|
|
879
|
+
string orgId = 6;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
message RegisterPassKitDeviceResponse {
|
|
883
|
+
StatusCode status = 0;
|
|
884
|
+
repeated Error errors = 1;
|
|
885
|
+
bool alreadyExists = 2;
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
message UnregisterPassKitDeviceRequest {
|
|
889
|
+
string spanContext = 0;
|
|
890
|
+
string deviceLibraryIdentifier = 1;
|
|
891
|
+
string passTypeIdentifier = 2;
|
|
892
|
+
string serialNumber = 3;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
message UnregisterPassKitDeviceResponse {
|
|
896
|
+
StatusCode status = 0;
|
|
897
|
+
repeated Error errors = 1;
|
|
898
|
+
bool deleted = 2;
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
message GetPassKitSerialNumbersRequest {
|
|
902
|
+
string spanContext = 0;
|
|
903
|
+
string deviceLibraryIdentifier = 1;
|
|
904
|
+
string passTypeIdentifier = 2;
|
|
905
|
+
int64 passesUpdatedSince = 3;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
message GetPassKitSerialNumbersResponse {
|
|
909
|
+
StatusCode status = 0;
|
|
910
|
+
repeated Error errors = 1;
|
|
911
|
+
repeated string serialNumbers = 2;
|
|
912
|
+
string lastUpdated = 3;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
message GetPassKitPushTokensRequest {
|
|
916
|
+
string spanContext = 0;
|
|
917
|
+
string orderId = 1;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
message GetPassKitPushTokensResponse {
|
|
921
|
+
StatusCode status = 0;
|
|
922
|
+
repeated Error errors = 1;
|
|
923
|
+
repeated string pushTokens = 2;
|
|
924
|
+
}
|
|
849
925
|
|
|
850
926
|
service OrderService {
|
|
851
927
|
// Create
|
|
@@ -897,4 +973,9 @@ service OrderService {
|
|
|
897
973
|
rpc orderIntegrationUpdate(OrderIntegrationUpdateRequest) returns(OrderIntegrationUpdateResponse){}
|
|
898
974
|
rpc emailTicketHolders(EmailTicketHolderRequest) returns(EmailTicketHolderResponse){}
|
|
899
975
|
rpc queryOrgDeletable(QueryOrgDeletableRequest) returns(QueryOrgDeletableResponse){}
|
|
976
|
+
// Apple Wallet PassKit Device Registration
|
|
977
|
+
rpc registerPassKitDevice(RegisterPassKitDeviceRequest) returns(RegisterPassKitDeviceResponse){}
|
|
978
|
+
rpc unregisterPassKitDevice(UnregisterPassKitDeviceRequest) returns(UnregisterPassKitDeviceResponse){}
|
|
979
|
+
rpc getPassKitSerialNumbers(GetPassKitSerialNumbersRequest) returns(GetPassKitSerialNumbersResponse){}
|
|
980
|
+
rpc getPassKitPushTokens(GetPassKitPushTokensRequest) returns(GetPassKitPushTokensResponse){}
|
|
900
981
|
}
|
package/src/schemas/Event.ts
CHANGED
package/src/schemas/Order.ts
CHANGED
|
@@ -24,6 +24,26 @@ const Refund = {
|
|
|
24
24
|
type: String,
|
|
25
25
|
required: false,
|
|
26
26
|
},
|
|
27
|
+
selloutFee: {
|
|
28
|
+
type: Number,
|
|
29
|
+
required: false,
|
|
30
|
+
default: null,
|
|
31
|
+
},
|
|
32
|
+
stripeFee: {
|
|
33
|
+
type: Number,
|
|
34
|
+
required: false,
|
|
35
|
+
default: null,
|
|
36
|
+
},
|
|
37
|
+
promoterFee: {
|
|
38
|
+
type: Number,
|
|
39
|
+
required: false,
|
|
40
|
+
default: null,
|
|
41
|
+
},
|
|
42
|
+
salesTaxFee: {
|
|
43
|
+
type: Number,
|
|
44
|
+
required: false,
|
|
45
|
+
default: null,
|
|
46
|
+
},
|
|
27
47
|
};
|
|
28
48
|
|
|
29
49
|
const Scan = {
|
|
@@ -218,7 +238,7 @@ const OrderTicket = {
|
|
|
218
238
|
guestTicket: {
|
|
219
239
|
type: Boolean,
|
|
220
240
|
required: false
|
|
221
|
-
},
|
|
241
|
+
},
|
|
222
242
|
isTicketSharing: {
|
|
223
243
|
type: Boolean,
|
|
224
244
|
required: false,
|
|
@@ -453,6 +473,42 @@ const Payment = {
|
|
|
453
473
|
billingAddress: BillingAddress,
|
|
454
474
|
}
|
|
455
475
|
|
|
476
|
+
const AppleWallet = {
|
|
477
|
+
url: {
|
|
478
|
+
type: String,
|
|
479
|
+
required: false,
|
|
480
|
+
default: null,
|
|
481
|
+
},
|
|
482
|
+
serialNumber: {
|
|
483
|
+
type: String,
|
|
484
|
+
required: false,
|
|
485
|
+
default: null,
|
|
486
|
+
},
|
|
487
|
+
authToken: {
|
|
488
|
+
type: String,
|
|
489
|
+
required: false,
|
|
490
|
+
default: null,
|
|
491
|
+
},
|
|
492
|
+
lastModified: {
|
|
493
|
+
type: Number,
|
|
494
|
+
required: false,
|
|
495
|
+
default: null,
|
|
496
|
+
},
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
const GoogleWallet = {
|
|
500
|
+
url: {
|
|
501
|
+
type: String,
|
|
502
|
+
required: false,
|
|
503
|
+
default: null,
|
|
504
|
+
},
|
|
505
|
+
objectId: {
|
|
506
|
+
type: String,
|
|
507
|
+
required: false,
|
|
508
|
+
default: null,
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
|
|
456
512
|
const orderIntegrationResponse = {
|
|
457
513
|
_id: {
|
|
458
514
|
type: String,
|
|
@@ -665,4 +721,6 @@ export default {
|
|
|
665
721
|
required: false,
|
|
666
722
|
default: null,
|
|
667
723
|
},
|
|
724
|
+
appleWallet: AppleWallet,
|
|
725
|
+
googleWallet: GoogleWallet,
|
|
668
726
|
};
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
};
|
|
@@ -14,6 +14,7 @@ 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';
|
|
17
18
|
// import { number } from "@hapi/joi";
|
|
18
19
|
|
|
19
20
|
interface IDuration {
|
|
@@ -978,7 +979,7 @@ export default {
|
|
|
978
979
|
},
|
|
979
980
|
|
|
980
981
|
// Returns start and end date
|
|
981
|
-
durationToUnix(duration: AnalyticsDurationEnum): IDuration {
|
|
982
|
+
durationToUnix(duration: AnalyticsDurationEnum, timezone?: string): IDuration {
|
|
982
983
|
type DurationEnumToDurationMap = Record<
|
|
983
984
|
AnalyticsDurationEnum,
|
|
984
985
|
() => IDuration
|
|
@@ -994,8 +995,8 @@ export default {
|
|
|
994
995
|
},
|
|
995
996
|
[AnalyticsDurationEnum.Today]: () => {
|
|
996
997
|
const duration: IDuration = {
|
|
997
|
-
startsAt: Time.getStartOfCurrentDay(),
|
|
998
|
-
endsAt: Time.getEndOfCurrentDay()
|
|
998
|
+
startsAt: timezone ? moment.tz(timezone).startOf("day").unix() : Time.getStartOfCurrentDay(),
|
|
999
|
+
endsAt: timezone ? moment.tz(timezone).endOf("day").unix() : Time.getEndOfCurrentDay()
|
|
999
1000
|
};
|
|
1000
1001
|
return duration;
|
|
1001
1002
|
},
|
package/src/utils/OrderUtil.ts
CHANGED
|
@@ -44,99 +44,6 @@ 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
|
-
|
|
140
47
|
const ticketTotal = order.tickets.reduce(
|
|
141
48
|
(cur, ticket) => cur + ticket.price,
|
|
142
49
|
0
|
|
@@ -224,17 +131,6 @@ export default {
|
|
|
224
131
|
upgrades: order?.upgrades
|
|
225
132
|
})
|
|
226
133
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
// order?.payments?.reduce((cur: number, payment: IPayment): number => {
|
|
230
|
-
// return cur + PaymentUtil.calculatePaymentSubtotal({
|
|
231
|
-
// tickets: order.tickets.filter(ticket => ticket.paymentId === payment._id),
|
|
232
|
-
// upgrades: order.upgrades.filter(upgrade => upgrade.paymentId === payment._id),
|
|
233
|
-
// fees: [],
|
|
234
|
-
// paymentMethodType: payment.paymentMethodType,
|
|
235
|
-
// })
|
|
236
|
-
// }, 0);
|
|
237
|
-
|
|
238
134
|
return subTotal || 0
|
|
239
135
|
},
|
|
240
136
|
|
package/src/utils/PaymentUtil.ts
CHANGED
|
@@ -793,21 +793,6 @@ 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
|
-
// });
|
|
811
796
|
filteredFees.forEach((fee) => {
|
|
812
797
|
const amount =
|
|
813
798
|
fee.type === FeeTypeEnum.Flat
|