feat: delete orphaned future snapshots after xml sync
This commit is contained in:
@@ -272,6 +272,19 @@ class TravelSnapshotService
|
||||
return $this->snapshotRepository->deleteExpiredSnapshots($beforeDate);
|
||||
}
|
||||
|
||||
/**
|
||||
* Purges future snapshots whose dateId is no longer present in the XML export.
|
||||
*
|
||||
* @param array<int> $activeXmlDateIds dateIds currently present in the XML file map
|
||||
*/
|
||||
public function purgeOrphanedFutureSnapshots(array $activeXmlDateIds): int
|
||||
{
|
||||
return $this->snapshotRepository->deleteOrphanedFutureSnapshots(
|
||||
$activeXmlDateIds,
|
||||
new \DateTimeImmutable('today'),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves snapshot by exact date/hotel or by date fallback.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user