syntax = "proto2";

package maps_adv.billing_proxy.proto.common;

message Error {
    enum ERROR_CODE {
        CLIENT_DOES_NOT_EXIST = 1;
        AGENCY_DOES_NOT_EXIST = 2;
        CLIENTS_DO_NOT_EXIST = 3;
        CONTRACT_DOES_NOT_EXIST = 4;
        CLIENT_CONTRACT_MISMATCH = 5;
        CLIENT_IS_AGENCY = 6;
        CLIENT_IS_NOT_AGENCY = 7;
        CLIENT_NOT_IN_AGENCY = 8;
        PRODUCT_DOES_NOT_EXIST = 9;
        PRODUCT_IS_INACTIVE = 10;
        PRODUCT_CLIENT_MISMATCH = 11;
        PRODUCT_AGENCY_MISMATCH = 12;
        NO_PRODUCTS_MATCHED = 13;
        MULTIPLE_PRODUCTS_MATCHED = 14;
        ORDER_DOES_NOT_EXIST = 15;
        ORDERS_DO_NOT_EXIST = 16;
        BILL_FOR_TS_IN_FUTURE = 17;
        NON_CPM_PRODUCT = 18;
        NO_ACTIVE_VERSIONS_FOR_PRODUCT = 19;
        BAD_DUPLICATE_CHARGE = 20;
        CLIENT_BY_UID_DOES_NOT_EXIST = 21;
        PRODUCT_SERVICE_DISMATCH = 22;
        USER_IS_ASSIGNED_TO_ANOTHER_CLIENT = 23;
        INVALID_BILLING_TYPE = 24;
        NO_PLATFORM_SPECIFIED = 25;
        NO_PRODUCT_VERSIONS_SPECIFIED = 26;
        CONFLICTING_PRODUCT_VERSION_TIME_SPANS = 27;
        CONFLICTING_PRODUCTS = 28;
        CLIENTS_ARE_ALREADY_IN_AGENCY = 29;
        CLIENTS_HAVE_ORDERS_WITH_AGENCY = 30;
        PRODUCT_HAS_ZERO_COST = 31;
        CLIENTS_ALREADY_BOUND_TO_OVERLAPPING_PRODUCTS = 32;

        DATA_VALIDATION_ERROR = 1000;
        BALANCE_API_ERROR = 1001;
    }

    required ERROR_CODE code = 1;
    optional string description = 2;
}

enum BillingType {
    CPM = 0;
    FIX = 1;
}

enum CampaignType {
    PIN_ON_ROUTE = 0;
    BILLBOARD = 1;
    ZERO_SPEED_BANNER = 2;
    CATEGORY_SEARCH_PIN = 3;
    ROUTE_BANNER = 4;
    VIA_POINTS = 5;
    OVERVIEW_BANNER = 6;
    PROMOCODE = 7;
}

enum PlatformType {
    MAPS = 0;
    METRO = 1;
    NAVI = 2;
}

enum CurrencyType {
    RUB = 0;
    BYN = 1;
    TRY = 2;
    KZT = 3;
    EUR = 4;
    USD = 5;
}

enum PaymentType {
    PRE_PAYMENT = 0;
    POST_PAYMENT = 1;
}

message MoneyQuantity {
    required uint64 value = 1;
}

message Date {
    required uint32 year = 1;
    required uint32 month = 2;
    required uint32 day = 3;
}
