// book.proto
syntax = "proto3";

package book;

enum Genre {
  UNKNOWN = 0;
  SCIENCE_FICTION = 1;
  MYSTERY = 2;
  BIOGRAPHY = 3;
  HISTORY = 4;
}

message Author {
  string first_name = 1;
  string last_name = 2;
}

message Book {
  string title = 1;
  Author author = 2;
  string isbn = 3;
  uint32 publication_year = 4;
  Genre genre = 5;
  repeated string tags = 6;
}

service BookService {
  rpc GetBook(BookRequest) returns (Book);
  rpc AddBook(Book) returns (BookResponse);
}

message BookRequest {
  string isbn = 1;
}

message BookResponse {
  bool success = 1;
  string message = 2;
}