@dvltcinema/contracts 1.3.5 → 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 +2 -0
- package/dist/proto/paths.js +2 -0
- package/gen/ts/payment.ts +154 -0
- package/gen/ts/refund.ts +65 -0
- package/package.json +1 -1
- package/proto/payment.proto +93 -0
- package/proto/refund.proto +27 -0
package/dist/proto/paths.d.ts
CHANGED
package/dist/proto/paths.js
CHANGED
|
@@ -13,4 +13,6 @@ exports.PROTO_PATHS = {
|
|
|
13
13
|
HALL: (0, node_path_1.join)(__dirname, "../../proto/hall.proto"),
|
|
14
14
|
SEAT: (0, node_path_1.join)(__dirname, "../../proto/seat.proto"),
|
|
15
15
|
SCREENING: (0, node_path_1.join)(__dirname, "../../proto/screening.proto"),
|
|
16
|
+
PAYMENT: (0, node_path_1.join)(__dirname, "../../proto/payment.proto"),
|
|
17
|
+
REFUND: (0, node_path_1.join)(__dirname, "../../proto/refund.proto"),
|
|
16
18
|
};
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.5
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: payment.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "payment.v1";
|
|
12
|
+
|
|
13
|
+
export interface CreatePaymentRequest {
|
|
14
|
+
userId: string;
|
|
15
|
+
screeningId: string;
|
|
16
|
+
seats: SeatInput[];
|
|
17
|
+
paymentMethodId?: string | undefined;
|
|
18
|
+
savePaymentMethod: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface CreatePaymentResponse {
|
|
22
|
+
url: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface ProcessPaymentEventRequest {
|
|
26
|
+
event: string;
|
|
27
|
+
paymentId: string;
|
|
28
|
+
bookingId: string;
|
|
29
|
+
userId: string;
|
|
30
|
+
savePaymentMethod: boolean;
|
|
31
|
+
providerPaymentId: string;
|
|
32
|
+
cardFirst6: string;
|
|
33
|
+
cardLast4: string;
|
|
34
|
+
bank: string;
|
|
35
|
+
brand: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface ProcessPaymentEventResponse {
|
|
39
|
+
ok: boolean;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface GetUserPaymentMethodsRequest {
|
|
43
|
+
userId: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface GetUserPaymentMethodsResponse {
|
|
47
|
+
items: 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 SeatInput {
|
|
78
|
+
seatId: string;
|
|
79
|
+
price: number;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface PaymentMethodItem {
|
|
83
|
+
id: string;
|
|
84
|
+
bank: string;
|
|
85
|
+
brand: string;
|
|
86
|
+
first6: string;
|
|
87
|
+
last4: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export const PAYMENT_V1_PACKAGE_NAME = "payment.v1";
|
|
91
|
+
|
|
92
|
+
export interface PaymentServiceClient {
|
|
93
|
+
createPayment(request: CreatePaymentRequest): Observable<CreatePaymentResponse>;
|
|
94
|
+
|
|
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>;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface PaymentServiceController {
|
|
107
|
+
createPayment(
|
|
108
|
+
request: CreatePaymentRequest,
|
|
109
|
+
): Promise<CreatePaymentResponse> | Observable<CreatePaymentResponse> | CreatePaymentResponse;
|
|
110
|
+
|
|
111
|
+
processPaymentEvent(
|
|
112
|
+
request: ProcessPaymentEventRequest,
|
|
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;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export function PaymentServiceControllerMethods() {
|
|
133
|
+
return function (constructor: Function) {
|
|
134
|
+
const grpcMethods: string[] = [
|
|
135
|
+
"createPayment",
|
|
136
|
+
"processPaymentEvent",
|
|
137
|
+
"getUserPaymentMethods",
|
|
138
|
+
"createPaymentMethod",
|
|
139
|
+
"verifyPaymentMethod",
|
|
140
|
+
"deletePaymentMethod",
|
|
141
|
+
];
|
|
142
|
+
for (const method of grpcMethods) {
|
|
143
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
144
|
+
GrpcMethod("PaymentService", method)(constructor.prototype[method], method, descriptor);
|
|
145
|
+
}
|
|
146
|
+
const grpcStreamMethods: string[] = [];
|
|
147
|
+
for (const method of grpcStreamMethods) {
|
|
148
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
149
|
+
GrpcStreamMethod("PaymentService", method)(constructor.prototype[method], method, descriptor);
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export const PAYMENT_SERVICE_NAME = "PaymentService";
|
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.11.5
|
|
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
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package payment.v1;
|
|
4
|
+
|
|
5
|
+
service PaymentService {
|
|
6
|
+
rpc CreatePayment(CreatePaymentRequest) returns (CreatePaymentResponse);
|
|
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);
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
message CreatePaymentRequest {
|
|
17
|
+
string user_id = 1;
|
|
18
|
+
string screening_id = 2;
|
|
19
|
+
repeated SeatInput seats = 3;
|
|
20
|
+
optional string payment_method_id = 4;
|
|
21
|
+
bool save_payment_method = 5;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
message CreatePaymentResponse {
|
|
25
|
+
string url = 1;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
message ProcessPaymentEventRequest {
|
|
29
|
+
string event = 1;
|
|
30
|
+
string payment_id = 2;
|
|
31
|
+
string booking_id = 3;
|
|
32
|
+
string user_id = 4;
|
|
33
|
+
bool save_payment_method = 5;
|
|
34
|
+
string provider_payment_id = 6;
|
|
35
|
+
string card_first6 = 7;
|
|
36
|
+
string card_last4 = 8;
|
|
37
|
+
string bank = 9;
|
|
38
|
+
string brand = 10;
|
|
39
|
+
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
message ProcessPaymentEventResponse {
|
|
43
|
+
bool ok = 1;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
message GetUserPaymentMethodsRequest {
|
|
47
|
+
string user_id = 1;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
message GetUserPaymentMethodsResponse {
|
|
51
|
+
repeated PaymentMethodItem items = 1;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
message CreatePaymentMethodRequest {
|
|
55
|
+
string user_id = 1;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
message CreatePaymentMethodResponse {
|
|
59
|
+
string id = 1;
|
|
60
|
+
string url = 2;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
message VerifyPaymentMethodRequest {
|
|
64
|
+
string user_id = 1;
|
|
65
|
+
string method_id = 2;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
message VerifyPaymentMethodResponse {
|
|
69
|
+
bool ok = 1;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
message DeletePaymentMethodRequest {
|
|
73
|
+
string user_id = 1;
|
|
74
|
+
string method_id = 2;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
message DeletePaymentMethodResponse {
|
|
78
|
+
bool ok = 1;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
message SeatInput {
|
|
82
|
+
string seat_id = 1;
|
|
83
|
+
int32 price = 2;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
message PaymentMethodItem {
|
|
87
|
+
string id = 1;
|
|
88
|
+
string bank = 2;
|
|
89
|
+
string brand = 3;
|
|
90
|
+
string first6 = 4;
|
|
91
|
+
string last4 = 5;
|
|
92
|
+
|
|
93
|
+
}
|
|
@@ -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
|
+
}
|