feat: cli command to clean up outdated or stale booking draft records
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user