syntax = "proto2";

package maps_adv.adv_store.proto.billing;

message Money {
    // Amount of money * 10^4
    required uint64 value = 1;
}

message Fix {
    enum TimeIntervalEnum {
        DAILY = 1;
        WEEKLY = 2;
        MONTHLY = 3;
    }

    required TimeIntervalEnum time_interval = 1;
    required Money cost = 2;
}

message Cpm {
    required Money cost = 1;
    optional Money budget = 2;
    optional Money daily_budget = 3;
    optional bool auto_daily_budget = 4 [default=false];
}

message Cpa {
    required Money cost = 1;
    optional Money budget = 2;
    optional Money daily_budget = 3;
    optional bool auto_daily_budget = 4 [default=false];
}

message Billing {
    oneof billing {
        Fix fix = 1;
        Cpm cpm = 2;
        Cpa cpa = 3;
    }
}
