@usteam/contracts 1.4.1 → 1.4.3

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.
@@ -9,4 +9,5 @@ export declare const PROTO_PATHS: {
9
9
  readonly SECTOR: string;
10
10
  readonly SEAT: string;
11
11
  readonly SCREENING: string;
12
+ readonly PAYMENT: string;
12
13
  };
@@ -13,4 +13,5 @@ exports.PROTO_PATHS = {
13
13
  SECTOR: (0, path_1.join)(__dirname, '../../proto/sector.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
  };
@@ -0,0 +1,87 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.10.1
4
+ // protoc v4.25.9
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
+ /** status */
27
+ event: string;
28
+ paymentId: string;
29
+ bookingId: string;
30
+ userId: string;
31
+ savePaymentMethod: boolean;
32
+ providerPaymentId: string;
33
+ cartFirst6: string;
34
+ cartLast4: string;
35
+ }
36
+
37
+ export interface ProcessPaymentEventResponse {
38
+ ok: boolean;
39
+ }
40
+
41
+ export interface SeatInput {
42
+ seatId: string;
43
+ price: number;
44
+ }
45
+
46
+ export const PAYMENT_V1_PACKAGE_NAME = "payment.v1";
47
+
48
+ export interface PaymentServiceClient {
49
+ /** Создание платежа */
50
+
51
+ createPayment(request: CreatePaymentRequest): Observable<CreatePaymentResponse>;
52
+
53
+ /** Обработка вебхука (начисление брони) от платежной системы */
54
+
55
+ processPaymentEvent(request: ProcessPaymentEventRequest): Observable<ProcessPaymentEventResponse>;
56
+ }
57
+
58
+ export interface PaymentServiceController {
59
+ /** Создание платежа */
60
+
61
+ createPayment(
62
+ request: CreatePaymentRequest,
63
+ ): Promise<CreatePaymentResponse> | Observable<CreatePaymentResponse> | CreatePaymentResponse;
64
+
65
+ /** Обработка вебхука (начисление брони) от платежной системы */
66
+
67
+ processPaymentEvent(
68
+ request: ProcessPaymentEventRequest,
69
+ ): Promise<ProcessPaymentEventResponse> | Observable<ProcessPaymentEventResponse> | ProcessPaymentEventResponse;
70
+ }
71
+
72
+ export function PaymentServiceControllerMethods() {
73
+ return function (constructor: Function) {
74
+ const grpcMethods: string[] = ["createPayment", "processPaymentEvent"];
75
+ for (const method of grpcMethods) {
76
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
77
+ GrpcMethod("PaymentService", method)(constructor.prototype[method], method, descriptor);
78
+ }
79
+ const grpcStreamMethods: string[] = [];
80
+ for (const method of grpcStreamMethods) {
81
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
82
+ GrpcStreamMethod("PaymentService", method)(constructor.prototype[method], method, descriptor);
83
+ }
84
+ };
85
+ }
86
+
87
+ export const PAYMENT_SERVICE_NAME = "PaymentService";
@@ -2,7 +2,7 @@
2
2
  // versions:
3
3
  // protoc-gen-ts_proto v2.10.1
4
4
  // protoc v4.25.9
5
- // source: screenings.proto
5
+ // source: screening.proto
6
6
 
7
7
  /* eslint-disable */
8
8
  import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
@@ -14,8 +14,8 @@ export const protobufPackage = "screening.v1";
14
14
  export interface CreateScreeningRequest {
15
15
  eventId: string;
16
16
  sectorId: string;
17
- startAt: Timestamp | undefined;
18
- endAt: Timestamp | undefined;
17
+ startAt: string;
18
+ endAt: string;
19
19
  }
20
20
 
21
21
  export interface CreateScreeningResponse {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usteam/contracts",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "scripts": {
@@ -0,0 +1,43 @@
1
+ syntax = "proto3";
2
+
3
+ package payment.v1;
4
+
5
+ service PaymentService {
6
+ // Создание платежа
7
+ rpc CreatePayment (CreatePaymentRequest) returns (CreatePaymentResponse);
8
+ // Обработка вебхука (начисление брони) от платежной системы
9
+ rpc ProcessPaymentEvent (ProcessPaymentEventRequest) returns (ProcessPaymentEventResponse);
10
+ //
11
+
12
+ }
13
+ message CreatePaymentRequest {
14
+ string user_id = 1;
15
+ string screening_id = 2;
16
+ repeated SeatInput seats = 3;
17
+ optional string payment_method_id = 4;
18
+ bool save_payment_method = 5;
19
+ }
20
+ message CreatePaymentResponse {
21
+ string url = 1;
22
+ }
23
+
24
+ message ProcessPaymentEventRequest {
25
+ //status
26
+ string event = 1;
27
+ string payment_id = 2;
28
+ string booking_id = 3;
29
+ string user_id = 4;
30
+ bool save_payment_method = 5;
31
+ string provider_payment_id = 6;
32
+ string cart_first6 = 7;
33
+ string cart_last4 = 8;
34
+ }
35
+
36
+ message ProcessPaymentEventResponse {
37
+ bool ok = 1;
38
+ }
39
+
40
+ message SeatInput {
41
+ string seat_id = 1;
42
+ int32 price = 2;
43
+ }
@@ -18,8 +18,8 @@ service ScreeningService {
18
18
  message CreateScreeningRequest {
19
19
  string event_id = 1;
20
20
  string sector_id = 2;
21
- google.protobuf.Timestamp start_at = 3;
22
- google.protobuf.Timestamp end_at = 4;
21
+ string start_at = 3;
22
+ string end_at = 4;
23
23
  }
24
24
 
25
25
  message CreateScreeningResponse {