@just-education-org/rpc-contracts 1.14.1 → 1.15.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.
@@ -1,8 +1,47 @@
1
+ import { Observable } from "rxjs";
1
2
  export declare const protobufPackage = "hall.v1";
3
+ export interface CreateHellRequest {
4
+ name: string;
5
+ theaterId: string;
6
+ layout: RowLayout[];
7
+ }
8
+ export interface CreateHellResponse {
9
+ hall: Hall | undefined;
10
+ }
11
+ export interface GetHallRequest {
12
+ id: string;
13
+ }
14
+ export interface GetHallResponse {
15
+ hall: Hall | undefined;
16
+ }
17
+ export interface ListHallsRequest {
18
+ theaterId: string;
19
+ }
20
+ export interface ListHallsResponse {
21
+ halls: Hall[];
22
+ }
23
+ export interface Hall {
24
+ id: string;
25
+ name: string;
26
+ theaterId: string;
27
+ layout: RowLayout[];
28
+ }
29
+ export interface RowLayout {
30
+ row: number;
31
+ columns: number;
32
+ type: string;
33
+ price: number;
34
+ }
2
35
  export declare const HALL_V1_PACKAGE_NAME = "hall.v1";
3
36
  export interface HallServiceClient {
37
+ createHall(request: CreateHellRequest): Observable<CreateHellResponse>;
38
+ getHall(request: GetHallRequest): Observable<GetHallResponse>;
39
+ listHallsByTheater(request: ListHallsRequest): Observable<ListHallsResponse>;
4
40
  }
5
41
  export interface HallServiceController {
42
+ createHall(request: CreateHellRequest): Promise<CreateHellResponse> | Observable<CreateHellResponse> | CreateHellResponse;
43
+ getHall(request: GetHallRequest): Promise<GetHallResponse> | Observable<GetHallResponse> | GetHallResponse;
44
+ listHallsByTheater(request: ListHallsRequest): Promise<ListHallsResponse> | Observable<ListHallsResponse> | ListHallsResponse;
6
45
  }
7
46
  export declare function HallServiceControllerMethods(): (constructor: Function) => void;
8
47
  export declare const HALL_SERVICE_NAME = "HallService";
@@ -13,7 +13,7 @@ exports.protobufPackage = "hall.v1";
13
13
  exports.HALL_V1_PACKAGE_NAME = "hall.v1";
