feat: delete orphaned future snapshots after xml sync

This commit is contained in:
Björn Fromme
2026-03-25 15:35:12 +01:00
parent facd91375c
commit bca3610cff
4 changed files with 84 additions and 0 deletions
+13
View File
@@ -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.
*/