<?php

namespace App\Classes\Modules\Vouchers\DataTransferObjects;


use App\Classes\General\Interfaces\DataTransferObject;
use App\Models\User;

class ValidateVoucherifyVoucherObject implements DataTransferObject
{
    /** @var int */
    private $companyId;

    /** @var string */
    private $voucherCode;

    /** @var float */
    private $amount;

    /** @var float */
    private $serviceCharge;

    /** @var User */
    private $user; //this will affect certain voucher that limit user redemption e.g. one user one redemption per campaign

    /** @var bool */
    private $isNewOrder; //comparing booking and voucher date, an order is deemed new when booking is created after receiving voucher

    /**
     * ValidateVoucherifyVoucherObject constructor.
     * @param int $companyId
     * @param string $voucherCode
     * @param float $amount
     * @param float $serviceCharge
     * @param User $user
     * @param bool $isNewOrder
     */
    public function __construct(int $companyId, string $voucherCode, float $amount, float $serviceCharge, User $user, ?bool $isNewOrder = null)
    {
        $this->companyId = $companyId;
        $this->voucherCode = $voucherCode;
        $this->amount = $amount;
        $this->serviceCharge = $serviceCharge;
        $this->user = $user;
        $this->isNewOrder = $isNewOrder;
    }

    /**
     * @return int
     */
    public function getCompanyId(): int
    {
        return $this->companyId;
    }

    /**
     * @return string
     */
    public function getVoucherCode(): string
    {
        return $this->voucherCode;
    }

    /**
     * @return float
     */
    public function getAmount(): float
    {
        return $this->amount;
    }

    /**
     * @return float
     */
    public function getServiceCharge(): float
    {
        return $this->serviceCharge;
    }

    /**
     * @return User
     */
    public function getUser(): User
    {
        return $this->user;
    }

    /**
     * @return bool|null
     */
    public function getIsNewOrder(): ?bool
    {
        return $this->isNewOrder;
    }

}
