@sellout/models 0.0.428 → 0.0.430
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/sendRegistrationEmailCode.mutation.d.ts +2 -0
- package/.dist/graphql/mutations/sendRegistrationEmailCode.mutation.js +10 -0
- package/.dist/graphql/mutations/sendRegistrationEmailCode.mutation.js.map +1 -0
- package/.dist/graphql/mutations/verifyRegistrationEmailCode.mutation.d.ts +2 -0
- package/.dist/graphql/mutations/verifyRegistrationEmailCode.mutation.js +10 -0
- package/.dist/graphql/mutations/verifyRegistrationEmailCode.mutation.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/IEmailVerification.d.ts +8 -0
- package/.dist/interfaces/IEmailVerification.js +3 -0
- package/.dist/interfaces/IEmailVerification.js.map +1 -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/Dispute.d.ts +85 -0
- package/.dist/schemas/Dispute.js +91 -0
- package/.dist/schemas/Dispute.js.map +1 -0
- package/.dist/sellout-proto.js +4817 -1324
- package/package.json +3 -3
- package/src/graphql/mutations/sendRegistrationEmailCode.mutation.ts +10 -0
- package/src/graphql/mutations/verifyRegistrationEmailCode.mutation.ts +10 -0
- package/src/interfaces/IDispute.ts +45 -0
- package/src/interfaces/IEmailVerification.ts +8 -0
- package/src/interfaces/ITask.ts +1 -0
- package/src/proto/email.proto +20 -0
- package/src/proto/order.proto +30 -0
- package/src/proto/organization.proto +13 -1
- package/src/proto/user.proto +35 -0
- package/src/schemas/Dispute.ts +86 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sellout/models",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.430",
|
|
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.430",
|
|
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": "720eb3c460b6973e1d5daf7ce7775077e52bfbb0"
|
|
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/ITask.ts
CHANGED
|
@@ -12,6 +12,7 @@ export enum TaskTypes {
|
|
|
12
12
|
SendAnvilCloseEvent = 'SendAnvilCloseEvent',
|
|
13
13
|
SendEmailTicketHolders = 'SendEmailTicketHolders',
|
|
14
14
|
ProcessTicketShareLifecycle = 'ProcessTicketShareLifecycle',
|
|
15
|
+
ClearExpiredEmailVerifications = 'ClearExpiredEmailVerifications',
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export default interface ITask {
|
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/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
|
package/src/proto/user.proto
CHANGED
|
@@ -67,6 +67,38 @@ message VerifyUserEmailResponse {
|
|
|
67
67
|
bool emailVerified = 2;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
message SendRegistrationEmailCodeRequest {
|
|
71
|
+
string spanContext = 1;
|
|
72
|
+
string email = 2;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
message SendRegistrationEmailCodeResponse {
|
|
76
|
+
StatusCode status = 1;
|
|
77
|
+
repeated Error errors = 2;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
message VerifyRegistrationEmailCodeRequest {
|
|
81
|
+
string spanContext = 1;
|
|
82
|
+
string email = 2;
|
|
83
|
+
string code = 3;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
message VerifyRegistrationEmailCodeResponse {
|
|
87
|
+
StatusCode status = 1;
|
|
88
|
+
repeated Error errors = 2;
|
|
89
|
+
bool emailVerified = 3;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
message ClearExpiredRegistrationEmailCodesRequest {
|
|
93
|
+
string spanContext = 1;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
message ClearExpiredRegistrationEmailCodesResponse {
|
|
97
|
+
StatusCode status = 1;
|
|
98
|
+
repeated Error errors = 2;
|
|
99
|
+
int32 deletedCount = 3;
|
|
100
|
+
}
|
|
101
|
+
|
|
70
102
|
//Verify Phone
|
|
71
103
|
message SendUserPhoneVerificationRequest {
|
|
72
104
|
string spanContext = 1;
|
|
@@ -460,6 +492,9 @@ service UserService {
|
|
|
460
492
|
// Verify
|
|
461
493
|
rpc sendUserEmailVerification(SendUserEmailVerificationRequest) returns (SendUserEmailVerificationResponse) {}
|
|
462
494
|
rpc verifyUserEmail(VerifyUserEmailRequest) returns (VerifyUserEmailResponse) {}
|
|
495
|
+
rpc sendRegistrationEmailCode(SendRegistrationEmailCodeRequest) returns (SendRegistrationEmailCodeResponse) {}
|
|
496
|
+
rpc verifyRegistrationEmailCode(VerifyRegistrationEmailCodeRequest) returns (VerifyRegistrationEmailCodeResponse) {}
|
|
497
|
+
rpc clearExpiredRegistrationEmailCodes(ClearExpiredRegistrationEmailCodesRequest) returns (ClearExpiredRegistrationEmailCodesResponse) {}
|
|
463
498
|
rpc sendUserPhoneVerification(SendUserPhoneVerificationRequest) returns (SendUserPhoneVerificationResponse) {}
|
|
464
499
|
rpc verifyUserPhoneNumber(VerifyUserPhoneNumberRequest) returns (VerifyUserPhoneNumberResponse) {}
|
|
465
500
|
// Auth
|
|
@@ -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
|
+
};
|