feat: cli command to clean up outdated or stale booking draft records

This commit is contained in:
Björn Fromme
2026-03-16 12:02:27 +01:00
parent e09e5858d8
commit 1fa17a7df7
6 changed files with 142 additions and 3 deletions
+2 -1
View File
@@ -59,12 +59,13 @@ class BookingEditDraftService
public function saveDraft(User $user, int $bookingId, BookingDto $bookingDto): void
{
$formData = $this->fingerprintService->extractUserData($bookingDto);
$travelDate = $bookingDto->travel->dateFrom;
$existingDraft = $this->findDraft($user, $bookingId);
if (null !== $existingDraft) {
$existingDraft->setFormData($formData);
} else {
$draft = new BookingEditDraft($user, $bookingId, $formData);
$draft = new BookingEditDraft($user, $bookingId, $travelDate, $formData);
$this->entityManager->persist($draft);
}