Deploy FeWo mit PipelineManager / deploy (push) Successful in 3m36s
- Zahlungen werden nicht mehr automatisch angemahnt: faellige Anzahlung/Restzahlung werden Aufgaben (Zahlungen & Wuensche, Tages-/Wochenuebersicht); Mail nur per Klick; je Portal und Buchungstyp abschaltbar - Freigabe-Link in der Eingangsbestaetigung, Storno-Link in der Buchungsbestaetigung; je Wohnung Wunsch / sofort / sofort bis Frist; Stornowuensche und Kosten bleiben Aufgabe des Gastgebers - Vertragsvorlagen mit Versionen (je Angebot, Portal oder Wohnung waehlbar), benutzte Versionen gesperrt; Angebot und finaler Vertrag als unveraenderliche PDF mit SHA-256, Vertrag wird nie neu geschrieben - Anreise-Mail je Wohnung einstellbar (Standard 3 Tage), neue Textfelder Schluessel/Parken/Ankunftstag Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
35 lines
1.2 KiB
PHP
35 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Support;
|
|
|
|
use App\Models\Booking;
|
|
use Carbon\CarbonImmutable;
|
|
use Illuminate\Support\Facades\URL;
|
|
|
|
/**
|
|
* Signed links the guest finds in mails to release a held request or to cancel a booking (no account needed).
|
|
* They only open a page; nothing changes before the guest confirms there.
|
|
*/
|
|
class SelfServiceLinks
|
|
{
|
|
/** Releases a request or offer the guest does not want; valid as long as the dates are held. */
|
|
public static function release(Booking $booking): string
|
|
{
|
|
return self::signed('reservations.release', $booking, $booking->hold_expires_at ?? now()->addDays(14));
|
|
}
|
|
|
|
/** Cancels (or asks to cancel) a binding booking; valid until the day of arrival. */
|
|
public static function cancel(Booking $booking): string
|
|
{
|
|
return self::signed('bookings.cancel', $booking, CarbonImmutable::parse($booking->arrival)->endOfDay());
|
|
}
|
|
|
|
private static function signed(string $route, Booking $booking, \DateTimeInterface $until): string
|
|
{
|
|
$parameters = ['booking' => $booking];
|
|
|
|
return $booking->website()?->temporarySignedRoute($route, $until, $parameters)
|
|
?? URL::temporarySignedRoute($route, $until, $parameters);
|
|
}
|
|
}
|