@teacinema/contracts 1.4.2 → 1.5.0
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/proto/paths.d.ts +1 -0
- package/dist/proto/paths.js +1 -0
- package/gen/ts/payment.ts +77 -1
- package/gen/ts/refund.ts +65 -0
- package/package.json +1 -1
- package/proto/payment.proto +50 -0
- package/proto/refund.proto +27 -0
package/dist/proto/paths.d.ts
CHANGED
package/dist/proto/paths.js
CHANGED
|
@@ -14,4 +14,5 @@ exports.PROTO_PATHS = {
|
|
|
14
14
|
SEAT: (0, path_1.join)(__dirname, '../../proto/seat.proto'),
|
|
15
15
|
SCREENING: (0, path_1.join)(__dirname, '../../proto/screening.proto'),
|
|
16
16
|
PAYMENT: (0, path_1.join)(__dirname, '../../proto/payment.proto'),
|
|
17
|
+
REFUND: (0, path_1.join)(__dirname, '../../proto/refund.proto'),
|
|
17
18
|
};
|
package/gen/ts/payment.ts
CHANGED
|
@@ -31,12 +31,57 @@ export interface ProcessPaymentEventRequest {
|
|
|
31
31
|
providerMethodId: string;
|
|
32
32
|
cardFirst6: string;
|
|
33
33
|
cardLast4: string;
|
|
34
|
+
bank: string;
|
|
35
|
+
brand: string;
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
export interface ProcessPaymentEventResponse {
|
|
37
39
|
ok: boolean;
|
|
38
40
|
}
|
|
39
41
|
|
|
42
|
+
export interface GetUserPaymentMethodsRequest {
|
|
43
|
+
userId: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface GetUserPaymentMethodsResponse {
|
|
47
|
+
methods: PaymentMethodItem[];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface CreatePaymentMethodRequest {
|
|
51
|
+
userId: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface CreatePaymentMethodResponse {
|
|
55
|
+
id: string;
|
|
56
|
+
url: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface VerifyPaymentMethodRequest {
|
|
60
|
+
userId: string;
|
|
61
|
+
methodId: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface VerifyPaymentMethodResponse {
|
|
65
|
+
ok: boolean;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface DeletePaymentMethodRequest {
|
|
69
|
+
userId: string;
|
|
70
|
+
methodId: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface DeletePaymentMethodResponse {
|
|
74
|
+
ok: boolean;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface PaymentMethodItem {
|
|
78
|
+
id: string;
|
|
79
|
+
bank: string;
|
|
80
|
+
brand: string;
|
|
81
|
+
first6: string;
|
|
82
|
+
last4: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
40
85
|
export interface SeatInput {
|
|
41
86
|
seatId: string;
|
|
42
87
|
price: number;
|
|
@@ -48,6 +93,14 @@ export interface PaymentServiceClient {
|
|
|
48
93
|
createPayment(request: CreatePaymentRequest): Observable<CreatePaymentResponse>;
|
|
49
94
|
|
|
50
95
|
processPaymentEvent(request: ProcessPaymentEventRequest): Observable<ProcessPaymentEventResponse>;
|
|
96
|
+
|
|
97
|
+
getUserPaymentMethods(request: GetUserPaymentMethodsRequest): Observable<GetUserPaymentMethodsResponse>;
|
|
98
|
+
|
|
99
|
+
createPaymentMethod(request: CreatePaymentMethodRequest): Observable<CreatePaymentMethodResponse>;
|
|
100
|
+
|
|
101
|
+
verifyPaymentMethod(request: VerifyPaymentMethodRequest): Observable<VerifyPaymentMethodResponse>;
|
|
102
|
+
|
|
103
|
+
deletePaymentMethod(request: DeletePaymentMethodRequest): Observable<DeletePaymentMethodResponse>;
|
|
51
104
|
}
|
|
52
105
|
|
|
53
106
|
export interface PaymentServiceController {
|
|
@@ -58,11 +111,34 @@ export interface PaymentServiceController {
|
|
|
58
111
|
processPaymentEvent(
|
|
59
112
|
request: ProcessPaymentEventRequest,
|
|
60
113
|
): Promise<ProcessPaymentEventResponse> | Observable<ProcessPaymentEventResponse> | ProcessPaymentEventResponse;
|
|
114
|
+
|
|
115
|
+
getUserPaymentMethods(
|
|
116
|
+
request: GetUserPaymentMethodsRequest,
|
|
117
|
+
): Promise<GetUserPaymentMethodsResponse> | Observable<GetUserPaymentMethodsResponse> | GetUserPaymentMethodsResponse;
|
|
118
|
+
|
|
119
|
+
createPaymentMethod(
|
|
120
|
+
request: CreatePaymentMethodRequest,
|
|
121
|
+
): Promise<CreatePaymentMethodResponse> | Observable<CreatePaymentMethodResponse> | CreatePaymentMethodResponse;
|
|
122
|
+
|
|
123
|
+
verifyPaymentMethod(
|
|
124
|
+
request: VerifyPaymentMethodRequest,
|
|
125
|
+
): Promise<VerifyPaymentMethodResponse> | Observable<VerifyPaymentMethodResponse> | VerifyPaymentMethodResponse;
|
|
126
|
+
|
|
127
|
+
deletePaymentMethod(
|
|
128
|
+
request: DeletePaymentMethodRequest,
|
|
129
|
+
): Promise<DeletePaymentMethodResponse> | Observable<DeletePaymentMethodResponse> | DeletePaymentMethodResponse;
|
|
61
130
|
}
|
|
62
131
|
|
|
63
132
|
export function PaymentServiceControllerMethods() {
|
|
64
133
|
return function (constructor: Function) {
|
|
65
|
-
const grpcMethods: string[] = [
|
|
134
|
+
const grpcMethods: string[] = [
|
|
135
|
+
"createPayment",
|
|
136
|
+
"processPaymentEvent",
|
|
137
|
+
"getUserPaymentMethods",
|
|
138
|
+
"createPaymentMethod",
|
|
139
|
+
"verifyPaymentMethod",
|
|
140
|
+
"deletePaymentMethod",
|
|
141
|
+
];
|
|
66
142
|
for (const method of grpcMethods) {
|
|
67
143
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
68
144
|
GrpcMethod("PaymentService", method)(constructor.prototype[method], method, descriptor);
|
package/gen/ts/refund.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.8.3
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: refund.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "refund.v1";
|
|
12
|
+
|
|
13
|
+
export interface CreateRefundRequest {
|
|
14
|
+
bookingId: string;
|
|
15
|
+
userId: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface CreateRefundResponse {
|
|
19
|
+
ok: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface ProcessRefundEventRequest {
|
|
23
|
+
event: string;
|
|
24
|
+
providerRefundId: string;
|
|
25
|
+
status: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface ProcessRefundEventResponse {
|
|
29
|
+
ok: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const REFUND_V1_PACKAGE_NAME = "refund.v1";
|
|
33
|
+
|
|
34
|
+
export interface RefundServiceClient {
|
|
35
|
+
createRefund(request: CreateRefundRequest): Observable<CreateRefundResponse>;
|
|
36
|
+
|
|
37
|
+
processRefundEvent(request: ProcessRefundEventRequest): Observable<ProcessRefundEventResponse>;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface RefundServiceController {
|
|
41
|
+
createRefund(
|
|
42
|
+
request: CreateRefundRequest,
|
|
43
|
+
): Promise<CreateRefundResponse> | Observable<CreateRefundResponse> | CreateRefundResponse;
|
|
44
|
+
|
|
45
|
+
processRefundEvent(
|
|
46
|
+
request: ProcessRefundEventRequest,
|
|
47
|
+
): Promise<ProcessRefundEventResponse> | Observable<ProcessRefundEventResponse> | ProcessRefundEventResponse;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function RefundServiceControllerMethods() {
|
|
51
|
+
return function (constructor: Function) {
|
|
52
|
+
const grpcMethods: string[] = ["createRefund", "processRefundEvent"];
|
|
53
|
+
for (const method of grpcMethods) {
|
|
54
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
55
|
+
GrpcMethod("RefundService", method)(constructor.prototype[method], method, descriptor);
|
|
56
|
+
}
|
|
57
|
+
const grpcStreamMethods: string[] = [];
|
|
58
|
+
for (const method of grpcStreamMethods) {
|
|
59
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
60
|
+
GrpcStreamMethod("RefundService", method)(constructor.prototype[method], method, descriptor);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const REFUND_SERVICE_NAME = "RefundService";
|
package/package.json
CHANGED
package/proto/payment.proto
CHANGED
|
@@ -5,6 +5,11 @@ package payment.v1;
|
|
|
5
5
|
service PaymentService {
|
|
6
6
|
rpc CreatePayment (CreatePaymentRequest) returns (CreatePaymentResponse);
|
|
7
7
|
rpc ProcessPaymentEvent (ProcessPaymentEventRequest) returns (ProcessPaymentEventResponse);
|
|
8
|
+
|
|
9
|
+
rpc GetUserPaymentMethods (GetUserPaymentMethodsRequest) returns (GetUserPaymentMethodsResponse);
|
|
10
|
+
rpc CreatePaymentMethod (CreatePaymentMethodRequest) returns (CreatePaymentMethodResponse);
|
|
11
|
+
rpc VerifyPaymentMethod (VerifyPaymentMethodRequest) returns (VerifyPaymentMethodResponse);
|
|
12
|
+
rpc DeletePaymentMethod (DeletePaymentMethodRequest) returns (DeletePaymentMethodResponse);
|
|
8
13
|
}
|
|
9
14
|
|
|
10
15
|
message CreatePaymentRequest {
|
|
@@ -28,12 +33,57 @@ message ProcessPaymentEventRequest {
|
|
|
28
33
|
string provider_method_id = 6;
|
|
29
34
|
string card_first6 = 7;
|
|
30
35
|
string card_last4 = 8;
|
|
36
|
+
string bank = 9;
|
|
37
|
+
string brand = 10;
|
|
31
38
|
}
|
|
32
39
|
|
|
33
40
|
message ProcessPaymentEventResponse {
|
|
34
41
|
bool ok = 1;
|
|
35
42
|
}
|
|
36
43
|
|
|
44
|
+
message GetUserPaymentMethodsRequest {
|
|
45
|
+
string user_id = 1;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
message GetUserPaymentMethodsResponse {
|
|
49
|
+
repeated PaymentMethodItem methods = 1;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
message CreatePaymentMethodRequest {
|
|
53
|
+
string user_id = 1;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
message CreatePaymentMethodResponse {
|
|
57
|
+
string id = 1;
|
|
58
|
+
string url = 2;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
message VerifyPaymentMethodRequest {
|
|
62
|
+
string user_id = 1;
|
|
63
|
+
string method_id = 2;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
message VerifyPaymentMethodResponse {
|
|
67
|
+
bool ok = 1;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
message DeletePaymentMethodRequest {
|
|
71
|
+
string user_id = 1;
|
|
72
|
+
string method_id = 2;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
message DeletePaymentMethodResponse {
|
|
76
|
+
bool ok = 1;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
message PaymentMethodItem {
|
|
80
|
+
string id = 1;
|
|
81
|
+
string bank = 2;
|
|
82
|
+
string brand = 3;
|
|
83
|
+
string first6 = 4;
|
|
84
|
+
string last4 = 5;
|
|
85
|
+
}
|
|
86
|
+
|
|
37
87
|
message SeatInput {
|
|
38
88
|
string seat_id = 1;
|
|
39
89
|
int32 price = 2;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package refund.v1;
|
|
4
|
+
|
|
5
|
+
service RefundService {
|
|
6
|
+
rpc CreateRefund(CreateRefundRequest) returns (CreateRefundResponse);
|
|
7
|
+
rpc ProcessRefundEvent(ProcessRefundEventRequest) returns (ProcessRefundEventResponse);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
message CreateRefundRequest {
|
|
11
|
+
string booking_id = 1;
|
|
12
|
+
string user_id = 2;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
message CreateRefundResponse {
|
|
16
|
+
bool ok = 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message ProcessRefundEventRequest {
|
|
20
|
+
string event = 1;
|
|
21
|
+
string provider_refund_id = 2;
|
|
22
|
+
string status = 3;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
message ProcessRefundEventResponse {
|
|
26
|
+
bool ok = 1;
|
|
27
|
+
}
|