14
14
  function HallServiceControllerMethods() {
15
15
  return function (constructor) {
16
- const grpcMethods = [];
16
+ const grpcMethods = ["createHall", "getHall", "listHallsByTheater"];
17
17
  for (const method of grpcMethods) {
18
18
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
19
19
  (0, microservices_1.GrpcMethod)("HallService", method)(constructor.prototype[method], method, descriptor);
@@ -1,8 +1,35 @@
1
+ import { Observable } from "rxjs";
1
2
  export declare const protobufPackage = "seat.v1";
3
+ export interface GetSeatRequest {
4
+ id: string;
5
+ }
6
+ export interface GetSeatResponse {
7
+ seat: Seat | undefined;
8
+ }
9
+ export interface ListSeatsRequest {
10
+ hallId: string;
11
+ screeningId: string;
12
+ }
13
+ export interface ListSeatsResponse {
14
+ seat: Seat[];
15
+ }
16
+ export interface Seat {
17
+ id: string;
18
+ row: number;
19
+ number: number;
20
+ price: number;
21
+ status: string;
22
+ type: string;
23
+ hallId: string;
24
+ }
2
25
  export declare const SEAT_V1_PACKAGE_NAME = "seat.v1";
3
26
  export interface SeatServiceClient {
27
+ getSeat(request: GetSeatRequest): Observable<GetSeatResponse>;
28
+ listSeatsByHall(request: ListSeatsRequest): Observable<ListSeatsResponse>;
4
29
  }
5
30
  export interface SeatServiceController {
31
+ getSeat(request: GetSeatRequest): Promise<GetSeatResponse> | Observable<GetSeatResponse> | GetSeatResponse;
32
+ listSeatsByHall(request: ListSeatsRequest): Promise<ListSeatsResponse> | Observable<ListSeatsResponse> | ListSeatsResponse;
6
33
  }
7
34
  export declare function SeatServiceControllerMethods(): (constructor: Function) => void;
8
35
  export declare const SEAT_SERVICE_NAME = "SeatService";
@@ -13,7 +13,7 @@ exports.protobufPackage = "seat.v1";
13
13
  exports.SEAT_V1_PACKAGE_NAME = "seat.v1";
14
14
  function SeatServiceControllerMethods() {
15
15
  return function (constructor) {
16
- const grpcMethods = [];
16
+ const grpcMethods = ["getSeat", "listSeatsByHall"];
17
17
  for (const method of grpcMethods) {
18
18
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
19
19
  (0, microservices_1.GrpcMethod)("SeatService", method)(constructor.prototype[method], method, descriptor);
@@ -44,6 +44,8 @@ export interface Theater {
44
44
  status: TheaterStatus;
45
45
  openingHours: OpeningHours[];
46
46
  imageUrls: string[];
47
+ venueName?: string | undefined;
48
+ floor?: string | undefined;
47
49
  }
48
50
  export interface OpeningHours {
49
51
  dayOfWeek: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@just-education-org/rpc-contracts",
3
- "version": "1.14.1",
3
+ "version": "1.15.0",
4
4
  "description": "Protobuf definitions and generated TS types",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/proto/hall.proto CHANGED
@@ -2,4 +2,50 @@ syntax = "proto3";
2
2
 
3
3
  package hall.v1;
4
4
 
5
- service HallService {}
5
+ service HallService {
6
+ rpc CreateHall(CreateHellRequest) returns(CreateHellResponse);
7
+
8
+ rpc GetHall(GetHallRequest) returns (GetHallResponse);
9
+
10
+ rpc ListHallsByTheater(ListHallsRequest) returns (ListHallsResponse);
11
+ }
12
+
13
+ message CreateHellRequest {
14
+ string name = 1;
15
+ string theater_id = 2;
16
+ repeated RowLayout layout = 3;
17
+ }
18
+
19
+ message CreateHellResponse {
20
+ Hall hall = 1;
21
+ }
22
+
23
+ message GetHallRequest {
24
+ string id = 1;
25
+ }
26
+
27
+ message GetHallResponse {
28
+ Hall hall = 1;
29
+ }
30
+
31
+ message ListHallsRequest {
32
+ string theater_id = 1;
33
+ }
34
+
35
+ message ListHallsResponse {
36
+ repeated Hall halls = 1;
37
+ }
38
+
39
+ message Hall {
40
+ string id = 1;
41
+ string name = 2;
42
+ string theater_id = 3;
43
+ repeated RowLayout layout = 4;
44
+ }
45
+
46
+ message RowLayout {
47
+ int32 row = 1;
48
+ int32 columns = 2;
49
+ string type = 3;
50
+ int32 price = 4;
51
+ }
package/proto/seat.proto CHANGED
@@ -2,4 +2,35 @@ syntax = "proto3";
2
2
 
3
3
  package seat.v1;
4
4
 
5
- service SeatService {}
5
+ service SeatService {
6
+ rpc GetSeat(GetSeatRequest) returns (GetSeatResponse);
7
+
8
+ rpc ListSeatsByHall(ListSeatsRequest) returns(ListSeatsResponse);
9
+ }
10
+
11
+ message GetSeatRequest {
12
+ string id = 1;
13
+ }
14
+
15
+ message GetSeatResponse {
16
+ Seat seat = 1;
17
+ }
18
+
19
+ message ListSeatsRequest {
20
+ string hall_id = 1;
21
+ string screening_id = 2;
22
+ }
23
+
24
+ message ListSeatsResponse {
25
+ repeated Seat seat = 1;
26
+ }
27
+
28
+ message Seat {
29
+ string id = 1;
30
+ int32 row = 2;
31
+ int32 number = 3;
32
+ int32 price = 4;
33
+ string status = 5;
34
+ string type = 6;
35
+ string hall_id = 8;
36
+ }
@@ -57,12 +57,11 @@ message Theater {
57
57
  optional string email = 6;
58
58
  optional string website_url = 7;
59
59
  optional string timezone = 8;
60
- TheaterStatus status = 10;
61
- repeated OpeningHours opening_hours = 11;
62
- repeated string image_urls = 13;
63
-
64
- reserved 9;
65
- reserved "amenities";
60
+ TheaterStatus status = 9;
61
+ repeated OpeningHours opening_hours = 10;
62
+ repeated string image_urls = 11;
63
+ optional string venue_name = 12;
64
+ optional string floor = 13;
66
65
  }
67
66
 
68
67
  enum TheaterStatus {