syntax = "proto2";

package maps_adv.geosmb.booking_yang.proto.orders;

import "google/protobuf/timestamp.proto";


message OrderInput {
    required uint64 permalink = 1;
    required google.protobuf.Timestamp reservation_datetime = 2;
    required string reservation_timezone = 3;
    required uint32 person_count = 4;
    required string customer_name = 5;
    required string customer_phone = 6;
    required string comment = 7;
    required bool call_agreement_accepted = 8;
    required uint64 biz_id = 9;
    optional uint64 customer_passport_uid = 10;
}

message OrderOutput {
    required google.protobuf.Timestamp processing_time = 1;
}

message ListClientOrdersInput {
    required uint64 client_id = 1;
    required uint64 biz_id = 2;
    optional google.protobuf.Timestamp datetime_from = 3;  // reservation datetime
    optional google.protobuf.Timestamp datetime_to = 4;  // reservation datetime
}

message ClientOrders {
    repeated ClientOrder orders = 1;
    required uint32 events_before = 2;
    required uint32 events_after = 3;
}

message ClientOrder {
    enum OrderStatus {
        UNPROCESSED = 1;
        REJECTED = 2;
        ACCEPTED = 3;
    }

    required uint64 order_id = 1;
    required google.protobuf.Timestamp created_at = 2;
    required google.protobuf.Timestamp reservation_datetime = 3;
    required string reservation_timezone = 4;
    required uint32 person_count = 5;
    required OrderStatus status = 6;
}

message ActualOrdersInput {
    required google.protobuf.Timestamp actual_on = 1;
}

message ActualOrdersOutput {
    repeated ActualOrderItem orders = 1;
}

message ActualOrderItem {
    required uint64 permalink = 1;
    required google.protobuf.Timestamp reservation_datetime = 2;
    required string reservation_timezone = 3;
    optional uint64 passport_uid = 4;
    optional uint64 client_id = 5;
}

message ClearOrdersForGdprInput {
    required uint64 passport_uid = 1;
}

message ClearOrdersForGdprOutput {
    repeated uint64 cleared_order_ids = 1;
}

message SearchOrdersForGdprInput {
    required uint64 passport_uid = 1;
}

message SearchOrdersForGdprOutput {
    required bool orders_exist = 1;
}
