- mailboxes (Modell für mehrere, eines aktiv): Übernahme des bisherigen Postfachs als „nur Portal-Mails“; Modus „alle Nachrichten“ für ein eigenes Postfach; Adresse als Antwortadresse der Rückfragen. - inbound_messages: jede Nachricht zuerst gespeichert, einmal je Message-ID, mit Testbetriebs-Kennzeichen (M10). Portal-Mails laufen unverändert über den Portalpfad (CH-08). - MessageMatcher (CH-13, ohne Scoring): Antwortbezug; Vorgangsnummer nur mit dem Gast als Absender; sonst Absender + Wohnung + beide Termine eines einzigen offenen Vorgangs. Ein offener Vorgang des Absenders allein genügt nicht (nur Hinweis). Alles andere → Klärung (M04). - Ausgehende Mails speichern ihre Message-ID; Antwort stoppt Erinnerungen. - Filament „Posteingang“: lesen, Vorgang zuordnen, als neue Anfrage anlegen, ignorieren, erledigt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
114 lines
4.7 KiB
PHP
114 lines
4.7 KiB
PHP
<?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';
|
||
case FactConflict = 'fact_conflict';
|
||
case ChangeRequest = 'change_request';
|
||
case GuestUnresponsive = 'guest_unresponsive';
|
||
case InboundReview = 'inbound_review';
|
||
|
||
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',
|
||
self::FactConflict => 'Abweichende Angabe des Gastes prüfen',
|
||
self::ChangeRequest => 'Änderungswunsch des Gastes prüfen',
|
||
self::GuestUnresponsive => 'Fehlende Angaben selbst beim Gast nachfragen',
|
||
self::InboundReview => 'Antwort des Gastes prüfen',
|
||
};
|
||
}
|
||
|
||
/**
|
||
* 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,
|
||
};
|
||
}
|
||
}
|