syntax = "proto3";

option go_package = "grpc/sms";

service SMSService {
  rpc HandleSMSSend(SendSMSRequest) returns (SMSDetailsResponse) {}
  rpc HandleSMSQueue(SendSMSRequest) returns (SMSQueueResponse) {}
  rpc HandleGetProducts(GetAvailableProductsRequest) returns (GetAvailableProductsResponse) {}
  rpc HandleChangeRatePlan(ChangeRatePlanRequest) returns (ChangeRatePlanResponse) {}
  rpc HandleCustomAttributes(CustomAtributesRequest) returns (CustomAtributeResponse) {}
  rpc HandleDeviceDetails(DeviceDetailsRequest) returns (DeviceDetailsResponse) {}
}

message SendSMSRequest {
  string ICCID = 1;
  string messageText = 3;
  enum MsgEncoding {
    LITERAL = 0;
    BASE64 = 1;
  }
  optional MsgEncoding messageEncoding = 4;
  enum DataCoding {
    ZERO = 0;
    ONE = 1;
    THREE = 3;
    FOUR = 4;
    EIGHT = 8;
  }
  optional DataCoding dataCoding = 5;
  optional string tpvp = 6;
  bool await = 7;
  string KafkaServiceTarget = 8;
}

message SMSDetailsResponse {
  string smsMsgID = 1;
  enum Status {
    Unknown = 0;
    Received = 1;
    Cancelled = 2;
    CancelFailed = 3;
    CancelPending = 4;
    Delivered = 5;
    Pending = 6;
    Failed = 7;
  }
  Status status = 2;
  string messageText = 3;
  string senderLogin = 4;
  string sentTo = 5;
  string sentFrom = 6;
  string msgType = 7;
  string dateSent = 8;
  string dateModified = 9;
  string ICCID = 10;
}

message SMSQueueResponse {
  string smsMsgID = 1;
  bool sentSuccessful = 2;
}

message ChangeRatePlanRequest {
  string productId = 1;
  string ICCID = 2;
  string accountId = 3;
}

message ChangeRatePlanResponse {
  string ICCID = 1;
}

message CustomAtributesRequest {
  string ICCID = 1;
  string accountCustom1 = 2;
}

message CustomAtributeResponse {
  string ICCID = 1;
}

message GetAvailableProductsRequest {
  string accountId = 1;
  repeated string productType = 2;
  repeated string productClassification = 3;
}

message RatePlan {
  string ratePlanName = 1;
  string planType = 2;
  string planStatus = 3;
  string chargeUnit = 4;
}

message AvailableTmobileProduct {
  string id = 1;
  string productId = 2; 
  string shortDescription = 3;
  string longDescription = 4;
  string status = 5;
  string effectiveDate = 6;
  string expirationDate = 7;
  RatePlan ratePlan = 8;
}

message GetAvailableProductsResponse {
  repeated AvailableTmobileProduct availableProducts = 1;
}

message DeviceDetailsRequest {
  string ICCID = 1;
}

message DeviceDetailsResponse {
  string ICCID = 1;
  string ratePlan = 2;
  string accountId = 3;
  string accountCustom1 = 4;
  string status = 5;
}
