Neustrukturierung Customer / Lead / Booking Phase 2
This commit is contained in:
parent
313f0dbf4e
commit
6df9c401af
69 changed files with 3809 additions and 374 deletions
27
app/Events/Offer/OfferAccepted.php
Normal file
27
app/Events/Offer/OfferAccepted.php
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace App\Events\Offer;
|
||||
|
||||
use App\Models\Offer;
|
||||
use App\Models\OfferVersion;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
|
||||
/**
|
||||
* Wird gefeuert, nachdem eine OfferVersion als `accepted` markiert wurde
|
||||
* (durch Admin oder Kunden-Token-Link). Listener schreiben Audit-Logs,
|
||||
* benachrichtigen das Team und aktivieren den Button „In Buchung übernehmen".
|
||||
*/
|
||||
class OfferAccepted
|
||||
{
|
||||
use Dispatchable;
|
||||
|
||||
public function __construct(
|
||||
public readonly Offer $offer,
|
||||
public readonly OfferVersion $version,
|
||||
/** customer_link | admin | email */
|
||||
public readonly string $via,
|
||||
public readonly ?string $ip = null,
|
||||
public readonly ?string $userAgent = null,
|
||||
) {
|
||||
}
|
||||
}
|
||||
24
app/Events/Offer/OfferDeclined.php
Normal file
24
app/Events/Offer/OfferDeclined.php
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace App\Events\Offer;
|
||||
|
||||
use App\Models\Offer;
|
||||
use App\Models\OfferVersion;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
|
||||
/**
|
||||
* Wird gefeuert, nachdem eine OfferVersion als `declined` markiert wurde.
|
||||
* Listener schreiben Audit-Log + informieren das Team.
|
||||
*/
|
||||
class OfferDeclined
|
||||
{
|
||||
use Dispatchable;
|
||||
|
||||
public function __construct(
|
||||
public readonly Offer $offer,
|
||||
public readonly OfferVersion $version,
|
||||
public readonly string $via,
|
||||
public readonly ?string $reason = null,
|
||||
) {
|
||||
}
|
||||
}
|
||||
31
app/Events/Offer/OfferSent.php
Normal file
31
app/Events/Offer/OfferSent.php
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace App\Events\Offer;
|
||||
|
||||
use App\Models\Offer;
|
||||
use App\Models\OfferAccessToken;
|
||||
use App\Models\OfferVersion;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
|
||||
/**
|
||||
* Wird gefeuert, nachdem eine OfferVersion status=sent gesetzt wurde und ein
|
||||
* frischer Access-Token existiert. Listener (Ticket B6) versenden die Mail,
|
||||
* schreiben das Kommunikations-Log und fügen den öffentlichen Link ein.
|
||||
*
|
||||
* Der Mail-Plaintext-Token liegt in `$token->plain_token` — wird NUR hier,
|
||||
* beim Versand, in den Link eingebaut. Nach dem Event wird die Property
|
||||
* wieder entsorgt.
|
||||
*/
|
||||
class OfferSent
|
||||
{
|
||||
use Dispatchable;
|
||||
|
||||
public function __construct(
|
||||
public readonly Offer $offer,
|
||||
public readonly OfferVersion $version,
|
||||
public readonly OfferAccessToken $token,
|
||||
/** @var array<string,mixed> Betreff/Body/CC aus dem Versand-Modal. */
|
||||
public readonly array $mailData = [],
|
||||
) {
|
||||
}
|
||||
}
|
||||
22
app/Events/Offer/OfferWithdrawn.php
Normal file
22
app/Events/Offer/OfferWithdrawn.php
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
namespace App\Events\Offer;
|
||||
|
||||
use App\Models\Offer;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
|
||||
/**
|
||||
* Wird gefeuert, nachdem ein Offer durch den Admin zurückgezogen wurde
|
||||
* (status=withdrawn, alle aktiven Tokens revoked). Listener schreiben
|
||||
* Audit-Log + benachrichtigen ggf. den Kunden.
|
||||
*/
|
||||
class OfferWithdrawn
|
||||
{
|
||||
use Dispatchable;
|
||||
|
||||
public function __construct(
|
||||
public readonly Offer $offer,
|
||||
public readonly string $reason,
|
||||
) {
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue