<?php

namespace App\Classes\Modules\Vouchers\DataTransferObjects;

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

class CreateVoucherObject implements DataTransferObject
{
    /** @var string */
    private $voucherCode;

    /** @var User */
    private $user;

    /** @var bool */
    private $isVoucherCodeUnique;

    /**
     * CreateVoucherObject constructor.
     * @param string $voucherCode
     * @param null|User $user
     * @param bool $isVoucherCodeUnique
     */
    public function __construct(string $voucherCode, ?User $user, bool $isVoucherCodeUnique = false)
    {
        $this->user = $user;
        $this->voucherCode = $voucherCode;
        $this->isVoucherCodeUnique = $isVoucherCodeUnique;
    }


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

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

    /**
     * @return bool
     */
    public function getIsVoucherCodeUnique(): bool
    {
        return $this->isVoucherCodeUnique;
    }

}
