syntax = "proto3";

package purgeplan;

option go_package = "purger";

import "github.com/gogo/protobuf/gogoproto/gogo.proto";
import "github.com/cortexproject/cortex/pkg/cortexpb/cortex.proto";

option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;

// DeletePlan holds all the chunks that are supposed to be deleted within an interval(usually a day)
// This Proto file is used just for storing Delete Plans in proto format.
message DeletePlan {
  Interval plan_interval = 1;
  repeated ChunksGroup chunks_group = 2 [(gogoproto.nullable) = false];
}

// ChunksGroup holds ChunkDetails and Labels for a group of chunks which have same series ID
message ChunksGroup {
  repeated cortexpb.LabelPair labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/cortexproject/cortex/pkg/cortexpb.LabelAdapter"];
  repeated ChunkDetails chunks = 2 [(gogoproto.nullable) = false];
}

message ChunkDetails {
  string ID = 1;
  Interval partially_deleted_interval = 2;
}

message Interval {
  int64 start_timestamp_ms = 1;
  int64 end_timestamp_ms = 2;
}
