@tcinema-pro/contracts 1.3.8 → 1.4.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.
@@ -6,4 +6,7 @@ export declare const PROTO_PATHS: {
6
6
  readonly MOVIE: string;
7
7
  readonly CATEGORY: string;
8
8
  readonly THEATER: string;
9
+ readonly HALL: string;
10
+ readonly SEAT: string;
11
+ readonly SCREENING: string;
9
12
  };
@@ -9,5 +9,8 @@ exports.PROTO_PATHS = {
9
9
  MEDIA: (0, path_1.join)(__dirname, '../../proto/media.proto'),
10
10
  MOVIE: (0, path_1.join)(__dirname, '../../proto/movie.proto'),
11
11
  CATEGORY: (0, path_1.join)(__dirname, '../../proto/category.proto'),
12
- THEATER: (0, path_1.join)(__dirname, '../../proto/theater.proto')
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'),
15
+ SCREENING: (0, path_1.join)(__dirname, '../../proto/screening.proto'),
13
16
  };
package/gen/hall.ts ADDED
@@ -0,0 +1,90 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.2
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 GetHallsByTheaterRequest {
14
+ theaterId: string;
15
+ }
16
+
17
+ export interface GetHallsByTheaterResponse {
18
+ hall: Hall | undefined;
19
+ }
20
+
21
+ export interface GetHallRequest {
22
+ id: string;
23
+ }
24
+
25
+ export interface GetHallResponse {
26
+ hall: Hall | undefined;
27
+ }
28
+
29
+ export interface CreateHallRequest {
30
+ name: string;
31
+ theaterId: string;
32
+ layout: RowLayout[];
33
+ }
34
+
35
+ export interface RowLayout {
36
+ row: number;
37
+ cols: number;
38
+ type: string;
39
+ price: number;
40
+ }
41
+
42
+ export interface CreateHallResponse {
43
+ hall: Hall | undefined;
44
+ }
45
+
46
+ export interface Hall {
47
+ name: string;
48
+ theaterId: string;
49
+ layout: RowLayout[];
50
+ id: string;
51
+ }
52
+
53
+ export const HALL_V1_PACKAGE_NAME = "hall.v1";
54
+
55
+ export interface HallServiceClient {
56
+ getHall(request: GetHallRequest): Observable<GetHallResponse>;
57
+
58
+ getHallsByTheater(request: GetHallsByTheaterRequest): Observable<GetHallsByTheaterResponse>;
59
+
60
+ createHall(request: CreateHallRequest): Observable<CreateHallResponse>;
61
+ }
62
+
63
+ export interface HallServiceController {
64
+ getHall(request: GetHallRequest): Promise<GetHallResponse> | Observable<GetHallResponse> | GetHallResponse;
65
+
66
+ getHallsByTheater(
67
+ request: GetHallsByTheaterRequest,
68
+ ): Promise<GetHallsByTheaterResponse> | Observable<GetHallsByTheaterResponse> | GetHallsByTheaterResponse;
69
+
70
+ createHall(
71
+ request: CreateHallRequest,
72
+ ): Promise<CreateHallResponse> | Observable<CreateHallResponse> | CreateHallResponse;
73
+ }
74
+
75
+ export function HallServiceControllerMethods() {
76
+ return function (constructor: Function) {
77
+ const grpcMethods: string[] = ["getHall", "getHallsByTheater", "createHall"];
78
+ for (const method of grpcMethods) {
79
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
80
+ GrpcMethod("HallService", method)(constructor.prototype[method], method, descriptor);
81
+ }
82
+ const grpcStreamMethods: string[] = [];
83
+ for (const method of grpcStreamMethods) {
84
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
85
+ GrpcStreamMethod("HallService", method)(constructor.prototype[method], method, descriptor);
86
+ }
87
+ };
88
+ }
89
+
90
+ export const HALL_SERVICE_NAME = "HallService";
@@ -0,0 +1,130 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.2
4
+ // protoc v3.21.12
5
+ // source: screening.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+ import { Timestamp } from "./google/protobuf/timestamp";
11
+
12
+ export const protobufPackage = "screening.v1";
13
+
14
+ export interface GetScreeningRequest {
15
+ id: string;
16
+ }
17
+
18
+ export interface GetScreeningResponse {
19
+ screening: Screening | undefined;
20
+ }
21
+
22
+ export interface GetScreeningsByMovieRequest {
23
+ movieId: string;
24
+ date?: Timestamp | undefined;
25
+ }
26
+
27
+ export interface GetScreeningsByMovieResponse {
28
+ screening: Screening[];
29
+ }
30
+
31
+ export interface CreateScreeningRequest {
32
+ movieId: string;
33
+ hallId: string;
34
+ startAt: Timestamp | undefined;
35
+ endAt: Timestamp | undefined;
36
+ }
37
+
38
+ export interface CreateScreeningResponse {
39
+ ok: boolean;
40
+ }
41
+
42
+ export interface GetScreeningsRequest {
43
+ theaterId?: string | undefined;
44
+ date?: string | undefined;
45
+ }
46
+
47
+ export interface GetScreeningsResponse {
48
+ screening: Screening[];
49
+ }
50
+
51
+ export interface Screening {
52
+ id: string;
53
+ startAt: Timestamp | undefined;
54
+ startEnd: Timestamp | undefined;
55
+ theater: Theater | undefined;
56
+ hall: Hall | undefined;
57
+ seatTypes: SeatType[];
58
+ movie: Movie | undefined;
59
+ }
60
+
61
+ export interface Movie {
62
+ id: string;
63
+ title: string;
64
+ slug: string;
65
+ duration: number;
66
+ banner: string;
67
+ }
68
+
69
+ export interface Theater {
70
+ id: string;
71
+ name: string;
72
+ address: string;
73
+ }
74
+
75
+ export interface Hall {
76
+ id: string;
77
+ name: string;
78
+ }
79
+
80
+ export interface SeatType {
81
+ type: string;
82
+ price: number;
83
+ }
84
+
85
+ export const SCREENING_V1_PACKAGE_NAME = "screening.v1";
86
+
87
+ export interface ScreeningServiceClient {
88
+ createScreening(request: CreateScreeningRequest): Observable<CreateScreeningResponse>;
89
+
90
+ getScreenings(request: GetScreeningsRequest): Observable<GetScreeningsResponse>;
91
+
92
+ getScreeningsByMovie(request: GetScreeningsByMovieRequest): Observable<GetScreeningsByMovieResponse>;
93
+
94
+ getScreening(request: GetScreeningRequest): Observable<GetScreeningResponse>;
95
+ }
96
+
97
+ export interface ScreeningServiceController {
98
+ createScreening(
99
+ request: CreateScreeningRequest,
100
+ ): Promise<CreateScreeningResponse> | Observable<CreateScreeningResponse> | CreateScreeningResponse;
101
+
102
+ getScreenings(
103
+ request: GetScreeningsRequest,
104
+ ): Promise<GetScreeningsResponse> | Observable<GetScreeningsResponse> | GetScreeningsResponse;
105
+
106
+ getScreeningsByMovie(
107
+ request: GetScreeningsByMovieRequest,
108
+ ): Promise<GetScreeningsByMovieResponse> | Observable<GetScreeningsByMovieResponse> | GetScreeningsByMovieResponse;
109
+
110
+ getScreening(
111
+ request: GetScreeningRequest,
112
+ ): Promise<GetScreeningResponse> | Observable<GetScreeningResponse> | GetScreeningResponse;
113
+ }
114
+
115
+ export function ScreeningServiceControllerMethods() {
116
+ return function (constructor: Function) {
117
+ const grpcMethods: string[] = ["createScreening", "getScreenings", "getScreeningsByMovie", "getScreening"];
118
+ for (const method of grpcMethods) {
119
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
120
+ GrpcMethod("ScreeningService", method)(constructor.prototype[method], method, descriptor);
121
+ }
122
+ const grpcStreamMethods: string[] = [];
123
+ for (const method of grpcStreamMethods) {
124
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
125
+ GrpcStreamMethod("ScreeningService", method)(constructor.prototype[method], method, descriptor);
126
+ }
127
+ };
128
+ }
129
+
130
+ export const SCREENING_SERVICE_NAME = "ScreeningService";
package/gen/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.11.2
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 GetSeatsByHallRequest {
14
+ hallId: string;
15
+ screeningId: string;
16
+ }
17
+
18
+ export interface GetSeatsByHallResponse {
19
+ seat: Seat[];
20
+ }
21
+
22
+ export interface GetSeatRequest {
23
+ id: string;
24
+ }
25
+
26
+ export interface GetSeatResponse {
27
+ seat: Seat | undefined;
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
+ getSeatsByHall(request: GetSeatsByHallRequest): Observable<GetSeatsByHallResponse>;
46
+ }
47
+
48
+ export interface SeatServiceController {
49
+ getSeat(request: GetSeatRequest): Promise<GetSeatResponse> | Observable<GetSeatResponse> | GetSeatResponse;
50
+
51
+ getSeatsByHall(
52
+ request: GetSeatsByHallRequest,
53
+ ): Promise<GetSeatsByHallResponse> | Observable<GetSeatsByHallResponse> | GetSeatsByHallResponse;
54
+ }
55
+
56
+ export function SeatServiceControllerMethods() {
57
+ return function (constructor: Function) {
58
+ const grpcMethods: string[] = ["getSeat", "getSeatsByHall"];
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/theater.ts CHANGED
@@ -24,7 +24,7 @@ export interface GetTheaterRequest {
24
24
  }
25
25
 
26
26
  export interface CreateTheaterResponse {
27
- ok: boolean;
27
+ theater: Theater | undefined;
28
28
  }
29
29
 
30
30
  export interface CreateTheaterRequest {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tcinema-pro/contracts",
3
- "version": "1.3.8",
3
+ "version": "1.4.0",
4
4
  "description": "Protobuf defs",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -0,0 +1,51 @@
1
+ syntax = 'proto3';
2
+
3
+ package hall.v1;
4
+
5
+ import "google/protobuf/empty.proto";
6
+
7
+ service HallService {
8
+ rpc GetHall (GetHallRequest) returns (GetHallResponse);
9
+ rpc GetHallsByTheater (GetHallsByTheaterRequest) returns (GetHallsByTheaterResponse);
10
+ rpc CreateHall (CreateHallRequest) returns (CreateHallResponse);
11
+ }
12
+
13
+ message GetHallsByTheaterRequest {
14
+ string theater_id = 1;
15
+ }
16
+
17
+ message GetHallsByTheaterResponse {
18
+ Hall hall = 1;
19
+ }
20
+
21
+ message GetHallRequest {
22
+ string id = 1;
23
+ }
24
+
25
+ message GetHallResponse {
26
+ Hall hall = 1;
27
+ }
28
+
29
+ message CreateHallRequest {
30
+ string name = 1;
31
+ string theater_id = 2;
32
+ repeated RowLayout layout = 3;
33
+ }
34
+
35
+ message RowLayout {
36
+ int32 row = 1;
37
+ int32 cols = 2;
38
+ string type = 3;
39
+ int32 price = 4;
40
+ }
41
+
42
+ message CreateHallResponse {
43
+ Hall hall = 1;
44
+ }
45
+
46
+ message Hall {
47
+ string name = 1;
48
+ string theater_id = 2;
49
+ repeated RowLayout layout = 3;
50
+ string id = 4;
51
+ }
@@ -0,0 +1,84 @@
1
+ syntax = 'proto3';
2
+
3
+ package screening.v1;
4
+
5
+ import "google/protobuf/timestamp.proto";
6
+
7
+ service ScreeningService {
8
+ rpc CreateScreening (CreateScreeningRequest) returns (CreateScreeningResponse);
9
+ rpc GetScreenings (GetScreeningsRequest) returns (GetScreeningsResponse);
10
+ rpc GetScreeningsByMovie (GetScreeningsByMovieRequest) returns (GetScreeningsByMovieResponse);
11
+ rpc GetScreening (GetScreeningRequest) returns (GetScreeningResponse);
12
+ }
13
+
14
+ message GetScreeningRequest {
15
+ string id = 1;
16
+ }
17
+
18
+ message GetScreeningResponse {
19
+ Screening screening = 1;
20
+ }
21
+
22
+ message GetScreeningsByMovieRequest {
23
+ string movie_id = 1;
24
+ optional google.protobuf.Timestamp date = 2;
25
+ }
26
+
27
+ message GetScreeningsByMovieResponse {
28
+ repeated Screening screening = 1;
29
+ }
30
+
31
+ message CreateScreeningRequest {
32
+ string movie_id = 1;
33
+ string hall_id = 2;
34
+ google.protobuf.Timestamp start_at = 3;
35
+ google.protobuf.Timestamp end_at = 4;
36
+ }
37
+
38
+ message CreateScreeningResponse {
39
+ bool ok = 1;
40
+ }
41
+
42
+ message GetScreeningsRequest {
43
+ optional string theater_id = 1;
44
+ optional string date = 2;
45
+ }
46
+
47
+ message GetScreeningsResponse {
48
+ repeated Screening screening = 1;
49
+ }
50
+
51
+ message Screening {
52
+ string id = 1;
53
+ google.protobuf.Timestamp start_at = 2;
54
+ google.protobuf.Timestamp start_end = 3;
55
+
56
+ Theater theater = 4;
57
+ Hall hall = 5;
58
+ repeated SeatType seat_types = 6;
59
+ Movie movie = 7;
60
+ }
61
+
62
+ message Movie {
63
+ string id = 1;
64
+ string title = 2;
65
+ string slug = 3;
66
+ int32 duration = 4;
67
+ string banner = 5;
68
+ }
69
+
70
+ message Theater {
71
+ string id = 1;
72
+ string name = 2;
73
+ string address = 3;
74
+ }
75
+
76
+ message Hall {
77
+ string id = 1;
78
+ string name = 2;
79
+ }
80
+
81
+ message SeatType {
82
+ string type = 1;
83
+ int32 price = 2;
84
+ }
@@ -0,0 +1,37 @@
1
+ syntax = 'proto3';
2
+
3
+ package seat.v1;
4
+
5
+ import "google/protobuf/empty.proto";
6
+
7
+ service SeatService {
8
+ rpc GetSeat (GetSeatRequest) returns (GetSeatResponse);
9
+ rpc GetSeatsByHall (GetSeatsByHallRequest) returns (GetSeatsByHallResponse);
10
+ }
11
+
12
+ message GetSeatsByHallRequest {
13
+ string hall_id = 1;
14
+ string screening_id = 2;
15
+ }
16
+
17
+ message GetSeatsByHallResponse {
18
+ repeated Seat seat = 1;
19
+ }
20
+
21
+ message GetSeatRequest {
22
+ string id = 1;
23
+ }
24
+
25
+ message GetSeatResponse {
26
+ Seat seat = 1;
27
+ }
28
+
29
+ message Seat {
30
+ string id = 1;
31
+ int32 row = 2;
32
+ int32 number = 3;
33
+ int32 price = 4;
34
+ string status = 5;
35
+ string type = 6;
36
+ string hall_id = 8;
37
+ }
@@ -23,7 +23,7 @@ message GetTheaterRequest {
23
23
  }
24
24
 
25
25
  message CreateTheaterResponse {
26
- bool ok = 1;
26
+ Theater theater = 1;
27
27
  }
28
28
 
29
29
  message CreateTheaterRequest {