All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.electrum.suv.api.models.RedemptionRequest Maven / Gradle / Ivy

package io.electrum.suv.api.models;

import java.util.Objects;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.JsonProperty;

import io.electrum.vas.Utils;
import io.electrum.vas.model.Amounts;
import io.electrum.vas.model.Transaction;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@ApiModel(description = "A description of a request to redeem a voucher. This object supports requests for "
      + "redemptions against amounts different to the value for which the voucher was provisioned.")
public final class RedemptionRequest extends Transaction {
   private Voucher voucher = null;
   private Amounts amounts = null;

   public RedemptionRequest amounts(Amounts amounts) {
      this.amounts = amounts;
      return this;
   }

   /**
    * Indicates the amount for which the voucher is to be redeemed.
    * 
    * @return amounts
    **/
   @JsonProperty("amounts")
   @ApiModelProperty(value = "Indicates the amount for which the voucher is to be redeemed.")
   @Valid
   public Amounts getAmounts() {
      return amounts;
   }

   public void setAmounts(Amounts amounts) {
      this.amounts = amounts;
   }

   public RedemptionRequest voucher(Voucher voucher) {
      this.voucher = voucher;
      return this;
   }

   /**
    * The voucher to be redeemed.
    * 
    * @return voucher
    **/
   @JsonProperty("voucher")
   @ApiModelProperty(required = true, value = "The voucher to be redeemed.")
   @NotNull
   @Valid
   public Voucher getVoucher() {
      return voucher;
   }

   public void setVoucher(Voucher voucher) {
      this.voucher = voucher;
   }

   @Override
   public boolean equals(Object o) {
      if (this == o)
         return true;
      if (o == null || getClass() != o.getClass())
         return false;
      if (!super.equals(o))
         return false;
      RedemptionRequest request = (RedemptionRequest) o;
      return Objects.equals(voucher, request.voucher) && Objects.equals(amounts, request.amounts);
   }

   @Override
   public int hashCode() {
      return Objects.hash(super.hashCode(), voucher, amounts);
   }

   @Override
   public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class RedemptionRequest {\n");
      sb.append("    id: ").append(Utils.toIndentedString(id)).append("\n");
      sb.append("    time: ").append(Utils.toIndentedString(time)).append("\n");
      sb.append("    originator: ").append(Utils.toIndentedString(originator)).append("\n");
      sb.append("    client: ").append(Utils.toIndentedString(client)).append("\n");
      sb.append("    settlementEntity: ").append(Utils.toIndentedString(settlementEntity)).append("\n");
      sb.append("    receiver: ").append(Utils.toIndentedString(receiver)).append("\n");
      sb.append("    thirdPartyIdentifiers: ").append(Utils.toIndentedString(thirdPartyIdentifiers)).append("\n");
      sb.append("    slipData: ").append(Utils.toIndentedString(slipData)).append("\n");
      sb.append("    basketRef: ").append(Utils.toIndentedString(basketRef)).append("\n");
      sb.append("    tranType: ").append(Utils.toIndentedString(tranType)).append("\n");
      sb.append("    srcAccType: ").append(Utils.toIndentedString(srcAccType)).append("\n");
      sb.append("    destAccType: ").append(Utils.toIndentedString(destAccType)).append("\n");
      sb.append("    amounts: ").append(Utils.toIndentedString(amounts)).append("\n");
      sb.append("    voucher: ").append(Utils.toIndentedString(voucher)).append("\n");
      sb.append("}");
      return sb.toString();
   }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy