@sellout/models 0.0.427 → 0.0.429
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/mutations/createTag.mutation.d.ts +2 -0
- package/.dist/graphql/mutations/createTag.mutation.js +15 -0
- package/.dist/graphql/mutations/createTag.mutation.js.map +1 -0
- package/.dist/graphql/mutations/deleteTag.mutation.d.ts +2 -0
- package/.dist/graphql/mutations/deleteTag.mutation.js +10 -0
- package/.dist/graphql/mutations/deleteTag.mutation.js.map +1 -0
- package/.dist/graphql/mutations/updateEvent.mutation.js +1 -0
- package/.dist/graphql/mutations/updateEvent.mutation.js.map +1 -1
- package/.dist/graphql/mutations/updateTag.mutation.d.ts +2 -0
- package/.dist/graphql/mutations/updateTag.mutation.js +15 -0
- package/.dist/graphql/mutations/updateTag.mutation.js.map +1 -0
- package/.dist/graphql/queries/event.query.js +1 -0
- package/.dist/graphql/queries/event.query.js.map +1 -1
- package/.dist/graphql/queries/events.query.js +1 -0
- package/.dist/graphql/queries/events.query.js.map +1 -1
- package/.dist/graphql/queries/eventsListOptimized.query.js +1 -0
- package/.dist/graphql/queries/eventsListOptimized.query.js.map +1 -1
- package/.dist/graphql/queries/tags.query.d.ts +2 -0
- package/.dist/graphql/queries/tags.query.js +15 -0
- package/.dist/graphql/queries/tags.query.js.map +1 -0
- package/.dist/interfaces/IDispute.d.ts +35 -0
- package/.dist/interfaces/IDispute.js +24 -0
- package/.dist/interfaces/IDispute.js.map +1 -0
- package/.dist/interfaces/IEvent.d.ts +1 -0
- package/.dist/interfaces/ITag.d.ts +6 -0
- package/.dist/interfaces/ITag.js +3 -0
- package/.dist/interfaces/ITag.js.map +1 -0
- package/.dist/schemas/Dispute.d.ts +85 -0
- package/.dist/schemas/Dispute.js +91 -0
- package/.dist/schemas/Dispute.js.map +1 -0
- 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/Tag.d.ts +20 -0
- package/.dist/schemas/Tag.js +26 -0
- package/.dist/schemas/Tag.js.map +1 -0
- package/.dist/sellout-proto.js +16708 -12293
- package/package.json +3 -3
- package/src/graphql/mutations/createTag.mutation.ts +14 -0
- package/src/graphql/mutations/deleteTag.mutation.ts +9 -0
- package/src/graphql/mutations/updateEvent.mutation.ts +1 -0
- package/src/graphql/mutations/updateTag.mutation.ts +14 -0
- package/src/graphql/queries/event.query.ts +1 -0
- package/src/graphql/queries/events.query.ts +1 -0
- package/src/graphql/queries/eventsListOptimized.query.ts +1 -0
- package/src/graphql/queries/tags.query.ts +14 -0
- package/src/interfaces/IDispute.ts +45 -0
- package/src/interfaces/IEvent.ts +1 -0
- package/src/interfaces/ITag.ts +6 -0
- package/src/proto/email.proto +20 -0
- package/src/proto/event.proto +58 -0
- package/src/proto/order.proto +30 -0
- package/src/proto/organization.proto +13 -1
- package/src/schemas/Dispute.ts +86 -0
- package/src/schemas/Event.ts +5 -0
- package/src/schemas/Tag.ts +21 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sellout/models",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.429",
|
|
4
4
|
"description": "Sellout.io models",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@apollo/client": "^3.9.6",
|
|
20
20
|
"@hapi/joi": "^17.1.1",
|
|
21
|
-
"@sellout/utils": "^0.0.
|
|
21
|
+
"@sellout/utils": "^0.0.429",
|
|
22
22
|
"@types/hapi__joi": "^16.0.1",
|
|
23
23
|
"@types/shortid": "^0.0.29",
|
|
24
24
|
"@types/zen-observable": "^0.8.7",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"protobufjs": "^6.11.2",
|
|
34
34
|
"typescript": "^4.9.5"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "29265758859924c2be553ccb66ee046872964ba7"
|
|
37
37
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export enum DisputeStatusEnum {
|
|
2
|
+
WarningNeedsResponse = 'warning_needs_response',
|
|
3
|
+
WarningUnderReview = 'warning_under_review',
|
|
4
|
+
WarningClosed = 'warning_closed',
|
|
5
|
+
NeedsResponse = 'needs_response',
|
|
6
|
+
UnderReview = 'under_review',
|
|
7
|
+
Won = 'won',
|
|
8
|
+
Lost = 'lost',
|
|
9
|
+
Prevented = 'prevented',
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const CLOSED_DISPUTE_STATUSES: string[] = [
|
|
13
|
+
DisputeStatusEnum.Won,
|
|
14
|
+
DisputeStatusEnum.Lost,
|
|
15
|
+
DisputeStatusEnum.WarningClosed,
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
export function isInquiryStatus(status: string): boolean {
|
|
19
|
+
return typeof status === 'string' && status.startsWith('warning_');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface IDisputeEmailedAt {
|
|
23
|
+
created?: number;
|
|
24
|
+
closed?: number;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default interface IDispute {
|
|
28
|
+
_id?: string;
|
|
29
|
+
stripeDisputeId: string;
|
|
30
|
+
stripeAccountId?: string;
|
|
31
|
+
stripeChargeId?: string;
|
|
32
|
+
paymentIntentId?: string;
|
|
33
|
+
orgId?: string;
|
|
34
|
+
orderId?: string;
|
|
35
|
+
amount?: number;
|
|
36
|
+
currency?: string;
|
|
37
|
+
reason?: string;
|
|
38
|
+
status?: string;
|
|
39
|
+
isInquiry?: boolean;
|
|
40
|
+
dueBy?: number;
|
|
41
|
+
emailedAt?: IDisputeEmailedAt;
|
|
42
|
+
processedEventIds?: string[];
|
|
43
|
+
createdAt?: number;
|
|
44
|
+
updatedAt?: number;
|
|
45
|
+
}
|
package/src/interfaces/IEvent.ts
CHANGED
package/src/proto/email.proto
CHANGED
|
@@ -429,6 +429,25 @@ message orderExportIssueEmailRequest {
|
|
|
429
429
|
repeated dayIdsTimeObj dayIdsTime = 14;
|
|
430
430
|
}
|
|
431
431
|
|
|
432
|
+
message QueueChargebackEmailRequest {
|
|
433
|
+
string spanContext = 1;
|
|
434
|
+
string toAddress = 2;
|
|
435
|
+
string orderId = 3;
|
|
436
|
+
string eventName = 4;
|
|
437
|
+
int32 amount = 5;
|
|
438
|
+
string currency = 6;
|
|
439
|
+
string reason = 7;
|
|
440
|
+
string status = 8;
|
|
441
|
+
string customerName = 9;
|
|
442
|
+
int32 dueBy = 10;
|
|
443
|
+
bool isClosed = 11;
|
|
444
|
+
string ordersUrl = 12;
|
|
445
|
+
string orgName = 13;
|
|
446
|
+
string disputeId = 14;
|
|
447
|
+
bool livemode = 15;
|
|
448
|
+
repeated string ccAddresses = 16;
|
|
449
|
+
}
|
|
450
|
+
|
|
432
451
|
service EmailService {
|
|
433
452
|
// User
|
|
434
453
|
rpc queueUserWelcomeEmail (QueueUserWelcomeEmailRequest) returns (google.protobuf.Empty) {}
|
|
@@ -452,5 +471,6 @@ service EmailService {
|
|
|
452
471
|
rpc immediateNotifyEmail (QueueOrderQRCodeEmailRequest) returns (google.protobuf.Empty) {}
|
|
453
472
|
rpc emailTicketHolder (emailTicketHolderRequest) returns (google.protobuf.Empty) {}
|
|
454
473
|
rpc orderExportIssueEmail (orderExportIssueEmailRequest) returns (google.protobuf.Empty) {}
|
|
474
|
+
rpc queueChargebackEmail (QueueChargebackEmailRequest) returns (google.protobuf.Empty) {}
|
|
455
475
|
|
|
456
476
|
}
|
package/src/proto/event.proto
CHANGED
|
@@ -54,6 +54,7 @@ message Event {
|
|
|
54
54
|
string googleWalletClassId = 46;
|
|
55
55
|
bool isEventTegIntegration = 47;
|
|
56
56
|
repeated string additionalPhotos = 48;
|
|
57
|
+
repeated string tagIds = 49;
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
message PublicEvent {
|
|
@@ -89,6 +90,7 @@ message PublicEvent {
|
|
|
89
90
|
repeated EventTaskTypes ticketTypes = 30;
|
|
90
91
|
bool isMultipleDays = 31;
|
|
91
92
|
repeated Performance performances = 32;
|
|
93
|
+
repeated Tag tags = 33;
|
|
92
94
|
}
|
|
93
95
|
|
|
94
96
|
message EventTaskTypes{
|
|
@@ -762,6 +764,56 @@ message PosterImageUrl {
|
|
|
762
764
|
string small = 2;
|
|
763
765
|
}
|
|
764
766
|
|
|
767
|
+
message Tag {
|
|
768
|
+
string _id = 1;
|
|
769
|
+
string name = 2;
|
|
770
|
+
int32 createdAt = 3;
|
|
771
|
+
int32 updatedAt = 4;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
message CreateTagRequest {
|
|
775
|
+
string spanContext = 0;
|
|
776
|
+
Tag tag = 1;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
message CreateTagResponse {
|
|
780
|
+
StatusCode status = 0;
|
|
781
|
+
repeated Error errors = 1;
|
|
782
|
+
Tag tag = 2;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
message UpdateTagRequest {
|
|
786
|
+
string spanContext = 0;
|
|
787
|
+
Tag tag = 1;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
message UpdateTagResponse {
|
|
791
|
+
StatusCode status = 0;
|
|
792
|
+
repeated Error errors = 1;
|
|
793
|
+
Tag tag = 2;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
message DeleteTagRequest {
|
|
797
|
+
string spanContext = 0;
|
|
798
|
+
string tagId = 1;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
message DeleteTagResponse {
|
|
802
|
+
StatusCode status = 0;
|
|
803
|
+
repeated Error errors = 1;
|
|
804
|
+
bool success = 2;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
message ListTagsRequest {
|
|
808
|
+
string spanContext = 0;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
message ListTagsResponse {
|
|
812
|
+
StatusCode status = 0;
|
|
813
|
+
repeated Error errors = 1;
|
|
814
|
+
repeated Tag tags = 2;
|
|
815
|
+
}
|
|
816
|
+
|
|
765
817
|
message CheckStubUniquenessRequest {
|
|
766
818
|
string spanContext = 1;
|
|
767
819
|
string stub = 2;
|
|
@@ -940,4 +992,10 @@ service EventService {
|
|
|
940
992
|
rpc incrementEventTicketScanned(IncrementEventTicketScannedRequest) returns (IncrementEventTicketScannedResponse) {}
|
|
941
993
|
// Change Event Date
|
|
942
994
|
rpc changeEventDate(ChangeEventDateRequest) returns (ChangeEventDateResponse) {}
|
|
995
|
+
|
|
996
|
+
// Tags
|
|
997
|
+
rpc createTag(CreateTagRequest) returns (CreateTagResponse) {}
|
|
998
|
+
rpc updateTag(UpdateTagRequest) returns (UpdateTagResponse) {}
|
|
999
|
+
rpc deleteTag(DeleteTagRequest) returns (DeleteTagResponse) {}
|
|
1000
|
+
rpc listTags(ListTagsRequest) returns (ListTagsResponse) {}
|
|
943
1001
|
}
|
package/src/proto/order.proto
CHANGED
|
@@ -1106,6 +1106,34 @@ message FindMobileCheckInOrderResponse {
|
|
|
1106
1106
|
MobileCheckInOrder order = 3;
|
|
1107
1107
|
}
|
|
1108
1108
|
|
|
1109
|
+
message ProcessStripeDisputeRequest {
|
|
1110
|
+
string spanContext = 0;
|
|
1111
|
+
// Stripe's event id, used to make redeliveries a no-op.
|
|
1112
|
+
string eventId = 1;
|
|
1113
|
+
// charge.dispute.created or charge.dispute.closed.
|
|
1114
|
+
string eventType = 2;
|
|
1115
|
+
// The connected account the dispute was raised on. Empty for platform charges.
|
|
1116
|
+
string stripeAccountId = 3;
|
|
1117
|
+
string disputeId = 4;
|
|
1118
|
+
string chargeId = 5;
|
|
1119
|
+
string paymentIntentId = 6;
|
|
1120
|
+
// The disputed amount, which can differ from the order total.
|
|
1121
|
+
int32 amount = 7;
|
|
1122
|
+
string currency = 8;
|
|
1123
|
+
string reason = 9;
|
|
1124
|
+
string status = 10;
|
|
1125
|
+
// Deadline for responding to the issuer.
|
|
1126
|
+
int32 dueBy = 11;
|
|
1127
|
+
// A production Connect endpoint receives test events too - only live ones
|
|
1128
|
+
// should reach a promoter's inbox.
|
|
1129
|
+
bool livemode = 12;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
message ProcessStripeDisputeResponse {
|
|
1133
|
+
StatusCode status = 0;
|
|
1134
|
+
repeated Error errors = 1;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1109
1137
|
service OrderService {
|
|
1110
1138
|
// Create
|
|
1111
1139
|
rpc createOrder(CreateOrderRequest) returns (CreateOrderResponse) {}
|
|
@@ -1173,4 +1201,6 @@ service OrderService {
|
|
|
1173
1201
|
// On-Demand Wallet Pass Generation
|
|
1174
1202
|
rpc generateWalletPass(GenerateWalletPassRequest) returns(GenerateWalletPassResponse){}
|
|
1175
1203
|
rpc resendTicketShareOffer(ResendTicketShareOfferRequest) returns(UpdateOrderResponse){}
|
|
1204
|
+
// Stripe Disputes (Chargebacks)
|
|
1205
|
+
rpc processStripeDispute(ProcessStripeDisputeRequest) returns(ProcessStripeDisputeResponse){}
|
|
1176
1206
|
}
|
|
@@ -123,6 +123,17 @@ message FindOrganizationResponse {
|
|
|
123
123
|
Organization organization = 2;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
message FindOrganizationByStripeIdRequest {
|
|
127
|
+
string spanContext = 0;
|
|
128
|
+
string stripeId = 1;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
message FindOrganizationByStripeIdResponse {
|
|
132
|
+
StatusCode status = 0;
|
|
133
|
+
repeated Error errors = 1;
|
|
134
|
+
Organization organization = 2;
|
|
135
|
+
}
|
|
136
|
+
|
|
126
137
|
// Delete Organization
|
|
127
138
|
message DeleteOrganizationRequest {
|
|
128
139
|
string spanContext = 0;
|
|
@@ -194,7 +205,8 @@ service OrganizationService {
|
|
|
194
205
|
rpc updateOrganization(UpdateOrganizationRequest) returns (UpdateOrganizationResponse) {}
|
|
195
206
|
rpc updateOrgEmailWebhook(UpdateOrgEmailWebhookRequest) returns (UpdateOrgEmailWebhookResponse) {}
|
|
196
207
|
// Find
|
|
197
|
-
rpc findOrganization(FindOrganizationRequest) returns (FindOrganizationResponse) {}
|
|
208
|
+
rpc findOrganization(FindOrganizationRequest) returns (FindOrganizationResponse) {}
|
|
209
|
+
rpc findOrganizationByStripeId(FindOrganizationByStripeIdRequest) returns (FindOrganizationByStripeIdResponse) {}
|
|
198
210
|
// Delete
|
|
199
211
|
rpc deleteOrganization(DeleteOrganizationRequest) returns (DeleteOrganizationResponse) {}
|
|
200
212
|
// Remove Stripe ID
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import shortid from 'shortid';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
_id: {
|
|
5
|
+
type: String,
|
|
6
|
+
default: shortid.generate,
|
|
7
|
+
},
|
|
8
|
+
stripeDisputeId: {
|
|
9
|
+
type: String,
|
|
10
|
+
required: true,
|
|
11
|
+
},
|
|
12
|
+
stripeAccountId: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: false,
|
|
15
|
+
},
|
|
16
|
+
stripeChargeId: {
|
|
17
|
+
type: String,
|
|
18
|
+
required: false,
|
|
19
|
+
index: true,
|
|
20
|
+
},
|
|
21
|
+
paymentIntentId: {
|
|
22
|
+
type: String,
|
|
23
|
+
required: false,
|
|
24
|
+
},
|
|
25
|
+
orgId: {
|
|
26
|
+
type: String,
|
|
27
|
+
required: false,
|
|
28
|
+
index: true,
|
|
29
|
+
},
|
|
30
|
+
orderId: {
|
|
31
|
+
type: String,
|
|
32
|
+
required: false,
|
|
33
|
+
index: true,
|
|
34
|
+
},
|
|
35
|
+
amount: {
|
|
36
|
+
type: Number,
|
|
37
|
+
required: false,
|
|
38
|
+
},
|
|
39
|
+
currency: {
|
|
40
|
+
type: String,
|
|
41
|
+
required: false,
|
|
42
|
+
},
|
|
43
|
+
reason: {
|
|
44
|
+
type: String,
|
|
45
|
+
required: false,
|
|
46
|
+
},
|
|
47
|
+
status: {
|
|
48
|
+
type: String,
|
|
49
|
+
required: false,
|
|
50
|
+
},
|
|
51
|
+
isInquiry: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
required: false,
|
|
54
|
+
default: false,
|
|
55
|
+
},
|
|
56
|
+
dueBy: {
|
|
57
|
+
type: Number,
|
|
58
|
+
required: false,
|
|
59
|
+
default: null,
|
|
60
|
+
},
|
|
61
|
+
emailedAt: {
|
|
62
|
+
created: {
|
|
63
|
+
type: Number,
|
|
64
|
+
required: false,
|
|
65
|
+
default: null,
|
|
66
|
+
},
|
|
67
|
+
closed: {
|
|
68
|
+
type: Number,
|
|
69
|
+
required: false,
|
|
70
|
+
default: null,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
processedEventIds: {
|
|
74
|
+
type: [String],
|
|
75
|
+
required: false,
|
|
76
|
+
default: [],
|
|
77
|
+
},
|
|
78
|
+
createdAt: {
|
|
79
|
+
type: Number,
|
|
80
|
+
required: false,
|
|
81
|
+
},
|
|
82
|
+
updatedAt: {
|
|
83
|
+
type: Number,
|
|
84
|
+
required: false,
|
|
85
|
+
},
|
|
86
|
+
};
|
package/src/schemas/Event.ts
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import shortid from 'shortid';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
_id: {
|
|
5
|
+
type: String,
|
|
6
|
+
default: shortid.generate,
|
|
7
|
+
},
|
|
8
|
+
name: {
|
|
9
|
+
type: String,
|
|
10
|
+
required: true,
|
|
11
|
+
trim: true,
|
|
12
|
+
},
|
|
13
|
+
createdAt: {
|
|
14
|
+
type: Number,
|
|
15
|
+
required: false,
|
|
16
|
+
},
|
|
17
|
+
updatedAt: {
|
|
18
|
+
type: Number,
|
|
19
|
+
required: false,
|
|
20
|
+
},
|
|
21
|
+
};
|