<?php
/**
 * Objects of this class represent a financial product (a V12 product)
 */

namespace billythekid\v12finance\models;


use JsonSerializable;

/**
 * Class FinanceProduct
 *
 * @package billythekid\v12finance\models
 */
class FinanceProduct implements JsonSerializable
{

  /**
   * APR rate
   * @var float
   */
  private $apr = 0.0;
  /**
   * Calculation factor
   * @var float
   */
  private $calculationFactor = 0.0;
  /**
   * Deferred period (months)
   * @var int
   */
  private $deferredPeriod = 0;
  /**
   * Product description
   * @var string
   */
  private $description = '';
  /**
   * Document fee
   * @var float
   */
  private $documentFee = 0.0;
  /**
   * Document fee collection month
   * @var int
   */
  private $documentFeeCollectionMonth = 0;
  /**
   * Maximum document fee
   * @var float
   */
  private $documentFeeMaximum = 0.0;
  /**
   * Minimum document fee
   * @var float
   */
  private $documentFeeMinimum = 0.0;
  /**
   * Maximum loan amount that this product is valid for
   * @var float
   */
  private $maxLoan = 0.0;
  /**
   * Minimum loan amount that this product is valid for
   * @var float
   */
  private $minLoan = 0.0;
  /**
   * Monthly rate
   * @var float
   */
  private $monthlyRate = 0.0;
  /**
   * Months
   * @var int
   */
  private $months = 0;
  /**
   * Product name
   * @var string
   */
  private $name = '';
  /**
   * Option period
   * @var int
   */
  private $optionPeriod = 0;
  /**
   * Product GUID
   * @var string
   */
  private $productGuid = '';
  /**
   * Product ID
   * @var float
   */
  private $productId = 0.0;
  /**
   * Service fee
   * @var float
   */
  private $serviceFee = 0.0;
  /**
   * Tag
   * @var string
   */
  private $tag = '';

  /**
   * Set the APR
   * @param float $apr
   * @return FinanceProduct
   */
  public function setApr(float $apr): FinanceProduct
  {
    $this->apr = $apr;

    return $this;
  }

  /**
   * Set the calculation factor
   * @param float $calculationFactor
   * @return FinanceProduct
   */
  public function setCalculationFactor(float $calculationFactor): FinanceProduct
  {
    $this->calculationFactor = $calculationFactor;

    return $this;
  }

  /**
   * Set the deferred period
   * @param int $deferredPeriod
   * @return FinanceProduct
   */
  public function setDeferredPeriod(int $deferredPeriod): FinanceProduct
  {
    $this->deferredPeriod = $deferredPeriod;

    return $this;
  }

  /**
   * Set the product description
   * @param string $description
   * @return FinanceProduct
   */
  public function setDescription(string $description): FinanceProduct
  {
    $this->description = $description;

    return $this;
  }

  /**
   * Set the document fee
   * @param float $documentFee
   * @return FinanceProduct
   */
  public function setDocumentFee(float $documentFee): FinanceProduct
  {
    $this->documentFee = $documentFee;

    return $this;
  }

  /**
   * Set the document fee collection month
   * @param int $documentFeeCollectionMonth
   * @return FinanceProduct
   */
  public function setDocumentFeeCollectionMonth(int $documentFeeCollectionMonth): FinanceProduct
  {
    $this->documentFeeCollectionMonth = $documentFeeCollectionMonth;

    return $this;
  }

  /**
   * Set the maximum document fee
   * @param float $documentFeeMaximum
   * @return FinanceProduct
   */
  public function setDocumentFeeMaximum(float $documentFeeMaximum): FinanceProduct
  {
    $this->documentFeeMaximum = $documentFeeMaximum;

    return $this;
  }

  /**
   * Set the minimum document fee
   * @param float $documentFeeMinimum
   * @return FinanceProduct
   */
  public function setDocumentFeeMinimum(float $documentFeeMinimum): FinanceProduct
  {
    $this->documentFeeMinimum = $documentFeeMinimum;

    return $this;
  }

  /**
   * Set the maximum loan amount
   * @param float $maxLoan
   * @return FinanceProduct
   */
  public function setMaxLoan(float $maxLoan): FinanceProduct
  {
    $this->maxLoan = $maxLoan;

    return $this;
  }

  /**
   * Set the minimum loan amount
   * @param float $minLoan
   * @return FinanceProduct
   */
  public function setMinLoan(float $minLoan): FinanceProduct
  {
    $this->minLoan = $minLoan;

    return $this;
  }

  /**
   * Set the monthly rate
   * @param int $monthlyRate
   * @return FinanceProduct
   */
  public function setMonthlyRate(int $monthlyRate): FinanceProduct
  {
    $this->monthlyRate = $monthlyRate;

    return $this;
  }

  /**
   * Set the months
   * @param int $months
   * @return FinanceProduct
   */
  public function setMonths(int $months): FinanceProduct
  {
    $this->months = $months;

    return $this;
  }

  /**
   * Set the name
   * @param string $name
   * @return FinanceProduct
   */
  public function setName(string $name): FinanceProduct
  {
    $this->name = $name;

    return $this;
  }

