mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 12:34:18 +00:00
74 lines
1.4 KiB
PHP
74 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Transactions\DataTransferObjects;
|
|
|
|
use App\Classes\General\Interfaces\DataTransferObject;
|
|
|
|
class TransactionDetailObject implements DataTransferObject
|
|
{
|
|
/** @var string|null */
|
|
private $reference;
|
|
|
|
/** @var string|null */
|
|
private $name;
|
|
|
|
/** @var float|null */
|
|
private $quantity;
|
|
|
|
/** @var float|null */
|
|
private $price;
|
|
|
|
/**
|
|
* TransactionDetailObject constructor.
|
|
* @param string $reference
|
|
* @param string $name
|
|
* @param float $quantity
|
|
* @param float $price
|
|
*/
|
|
public function __construct(?string $reference, ?string $name , ?float $quantity, ?float $price)
|
|
{
|
|
$this->reference = $reference;
|
|
$this->name = $name;
|
|
$this->quantity = $quantity;
|
|
$this->price = $price;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getReference(): ?string
|
|
{
|
|
return $this->reference;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getName(): ?string
|
|
{
|
|
return $this->name;
|
|
}
|
|
|
|
/**
|
|
* @return float
|
|
*/
|
|
public function getQuantity(): ?float
|
|
{
|
|
return $this->quantity;
|
|
}
|
|
|
|
/**
|
|
* @return float
|
|
*/
|
|
public function getPrice(): ?float
|
|
{
|
|
return $this->price;
|
|
}
|
|
|
|
public function getAmount(): float
|
|
{
|
|
return $this->getQuantity() * $this->getPrice();
|
|
}
|
|
|
|
}
|