import "mapreduce/yt/interface/protos/extension.proto";

package NWebmaster.NProto;

message TOfferLogRecord {
    optional string Hash         = 1 [(NYT.column_name) = "hash"];
    optional string Source       = 2 [(NYT.column_name) = "source"];
    optional string Feed         = 3 [(NYT.column_name) = "feed"];
    optional string Url          = 4 [(NYT.column_name) = "document"];
    optional string Status       = 5 [(NYT.column_name) = "status"];
    optional bytes Events        = 7 [(NYT.column_name) = "events", (NYT.flags) = ANY];
    optional bytes Errors        = 8 [(NYT.column_name) = "errors", (NYT.flags) = ANY];
    optional bytes Stats         = 9 [(NYT.column_name) = "stats", (NYT.flags) = ANY];
    optional int64 LastAccess    = 10 [(NYT.column_name) = "last_access"];
    optional string Title        = 11 [(NYT.column_name) = "title"];
    optional string Action       = 12 [(NYT.column_name) = "action"];
    optional string SaasKey      = 13 [(NYT.column_name) = "saas_key"];
    optional string WmcHost      = 14 [(NYT.column_name) = "wmc_host"];
    optional int64 Timestamp     = 15 [(NYT.column_name) = "timestamp"];
}

message TFeedHistoryRecord {
    optional string Feed             = 1 [(NYT.key_column_name) = "feed"];
    optional int64 Timestamp         = 2 [(NYT.key_column_name) = "timestamp"];
    optional string Host             = 3 [(NYT.column_name) = "host"];
    optional string Type             = 4 [(NYT.column_name) = "type"];
    optional string Hash             = 5 [(NYT.column_name) = "hash"];
    optional int64 LastAccess        = 6 [(NYT.column_name) = "last_access"];
    optional bytes Stats             = 10 [(NYT.column_name) = "stats", (NYT.flags) = ANY];
    optional bytes ErrorStats        = 12 [(NYT.column_name) = "error_stats", (NYT.flags) = ANY];
    optional bytes Errors            = 11 [(NYT.column_name) = "errors", (NYT.flags) = ANY];
}

message TFeedSerpdataRecord {
    optional string Host             = 1 [(NYT.column_name) = "service"];
    optional string FeedUrl          = 2 [(NYT.column_name) = "feed_url"];
    optional string Theme            = 3 [(NYT.column_name) = "theme"];
    optional string Url              = 4 [(NYT.column_name) = "url"];
    optional bytes Error             = 5 [(NYT.column_name) = "fail_reason", (NYT.flags) = ANY];
    optional int64 Timestamp         = 6 [(NYT.key_column_name) = "timestamp"];
}

message TSetWithFeedRecord {
    optional string Set              = 1 [(NYT.column_name) = "url"];
    optional string Host             = 2 [(NYT.column_name) = "domain"];
    optional string Feed             = 3 [(NYT.column_name) = "feed_url"];
}

message TFeedHistoryArchiveRecord {
    optional string Host             = 1 [(NYT.key_column_name) = "host"];
    optional string Feed             = 2 [(NYT.key_column_name) = "feed"];
    optional int64 Timestamp         = 3 [(NYT.column_name) = "timestamp"];
    optional int64 LastAccess        = 4 [(NYT.column_name) = "last_access"];
    optional string Partition        = 5 [(NYT.column_name) = "partition"];
    optional bytes Data              = 6 [(NYT.column_name) = "data"];
}

// only minimum needed fields
message TOfferBaseRecord {
    optional string Feed             = 1 [(NYT.column_name) = "feed_url"];
    optional bytes Sets              = 2 [(NYT.column_name) = "sets", (NYT.flags) = ANY];
}
