syntax = "proto2";

package maps_adv.geosmb.tuner.proto.settings;

message FetchSettings {
    required uint64 biz_id = 1;
}

message Settings {
    repeated string emails = 1;
    required EmailNotifications notifications = 2;
    optional Booking booking = 3; // temporally optional
    optional uint64 phone = 4;
    optional SmsNotifications sms_notifications = 5;
    optional Requests requests = 6;
}

message Contacts {
    repeated string emails = 1;
    repeated uint64 phones = 2;
    repeated string telegram_logins = 3;
}

message SettingsV2 {
    required Contacts contacts = 1;
    required EmailNotifications notifications = 2;
    optional Booking booking = 3; // temporally optional
    optional SmsNotifications sms_notifications = 4;
    optional Requests requests = 5;
}

message EmailNotifications {
    // new order created by client
    required bool order_created = 1;
    // new order cancelled by client
    required bool order_cancelled = 2;
    // new order rescheduled by client
    required bool order_changed = 3;
    // all notifications about settings
    required bool certificate_notifications = 4;
    // new request created by client
    optional bool request_created = 5;
}

message SmsNotifications {
    // new request created by client
    required bool request_created = 1;
}

message UpdateSettings {
    required uint64 biz_id = 1;
    required Settings settings = 2;
}

message UpdateSettingsV2 {
    required uint64 biz_id = 1;
    required SettingsV2 settings = 2;
}

message Booking {
    required bool enabled = 1;
    required uint32 slot_interval = 2; // in minutes
    oneof settings {
        OnlineBookingSettings online_settings = 3;
    }
}

message Requests {
    required bool enabled = 1;
    required string button_text = 2;
}

message OnlineBookingSettings {
    required bool export_to_ya_services = 1;
}

message GeneralScheduleIdSetting {
    optional uint64 general_schedule_id = 1;
}

message UpdateGeneralScheduleIdSetting {
    required uint64 biz_id = 1;
    optional uint64 general_schedule_id = 2;
}
