<?php
declare(strict_types=1);
namespace App\Domain\Merchant\Model;
use App\Domain\Shared\Model\TimestampTrait;
use Symfony\Component\Uid\Uuid;
class MerchantResetPasswordToken
{
use TimestampTrait;
public function __construct(
private readonly Uuid $id,
private readonly Merchant $merchant,
private readonly \DateTimeImmutable $expiryDate,
private readonly string $token,
private bool $used = false
) {
$this->createdAt = new \DateTimeImmutable();
}
public function getExpiryDate(): \DateTimeImmutable
{
return $this->expiryDate;
}
public function getMerchant(): Merchant
{
return $this->merchant;
}
public function getToken(): string
{
return $this->token;
}
public function isUsed(): bool
{
return $this->used;
}
public function isExpired(): bool
{
return $this->expiryDate < new \DateTimeImmutable();
}
public function setUsed(bool $used): void
{
$this->used = $used;
}
}