Files
fewo-stommer/app/Enums/BookingTaskKind.php
T
LarsandClaude Opus 5.5 40d20cb7d1 Pakete 7 und 9: Auskunft und Buchungswunsch, Aufenthalt und Abschluss (Zwischenstand)
- Haltefrist 0: unverbindliche Auskunft mit signiertem Link "Buchung anfragen",
  erneute Prüfung unter Sperre, automatische oder manuelle Bestätigung, Absage
  bei vergebenem Zeitraum, Ablauf unbeantworteter Auskünfte
- Aufenthalt: Anreisedaten, Aufgaben je Wohnung, gebuchte Leistungen,
  Abweichungen und Folgeaufgaben als Aufgaben am Vorgang
- Abschluss getrennt: Aufenthalt abgeschlossen / kaufmännisch abgeschlossen,
  Nachläufer (Forderung, Auszahlung) bleiben sichtbar
- Zahlungsstatus nur aus Geld auf unserem Konto; Altbestand per Vorschau-Befehl
- Verlauf weist Testzustellungen als solche aus
- Abnahmetests T16-T25, T23 über isolierten SMTP-Empfänger

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 08:29:19 +01:00

106 lines
4.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace App\Enums;
use App\Mail\PaymentReminder;
use Filament\Support\Contracts\HasLabel;
/**
* What the landlord has to do about a booking. Payment tasks are created by the daily run; nothing is
* sent to the guest until the landlord has checked the payment and chooses to send the mail.
*
* Package 9 sorts every task into what it holds up: tasks of the stay ({@see self::blocksStay()}) keep the stay from
* being closed, commercial tasks ({@see self::isCommercial()}) keep the case from being settled, follow-ups hold up
* neither and simply stay on the case until they are done.
*/
enum BookingTaskKind: string implements HasLabel
{
case DepositReminder = 'deposit_reminder';
case BalanceRequest = 'balance_request';
case BalanceReminder = 'balance_reminder';
case CancellationRequest = 'cancellation_request';
case CancellationFee = 'cancellation_fee';
case PortalCancellation = 'portal_cancellation';
case PortalCancellationReported = 'portal_cancel_reported';
case PortalChangeReported = 'portal_change_reported';
case RefundCheck = 'refund_check';
case BookingWish = 'booking_wish';
case ArrivalDetails = 'arrival_details';
case Service = 'service';
case Issue = 'issue';
case FollowUp = 'follow_up';
case PayoutCheck = 'payout_check';
case OpenClaim = 'open_claim';
public function getLabel(): string
{
return match ($this) {
self::DepositReminder => 'Anzahlung überfällig – anmahnen',
self::BalanceRequest => 'Restzahlung bald fällig – anfordern',
self::BalanceReminder => 'Restzahlung überfällig – anmahnen',
self::CancellationRequest => 'Stornierungswunsch des Gastes',
self::CancellationFee => 'Stornokosten prüfen und abrechnen',
self::PortalCancellation => 'Stornierung im Portal veranlassen bzw. prüfen',
self::PortalCancellationReported => 'Das Portal meldet eine Stornierung – bitte prüfen',
self::PortalChangeReported => 'Das Portal meldet eine Änderung – bitte prüfen',
self::RefundCheck => 'Erstattung an den Gast prüfen',
self::BookingWish => 'Buchungswunsch bestätigen?',
self::ArrivalDetails => 'Anreisedaten beim Gast erfragen',
self::Service => 'Leistung vorbereiten',
self::Issue => 'Abweichung oder Problem klären',
self::FollowUp => 'Folgeaufgabe',
self::PayoutCheck => 'Auszahlung des Portals prüfen',
self::OpenClaim => 'Offenen Betrag nach der Abreise klären',
};
}
/**
* Whether this is a payment reminder task (created by the daily run, settled by a payment or a reminder mail).
*/
public function isPayment(): bool
{
return in_array($this, [self::DepositReminder, self::BalanceRequest, self::BalanceReminder], true);
}
/**
* Whether an open task of this kind keeps the stay from being closed (it belongs to the stay itself).
*/
public function blocksStay(): bool
{
return in_array($this, [self::Service, self::Issue, self::PortalChangeReported], true);
}
/**
* Whether an open task of this kind keeps the case from being commercially settled.
*/
public function isCommercial(): bool
{
return $this->isPayment() || in_array($this, [self::CancellationFee, self::RefundCheck, self::PayoutCheck, self::OpenClaim], true);
}
/**
* Kinds the landlord adds by hand on a case (several per case, each with its own title).
*
* @return list<self>
*/
public static function manual(): array
{
return [self::Service, self::Issue, self::FollowUp];
}
/**
* The mail kind (App\Mail\PaymentReminder) and the booking column that records its dispatch.
*
* @return array{0: string, 1: string}|null
*/
public function reminder(): ?array
{
return match ($this) {
self::DepositReminder => [PaymentReminder::DEPOSIT_OVERDUE, 'deposit_reminded_at'],
self::BalanceRequest => [PaymentReminder::BALANCE_REQUEST, 'balance_requested_at'],
self::BalanceReminder => [PaymentReminder::BALANCE_OVERDUE, 'balance_reminded_at'],
default => null,
};
}
}