@teacinema/contracts 1.2.4 → 1.3.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/proto/paths.d.ts +2 -0
- package/dist/proto/paths.js +2 -0
- package/gen/ts/hall.ts +89 -0
- package/gen/ts/seat.ts +71 -0
- package/gen/ts/theater.ts +1 -1
- package/package.json +1 -1
- package/proto/hall.proto +49 -0
- package/proto/seat.proto +35 -0
- package/proto/theater.proto +1 -1
package/dist/proto/paths.d.ts
CHANGED
package/dist/proto/paths.js
CHANGED
|
@@ -10,4 +10,6 @@ exports.PROTO_PATHS = {
|
|
|
10
10
|
MOVIE: (0, path_1.join)(__dirname, '../../proto/movie.proto'),
|
|
11
11
|
CATEGORY: (0, path_1.join)(__dirname, '../../proto/category.proto'),
|
|
12
12
|
THEATER: (0, path_1.join)(__dirname, '../../proto/theater.proto'),
|
|
13
|
+
HALL: (0, path_1.join)(__dirname, '../../proto/hall.proto'),
|
|
14
|
+
SEAT: (0, path_1.join)(__dirname, '../../proto/seat.proto'),
|
|
13
15
|
};
|
package/gen/ts/hall.ts
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.8.3
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: hall.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "hall.v1";
|
|
12
|
+
|
|
13
|
+
export interface CreateHallRequest {
|
|
14
|
+
name: string;
|
|
15
|
+
theaterId: string;
|
|
16
|
+
layout: RowLayout[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface CreateHallResponse {
|
|
20
|
+
hall: Hall | undefined;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface GetHallRequest {
|
|
24
|
+
id: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface GetHallResponse {
|
|
28
|
+
halls: Hall | undefined;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface ListHallsRequest {
|
|
32
|
+
theaterId: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface ListHallsResponse {
|
|
36
|
+
hall: Hall[];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface Hall {
|
|
40
|
+
id: string;
|
|
41
|
+
name: string;
|
|
42
|
+
theaterId: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface RowLayout {
|
|
46
|
+
row: number;
|
|
47
|
+
columns: number;
|
|
48
|
+
type: string;
|
|
49
|
+
price: number;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const HALL_V1_PACKAGE_NAME = "hall.v1";
|
|
53
|
+
|
|
54
|
+
export interface HallServiceClient {
|
|
55
|
+
createHall(request: CreateHallRequest): Observable<CreateHallResponse>;
|
|
56
|
+
|
|
57
|
+
getHall(request: GetHallRequest): Observable<GetHallResponse>;
|
|
58
|
+
|
|
59
|
+
listHallsByTheater(request: ListHallsRequest): Observable<ListHallsResponse>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface HallServiceController {
|
|
63
|
+
createHall(
|
|
64
|
+
request: CreateHallRequest,
|
|
65
|
+
): Promise<CreateHallResponse> | Observable<CreateHallResponse> | CreateHallResponse;
|
|
66
|
+
|
|
67
|
+
getHall(request: GetHallRequest): Promise<GetHallResponse> | Observable<GetHallResponse> | GetHallResponse;
|
|
68
|
+
|
|
69
|
+
listHallsByTheater(
|
|
70
|
+
request: ListHallsRequest,
|
|
71
|
+
): Promise<ListHallsResponse> | Observable<ListHallsResponse> | ListHallsResponse;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function HallServiceControllerMethods() {
|
|
75
|
+
return function (constructor: Function) {
|
|
76
|
+
const grpcMethods: string[] = ["createHall", "getHall", "listHallsByTheater"];
|
|
77
|
+
for (const method of grpcMethods) {
|
|
78
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
79
|
+
GrpcMethod("HallService", method)(constructor.prototype[method], method, descriptor);
|
|
80
|
+
}
|
|
81
|
+
const grpcStreamMethods: string[] = [];
|
|
82
|
+
for (const method of grpcStreamMethods) {
|
|
83
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
84
|
+
GrpcStreamMethod("HallService", method)(constructor.prototype[method], method, descriptor);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export const HALL_SERVICE_NAME = "HallService";
|
package/gen/ts/seat.ts
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.8.3
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: seat.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "seat.v1";
|
|
12
|
+
|
|
13
|
+
export interface GetSeatRequest {
|
|
14
|
+
id: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface GetSeatResponse {
|
|
18
|
+
seat: Seat | undefined;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface ListSeatsRequest {
|
|
22
|
+
hallId: string;
|
|
23
|
+
screeningId: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface ListSeatsResponse {
|
|
27
|
+
seat: Seat[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface Seat {
|
|
31
|
+
id: string;
|
|
32
|
+
row: number;
|
|
33
|
+
number: number;
|
|
34
|
+
price: number;
|
|
35
|
+
status: string;
|
|
36
|
+
type: string;
|
|
37
|
+
hallId: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const SEAT_V1_PACKAGE_NAME = "seat.v1";
|
|
41
|
+
|
|
42
|
+
export interface SeatServiceClient {
|
|
43
|
+
getSeat(request: GetSeatRequest): Observable<GetSeatResponse>;
|
|
44
|
+
|
|
45
|
+
listSeatsByHall(request: ListSeatsRequest): Observable<ListSeatsResponse>;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface SeatServiceController {
|
|
49
|
+
getSeat(request: GetSeatRequest): Promise<GetSeatResponse> | Observable<GetSeatResponse> | GetSeatResponse;
|
|
50
|
+
|
|
51
|
+
listSeatsByHall(
|
|
52
|
+
request: ListSeatsRequest,
|
|
53
|
+
): Promise<ListSeatsResponse> | Observable<ListSeatsResponse> | ListSeatsResponse;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function SeatServiceControllerMethods() {
|
|
57
|
+
return function (constructor: Function) {
|
|
58
|
+
const grpcMethods: string[] = ["getSeat", "listSeatsByHall"];
|
|
59
|
+
for (const method of grpcMethods) {
|
|
60
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
61
|
+
GrpcMethod("SeatService", method)(constructor.prototype[method], method, descriptor);
|
|
62
|
+
}
|
|
63
|
+
const grpcStreamMethods: string[] = [];
|
|
64
|
+
for (const method of grpcStreamMethods) {
|
|
65
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
66
|
+
GrpcStreamMethod("SeatService", method)(constructor.prototype[method], method, descriptor);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const SEAT_SERVICE_NAME = "SeatService";
|
package/gen/ts/theater.ts
CHANGED
package/package.json
CHANGED
package/proto/hall.proto
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package hall.v1;
|
|
4
|
+
|
|
5
|
+
service HallService {
|
|
6
|
+
rpc CreateHall (CreateHallRequest) returns (CreateHallResponse);
|
|
7
|
+
|
|
8
|
+
rpc GetHall (GetHallRequest) returns (GetHallResponse);
|
|
9
|
+
rpc ListHallsByTheater (ListHallsRequest) returns (ListHallsResponse);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
message CreateHallRequest {
|
|
13
|
+
string name = 1;
|
|
14
|
+
string theater_id = 2;
|
|
15
|
+
repeated RowLayout layout = 3;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
message CreateHallResponse {
|
|
19
|
+
Hall hall = 1;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
message GetHallRequest {
|
|
23
|
+
string id = 1;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
message GetHallResponse {
|
|
27
|
+
Hall halls = 1;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
message ListHallsRequest {
|
|
31
|
+
string theater_id = 1;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
message ListHallsResponse {
|
|
35
|
+
repeated Hall hall = 1;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
message Hall {
|
|
39
|
+
string id = 1;
|
|
40
|
+
string name = 2;
|
|
41
|
+
string theater_id = 3;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
message RowLayout {
|
|
45
|
+
int32 row = 1;
|
|
46
|
+
int32 columns = 2;
|
|
47
|
+
string type = 3;
|
|
48
|
+
int32 price = 4;
|
|
49
|
+
}
|
package/proto/seat.proto
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package seat.v1;
|
|
4
|
+
|
|
5
|
+
service SeatService {
|
|
6
|
+
rpc GetSeat (GetSeatRequest) returns (GetSeatResponse);
|
|
7
|
+
rpc ListSeatsByHall (ListSeatsRequest) returns (ListSeatsResponse);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
message GetSeatRequest {
|
|
11
|
+
string id = 1;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
message GetSeatResponse {
|
|
15
|
+
Seat seat = 1;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
message ListSeatsRequest {
|
|
19
|
+
string hall_id = 1;
|
|
20
|
+
string screening_id = 2;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
message ListSeatsResponse {
|
|
24
|
+
repeated Seat seat = 1;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
message Seat {
|
|
28
|
+
string id = 1;
|
|
29
|
+
int32 row = 2;
|
|
30
|
+
int32 number = 3;
|
|
31
|
+
int32 price = 4;
|
|
32
|
+
string status = 5;
|
|
33
|
+
string type = 6;
|
|
34
|
+
string hall_id = 8;
|
|
35
|
+
}
|