@neo-tickets/contracts 1.21.0 → 1.22.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/gen/ts/index.d.ts +1 -0
- package/dist/gen/ts/index.js +2 -1
- package/dist/gen/ts/index.refund.d.ts +1 -0
- package/dist/gen/ts/index.refund.js +42 -0
- package/dist/gen/ts/index.refund.v1.d.ts +1 -0
- package/dist/gen/ts/index.refund.v1.js +22 -0
- package/dist/gen/ts/payment.d.ts +46 -2
- package/dist/gen/ts/payment.js +8 -1
- package/dist/gen/ts/refund.d.ts +26 -0
- package/dist/gen/ts/refund.js +28 -0
- package/dist/src/proto/paths.d.ts +1 -0
- package/dist/src/proto/paths.js +1 -0
- package/gen/ts/index.refund.ts +8 -0
- package/gen/ts/index.refund.v1.ts +8 -0
- package/gen/ts/index.ts +1 -0
- package/gen/ts/payment.ts +79 -3
- package/gen/ts/refund.ts +63 -0
- package/package.json +1 -1
- package/proto/payment.proto +52 -2
- package/proto/refund.proto +27 -0
package/dist/gen/ts/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * as hall from "./index.hall";
|
|
|
7
7
|
export * as media from "./index.media";
|
|
8
8
|
export * as movie from "./index.movie";
|
|
9
9
|
export * as payment from "./index.payment";
|
|
10
|
+
export * as refund from "./index.refund";
|
|
10
11
|
export * as screening from "./index.screening";
|
|
11
12
|
export * as seat from "./index.seat";
|
|
12
13
|
export * as theater from "./index.theater";
|
package/dist/gen/ts/index.js
CHANGED
|
@@ -37,7 +37,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
37
37
|
};
|
|
38
38
|
})();
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.users = exports.theater = exports.seat = exports.screening = exports.payment = exports.movie = exports.media = exports.hall = exports.common = exports.category = exports.auth = exports.google = exports.account = void 0;
|
|
40
|
+
exports.users = exports.theater = exports.seat = exports.screening = exports.refund = exports.payment = exports.movie = exports.media = exports.hall = exports.common = exports.category = exports.auth = exports.google = exports.account = void 0;
|
|
41
41
|
/* eslint-disable */
|
|
42
42
|
exports.account = __importStar(require("./index.account"));
|
|
43
43
|
exports.google = __importStar(require("./index.google"));
|
|
@@ -48,6 +48,7 @@ exports.hall = __importStar(require("./index.hall"));
|
|
|
48
48
|
exports.media = __importStar(require("./index.media"));
|
|
49
49
|
exports.movie = __importStar(require("./index.movie"));
|
|
50
50
|
exports.payment = __importStar(require("./index.payment"));
|
|
51
|
+
exports.refund = __importStar(require("./index.refund"));
|
|
51
52
|
exports.screening = __importStar(require("./index.screening"));
|
|
52
53
|
exports.seat = __importStar(require("./index.seat"));
|
|
53
54
|
exports.theater = __importStar(require("./index.theater"));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as v1 from "./index.refund.v1";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.12.4
|
|
5
|
+
// protoc v3.21.12
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
23
|
+
var ownKeys = function(o) {
|
|
24
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
25
|
+
var ar = [];
|
|
26
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
29
|
+
return ownKeys(o);
|
|
30
|
+
};
|
|
31
|
+
return function (mod) {
|
|
32
|
+
if (mod && mod.__esModule) return mod;
|
|
33
|
+
var result = {};
|
|
34
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
35
|
+
__setModuleDefault(result, mod);
|
|
36
|
+
return result;
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.v1 = void 0;
|
|
41
|
+
/* eslint-disable */
|
|
42
|
+
exports.v1 = __importStar(require("./index.refund.v1"));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./refund";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.12.4
|
|
5
|
+
// protoc v3.21.12
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
18
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
/* eslint-disable */
|
|
22
|
+
__exportStar(require("./refund"), exports);
|
package/dist/gen/ts/payment.d.ts
CHANGED
|
@@ -15,13 +15,49 @@ export interface ProcessPaymentEventRequest {
|
|
|
15
15
|
bookingId: string;
|
|
16
16
|
userId: string;
|
|
17
17
|
savePaymentMethod: boolean;
|
|
18
|
-
|
|
18
|
+
providerMethodId: string;
|
|
19
19
|
cardFirst6: string;
|
|
20
|
-
|
|
20
|
+
cardLast4: string;
|
|
21
|
+
bank: string;
|
|
22
|
+
brand: string;
|
|
21
23
|
}
|
|
22
24
|
export interface ProcessPaymentEventResponse {
|
|
23
25
|
ok: boolean;
|
|
24
26
|
}
|
|
27
|
+
export interface GetUserPaymentMethodsRequest {
|
|
28
|
+
userId: string;
|
|
29
|
+
}
|
|
30
|
+
export interface GetUserPaymentMethodsResponse {
|
|
31
|
+
methods: PaymentMethodItem[];
|
|
32
|
+
}
|
|
33
|
+
export interface CreatePaymentMethodRequest {
|
|
34
|
+
userId: string;
|
|
35
|
+
}
|
|
36
|
+
export interface CreatePaymentMethodResponse {
|
|
37
|
+
id: string;
|
|
38
|
+
url: string;
|
|
39
|
+
}
|
|
40
|
+
export interface VerifyPaymentMethodRequest {
|
|
41
|
+
userId: string;
|
|
42
|
+
methodId: string;
|
|
43
|
+
}
|
|
44
|
+
export interface VerifyPaymentMethodResponse {
|
|
45
|
+
ok: boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface DeletePaymentMethodRequest {
|
|
48
|
+
userId: string;
|
|
49
|
+
methodId: string;
|
|
50
|
+
}
|
|
51
|
+
export interface DeletePaymentMethodResponse {
|
|
52
|
+
ok: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface PaymentMethodItem {
|
|
55
|
+
id: string;
|
|
56
|
+
bank: string;
|
|
57
|
+
brand: string;
|
|
58
|
+
first6: string;
|
|
59
|
+
last4: string;
|
|
60
|
+
}
|
|
25
61
|
export interface SeatInput {
|
|
26
62
|
seatId: string;
|
|
27
63
|
seatPrice: number;
|
|
@@ -29,10 +65,18 @@ export interface SeatInput {
|
|
|
29
65
|
export interface PaymentServiceClient {
|
|
30
66
|
createPayment(request: CreatePaymentRequest): Observable<CreatePaymentResponse>;
|
|
31
67
|
processPaymentEvent(request: ProcessPaymentEventRequest): Observable<ProcessPaymentEventResponse>;
|
|
68
|
+
getUserPaymentMethods(request: GetUserPaymentMethodsRequest): Observable<GetUserPaymentMethodsResponse>;
|
|
69
|
+
createPaymentMethod(request: CreatePaymentMethodRequest): Observable<CreatePaymentMethodResponse>;
|
|
70
|
+
verifyPaymentMethod(request: VerifyPaymentMethodRequest): Observable<VerifyPaymentMethodResponse>;
|
|
71
|
+
deletePaymentMethod(request: DeletePaymentMethodRequest): Observable<DeletePaymentMethodResponse>;
|
|
32
72
|
}
|
|
33
73
|
export interface PaymentServiceController {
|
|
34
74
|
createPayment(request: CreatePaymentRequest): Promise<CreatePaymentResponse> | Observable<CreatePaymentResponse> | CreatePaymentResponse;
|
|
35
75
|
processPaymentEvent(request: ProcessPaymentEventRequest): Promise<ProcessPaymentEventResponse> | Observable<ProcessPaymentEventResponse> | ProcessPaymentEventResponse;
|
|
76
|
+
getUserPaymentMethods(request: GetUserPaymentMethodsRequest): Promise<GetUserPaymentMethodsResponse> | Observable<GetUserPaymentMethodsResponse> | GetUserPaymentMethodsResponse;
|
|
77
|
+
createPaymentMethod(request: CreatePaymentMethodRequest): Promise<CreatePaymentMethodResponse> | Observable<CreatePaymentMethodResponse> | CreatePaymentMethodResponse;
|
|
78
|
+
verifyPaymentMethod(request: VerifyPaymentMethodRequest): Promise<VerifyPaymentMethodResponse> | Observable<VerifyPaymentMethodResponse> | VerifyPaymentMethodResponse;
|
|
79
|
+
deletePaymentMethod(request: DeletePaymentMethodRequest): Promise<DeletePaymentMethodResponse> | Observable<DeletePaymentMethodResponse> | DeletePaymentMethodResponse;
|
|
36
80
|
}
|
|
37
81
|
export declare function PaymentServiceControllerMethods(): (constructor: Function) => void;
|
|
38
82
|
export declare const PAYMENT_SERVICE_NAME = "PaymentService";
|
package/dist/gen/ts/payment.js
CHANGED
|
@@ -11,7 +11,14 @@ exports.PaymentServiceControllerMethods = PaymentServiceControllerMethods;
|
|
|
11
11
|
const microservices_1 = require("@nestjs/microservices");
|
|
12
12
|
function PaymentServiceControllerMethods() {
|
|
13
13
|
return function (constructor) {
|
|
14
|
-
const grpcMethods = [
|
|
14
|
+
const grpcMethods = [
|
|
15
|
+
"createPayment",
|
|
16
|
+
"processPaymentEvent",
|
|
17
|
+
"getUserPaymentMethods",
|
|
18
|
+
"createPaymentMethod",
|
|
19
|
+
"verifyPaymentMethod",
|
|
20
|
+
"deletePaymentMethod",
|
|
21
|
+
];
|
|
15
22
|
for (const method of grpcMethods) {
|
|
16
23
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
17
24
|
(0, microservices_1.GrpcMethod)("PaymentService", method)(constructor.prototype[method], method, descriptor);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export interface CreateRefundRequest {
|
|
3
|
+
bookingId: string;
|
|
4
|
+
userId: string;
|
|
5
|
+
}
|
|
6
|
+
export interface CreateRefundResponse {
|
|
7
|
+
ok: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface ProcessRefundEventRequest {
|
|
10
|
+
event: string;
|
|
11
|
+
providerRefundId: string;
|
|
12
|
+
status: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ProcessRefundEventResponse {
|
|
15
|
+
ok: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface RefundServiceClient {
|
|
18
|
+
createRefund(request: CreateRefundRequest): Observable<CreateRefundResponse>;
|
|
19
|
+
processRefundEvent(request: ProcessRefundEventRequest): Observable<ProcessRefundEventResponse>;
|
|
20
|
+
}
|
|
21
|
+
export interface RefundServiceController {
|
|
22
|
+
createRefund(request: CreateRefundRequest): Promise<CreateRefundResponse> | Observable<CreateRefundResponse> | CreateRefundResponse;
|
|
23
|
+
processRefundEvent(request: ProcessRefundEventRequest): Promise<ProcessRefundEventResponse> | Observable<ProcessRefundEventResponse> | ProcessRefundEventResponse;
|
|
24
|
+
}
|
|
25
|
+
export declare function RefundServiceControllerMethods(): (constructor: Function) => void;
|
|
26
|
+
export declare const REFUND_SERVICE_NAME = "RefundService";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.12.4
|
|
5
|
+
// protoc v3.21.12
|
|
6
|
+
// source: refund.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.REFUND_SERVICE_NAME = void 0;
|
|
9
|
+
exports.RefundServiceControllerMethods = RefundServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
function RefundServiceControllerMethods() {
|
|
13
|
+
return function (constructor) {
|
|
14
|
+
const grpcMethods = ["createRefund", "processRefundEvent"];
|
|
15
|
+
for (const method of grpcMethods) {
|
|
16
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
17
|
+
(0, microservices_1.GrpcMethod)("RefundService", method)(constructor.prototype[method], method, descriptor);
|
|
18
|
+
Object.defineProperty(constructor.prototype, method, descriptor);
|
|
19
|
+
}
|
|
20
|
+
const grpcStreamMethods = [];
|
|
21
|
+
for (const method of grpcStreamMethods) {
|
|
22
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
23
|
+
(0, microservices_1.GrpcStreamMethod)("RefundService", method)(constructor.prototype[method], method, descriptor);
|
|
24
|
+
Object.defineProperty(constructor.prototype, method, descriptor);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
exports.REFUND_SERVICE_NAME = "RefundService";
|
package/dist/src/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/index.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * as hall from "./index.hall";
|
|
|
14
14
|
export * as media from "./index.media";
|
|
15
15
|
export * as movie from "./index.movie";
|
|
16
16
|
export * as payment from "./index.payment";
|
|
17
|
+
export * as refund from "./index.refund";
|
|
17
18
|
export * as screening from "./index.screening";
|
|
18
19
|
export * as seat from "./index.seat";
|
|
19
20
|
export * as theater from "./index.theater";
|
package/gen/ts/payment.ts
CHANGED
|
@@ -26,15 +26,60 @@ export interface ProcessPaymentEventRequest {
|
|
|
26
26
|
bookingId: string;
|
|
27
27
|
userId: string;
|
|
28
28
|
savePaymentMethod: boolean;
|
|
29
|
-
|
|
29
|
+
providerMethodId: string;
|
|
30
30
|
cardFirst6: string;
|
|
31
|
-
|
|
31
|
+
cardLast4: string;
|
|
32
|
+
bank: string;
|
|
33
|
+
brand: string;
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
export interface ProcessPaymentEventResponse {
|
|
35
37
|
ok: boolean;
|
|
36
38
|
}
|
|
37
39
|
|
|
40
|
+
export interface GetUserPaymentMethodsRequest {
|
|
41
|
+
userId: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface GetUserPaymentMethodsResponse {
|
|
45
|
+
methods: PaymentMethodItem[];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface CreatePaymentMethodRequest {
|
|
49
|
+
userId: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface CreatePaymentMethodResponse {
|
|
53
|
+
id: string;
|
|
54
|
+
url: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface VerifyPaymentMethodRequest {
|
|
58
|
+
userId: string;
|
|
59
|
+
methodId: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface VerifyPaymentMethodResponse {
|
|
63
|
+
ok: boolean;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface DeletePaymentMethodRequest {
|
|
67
|
+
userId: string;
|
|
68
|
+
methodId: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface DeletePaymentMethodResponse {
|
|
72
|
+
ok: boolean;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface PaymentMethodItem {
|
|
76
|
+
id: string;
|
|
77
|
+
bank: string;
|
|
78
|
+
brand: string;
|
|
79
|
+
first6: string;
|
|
80
|
+
last4: string;
|
|
81
|
+
}
|
|
82
|
+
|
|
38
83
|
export interface SeatInput {
|
|
39
84
|
seatId: string;
|
|
40
85
|
seatPrice: number;
|
|
@@ -44,6 +89,14 @@ export interface PaymentServiceClient {
|
|
|
44
89
|
createPayment(request: CreatePaymentRequest): Observable<CreatePaymentResponse>;
|
|
45
90
|
|
|
46
91
|
processPaymentEvent(request: ProcessPaymentEventRequest): Observable<ProcessPaymentEventResponse>;
|
|
92
|
+
|
|
93
|
+
getUserPaymentMethods(request: GetUserPaymentMethodsRequest): Observable<GetUserPaymentMethodsResponse>;
|
|
94
|
+
|
|
95
|
+
createPaymentMethod(request: CreatePaymentMethodRequest): Observable<CreatePaymentMethodResponse>;
|
|
96
|
+
|
|
97
|
+
verifyPaymentMethod(request: VerifyPaymentMethodRequest): Observable<VerifyPaymentMethodResponse>;
|
|
98
|
+
|
|
99
|
+
deletePaymentMethod(request: DeletePaymentMethodRequest): Observable<DeletePaymentMethodResponse>;
|
|
47
100
|
}
|
|
48
101
|
|
|
49
102
|
export interface PaymentServiceController {
|
|
@@ -54,11 +107,34 @@ export interface PaymentServiceController {
|
|
|
54
107
|
processPaymentEvent(
|
|
55
108
|
request: ProcessPaymentEventRequest,
|
|
56
109
|
): Promise<ProcessPaymentEventResponse> | Observable<ProcessPaymentEventResponse> | ProcessPaymentEventResponse;
|
|
110
|
+
|
|
111
|
+
getUserPaymentMethods(
|
|
112
|
+
request: GetUserPaymentMethodsRequest,
|
|
113
|
+
): Promise<GetUserPaymentMethodsResponse> | Observable<GetUserPaymentMethodsResponse> | GetUserPaymentMethodsResponse;
|
|
114
|
+
|
|
115
|
+
createPaymentMethod(
|
|
116
|
+
request: CreatePaymentMethodRequest,
|
|
117
|
+
): Promise<CreatePaymentMethodResponse> | Observable<CreatePaymentMethodResponse> | CreatePaymentMethodResponse;
|
|
118
|
+
|
|
119
|
+
verifyPaymentMethod(
|
|
120
|
+
request: VerifyPaymentMethodRequest,
|
|
121
|
+
): Promise<VerifyPaymentMethodResponse> | Observable<VerifyPaymentMethodResponse> | VerifyPaymentMethodResponse;
|
|
122
|
+
|
|
123
|
+
deletePaymentMethod(
|
|
124
|
+
request: DeletePaymentMethodRequest,
|
|
125
|
+
): Promise<DeletePaymentMethodResponse> | Observable<DeletePaymentMethodResponse> | DeletePaymentMethodResponse;
|
|
57
126
|
}
|
|
58
127
|
|
|
59
128
|
export function PaymentServiceControllerMethods() {
|
|
60
129
|
return function (constructor: Function) {
|
|
61
|
-
const grpcMethods: string[] = [
|
|
130
|
+
const grpcMethods: string[] = [
|
|
131
|
+
"createPayment",
|
|
132
|
+
"processPaymentEvent",
|
|
133
|
+
"getUserPaymentMethods",
|
|
134
|
+
"createPaymentMethod",
|
|
135
|
+
"verifyPaymentMethod",
|
|
136
|
+
"deletePaymentMethod",
|
|
137
|
+
];
|
|
62
138
|
for (const method of grpcMethods) {
|
|
63
139
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
64
140
|
GrpcMethod("PaymentService", method)(constructor.prototype[method], method, descriptor);
|
package/gen/ts/refund.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.12.4
|
|
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 interface CreateRefundRequest {
|
|
12
|
+
bookingId: string;
|
|
13
|
+
userId: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface CreateRefundResponse {
|
|
17
|
+
ok: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ProcessRefundEventRequest {
|
|
21
|
+
event: string;
|
|
22
|
+
providerRefundId: string;
|
|
23
|
+
status: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface ProcessRefundEventResponse {
|
|
27
|
+
ok: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface RefundServiceClient {
|
|
31
|
+
createRefund(request: CreateRefundRequest): Observable<CreateRefundResponse>;
|
|
32
|
+
|
|
33
|
+
processRefundEvent(request: ProcessRefundEventRequest): Observable<ProcessRefundEventResponse>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface RefundServiceController {
|
|
37
|
+
createRefund(
|
|
38
|
+
request: CreateRefundRequest,
|
|
39
|
+
): Promise<CreateRefundResponse> | Observable<CreateRefundResponse> | CreateRefundResponse;
|
|
40
|
+
|
|
41
|
+
processRefundEvent(
|
|
42
|
+
request: ProcessRefundEventRequest,
|
|
43
|
+
): Promise<ProcessRefundEventResponse> | Observable<ProcessRefundEventResponse> | ProcessRefundEventResponse;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function RefundServiceControllerMethods() {
|
|
47
|
+
return function (constructor: Function) {
|
|
48
|
+
const grpcMethods: string[] = ["createRefund", "processRefundEvent"];
|
|
49
|
+
for (const method of grpcMethods) {
|
|
50
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
51
|
+
GrpcMethod("RefundService", method)(constructor.prototype[method], method, descriptor);
|
|
52
|
+
Object.defineProperty(constructor.prototype, method, descriptor);
|
|
53
|
+
}
|
|
54
|
+
const grpcStreamMethods: string[] = [];
|
|
55
|
+
for (const method of grpcStreamMethods) {
|
|
56
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
57
|
+
GrpcStreamMethod("RefundService", method)(constructor.prototype[method], method, descriptor);
|
|
58
|
+
Object.defineProperty(constructor.prototype, method, descriptor);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
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 {
|
|
@@ -25,15 +30,60 @@ message ProcessPaymentEventRequest {
|
|
|
25
30
|
string booking_id = 3;
|
|
26
31
|
string user_id = 4;
|
|
27
32
|
bool save_payment_method = 5;
|
|
28
|
-
string
|
|
33
|
+
string provider_method_id = 6;
|
|
29
34
|
string card_first6 = 7;
|
|
30
|
-
string
|
|
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 seat_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
|
+
}
|