  /**
   * Set the option period
   * @param int $optionPeriod
   * @return FinanceProduct
   */
  public function setOptionPeriod(int $optionPeriod): FinanceProduct
  {
    $this->optionPeriod = $optionPeriod;

    return $this;
  }

  /**
   * Set the GUID
   * @param string $productGuid
   * @return FinanceProduct
   */
  public function setProductGuid(string $productGuid): FinanceProduct
  {
    $this->productGuid = $productGuid;

    return $this;
  }

  /**
   * Set the ID
   * @param int $productId
   * @return FinanceProduct
   */
  public function setProductId(int $productId): FinanceProduct
  {
    $this->productId = $productId;

    return $this;
  }

  /**
   * Set teh service fee
   * @param int $serviceFee
   * @return FinanceProduct
   */
  public function setServiceFee(int $serviceFee): FinanceProduct
  {
    $this->serviceFee = $serviceFee;

    return $this;
  }

  /**
   * Set the tag
   * @param string $tag
   * @return FinanceProduct
   */
  public function setTag(string $tag): FinanceProduct
  {
    $this->tag = $tag;

    return $this;
  }

  /**
   * Get the APR
   * @return float
   */
  public function getApr(): float
  {
    return $this->apr;
  }

  /**
   * Get the calculation factor
   * @return float
   */
  public function getCalculationFactor(): float
  {
    return $this->calculationFactor;
  }

  /**
   * Get the deferred period
   * @return int
   */
  public function getDeferredPeriod(): int
  {
    return $this->deferredPeriod;
  }

  /**
   * Get the description
   * @return string
   */
  public function getDescription(): string
  {
    return $this->description;
  }

  /**
   * Get the document fee
   * @return float
   */
  public function getDocumentFee(): float
  {
    return $this->documentFee;
  }

  /**
   * Get the document fee collection month
   * @return int
   */
  public function getDocumentFeeCollectionMonth(): int
  {
    return $this->documentFeeCollectionMonth;
  }

  /**
   * Get the maximum document fee
   * @return int
   */
  public function getDocumentFeeMaximum(): int
  {
    return $this->documentFeeMaximum;
  }

  /**
   * Get the minimum document fee
   * @return int
   */
  public function getDocumentFeeMinimum(): int
  {
    return $this->documentFeeMinimum;
  }

  /**
   * Get the maximum loan amount
   * @return float
   */
  public function getMaxLoan(): float
  {
    return $this->maxLoan;
  }

  /**
   * Get the minimum loan amount
   * @return float
   */
  public function getMinLoan(): float
  {
    return $this->minLoan;
  }

  /**
   * Get the monthly rate
   * @return float
   */
  public function getMonthlyRate(): float
  {
    return $this->monthlyRate;
  }

  /**
   * Get the months
   * @return int
   */
  public function getMonths(): int
  {
    return $this->months;
  }

  /**
   * Get the name
   * @return string
   */
  public function getName(): string
  {
    return $this->name;
  }

  /**
   * Get the option period
   * @return int
   */
  public function getOptionPeriod(): int
  {
    return $this->optionPeriod;
  }

  /**
   * Get the GUID
   * @return string
   */
  public function getProductGuid(): string
  {
    return $this->productGuid;
  }

  /**
   * Get the ID
   * @return int
   */
  public function getProductId(): int
  {
    return $this->productId;
  }

  /**
   * Get the service fee
   * @return int
   */
  public function getServiceFee(): int
  {
    return $this->serviceFee;
  }

  /**
   * Get the tag
   * @return string
   */
  public function getTag(): string
  {
    return $this->tag;
  }

  /**
   * Specify data which should be serialized to JSON
   *
   * @link  http://php.net/manual/en/jsonserializable.jsonserialize.php
   * @return mixed data which can be serialized by <b>json_encode</b>,
   * which is a value of any type other than a resource.
   * @since 5.4.0
   */
  public function jsonSerialize()
  {
    return [
        "APR"                        => $this->getApr(),
        "CalculationFactor"          => $this->getCalculationFactor(),
        "DeferredPeriod"             => $this->getDeferredPeriod(),
        "Description"                => $this->getDescription(),
        "DocumentFee"                => $this->getDocumentFee(),
        "DocumentFeeCollectionMonth" => $this->getDocumentFeeCollectionMonth(),
        "DocumentFeeMaximum"         => $this->getDocumentFeeMaximum(),
        "DocumentFeeMinimum"         => $this->getDocumentFeeMinimum(),
        "MaxLoan"                    => $this->getMaxLoan(),
        "MinLoan"                    => $this->getMinLoan(),
        "MonthlyRate"                => $this->getMonthlyRate(),
        "Months"                     => $this->getMonths(),
        "Name"                       => $this->getName(),
        "OptionPeriod"               => $this->getOptionPeriod(),
        "ProductGuid"                => $this->getProductGuid(),
        "ProductId"                  => $this->getProductId(),
        "ServiceFee"                 => $this->getServiceFee(),
        "Tag"                        => $this->getTag(),
    ];
  }


}
