feat(payment): implement expiration handling for appointment payments

This commit is contained in:
hamed
2026-07-03 09:53:55 +03:30
parent ab83a64d9d
commit 34d521434f
4 changed files with 232 additions and 0 deletions
+9
View File
@@ -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);