@microservsforsell/contracts 1.4.0 → 1.4.1
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/payment.d.ts +40 -0
- package/dist/gen/ts/payment.js +28 -0
- package/dist/proto/paths.d.ts +1 -0
- package/dist/proto/paths.js +1 -0
- package/package.json +1 -1
- package/proto/payment.proto +40 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export declare const protobufPackage = "payment.v1";
|
|
3
|
+
export interface CreatePaymentRequest {
|
|
4
|
+
userId: string;
|
|
5
|
+
screeningId: string;
|
|
6
|
+
seats: SeatInput[];
|
|
7
|
+
paymentMethod?: string | undefined;
|
|
8
|
+
savePaymentId: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface CreatePaymentResponse {
|
|
11
|
+
url: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ProccessPaymentEventRequest {
|
|
14
|
+
event: string;
|
|
15
|
+
paymentId: string;
|
|
16
|
+
bookingId: string;
|
|
17
|
+
userId: string;
|
|
18
|
+
savePaymentMethod: boolean;
|
|
19
|
+
providerPaymentId: string;
|
|
20
|
+
cardFirst6: string;
|
|
21
|
+
cardLast4: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ProccessPaymentEventResponse {
|
|
24
|
+
ok: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface SeatInput {
|
|
27
|
+
seatId: string;
|
|
28
|
+
price: number;
|
|
29
|
+
}
|
|
30
|
+
export declare const PAYMENT_V1_PACKAGE_NAME = "payment.v1";
|
|
31
|
+
export interface PaymentServiceClient {
|
|
32
|
+
createPayment(request: CreatePaymentRequest): Observable<CreatePaymentResponse>;
|
|
33
|
+
proccessPaymentEvent(request: ProccessPaymentEventRequest): Observable<ProccessPaymentEventResponse>;
|
|
34
|
+
}
|
|
35
|
+
export interface PaymentServiceController {
|
|
36
|
+
createPayment(request: CreatePaymentRequest): Promise<CreatePaymentResponse> | Observable<CreatePaymentResponse> | CreatePaymentResponse;
|
|
37
|
+
proccessPaymentEvent(request: ProccessPaymentEventRequest): Promise<ProccessPaymentEventResponse> | Observable<ProccessPaymentEventResponse> | ProccessPaymentEventResponse;
|
|
38
|
+
}
|
|
39
|
+
export declare function PaymentServiceControllerMethods(): (constructor: Function) => void;
|
|
40
|
+
export declare const PAYMENT_SERVICE_NAME = "PaymentService";
|
|
@@ -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.11.0
|
|
5
|
+
// protoc v3.21.12
|
|
6
|
+
// source: payment.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.PAYMENT_SERVICE_NAME = exports.PAYMENT_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
+
exports.PaymentServiceControllerMethods = PaymentServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.protobufPackage = "payment.v1";
|
|
13
|
+
exports.PAYMENT_V1_PACKAGE_NAME = "payment.v1";
|
|
14
|
+
function PaymentServiceControllerMethods() {
|
|
15
|
+
return function (constructor) {
|
|
16
|
+
const grpcMethods = ["createPayment", "proccessPaymentEvent"];
|
|
17
|
+
for (const method of grpcMethods) {
|
|
18
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
19
|
+
(0, microservices_1.GrpcMethod)("PaymentService", method)(constructor.prototype[method], method, descriptor);
|
|
20
|
+
}
|
|
21
|
+
const grpcStreamMethods = [];
|
|
22
|
+
for (const method of grpcStreamMethods) {
|
|
23
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
24
|
+
(0, microservices_1.GrpcStreamMethod)("PaymentService", method)(constructor.prototype[method], method, descriptor);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
exports.PAYMENT_SERVICE_NAME = "PaymentService";
|
package/dist/proto/paths.d.ts
CHANGED
package/dist/proto/paths.js
CHANGED
|
@@ -13,6 +13,7 @@ exports.PROTO_PATHS = {
|
|
|
13
13
|
HALL: (0, path_1.join)(__dirname, "../../proto/hall.proto"),
|
|
14
14
|
SEAT: (0, path_1.join)(__dirname, "../../proto/seat.proto"),
|
|
15
15
|
SCREENING: (0, path_1.join)(__dirname, "../../proto/screening.proto"),
|
|
16
|
+
PAYMENT: (0, path_1.join)(__dirname, "../../proto/payment.proto"),
|
|
16
17
|
};
|
|
17
18
|
// GENRE: join(__dirname, "../../proto/genre.proto"),
|
|
18
19
|
// REVIEW: join(__dirname, "../../proto/review.proto"),
|
package/package.json
CHANGED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package payment.v1;
|
|
4
|
+
|
|
5
|
+
service PaymentService {
|
|
6
|
+
rpc CreatePayment (CreatePaymentRequest) returns (CreatePaymentResponse);
|
|
7
|
+
rpc ProccessPaymentEvent (ProccessPaymentEventRequest) returns (ProccessPaymentEventResponse);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
message CreatePaymentRequest {
|
|
11
|
+
string user_id = 1;
|
|
12
|
+
string screening_id = 2;
|
|
13
|
+
repeated SeatInput seats = 3;
|
|
14
|
+
optional string payment_method = 4;
|
|
15
|
+
bool save_payment_id = 5;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
message CreatePaymentResponse {
|
|
19
|
+
string url = 1;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
message ProccessPaymentEventRequest {
|
|
23
|
+
string event = 1;
|
|
24
|
+
string payment_id = 2;
|
|
25
|
+
string booking_id = 3;
|
|
26
|
+
string user_id = 4;
|
|
27
|
+
bool save_payment_method = 5;
|
|
28
|
+
string provider_payment_id = 6;
|
|
29
|
+
string card_first6 = 7;
|
|
30
|
+
string card_last4 = 8;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
message ProccessPaymentEventResponse {
|
|
34
|
+
bool ok = 1;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
message SeatInput {
|
|
38
|
+
string seat_id = 1;
|
|
39
|
+
int32 price = 2;
|
|
40
|
+
}
|