@neo-tickets/contracts 1.23.1 → 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.
- package/dist/gen/ts/booking.d.ts +30 -29
- package/dist/gen/ts/booking.js +1 -7
- package/gen/ts/booking.ts +31 -41
- package/package.json +1 -1
- package/proto/booking.proto +33 -30
package/dist/gen/ts/booking.d.ts
CHANGED
|
@@ -3,21 +3,15 @@ export interface GetUserBookingsRequest {
|
|
|
3
3
|
userId: string;
|
|
4
4
|
}
|
|
5
5
|
export interface GetUserBookingsResponse {
|
|
6
|
-
bookings:
|
|
6
|
+
bookings: Booking[];
|
|
7
7
|
}
|
|
8
8
|
export interface CreateReservationRequest {
|
|
9
|
-
userId: string;
|
|
10
9
|
screeningId: string;
|
|
11
|
-
|
|
10
|
+
seatIds: string[];
|
|
12
11
|
}
|
|
13
12
|
export interface CreateReservationResponse {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
amount: number;
|
|
17
|
-
}
|
|
18
|
-
export interface SeatInput {
|
|
19
|
-
seatId: string;
|
|
20
|
-
price: number;
|
|
13
|
+
bookingId: string;
|
|
14
|
+
totalPrice: number;
|
|
21
15
|
}
|
|
22
16
|
export interface ConfirmBookingRequest {
|
|
23
17
|
bookingId: string;
|
|
@@ -33,54 +27,61 @@ export interface CancelBookingRequest {
|
|
|
33
27
|
export interface CancelBookingResponse {
|
|
34
28
|
ok: boolean;
|
|
35
29
|
}
|
|
36
|
-
export interface
|
|
37
|
-
|
|
38
|
-
|
|
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;
|
|
39
38
|
}
|
|
40
|
-
export interface
|
|
41
|
-
|
|
39
|
+
export interface Ticket {
|
|
40
|
+
id: string;
|
|
41
|
+
price: number;
|
|
42
|
+
paidAt: string;
|
|
43
|
+
status: string;
|
|
44
|
+
screening: ScreeningInfo | undefined;
|
|
45
|
+
seat: SeatInfo | undefined;
|
|
42
46
|
}
|
|
43
|
-
export interface
|
|
47
|
+
export interface SeatInfo {
|
|
44
48
|
id: string;
|
|
45
49
|
row: number;
|
|
46
50
|
number: number;
|
|
47
51
|
}
|
|
48
|
-
export interface
|
|
52
|
+
export interface MovieInfo {
|
|
49
53
|
id: string;
|
|
50
54
|
title: string;
|
|
51
55
|
poster: string;
|
|
52
56
|
}
|
|
53
|
-
export interface
|
|
57
|
+
export interface TheaterInfo {
|
|
54
58
|
id: string;
|
|
55
59
|
name: string;
|
|
60
|
+
address: string;
|
|
56
61
|
}
|
|
57
|
-
export interface
|
|
62
|
+
export interface HallInfo {
|
|
58
63
|
id: string;
|
|
59
64
|
name: string;
|
|
60
65
|
}
|
|
61
|
-
export interface
|
|
66
|
+
export interface ScreeningInfo {
|
|
62
67
|
id: string;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
movie:
|
|
66
|
-
theater:
|
|
67
|
-
hall:
|
|
68
|
-
seats: BookingSeatInfo[];
|
|
69
|
-
qrCode: string;
|
|
68
|
+
startsAt: string;
|
|
69
|
+
endsAt: string;
|
|
70
|
+
movie: MovieInfo | undefined;
|
|
71
|
+
theater: TheaterInfo | undefined;
|
|
72
|
+
hall: HallInfo | undefined;
|
|
70
73
|
}
|
|
71
74
|
export interface BookingServiceClient {
|
|
72
75
|
getUserBookings(request: GetUserBookingsRequest): Observable<GetUserBookingsResponse>;
|
|
73
76
|
createReservation(request: CreateReservationRequest): Observable<CreateReservationResponse>;
|
|
74
77
|
confirmBooking(request: ConfirmBookingRequest): Observable<ConfirmBookingResponse>;
|
|
75
78
|
cancelBooking(request: CancelBookingRequest): Observable<CancelBookingResponse>;
|
|
76
|
-
listReservedSeats(request: ListReservedSeatsRequest): Observable<ListReservedSeatsResponse>;
|
|
77
79
|
}
|
|
78
80
|
export interface BookingServiceController {
|
|
79
81
|
getUserBookings(request: GetUserBookingsRequest): Promise<GetUserBookingsResponse> | Observable<GetUserBookingsResponse> | GetUserBookingsResponse;
|
|
80
82
|
createReservation(request: CreateReservationRequest): Promise<CreateReservationResponse> | Observable<CreateReservationResponse> | CreateReservationResponse;
|
|
81
83
|
confirmBooking(request: ConfirmBookingRequest): Promise<ConfirmBookingResponse> | Observable<ConfirmBookingResponse> | ConfirmBookingResponse;
|
|
82
84
|
cancelBooking(request: CancelBookingRequest): Promise<CancelBookingResponse> | Observable<CancelBookingResponse> | CancelBookingResponse;
|
|
83
|
-
listReservedSeats(request: ListReservedSeatsRequest): Promise<ListReservedSeatsResponse> | Observable<ListReservedSeatsResponse> | ListReservedSeatsResponse;
|
|
84
85
|
}
|
|
85
86
|
export declare function BookingServiceControllerMethods(): (constructor: Function) => void;
|
|
86
87
|
export declare const BOOKING_SERVICE_NAME = "BookingService";
|
package/dist/gen/ts/booking.js
CHANGED
|
@@ -11,13 +11,7 @@ exports.BookingServiceControllerMethods = BookingServiceControllerMethods;
|
|
|
11
11
|
const microservices_1 = require("@nestjs/microservices");
|
|
12
12
|
function BookingServiceControllerMethods() {
|
|
13
13
|
return function (constructor) {
|
|
14
|
-
const grpcMethods = [
|
|
15
|
-
"getUserBookings",
|
|
16
|
-
"createReservation",
|
|
17
|
-
"confirmBooking",
|
|
18
|
-
"cancelBooking",
|
|
19
|
-
"listReservedSeats",
|
|
20
|
-
];
|
|
14
|
+
const grpcMethods = ["getUserBookings", "createReservation", "confirmBooking", "cancelBooking"];
|
|
21
15
|
for (const method of grpcMethods) {
|
|
22
16
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
23
17
|
(0, microservices_1.GrpcMethod)("BookingService", method)(constructor.prototype[method], method, descriptor);
|
package/gen/ts/booking.ts
CHANGED
|
@@ -13,24 +13,17 @@ export interface GetUserBookingsRequest {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export interface GetUserBookingsResponse {
|
|
16
|
-
bookings:
|
|
16
|
+
bookings: Booking[];
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export interface CreateReservationRequest {
|
|
20
|
-
userId: string;
|
|
21
20
|
screeningId: string;
|
|
22
|
-
|
|
21
|
+
seatIds: string[];
|
|
23
22
|
}
|
|
24
23
|
|
|
25
24
|
export interface CreateReservationResponse {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
amount: number;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface SeatInput {
|
|
32
|
-
seatId: string;
|
|
33
|
-
price: number;
|
|
25
|
+
bookingId: string;
|
|
26
|
+
totalPrice: number;
|
|
34
27
|
}
|
|
35
28
|
|
|
36
29
|
export interface ConfirmBookingRequest {
|
|
@@ -51,46 +44,55 @@ export interface CancelBookingResponse {
|
|
|
51
44
|
ok: boolean;
|
|
52
45
|
}
|
|
53
46
|
|
|
54
|
-
export interface
|
|
55
|
-
|
|
56
|
-
|
|
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;
|
|
57
55
|
}
|
|
58
56
|
|
|
59
|
-
export interface
|
|
60
|
-
|
|
57
|
+
export interface Ticket {
|
|
58
|
+
id: string;
|
|
59
|
+
price: number;
|
|
60
|
+
paidAt: string;
|
|
61
|
+
status: string;
|
|
62
|
+
screening: ScreeningInfo | undefined;
|
|
63
|
+
seat: SeatInfo | undefined;
|
|
61
64
|
}
|
|
62
65
|
|
|
63
|
-
export interface
|
|
66
|
+
export interface SeatInfo {
|
|
64
67
|
id: string;
|
|
65
68
|
row: number;
|
|
66
69
|
number: number;
|
|
67
70
|
}
|
|
68
71
|
|
|
69
|
-
export interface
|
|
72
|
+
export interface MovieInfo {
|
|
70
73
|
id: string;
|
|
71
74
|
title: string;
|
|
72
75
|
poster: string;
|
|
73
76
|
}
|
|
74
77
|
|
|
75
|
-
export interface
|
|
78
|
+
export interface TheaterInfo {
|
|
76
79
|
id: string;
|
|
77
80
|
name: string;
|
|
81
|
+
address: string;
|
|
78
82
|
}
|
|
79
83
|
|
|
80
|
-
export interface
|
|
84
|
+
export interface HallInfo {
|
|
81
85
|
id: string;
|
|
82
86
|
name: string;
|
|
83
87
|
}
|
|
84
88
|
|
|
85
|
-
export interface
|
|
89
|
+
export interface ScreeningInfo {
|
|
86
90
|
id: string;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
movie:
|
|
90
|
-
theater:
|
|
91
|
-
hall:
|
|
92
|
-
seats: BookingSeatInfo[];
|
|
93
|
-
qrCode: string;
|
|
91
|
+
startsAt: string;
|
|
92
|
+
endsAt: string;
|
|
93
|
+
movie: MovieInfo | undefined;
|
|
94
|
+
theater: TheaterInfo | undefined;
|
|
95
|
+
hall: HallInfo | undefined;
|
|
94
96
|
}
|
|
95
97
|
|
|
96
98
|
export interface BookingServiceClient {
|
|
@@ -101,8 +103,6 @@ export interface BookingServiceClient {
|
|
|
101
103
|
confirmBooking(request: ConfirmBookingRequest): Observable<ConfirmBookingResponse>;
|
|
102
104
|
|
|
103
105
|
cancelBooking(request: CancelBookingRequest): Observable<CancelBookingResponse>;
|
|
104
|
-
|
|
105
|
-
listReservedSeats(request: ListReservedSeatsRequest): Observable<ListReservedSeatsResponse>;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
export interface BookingServiceController {
|
|
@@ -121,21 +121,11 @@ export interface BookingServiceController {
|
|
|
121
121
|
cancelBooking(
|
|
122
122
|
request: CancelBookingRequest,
|
|
123
123
|
): Promise<CancelBookingResponse> | Observable<CancelBookingResponse> | CancelBookingResponse;
|
|
124
|
-
|
|
125
|
-
listReservedSeats(
|
|
126
|
-
request: ListReservedSeatsRequest,
|
|
127
|
-
): Promise<ListReservedSeatsResponse> | Observable<ListReservedSeatsResponse> | ListReservedSeatsResponse;
|
|
128
124
|
}
|
|
129
125
|
|
|
130
126
|
export function BookingServiceControllerMethods() {
|
|
131
127
|
return function (constructor: Function) {
|
|
132
|
-
const grpcMethods: string[] = [
|
|
133
|
-
"getUserBookings",
|
|
134
|
-
"createReservation",
|
|
135
|
-
"confirmBooking",
|
|
136
|
-
"cancelBooking",
|
|
137
|
-
"listReservedSeats",
|
|
138
|
-
];
|
|
128
|
+
const grpcMethods: string[] = ["getUserBookings", "createReservation", "confirmBooking", "cancelBooking"];
|
|
139
129
|
for (const method of grpcMethods) {
|
|
140
130
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
141
131
|
GrpcMethod("BookingService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/booking.proto
CHANGED
|
@@ -7,7 +7,6 @@ service BookingService {
|
|
|
7
7
|
rpc CreateReservation (CreateReservationRequest) returns (CreateReservationResponse);
|
|
8
8
|
rpc ConfirmBooking (ConfirmBookingRequest) returns (ConfirmBookingResponse);
|
|
9
9
|
rpc CancelBooking (CancelBookingRequest) returns (CancelBookingResponse);
|
|
10
|
-
rpc ListReservedSeats (ListReservedSeatsRequest) returns (ListReservedSeatsResponse);
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
message GetUserBookingsRequest {
|
|
@@ -15,24 +14,17 @@ message GetUserBookingsRequest {
|
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
message GetUserBookingsResponse {
|
|
18
|
-
repeated
|
|
17
|
+
repeated Booking bookings = 1;
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
message CreateReservationRequest {
|
|
22
|
-
string
|
|
23
|
-
string
|
|
24
|
-
repeated SeatInput seats = 3;
|
|
21
|
+
string screening_id = 1;
|
|
22
|
+
repeated string seat_ids = 2;
|
|
25
23
|
}
|
|
26
24
|
|
|
27
25
|
message CreateReservationResponse {
|
|
28
|
-
string
|
|
29
|
-
|
|
30
|
-
int32 amount = 3;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
message SeatInput {
|
|
34
|
-
string seat_id = 1;
|
|
35
|
-
int32 price = 2;
|
|
26
|
+
string booking_id = 1;
|
|
27
|
+
int32 total_price = 2;
|
|
36
28
|
}
|
|
37
29
|
|
|
38
30
|
message ConfirmBookingRequest {
|
|
@@ -53,44 +45,55 @@ message CancelBookingResponse {
|
|
|
53
45
|
bool ok = 1;
|
|
54
46
|
}
|
|
55
47
|
|
|
56
|
-
message
|
|
57
|
-
string
|
|
58
|
-
|
|
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;
|
|
59
56
|
}
|
|
60
57
|
|
|
61
|
-
message
|
|
62
|
-
|
|
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;
|
|
63
66
|
}
|
|
64
67
|
|
|
65
|
-
message
|
|
68
|
+
message SeatInfo {
|
|
66
69
|
string id = 1;
|
|
67
70
|
int32 row = 2;
|
|
68
71
|
int32 number = 3;
|
|
69
72
|
}
|
|
70
73
|
|
|
71
|
-
message
|
|
74
|
+
message MovieInfo {
|
|
72
75
|
string id = 1;
|
|
73
76
|
string title = 2;
|
|
74
77
|
string poster = 3;
|
|
75
78
|
}
|
|
76
79
|
|
|
77
|
-
message
|
|
80
|
+
message TheaterInfo {
|
|
78
81
|
string id = 1;
|
|
79
82
|
string name = 2;
|
|
83
|
+
string address = 3;
|
|
80
84
|
}
|
|
81
85
|
|
|
82
|
-
message
|
|
86
|
+
message HallInfo {
|
|
83
87
|
string id = 1;
|
|
84
88
|
string name = 2;
|
|
85
89
|
}
|
|
86
90
|
|
|
87
|
-
message
|
|
91
|
+
message ScreeningInfo {
|
|
88
92
|
string id = 1;
|
|
89
|
-
string
|
|
90
|
-
string
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
string qr_code = 8;
|
|
93
|
+
string starts_at = 2;
|
|
94
|
+
string ends_at = 3;
|
|
95
|
+
|
|
96
|
+
MovieInfo movie = 4;
|
|
97
|
+
TheaterInfo theater = 5;
|
|
98
|
+
HallInfo hall = 6;
|
|
96
99
|
}
|