syntax = "proto2";

package maps_adv.geosmb.doorman.proto.segments;

import "google/protobuf/timestamp.proto";

message ListSegmentsInput {
    required uint64 biz_id = 1;
}

message Segment {
    required SegmentType type = 1;
    required uint32 current_size = 2;
    optional uint32 previous_size = 3;
}

message Label {
    required string name = 1;
    required uint32 size = 2;
}

message ListSegmentsOutput {
    required uint32 total_clients_current = 1;
    required uint32 total_clients_previous = 3;
    repeated Segment segments = 2;
    repeated Label labels = 4;
}

enum SegmentType {
    REGULAR = 1;
    ACTIVE = 2;
    LOST = 3;
    NO_ORDERS = 4;
    UNPROCESSED_ORDERS = 5;
    MISSED_LAST_CALL = 6;
    SHORT_LAST_CALL = 7;
}

message SegmentStatisticsInput {
    required uint64 biz_id = 1;
    optional SegmentType segment_type = 2;
}

message SegmentStatisticsOutput {
    repeated SegmentStatisticsOnDate statistics = 1;
}

message SegmentStatisticsOnDate {
    required google.protobuf.Timestamp timestamp = 1;
    required uint32 size = 2;
}
