Compare commits

...

2 Commits

Author SHA1 Message Date
2a1a909138 1.4.0
All checks were successful
Publish / Publish npm package action (push) Successful in 53s
Publish Go Bondings / Publish Go package action (push) Successful in 1m32s
2026-04-18 08:35:51 +03:00
bb9ff65861 feat: add hall and seat proto 2026-04-18 08:35:24 +03:00
4 changed files with 87 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@teacinema/contracts",
"version": "1.3.2",
"version": "1.4.0",
"description": "Protocol Buffers contracts for microservices",
"scripts": {
"build": "tsc -p tsconfig.build.json",

49
proto/hall.proto Normal file
View File

@ -0,0 +1,49 @@
syntax = "proto3";
package hall.v1;
service HallService {
rpc CreateHall (CreateHallRequest) returns (CreateHallResponse);
rpc GetHall (GetHallRequest) returns (GetHallResponse);
rpc ListHallsByTheater (ListHallsByTheaterRequest) returns (ListHallsByTheaterResponse);
}
message CreateHallRequest {
string name = 1;
string theater_id = 2;
repeated RowLayout layout = 3;
}
message CreateHallResponse {
Hall hall = 1;
}
message ListHallsByTheaterRequest {
string theater_id = 1;
}
message ListHallsByTheaterResponse {
repeated Hall halls = 1;
}
message GetHallRequest {
string id = 1;
}
message GetHallResponse {
Hall hall = 1;
}
message Hall {
string id = 1;
string name = 2;
string theater_id = 3;
repeated RowLayout layout = 4;
}
message RowLayout {
int32 row = 1;
int32 columns = 2;
string type = 3;
int32 price = 4;
}

33
proto/seat.proto Normal file
View File

@ -0,0 +1,33 @@
syntax = "proto3";
package seat.v1;
service SeatService {
rpc GetSeat (GetSeatRequest) returns (GetSeatResponse);
rpc ListSeatsByHall (ListSeatsByHallRequest) returns (ListSeatsByHallResponse);
}
message GetSeatRequest {
string id = 1;
}
message GetSeatResponse {
Seat seat = 1;
}
message ListSeatsByHallRequest {
string hall_id = 1;
string screening_id = 2;
}
message ListSeatsByHallResponse {
repeated Seat seats = 1;
}
message Seat {
string id = 1;
int32 row = 2;
int32 number = 3;
int32 price = 4;
string status = 5;
string type = 6;
string hall_id = 7;
}

View File

@ -36,4 +36,8 @@ export const PROTO_PATHS = {
CATEGORY: join(__dirname, '../../proto/category.proto'),
/** Путь к `theater.proto` (пакет `theater.v1`) */
THEATER: join(__dirname, '../../proto/theater.proto'),
/** Путь к `hall.proto` (пакет `hall.v1`) */
HALL: join(__dirname, '../../proto/hall.proto'),
/** Путь к `seat.proto` (пакет `seat.v1`) */
SEAT: join(__dirname, '../../proto/seat.proto'),
} as const