From bb9ff65861d41c9980351bf33955c105889c0b09 Mon Sep 17 00:00:00 2001 From: Sergey Krylov Date: Sat, 18 Apr 2026 08:35:24 +0300 Subject: [PATCH] feat: add hall and seat proto --- proto/hall.proto | 49 ++++++++++++++++++++++++++++++++++++++++++++++ proto/seat.proto | 33 +++++++++++++++++++++++++++++++ src/proto/paths.ts | 4 ++++ 3 files changed, 86 insertions(+) create mode 100644 proto/hall.proto create mode 100644 proto/seat.proto diff --git a/proto/hall.proto b/proto/hall.proto new file mode 100644 index 0000000..3da3769 --- /dev/null +++ b/proto/hall.proto @@ -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; +} diff --git a/proto/seat.proto b/proto/seat.proto new file mode 100644 index 0000000..9c32ed9 --- /dev/null +++ b/proto/seat.proto @@ -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; +} diff --git a/src/proto/paths.ts b/src/proto/paths.ts index 50bf8d1..bacad9b 100644 --- a/src/proto/paths.ts +++ b/src/proto/paths.ts @@ -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