@neo-tickets/contracts 1.22.0 → 1.24.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.
@@ -0,0 +1,87 @@
1
+ import { Observable } from "rxjs";
2
+ export interface GetUserBookingsRequest {
3
+ userId: string;
4
+ }
5
+ export interface GetUserBookingsResponse {
6
+ bookings: Booking[];
7
+ }
8
+ export interface CreateReservationRequest {
9
+ screeningId: string;
10
+ seatIds: string[];
11
+ }
12
+ export interface CreateReservationResponse {
13
+ bookingId: string;
14
+ totalPrice: number;
15
+ }
16
+ export interface ConfirmBookingRequest {
17
+ bookingId: string;
18
+ userId: string;
19
+ }
20
+ export interface ConfirmBookingResponse {
21
+ ok: boolean;
22
+ }
23
+ export interface CancelBookingRequest {
24
+ bookingId: string;
25
+ userId: string;
26
+ }
27
+ export interface CancelBookingResponse {
28
+ ok: boolean;
29
+ }
30
+ export interface Booking {
31
+ id: string;
32
+ totalPrice: number;
33
+ qrCode?: string | undefined;
34
+ userId: string;
35
+ status: string;
36
+ tickets: Ticket[];
37
+ createdT: string;
38
+ }
39
+ export interface Ticket {
40
+ id: string;
41
+ price: number;
42
+ paidAt: string;
43
+ status: string;
44
+ screening: ScreeningInfo | undefined;
45
+ seat: SeatInfo | undefined;
46
+ }
47
+ export interface SeatInfo {
48
+ id: string;
49
+ row: number;
50
+ number: number;
51
+ }
52
+ export interface MovieInfo {
53
+ id: string;
54
+ title: string;
55
+ poster: string;
56
+ }
57
+ export interface TheaterInfo {
58
+ id: string;
59
+ name: string;
60
+ address: string;
61
+ }
62
+ export interface HallInfo {
63
+ id: string;
64
+ name: string;
65
+ }
66
+ export interface ScreeningInfo {
67
+ id: string;
68
+ startsAt: string;
69
+ endsAt: string;
70
+ movie: MovieInfo | undefined;
71
+ theater: TheaterInfo | undefined;
72
+ hall: HallInfo | undefined;
73
+ }
74
+ export interface BookingServiceClient {
75
+ getUserBookings(request: GetUserBookingsRequest): Observable<GetUserBookingsResponse>;
76
+ createReservation(request: CreateReservationRequest): Observable<CreateReservationResponse>;
77
+ confirmBooking(request: ConfirmBookingRequest): Observable<ConfirmBookingResponse>;
78
+ cancelBooking(request: CancelBookingRequest): Observable<CancelBookingResponse>;
79
+ }
80
+ export interface BookingServiceController {
81
+ getUserBookings(request: GetUserBookingsRequest): Promise<GetUserBookingsResponse> | Observable<GetUserBookingsResponse> | GetUserBookingsResponse;
82
+ createReservation(request: CreateReservationRequest): Promise<CreateReservationResponse> | Observable<CreateReservationResponse> | CreateReservationResponse;
83
+ confirmBooking(request: ConfirmBookingRequest): Promise<ConfirmBookingResponse> | Observable<ConfirmBookingResponse> | ConfirmBookingResponse;
84
+ cancelBooking(request: CancelBookingRequest): Promise<CancelBookingResponse> | Observable<CancelBookingResponse> | CancelBookingResponse;
85
+ }
86
+ export declare function BookingServiceControllerMethods(): (constructor: Function) => void;
87
+ export declare const BOOKING_SERVICE_NAME = "BookingService";
@@ -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: booking.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.BOOKING_SERVICE_NAME = void 0;
9
+ exports.BookingServiceControllerMethods = BookingServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ function BookingServiceControllerMethods() {
13
+ return function (constructor) {
14
+ const grpcMethods = ["getUserBookings", "createReservation", "confirmBooking", "cancelBooking"];
15
+ for (const method of grpcMethods) {
16
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
17
+ (0, microservices_1.GrpcMethod)("BookingService", 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)("BookingService", method)(constructor.prototype[method], method, descriptor);
24
+ Object.defineProperty(constructor.prototype, method, descriptor);
25
+ }
26
+ };
27
+ }
28
+ exports.BOOKING_SERVICE_NAME = "BookingService";
@@ -0,0 +1 @@
1
+ export * as v1 from "./index.booking.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.booking.v1"));
@@ -0,0 +1 @@
1
+ export * from "./booking";
@@ -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("./booking"), exports);
@@ -1,6 +1,7 @@
1
1
  export * as account from "./index.account";
2
2
  export * as google from "./index.google";
3
3
  export * as auth from "./index.auth";
4
+ export * as booking from "./index.booking";
4
5
  export * as category from "./index.category";
5
6
  export * as common from "./index.common";
6
7
  export * as hall from "./index.hall";
@@ -37,11 +37,12 @@ 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.refund = 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.booking = 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"));
44
44
  exports.auth = __importStar(require("./index.auth"));
