import "common_base.proto";

message CPromotionEventInvitation {
	optional fixed64 inviteid = 1;
	optional uint32 appid = 2;
	optional uint32 invite_account = 3;
	optional uint32 rtinvitetime = 4;
	optional uint32 rtexpiretime = 5;
	optional int32 type = 6 [(.description) = "enum"];
	optional uint32 accept_account = 7;
	optional uint32 rtaccepttime = 8;
	optional uint32 rtdatechosen = 9;
	optional uint32 discount_eventid = 10;
	optional uint32 packageid = 11;
	optional uint32 bundleid = 12;
	optional uint32 primary_partnerid = 13;
	optional .CPromotionRequirements deadlines = 14;
	optional bool notify_partner = 15;
	repeated string additional_email = 16;
	optional string promotion_id = 17;
	optional bool cancelled = 18;
	optional uint32 rtime32_cancel_time = 19;
	optional bool require_sale_page = 20;
	optional int32 require_sale_page_type = 21 [(.description) = "enum"];
	optional string admin_notes = 22;
	optional string partner_notes = 23;
}

message CPromotionEventInviteReceive {
	optional uint32 accountid = 1;
	optional uint32 partnerid = 2;
	optional string email_address = 3;
}

message CPromotionEventInvites_AcceptInvite_Request {
	optional fixed64 inviteid = 1;
	optional uint32 rtdatechosen = 2;
	optional uint32 discount_days = 3;
	optional string discount_info = 4;
	optional bool skip_discount_event = 5;
}

message CPromotionEventInvites_AcceptInvite_Response {
	optional fixed64 gid = 1;
}

message CPromotionEventInvites_CancelInvite_Request {
	optional fixed64 inviteid = 1;
}

message CPromotionEventInvites_CancelInvite_Response {
}

message CPromotionEventInvites_GetEmailTargets_Request {
	optional fixed64 inviteid = 1;
}

message CPromotionEventInvites_GetEmailTargets_Response {
	repeated .CPromotionEventInviteReceive targets = 1;
	repeated string additional_email_address = 2;
	repeated uint32 valve_account_ids = 3;
	optional string operation_email = 4;
}

message CPromotionEventInvites_GetInvite_Request {
	optional fixed64 inviteid = 1;
	optional uint32 appid = 2;
	optional uint32 packageid = 3;
	optional uint32 bundleid = 4;
	optional uint32 partnerid = 5;
	optional string promotion_id = 6;
}

message CPromotionEventInvites_GetInvite_Response {
	repeated .CPromotionEventInvitation invites = 1;
}

message CPromotionEventInvites_ResendEmailInvite_Request {
	optional fixed64 inviteid = 1;
	optional bool only_notify_additional_email = 2;
}

message CPromotionEventInvites_ResendEmailInvite_Response {
}

message CPromotionEventInvites_SetInvite_Request {
	optional .CPromotionEventInvitation invite = 1;
	optional bool queue_email_to_send = 2;
}

message CPromotionEventInvites_SetInvite_Response {
	optional fixed64 inviteid = 1;
}

message CPromotionRequirements {
	optional uint32 spotlight_due_date = 1;
	optional uint32 marketing_message_due_date = 2;
	optional uint32 discount_event_due_date = 3;
}

service PromotionEventInvites {
	// ePrivilege=1
	rpc AcceptInvite (.CPromotionEventInvites_AcceptInvite_Request) returns (.CPromotionEventInvites_AcceptInvite_Response);
	// ePrivilege=4
	rpc CancelInvite (.CPromotionEventInvites_CancelInvite_Request) returns (.CPromotionEventInvites_CancelInvite_Response);
	// ePrivilege=4
	rpc GetEmailTargets (.CPromotionEventInvites_GetEmailTargets_Request) returns (.CPromotionEventInvites_GetEmailTargets_Response);
	// bConstMethod=true, ePrivilege=1
	rpc GetInvite (.CPromotionEventInvites_GetInvite_Request) returns (.CPromotionEventInvites_GetInvite_Response);
	// ePrivilege=4
	rpc ResendEmailInvite (.CPromotionEventInvites_ResendEmailInvite_Request) returns (.CPromotionEventInvites_ResendEmailInvite_Response);
	// ePrivilege=4
	rpc SetInvite (.CPromotionEventInvites_SetInvite_Request) returns (.CPromotionEventInvites_SetInvite_Response);
}

