Deploy FeWo mit PipelineManager / deploy (push) Failing after 3m38s
- Angebotsbedingungen und Zahlungsdaten werden je Version eingefroren (offer_terms, offer_hash) - Annahme in einer gesperrten Transaktion, idempotent, mit Nachweis; Mail- und Portalfehler machen eine gespeicherte Buchung nicht ungueltig (Postfach, Nachversand) - Je Wohnung: manuelle/automatische Angebote, optionale Vorreservierung - Automatische Freigabe abhaengig von aktuellen Importen und Feed-Abruf bei Sofortbuchungsportalen - Deutsche Fehlerseiten, Buchungsseite zeigt Angebots- und Zustellstatus - Dokumentation: BOOKING-E2E-*.md, BOOKING-COMPLIANCE-HANDOVER.md Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
42 lines
1.3 KiB
PHP
42 lines
1.3 KiB
PHP
<?php
|
||
|
||
namespace App\Console\Commands;
|
||
|
||
use App\Actions\ConfirmBooking;
|
||
use App\Enums\BookingStatus;
|
||
use App\Models\Booking;
|
||
use App\Models\Tenant;
|
||
use App\Tenancy\TenantRunner;
|
||
use Illuminate\Console\Attributes\Description;
|
||
use Illuminate\Console\Attributes\Signature;
|
||
use Illuminate\Console\Command;
|
||
|
||
#[Signature('bookings:resend-confirmations')]
|
||
#[Description('Retry booking confirmations whose mail failed (last three days) – once per landlord')]
|
||
class ResendBookingConfirmations extends Command
|
||
{
|
||
/**
|
||
* Execute the console command.
|
||
*/
|
||
public function handle(ConfirmBooking $confirmBooking, TenantRunner $runner): int
|
||
{
|
||
$runner->each(function (Tenant $tenant) use ($confirmBooking): void {
|
||
$sent = 0;
|
||
$failed = Booking::query()
|
||
->whereIn('status', BookingStatus::occupying())
|
||
->whereNotNull('confirmation_failed_at')
|
||
->where('confirmation_failed_at', '>=', now()->subDays(3))
|
||
->whereNull('confirmation_sent_at')
|
||
->get();
|
||
|
||
foreach ($failed as $booking) {
|
||
$sent += $confirmBooking->resend($booking) ? 1 : 0;
|
||
}
|
||
|
||
$this->info("{$tenant->name}: {$sent} von {$failed->count()} Bestätigung(en) nachgesendet.");
|
||
});
|
||
|
||
return self::SUCCESS;
|
||
}
|
||
}
|