Neustrukturierung Customer / Lead / Booking Phase 2
This commit is contained in:
parent
313f0dbf4e
commit
6df9c401af
69 changed files with 3809 additions and 374 deletions
31
app/Exceptions/Offer/OfferNotEditableException.php
Normal file
31
app/Exceptions/Offer/OfferNotEditableException.php
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace App\Exceptions\Offer;
|
||||
|
||||
use App\Models\OfferVersion;
|
||||
use DomainException;
|
||||
|
||||
/**
|
||||
* Geworfen, wenn eine nicht-Draft-Version verändert werden soll.
|
||||
* Klar abgrenzbarer Typ zu {@see InvalidOfferStatusException}
|
||||
* (dort: Offer.status passt nicht; hier: OfferVersion.status blockiert Edits).
|
||||
*/
|
||||
class OfferNotEditableException extends DomainException
|
||||
{
|
||||
public readonly int $versionId;
|
||||
public readonly string $currentStatus;
|
||||
|
||||
public function __construct(OfferVersion $v, string $attemptedAction = 'ändern')
|
||||
{
|
||||
$this->versionId = $v->id;
|
||||
$this->currentStatus = $v->status;
|
||||
|
||||
parent::__construct(sprintf(
|
||||
'OfferVersion #%d ist nicht mehr editierbar (status=%s). '
|
||||
. 'Aktion „%s" erfordert eine Draft-Version — nutze createNewVersion() / supersede().',
|
||||
$v->id,
|
||||
$v->status,
|
||||
$attemptedAction
|
||||
));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue