@microservsforsell/contracts 1.4.5 → 1.4.6

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.
@@ -0,0 +1,89 @@
1
+ import { Observable } from "rxjs";
2
+ export declare const protobufPackage = "booking.v1";
3
+ export interface GetUserBookingRequest {
4
+ userId: string;
5
+ }
6
+ export interface GetUserBookingResponse {
7
+ bookings: BookingItem[];
8
+ }
9
+ export interface CreateReservationRequest {
10
+ userId: string;
11
+ screeningId: string;
12
+ seats: SeatInput[];
13
+ }
14
+ export interface CreateReservationResponse {
15
+ orderId: string;
16
+ amount: number;
17
+ ticketIds: string[];
18
+ }
19
+ export interface SeatInput {
20
+ seatId: string;
21
+ price: number;
22
+ }
23
+ export interface ConfirmBookingRequest {
24
+ bookingId: string;
25
+ userId: string;
26
+ }
27
+ export interface ConfirmBookingResponse {
28
+ ok: boolean;
29
+ }
30
+ export interface CancelBookingRequest {
31
+ bookingId: string;
32
+ userId: string;
33
+ }
34
+ export interface CancelBookingResponse {
35
+ ok: boolean;
36
+ }
37
+ export interface ListReservedSeatsRequest {
38
+ hallId: string;
39
+ screeningId: string;
40
+ }
41
+ export interface ListReservedSeatsResponse {
42
+ ok: boolean;
43
+ reservedSeatIds: string[];
44
+ }
45
+ export interface BookingSeatInfo {
46
+ id: string;
47
+ row: number;
48
+ number: number;
49
+ }
50
+ export interface BookingMovieInfo {
51
+ id: string;
52
+ title: string;
53
+ poster: string;
54
+ }
55
+ export interface BookingTheatherInfo {
56
+ id: string;
57
+ name: string;
58
+ }
59
+ export interface BookingHallInfo {
60
+ id: string;
61
+ name: string;
62
+ }
63
+ export interface BookingItem {
64
+ id: string;
65
+ screeningDate: string;
66
+ screeningTime: string;
67
+ movie: BookingMovieInfo | undefined;
68
+ theather: BookingTheatherInfo | undefined;
69
+ hall: BookingHallInfo | undefined;
70
+ seats: BookingSeatInfo[];
71
+ qrCode: string;
72
+ }
73
+ export declare const BOOKING_V1_PACKAGE_NAME = "booking.v1";
74
+ export interface BookingServiceClient {
75
+ getUserBooking(request: GetUserBookingRequest): Observable<GetUserBookingResponse>;
76
+ createReservation(request: CreateReservationRequest): Observable<CreateReservationResponse>;
77
+ confirmBooking(request: ConfirmBookingRequest): Observable<ConfirmBookingResponse>;
78
+ cancelBooking(request: CancelBookingRequest): Observable<CancelBookingResponse>;
79
+ listReservedSeats(request: ListReservedSeatsRequest): Observable<ListReservedSeatsResponse>;
80
+ }
81
+ export interface BookingServiceController {
82
+ getUserBooking(request: GetUserBookingRequest): Promise<GetUserBookingResponse> | Observable<GetUserBookingResponse> | GetUserBookingResponse;
83
+ createReservation(request: CreateReservationRequest): Promise<CreateReservationResponse> | Observable<CreateReservationResponse> | CreateReservationResponse;
84
+ confirmBooking(request: ConfirmBookingRequest): Promise<ConfirmBookingResponse> | Observable<ConfirmBookingResponse> | ConfirmBookingResponse;
85
+ cancelBooking(request: CancelBookingRequest): Promise<CancelBookingResponse> | Observable<CancelBookingResponse> | CancelBookingResponse;
86
+ listReservedSeats(request: ListReservedSeatsRequest): Promise<ListReservedSeatsResponse> | Observable<ListReservedSeatsResponse> | ListReservedSeatsResponse;
87
+ }
88
+ export declare function BookingServiceControllerMethods(): (constructor: Function) => void;
89
+ export declare const BOOKING_SERVICE_NAME = "BookingService";
@@ -0,0 +1,34 @@
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: booking.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.BOOKING_SERVICE_NAME = exports.BOOKING_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ exports.BookingServiceControllerMethods = BookingServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "booking.v1";
13
+ exports.BOOKING_V1_PACKAGE_NAME = "booking.v1";
14
+ function BookingServiceControllerMethods() {
15
+ return function (constructor) {
16
+ const grpcMethods = [
17
+ "getUserBooking",
18
+ "createReservation",
19
+ "confirmBooking",
20
+ "cancelBooking",
21
+ "listReservedSeats",
22
+ ];
23
+ for (const method of grpcMethods) {
24
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
25
+ (0, microservices_1.GrpcMethod)("BookingService", method)(constructor.prototype[method], method, descriptor);
26
+ }
27
+ const grpcStreamMethods = [];
28
+ for (const method of grpcStreamMethods) {
29
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
30
+ (0, microservices_1.GrpcStreamMethod)("BookingService", method)(constructor.prototype[method], method, descriptor);
31
+ }
32
+ };
33
+ }
34
+ exports.BOOKING_SERVICE_NAME = "BookingService";
@@ -44,6 +44,7 @@ export interface Movie {
44
44
  slug: string;
45
45
  duration: number;
46
46
  banner: string;
47
+ poster: string;
47
48
  }
