syntax = "proto3";
option go_package = "git.coopgo.io/coopgo-platform/solidarity-service/servers/grpc/proto";
import "google/protobuf/timestamp.proto";

message Feature {
    double lat = 1;
    double long = 2;
    string address = 3;
}

message DriverJourney {
  User user = 1;
  Car car = 2;
  google.protobuf.Timestamp driver_departure_Date = 3;
  Price price = 4;
  string driver_departure_Address = 5;
  oneof availabilities {
    RepeatedPunctualAvailabilitySlot repeated_punctual_availabilities = 6;
    RepeatedRegularAvailabilitySlot repeated_regular_availabilities = 7;
  }
}
message RepeatedPunctualAvailabilitySlot {
  repeated PunctualAvailabilitySlot punctual_availabilities = 1;
}

message RepeatedRegularAvailabilitySlot {
  repeated RegularAvailabilitySlot regular_availabilities = 1;
}

message DriverRequest{
  Feature driver_address = 1;
  int32 driver_radius = 2;
  User driver = 3;
  Preferences preferences = 4;
  Car   car = 5;
}

message PunctualAvailabilitySlot {
  google.protobuf.Timestamp date = 1;
  string startTime = 2;
  string endTime = 3;
}

message RegularAvailabilitySlot {
  DayOfWeek dayOfWeek = 1;
  string startTime = 2;
  string endTime = 3;
}

enum DayOfWeek {
    MON = 0;
    TUE = 1;
    WED = 3;
    THU = 4;
    FRI = 5;
    SAT = 6;
    SUN = 7;
}

message BookingSolidarityRequest {
  string id = 1;
 string passengerId = 2;
 string driverId = 3;
 BookingSolidarityStatus status = 4;
 Feature departure_address =5;
 Feature destination_address = 6;
  google.protobuf.Timestamp pickup_date = 7;
}

message BookingSolidarity {
  string id = 1;
  User driver = 2;
  User passenger = 3;
  google.protobuf.Timestamp passengerPickupDate =4;
  Feature passenger_departure_route = 5;
  Feature passenger_destination_route = 6;
  BookingSolidarityStatus status = 7;
  int64 duration = 8;
  int64 distance = 9;
  Price price = 10;
  Car car = 11;
  google.protobuf.Timestamp pickup_date = 12;
}

message GetAllPassengers {
  
}


message GetPassenger {
  
}

message Car {
  string model = 1;
  string brand = 2;
}

message Preferences {
  bool smoking = 1;
  bool animals = 2;
  bool music = 3;
  bool is_talker = 4;
  int64 luggage_size = 5;
}


enum PriceType {
  FREE = 0;
  PAYING = 1;
  UNKNOWN = 2;
}

message Price {
  PriceType type = 1;
  double amount = 2;
  string currency = 3;
}

message User {
  string id = 1;
  string alias = 2;
  string first_name = 3;
  string last_name = 4;
  int64 grade = 5;
  string picture = 6;
  string gender = 7;
  bool verified_identity = 8;
}

enum BookingSolidarityStatus {
  INITIATED = 0;
  WAITING_DRIVER_CONFIRMATION = 1;
  WAITING_PASSENGER_CONFIRMATION = 2;
  CONFIRMED = 3;
  CANCELLED = 4;
  COMPLETED_PENDING_VALIDATION = 5;
  VALIDATED = 6;
}

enum UserType{
  driver = 0;
  passenger = 1;
}