Files
fewo-stommer/app/Console/Commands/ResendBookingConfirmations.php
LarsandClaude Sonnet 5.5 eafab8a2cb
Deploy FeWo mit PipelineManager / deploy (push) Failing after 3m38s
Buchungsprozess: Angebots-Snapshot, atomare Annahme, Auto-Angebot, Kanalfreigabe
- 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>
2026-10-30 12:01:02 +01:00

42 lines
1.3 KiB
PHP
Raw Permalink 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\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;
}
}