@usteam/contracts 1.2.5 → 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.
@@ -6,4 +6,6 @@ export declare const PROTO_PATHS: {
6
6
  readonly EVENT: string;
7
7
  readonly CATEGORY: string;
8
8
  readonly ARENA: string;
9
+ readonly SECTOR: string;
10
+ readonly SEAT: string;
9
11
  };
@@ -10,4 +10,6 @@ exports.PROTO_PATHS = {
10
10
  EVENT: (0, path_1.join)(__dirname, '../../proto/event.proto'),
11
11
  CATEGORY: (0, path_1.join)(__dirname, '../../proto/category.proto'),
12
12
  ARENA: (0, path_1.join)(__dirname, '../../proto/arena.proto'),
13
+ SECTOR: (0, path_1.join)(__dirname, '../../proto/sector.proto'),
14
+ SEAT: (0, path_1.join)(__dirname, '../../proto/seat.proto'),
13
15
  };
package/gen/ts/arena.ts CHANGED
@@ -30,7 +30,7 @@ export interface CreateArenaRequest {
30
30
  }
31
31
 
32
32
  export interface CreateArenaResponse {
33
- ok: boolean;
33
+ arena: Arena | undefined;
34
34
  }
35
35
 
36
36
  export interface Arena {
package/gen/ts/seat.ts ADDED
@@ -0,0 +1,79 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.10.1
4
+ // protoc v4.25.9
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
+ sectorId: 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
+ sectorId: string;
38
+ }
39
+
40
+ export const SEAT_V1_PACKAGE_NAME = "seat.v1";
41
+
42
+ export interface SeatServiceClient {
43
+ /** Получение места по id */
44
+
45
+ getSeat(request: GetSeatRequest): Observable<GetSeatResponse>;
46
+
47
+ /** Получение мест для конкретного сектора */
48
+
49
+ listSeatBySector(request: ListSeatsRequest): Observable<ListSeatsResponse>;
50
+ }
51
+
52
+ export interface SeatServiceController {
53
+ /** Получение места по id */
54
+
55
+ getSeat(request: GetSeatRequest): Promise<GetSeatResponse> | Observable<GetSeatResponse> | GetSeatResponse;
56
+
57
+ /** Получение мест для конкретного сектора */
58
+
59
+ listSeatBySector(
60
+ request: ListSeatsRequest,
61
+ ): Promise<ListSeatsResponse> | Observable<ListSeatsResponse> | ListSeatsResponse;
62
+ }
63
+
64
+ export function SeatServiceControllerMethods() {
65
+ return function (constructor: Function) {
66
+ const grpcMethods: string[] = ["getSeat", "listSeatBySector"];
67
+ for (const method of grpcMethods) {
68
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
69
+ GrpcMethod("SeatService", method)(constructor.prototype[method], method, descriptor);
70
+ }
71
+ const grpcStreamMethods: string[] = [];
72
+ for (const method of grpcStreamMethods) {
73
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
74
+ GrpcStreamMethod("SeatService", method)(constructor.prototype[method], method, descriptor);
75
+ }
76
+ };
77
+ }
78
+
79
+ export const SEAT_SERVICE_NAME = "SeatService";
@@ -0,0 +1,101 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.10.1
4
+ // protoc v4.25.9
5
+ // source: sector.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+
11
+ export const protobufPackage = "sector.v1";
12
+
13
+ export interface CreateSectorRequest {
14
+ name: string;
15
+ arenaId: string;
16
+ layout: RowLayout[];
17
+ }
18
+
19
+ export interface CreateSectorResponse {
20
+ sector: Sector | undefined;
21
+ }
22
+
23
+ export interface GetSectorRequest {
24
+ id: string;
25
+ }
26
+
27
+ export interface GetSectorResponse {
28
+ sector: Sector | undefined;
29
+ }
30
+
31
+ export interface ListSectorsRequest {
32
+ sectorId: string;
33
+ }
34
+
35
+ export interface ListSectorsResponse {
36
+ sectors: Sector[];
37
+ }
38
+
39
+ export interface Sector {
40
+ id: string;
41
+ name: string;
42
+ arenaId: string;
43
+ }
44
+
45
+ export interface RowLayout {
46
+ row: number;
47
+ colomns: number;
48
+ type: string;
49
+ price: number;
50
+ }
51
+
52
+ export const SECTOR_V1_PACKAGE_NAME = "sector.v1";
53
+
54
+ export interface SectorServiceClient {
55
+ /** Создание сектора */
56
+
57
+ createSector(request: CreateSectorRequest): Observable<CreateSectorResponse>;
58
+
59
+ /** Получение сектора по id */
60
+
61
+ getSector(request: GetSectorRequest): Observable<GetSectorResponse>;
62
+
63
+ /** Получение секторов для конкретной арены */
64
+
65
+ listSectorsByArena(request: ListSectorsRequest): Observable<ListSectorsResponse>;
66
+ }
67
+
68
+ export interface SectorServiceController {
69
+ /** Создание сектора */
70
+
71
+ createSector(
72
+ request: CreateSectorRequest,
73
+ ): Promise<CreateSectorResponse> | Observable<CreateSectorResponse> | CreateSectorResponse;
74
+
75
+ /** Получение сектора по id */
76
+
77
+ getSector(request: GetSectorRequest): Promise<GetSectorResponse> | Observable<GetSectorResponse> | GetSectorResponse;
78
+
79
+ /** Получение секторов для конкретной арены */
80
+
81
+ listSectorsByArena(
82
+ request: ListSectorsRequest,
83
+ ): Promise<ListSectorsResponse> | Observable<ListSectorsResponse> | ListSectorsResponse;
84
+ }
85
+
86
+ export function SectorServiceControllerMethods() {
87
+ return function (constructor: Function) {
88
+ const grpcMethods: string[] = ["createSector", "getSector", "listSectorsByArena"];
89
+ for (const method of grpcMethods) {
90
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
91
+ GrpcMethod("SectorService", method)(constructor.prototype[method], method, descriptor);
92
+ }
93
+ const grpcStreamMethods: string[] = [];
94
+ for (const method of grpcStreamMethods) {
95
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
96
+ GrpcStreamMethod("SectorService", method)(constructor.prototype[method], method, descriptor);
97
+ }
98
+ };
99
+ }
100
+
101
+ export const SECTOR_SERVICE_NAME = "SectorService";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usteam/contracts",
3
- "version": "1.2.5",
3
+ "version": "1.3.1",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "scripts": {
package/proto/arena.proto CHANGED
@@ -34,7 +34,7 @@ message CreateArenaRequest {
34
34
  }
35
35
 
36
36
  message CreateArenaResponse {
37
- bool ok = 1;
37
+ Arena arena = 1;
38
38
  }
39
39
 
40
40
  message Arena {
@@ -0,0 +1,38 @@
1
+ syntax = "proto3";
2
+
3
+ package seat.v1;
4
+
5
+ service SeatService {
6
+ // Получение места по id
7
+ rpc GetSeat (GetSeatRequest) returns (GetSeatResponse);
8
+ //Получение мест для конкретного сектора
9
+ rpc ListSeatBySector (ListSeatsRequest) returns (ListSeatsResponse);
10
+
11
+ }
12
+
13
+ message GetSeatRequest {
14
+ string id = 1;
15
+ }
16
+
17
+ message GetSeatResponse {
18
+ Seat seat = 1;
19
+ }
20
+
21
+ message ListSeatsRequest {
22
+ string sector_id = 1;
23
+ string screening_id = 2;
24
+ }
25
+
26
+ message ListSeatsResponse {
27
+ repeated Seat seat = 1;
28
+ }
29
+
30
+ message Seat {
31
+ string id = 1;
32
+ int32 row = 2;
33
+ int32 number = 3;
34
+ int32 price = 4;
35
+ string status = 5;
36
+ string type = 6;
37
+ string sector_id = 7;
38
+ }
@@ -0,0 +1,54 @@
1
+ syntax = "proto3";
2
+
3
+ package sector.v1;
4
+
5
+ service SectorService {
6
+ // Создание сектора
7
+ rpc CreateSector (CreateSectorRequest) returns (CreateSectorResponse);
8
+ // Получение сектора по id
9
+ rpc GetSector (GetSectorRequest) returns (GetSectorResponse);
10
+ //Получение секторов для конкретной арены
11
+ rpc ListSectorsByArena (ListSectorsRequest) returns (ListSectorsResponse);
12
+
13
+ }
14
+
15
+ message CreateSectorRequest {
16
+ string name = 1;
17
+ string arena_id = 2;
18
+ repeated RowLayout layout = 3;
19
+ }
20
+
21
+ message CreateSectorResponse {
22
+ Sector sector = 1;
23
+ }
24
+
25
+ message GetSectorRequest {
26
+ string id =1;
27
+ }
28
+
29
+ message GetSectorResponse {
30
+ Sector sector = 1;
31
+ }
32
+
33
+ message ListSectorsRequest {
34
+ string sector_id =1;
35
+ }
36
+
37
+ message ListSectorsResponse {
38
+ repeated Sector sectors = 1;
39
+ }
40
+
41
+
42
+
43
+ message Sector {
44
+ string id = 1;
45
+ string name = 2;
46
+ string arena_id = 3;
47
+ }
48
+
49
+ message RowLayout {
50
+ int32 row = 1;
51
+ int32 colomns = 2;
52
+ string type = 3;
53
+ int32 price = 4;
54
+ }