feat(payment): implement expiration handling for appointment payments
This commit is contained in:
@@ -170,6 +170,15 @@ class Appointment
|
||||
return $this;
|
||||
}
|
||||
|
||||
/** آیا پنجرهٔ ۱۵ دقیقهایِ پرداخت گذشته یا زمان اسلات رد شده است؟ */
|
||||
public function isPaymentWindowExpired(int $now): bool
|
||||
{
|
||||
if ($this->expiresAt !== null && $now > $this->expiresAt) {
|
||||
return true;
|
||||
}
|
||||
return $now >= $this->slotStart;
|
||||
}
|
||||
|
||||
public function canTransitionTo(string $newStatus): bool
|
||||
{
|
||||
return in_array($newStatus, self::ALLOWED_TRANSITIONS[$this->status] ?? [], true);
|
||||
|
||||
Reference in New Issue
Block a user