import "common_base.proto";

message CDailyDeal_CancelDailyDeal_Request {
	optional fixed64 gid = 1;
}

message CDailyDeal_CancelDailyDeal_Response {
}

message CDailyDeal_CreateDailyDeal_Request {
	optional .CDailyDealDetails daily_deal = 1;
	optional uint32 partnerid = 2;
	optional fixed64 inviteid = 3;
}

message CDailyDeal_CreateDailyDeal_Response {
	optional fixed64 gid = 1;
}

message CDailyDeal_DeleteDailyDeal_Request {
	optional fixed64 gid = 1;
}

message CDailyDeal_DeleteDailyDeal_Response {
}

message CDailyDeal_GetDailyDeals_Request {
	optional fixed64 gid = 1;
	optional uint32 rtime32_start_date = 2;
	optional uint32 rtime32_end_date = 3;
	optional uint32 appid = 4;
	optional int32 store_item_type = 5 [(.description) = "enum"];
	optional string search_term = 6;
	optional uint32 partnerid = 7;
}

message CDailyDeal_GetDailyDeals_Response {
	repeated .CDailyDealDetails daily_deals = 1;
	repeated uint32 blocked_dates = 2;
	repeated uint32 scheduled_slots = 3;
	repeated .CDailyDeal_GetDailyDeals_Response_DailyDealBlockedDate blocked = 4;
	repeated .CDailyDeal_GetDailyDeals_Response_DailyDealScheduledSlot scheduled = 5;
}

message CDailyDeal_GetDailyDeals_Response_DailyDealBlockedDate {
	optional uint32 date = 1;
	optional string name = 2;
}

message CDailyDeal_GetDailyDeals_Response_DailyDealScheduledSlot {
	optional uint32 date = 1;
	optional string descids = 2;
}

message CDailyDeal_GetDailyDealsForApps_Request {
	repeated uint32 appids = 1;
}

message CDailyDeal_GetDailyDealsForApps_Response {
	repeated .CDailyDealDetails daily_deals = 1;
}

message CDailyDeal_UpdateDailyDeal_Request {
	optional .CDailyDealDetails daily_deal = 1;
	optional fixed64 gid = 2;
}

message CDailyDeal_UpdateDailyDeal_Response {
}

message CDailyDealDetails {
	optional fixed64 gid = 1;
	optional int32 store_item_type = 2 [(.description) = "enum"];
	optional uint32 store_item_id = 3;
	optional string store_item_name = 4;
	optional uint32 discount_event_id = 5;
	optional uint32 creator_id = 6;
	optional uint32 rtime32_start_time = 7;
	optional uint32 last_update_time = 8;
	optional string template_json = 9;
	optional string partner_jsondata = 10;
	optional string internal_json = 11;
	optional bool deleted = 12;
	optional bool cancelled = 13;
	optional uint32 rtime32_cancel_time = 14;
	optional fixed64 asset_request_id = 15;
	optional string descids = 16;
}

service DailyDeal {
	// ePrivilege=1
	rpc CancelDailyDeal (.CDailyDeal_CancelDailyDeal_Request) returns (.CDailyDeal_CancelDailyDeal_Response);
	// ePrivilege=1
	rpc CreateDailyDeal (.CDailyDeal_CreateDailyDeal_Request) returns (.CDailyDeal_CreateDailyDeal_Response);
	// ePrivilege=1
	rpc DeleteDailyDeal (.CDailyDeal_DeleteDailyDeal_Request) returns (.CDailyDeal_DeleteDailyDeal_Response);
	// bConstMethod=true, ePrivilege=1
	rpc GetDailyDeals (.CDailyDeal_GetDailyDeals_Request) returns (.CDailyDeal_GetDailyDeals_Response);
	// bConstMethod=true, ePrivilege=4
	rpc GetDailyDealsForApps (.CDailyDeal_GetDailyDealsForApps_Request) returns (.CDailyDeal_GetDailyDealsForApps_Response);
	// ePrivilege=1
	rpc UpdateDailyDeal (.CDailyDeal_UpdateDailyDeal_Request) returns (.CDailyDeal_UpdateDailyDeal_Response);
}