45
+ exports.booking = __importStar(require("./index.booking"));
45
46
  exports.category = __importStar(require("./index.category"));
46
47
  exports.common = __importStar(require("./index.common"));
47
48
  exports.hall = __importStar(require("./index.hall"));
@@ -46,6 +46,7 @@ export interface Movie {
46
46
  slug: string;
47
47
  duration: number;
48
48
  banner: string;
49
+ poster: string;
49
50
  }
50
51
  export interface Theater {
51
52
  id: string;
@@ -11,4 +11,5 @@ export declare const PROTO_PATHS: {
11
11
  readonly SCREENING: string;
12
12
  readonly PAYMENT: string;
13
13
  readonly REFUND: string;
14
+ readonly BOOKING: string;
14
15
  };
@@ -15,4 +15,5 @@ exports.PROTO_PATHS = {
15
15
  SCREENING: (0, path_1.join)(__dirname, "../../../proto/screening.proto"),
16
16
  PAYMENT: (0, path_1.join)(__dirname, "../../../proto/payment.proto"),
17
17
  REFUND: (0, path_1.join)(__dirname, "../../../proto/refund.proto"),
18
+ BOOKING: (0, path_1.join)(__dirname, "../../../proto/booking.proto"),
18
19
  };
@@ -0,0 +1,143 @@
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: booking.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+
11
+ export interface GetUserBookingsRequest {
12
+ userId: string;
13
+ }
14
+
15
+ export interface GetUserBookingsResponse {
16
+ bookings: Booking[];
17
+ }
18
+
19
+ export interface CreateReservationRequest {
20
+ screeningId: string;
21
+ seatIds: string[];
22
+ }
23
+
24
+ export interface CreateReservationResponse {
25
+ bookingId: string;
26
+ totalPrice: number;
27
+ }
28
+
29
+ export interface ConfirmBookingRequest {
30
+ bookingId: string;
31
+ userId: string;
32
+ }
33
+
34
+ export interface ConfirmBookingResponse {
35
+ ok: boolean;
36
+ }
37
+
38
+ export interface CancelBookingRequest {
39
+ bookingId: string;
40
+ userId: string;
41
+ }
42
+
43
+ export interface CancelBookingResponse {
44
+ ok: boolean;
45
+ }
46
+
47
+ export interface Booking {
48
+ id: string;
49
+ totalPrice: number;
50
+ qrCode?: string | undefined;
51
+ userId: string;
52
+ status: string;
53
+ tickets: Ticket[];
54
+ createdT: string;
55
+ }
56
+
57
+ export interface Ticket {
58
+ id: string;
59
+ price: number;
60
+ paidAt: string;
61
+ status: string;
62
+ screening: ScreeningInfo | undefined;
63
+ seat: SeatInfo | undefined;
64
+ }
65
+
66
+ export interface SeatInfo {
67
+ id: string;
68
+ row: number;
69
+ number: number;
70
+ }
71
+
72
+ export interface MovieInfo {
73
+ id: string;
74
+ title: string;
75
+ poster: string;
76
+ }
77
+
78
+ export interface TheaterInfo {
79
+ id: string;
80
+ name: string;
81
+ address: string;
82
+ }
83
+
84
+ export interface HallInfo {
85
+ id: string;
86
+ name: string;
87
+ }
88
+
89
+ export interface ScreeningInfo {
90
+ id: string;
91
+ startsAt: string;
92
+ endsAt: string;
93
+ movie: MovieInfo | undefined;
94
+ theater: TheaterInfo | undefined;
95
+ hall: HallInfo | undefined;
96
+ }
97
+
98
+ export interface BookingServiceClient {
99
+ getUserBookings(request: GetUserBookingsRequest): Observable<GetUserBookingsResponse>;
100
+
101
+ createReservation(request: CreateReservationRequest): Observable<CreateReservationResponse>;
102
+
103
+ confirmBooking(request: ConfirmBookingRequest): Observable<ConfirmBookingResponse>;
104
+
105
+ cancelBooking(request: CancelBookingRequest): Observable<CancelBookingResponse>;
106
+ }
107
+
108
+ export interface BookingServiceController {
109
+ getUserBookings(
110
+ request: GetUserBookingsRequest,
111
+ ): Promise<GetUserBookingsResponse> | Observable<GetUserBookingsResponse> | GetUserBookingsResponse;
112
+
113
+ createReservation(
114
+ request: CreateReservationRequest,
115
+ ): Promise<CreateReservationResponse> | Observable<CreateReservationResponse> | CreateReservationResponse;
116
+
117
+ confirmBooking(
118
+ request: ConfirmBookingRequest,
119
+ ): Promise<ConfirmBookingResponse> | Observable<ConfirmBookingResponse> | ConfirmBookingResponse;
120
+
121
+ cancelBooking(
122
+ request: CancelBookingRequest,
123
+ ): Promise<CancelBookingResponse> | Observable<CancelBookingResponse> | CancelBookingResponse;
124
+ }
125
+
126
+ export function BookingServiceControllerMethods() {
127
+ return function (constructor: Function) {
128
+ const grpcMethods: string[] = ["getUserBookings", "createReservation", "confirmBooking", "cancelBooking"];
129
+ for (const method of grpcMethods) {
130
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
131
+ GrpcMethod("BookingService", method)(constructor.prototype[method], method, descriptor);
132
+ Object.defineProperty(constructor.prototype, method, descriptor);
133
+ }
134
+ const grpcStreamMethods: string[] = [];
135
+ for (const method of grpcStreamMethods) {
136
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
137
+ GrpcStreamMethod("BookingService", method)(constructor.prototype[method], method, descriptor);
138
+ Object.defineProperty(constructor.prototype, method, descriptor);
139
+ }
140
+ };
141
+ }
142
+
143
+ export const BOOKING_SERVICE_NAME = "BookingService";
@@ -0,0 +1,8 @@
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
+
6
+ /* eslint-disable */
7
+
8
+ export * as v1 from "./index.booking.v1";
@@ -0,0 +1,8 @@
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
+
6
+ /* eslint-disable */
7
+
8
+ export * from "./booking";
package/gen/ts/index.ts CHANGED
@@ -8,6 +8,7 @@
8
8
  export * as account from "./index.account";
9
9
  export * as google from "./index.google";
10
10
  export * as auth from "./index.auth";
11
+ export * as booking from "./index.booking";
11
12
  export * as category from "./index.category";
12
13
  export * as common from "./index.common";
13
14
  export * as hall from "./index.hall";
@@ -64,6 +64,7 @@ export interface Movie {
64
64
  slug: string;
65
65
  duration: number;
66
66
  banner: string;
67
+ poster: string;
67
68
  }
68
69
 
69
70
  export interface Theater {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neo-tickets/contracts",
3
- "version": "1.22.0",
3
+ "version": "1.24.0",
4
4
  "main": "./dist/src/index.js",
5
5
  "types": "./dist/src/index.d.ts",
6
6
  "scripts": {
@@ -0,0 +1,99 @@
1
+ syntax = "proto3";
2
+
3
+ package booking.v1;
4
+
5
+ service BookingService {
6
+ rpc GetUserBookings (GetUserBookingsRequest) returns (GetUserBookingsResponse);
7
+ rpc CreateReservation (CreateReservationRequest) returns (CreateReservationResponse);
8
+ rpc ConfirmBooking (ConfirmBookingRequest) returns (ConfirmBookingResponse);
9
+ rpc CancelBooking (CancelBookingRequest) returns (CancelBookingResponse);
10
+ }
11
+
12
+ message GetUserBookingsRequest {
13
+ string user_id = 1;
14
+ }
15
+
16
+ message GetUserBookingsResponse {
17
+ repeated Booking bookings = 1;
18
+ }
19
+
20
+ message CreateReservationRequest {
21
+ string screening_id = 1;
22
+ repeated string seat_ids = 2;
23
+ }
24
+
25
+ message CreateReservationResponse {
26
+ string booking_id = 1;
27
+ int32 total_price = 2;
28
+ }
29
+
30
+ message ConfirmBookingRequest {
31
+ string booking_id = 1;
32
+ string user_id = 2;
33
+ }
34
+
35
+ message ConfirmBookingResponse {
36
+ bool ok = 1;
37
+ }
38
+
39
+ message CancelBookingRequest {
40
+ string booking_id = 1;
41
+ string user_id = 2;
42
+ }
43
+
44
+ message CancelBookingResponse {
45
+ bool ok = 1;
46
+ }
47
+
48
+ message Booking {
49
+ string id = 1;
50
+ int32 total_price = 2;
51
+ optional string qr_code = 3;
52
+ string user_id = 4;
53
+ string status = 5;
54
+ repeated Ticket tickets = 6;
55
+ string created_t = 7;
56
+ }
57
+
58
+ message Ticket {
59
+ string id = 1;
60
+ int32 price = 2;
61
+ string paid_at = 3;
62
+ string status = 4;
63
+
64
+ ScreeningInfo screening = 5;
65
+ SeatInfo seat = 6;
66
+ }
67
+
68
+ message SeatInfo {
69
+ string id = 1;
70
+ int32 row = 2;
71
+ int32 number = 3;
72
+ }
73
+
74
+ message MovieInfo {
75
+ string id = 1;
76
+ string title = 2;
77
+ string poster = 3;
78
+ }
79
+
80
+ message TheaterInfo {
81
+ string id = 1;
82
+ string name = 2;
83
+ string address = 3;
84
+ }
85
+
86
+ message HallInfo {
87
+ string id = 1;
88
+ string name = 2;
89
+ }
90
+
91
+ message ScreeningInfo {
92
+ string id = 1;
93
+ string starts_at = 2;
94
+ string ends_at = 3;
95
+
96
+ MovieInfo movie = 4;
97
+ TheaterInfo theater = 5;
98
+ HallInfo hall = 6;
99
+ }
@@ -64,6 +64,7 @@ message Movie {
64
64
  string slug = 3;
65
65
  int32 duration = 4;
66
66
  string banner = 5;
67
+ string poster = 6;
67
68
  }
68
69
 
69
70
  message Theater {