48
49
  export interface Theater {
49
50
  id: string;
@@ -10,4 +10,5 @@ export declare const PROTO_PATHS: {
10
10
  readonly SEAT: string;
11
11
  readonly SCREENING: string;
12
12
  readonly PAYMENT: string;
13
+ readonly BOOKING: string;
13
14
  };
@@ -14,6 +14,7 @@ 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
+ BOOKING: (0, path_1.join)(__dirname, "../../proto/booking.proto"),
17
18
  };
18
19
  // GENRE: join(__dirname, "../../proto/genre.proto"),
19
20
  // REVIEW: join(__dirname, "../../proto/review.proto"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microservsforsell/contracts",
3
- "version": "1.4.5",
3
+ "version": "1.4.6",
4
4
  "description": "Protobuf definitions and generated Typecript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -0,0 +1,102 @@
1
+ syntax = "proto3";
2
+
3
+ package booking.v1;
4
+
5
+ service BookingService {
6
+ rpc GetUserBooking (GetUserBookingRequest) returns (GetUserBookingResponse);
7
+ rpc CreateReservation (CreateReservationRequest) returns (CreateReservationResponse);
8
+ rpc ConfirmBooking (ConfirmBookingRequest) returns (ConfirmBookingResponse);
9
+ rpc CancelBooking (CancelBookingRequest) returns (CancelBookingResponse);
10
+ rpc ListReservedSeats (ListReservedSeatsRequest) returns (ListReservedSeatsResponse);
11
+ }
12
+
13
+ message GetUserBookingRequest {
14
+ string user_id = 1;
15
+ }
16
+
17
+ message GetUserBookingResponse {
18
+ repeated BookingItem bookings = 1;
19
+ }
20
+
21
+ message CreateReservationRequest {
22
+ string user_id = 1;
23
+ string screening_id = 2;
24
+ repeated SeatInput seats = 3;
25
+ }
26
+
27
+ message CreateReservationResponse {
28
+ string order_id = 1;
29
+ int32 amount = 2;
30
+ repeated string ticket_ids = 3;
31
+ }
32
+
33
+ message SeatInput {
34
+ string seat_id = 1;
35
+ int32 price = 2;
36
+ }
37
+
38
+ message ConfirmBookingRequest {
39
+ string booking_id = 1;
40
+ string user_id = 2;
41
+ }
42
+
43
+ message ConfirmBookingResponse {
44
+ bool ok = 1;
45
+ }
46
+
47
+ message CancelBookingRequest {
48
+ string booking_id = 1;
49
+ string user_id = 2;
50
+ }
51
+
52
+ message CancelBookingResponse {
53
+ bool ok = 1;
54
+ }
55
+
56
+ message ListReservedSeatsRequest {
57
+ string hall_id = 1;
58
+ string screening_id = 2;
59
+ }
60
+
61
+ message ListReservedSeatsResponse {
62
+ bool ok = 1;
63
+ repeated string reserved_seat_ids = 2;
64
+ }
65
+
66
+ message BookingSeatInfo {
67
+ string id = 1;
68
+ int32 row = 2;
69
+ int32 number = 3;
70
+ }
71
+
72
+ message BookingMovieInfo {
73
+ string id = 1;
74
+ string title = 2;
75
+ string poster = 3;
76
+ }
77
+
78
+ message BookingTheatherInfo {
79
+ string id = 1;
80
+ string name = 2;
81
+ }
82
+
83
+ message BookingHallInfo {
84
+ string id = 1;
85
+ string name = 2;
86
+ }
87
+
88
+ message BookingItem {
89
+ string id = 1;
90
+ string screening_date = 2;
91
+ string screening_time = 3;
92
+ BookingMovieInfo movie = 4;
93
+ BookingTheatherInfo theather = 5;
94
+ BookingHallInfo hall = 6;
95
+ repeated BookingSeatInfo seats = 7;
96
+ string qr_code = 8;
97
+ }
98
+
99
+
100
+
101
+
102
+
@@ -64,7 +64,7 @@ message Movie {
64
64
  string slug = 3;
65
65
  int32 duration = 4;
66
66
  string banner = 5;
67
-
67
+ string poster = 6;
68
68
  }
69
69
 
70
70
  message Theater {