Files
2023-05-30 22:02:09 +08:00

83 lines
1.7 KiB
PHP

<?php
namespace App\Classes\Modules\Vouchers\DataTransferObjects;
use App\Classes\General\Interfaces\DataTransferObject;
class ValidatedVoucherObject implements DataTransferObject
{
/** @var string */
private $voucher_name;
/** @var string */
private $code;
/** @var string */
private $discount_type;
/** @var int */
private $total_discount_amount;
/** @var int */
private $total_amount;
/**
* ValidatedVoucherObject constructor.
* @param string $voucher_name
* @param string $code
* @param string $discount_type
* @param int $total_discount_amount
* @param int $total_amount
*/
public function __construct(string $voucher_name, string $code, string $discount_type, int $total_discount_amount, int $total_amount)
{
$this->voucher_name = $voucher_name;
$this->code = $code;
$this->discount_type = $discount_type;
$this->total_discount_amount = $total_discount_amount;
$this->total_amount = $total_amount;
}
/**
* @return string
*/
public function getVoucherName(): string
{
return $this->voucher_name;
}
/**
* @return string
*/
public function getCode(): string
{
return $this->code;
}
/**
* @return string
*/
public function getDiscountType(): string
{
return $this->discount_type;
}
/**
* @return float
*/
public function getTotalDiscountAmount(): float
{
return $this->total_discount_amount / 100;
}
/**
* @return float
*/
public function getTotalAmount(): float
{
return $this->total_amount / 100;
}
}