syntax = "proto3";

package campaigns;

service CampaignService {
  rpc findCampaignByCustomer (CampaignByCustomerInput) returns (CampaignResponse);
}

message EmailTemplate {
  string title = 1;
  string text = 2;
  string facebookUrl = 3;
  string instagramUrl = 4;
  string twitterUrl = 5;
  string imageUrl = 6;
}

message Empty {}

message CampaignByCustomerInput {
  string customerId = 1;
  string rewardType = 2;
  repeated string campaignIds = 3;
}

message Segment {
  string title = 1;
  string query = 2;
  string createdBy = 3;
  string updatedBy = 5;
}

message Campaign {
  string id = 1;
  string title = 2;
  string idempotencyKey = 3;
  EmailTemplate emailTemplate = 4;
  string searchType = 5;
  string smsTemplate = 6;
  string pushTemplate = 7;
  string programId = 8;
  string rewardId = 9;
  string rewardType = 10;
  string pointMultiplier = 11;
  string extraPoints = 12;
  string inactiveDays = 13;
  string updatedBy = 14;
  string createdBy = 15;
  string isActive = 16;
  repeated Segment segments = 17;
}

message CampaignToCustomer {
  string customerId = 1;
}

message CampaignResponse {
  repeated Campaign campaigns = 1;
}