syntax = "proto2";

package maps_adv.billing_proxy.proto.clients;

import "maps_adv/billing_proxy/proto/common.proto";

// Client creation request payload
message ClientCreationInput {
    required string name = 1;
    required string email = 2;
    required string phone = 3;
    optional uint64 account_manager_id = 4;
    required string domain = 5;
    optional bool has_accepted_offer = 6;
}

message ClientFindByUidSchema {
    required uint64 uid = 1;
}

// Client set account manager payload
message ClientSetAccountManagerInput {
    required uint64 client_id = 1;
    required uint64 account_manager_id = 2;
}

// Client info
message Client {
    required uint64 id = 1;
    required string name = 2;
    required string email = 3;
    required string phone = 4;
    optional uint64 orders_count = 5;
    optional uint64 account_manager_id = 6;
    optional uint64 partner_agency_id = 7;
    optional bool has_accepted_offer = 8;
}

message Clients {
    repeated Client clients = 1;
}

message ClientIds {
    repeated uint64 client_ids = 1;
}

// Agency info
message Agency {
    required uint64 id = 1;
    required string name = 2;
    required string email = 3;
    required string phone = 4;
    optional bool has_accepted_offer = 5;
}

message Agencies {
    repeated Agency agencies = 1;
}

// Contract info
message Contract {
    required uint64 id = 1;
    required string external_id = 2;
    required uint64 client_id = 3;
    required common.CurrencyType currency = 4;
    required bool is_active = 5;
    required common.Date date_start = 6;
    optional common.Date date_end = 7;
    required common.PaymentType payment_type = 8;
    required bool preferred = 9;
}

message Contracts {
    repeated Contract contracts = 1;
}

message Uids {
    repeated uint64 uids = 1;
}
