feat: duplicate an accommodation booking into a new draft
addresses #869f6z44f
This commit is contained in:
1 parent
2aa98b81fe
commit
29f295abf6
9 files changed
+470
No files matched your search
@@ -200,6 +200,34 @@ class AccommodationBooking implements BlameableEntityInterface, TimestampableEnt
|
||||
$this->uuid = Uuid::v4()->toRfc4122();
|
||||
}
|
||||
|
||||
/**
|
||||
* A copy is a new record, not a second view of the original: it gets its own identity and
|
||||
* its own access link token — sharing that token would put two records behind one customer
|
||||
* link — and every mark the lifecycle left is wiped, so the copy starts as an Entwurf that
|
||||
* has never been in front of a customer. The origin is rewritten too: however the original
|
||||
* came about, the copy comes about as an offer the office prepared, which is what keeps the
|
||||
* field truthful.
|
||||
*
|
||||
* The price snapshot, the service snapshots and all four discounts are deliberately carried
|
||||
* over untouched. A copy is made to vary an offer that was already quoted, so it has to show
|
||||
* the same numbers as the record it came from rather than a re-quote at today's catalog
|
||||
* prices; saving it through the edit form recomputes it.
|
||||
*/
|
||||
public function __clone()
|
||||
{
|
||||
$this->id = null;
|
||||
$this->uuid = Uuid::v4()->toRfc4122();
|
||||
$this->status = AccommodationBookingStatus::Draft;
|
||||
$this->origin = AccommodationBookingOrigin::Offer;
|
||||
$this->accessLinkIssuedAt = null;
|
||||
$this->acceptedAt = null;
|
||||
$this->confirmedAt = null;
|
||||
$this->createdAt = null;
|
||||
$this->updatedAt = null;
|
||||
$this->createdBy = null;
|
||||
$this->updatedBy = null;
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
|
||||
Reference in new issue
Block a user