feat: report the source export timestamp on every travel export page
This commit is contained in:
1 parent
c2c55bc8b2
commit
272c811f4f
6 files changed
+49
-5
No files matched your search
@@ -6,6 +6,7 @@ namespace App\Service;
|
||||
|
||||
use App\BusProNet\Model\Hotel;
|
||||
use App\BusProNet\Model\Pickup;
|
||||
use App\BusProNet\Model\XmlExportInfo;
|
||||
use App\BusProNet\Traits\TypeConversionTrait;
|
||||
use App\BusProNet\XmlCrawlerFactory;
|
||||
use App\BusProNet\XmlLoader\HotelLoader;
|
||||
@@ -67,6 +68,11 @@ class TravelExportBuilder
|
||||
|
||||
private function assemble(): TravelExport
|
||||
{
|
||||
// Read before the walk and cached with the rows, so every page served from this
|
||||
// copy names the same source export. A client that sees it change between pages
|
||||
// knows xml-sync swapped the export underneath its walk.
|
||||
$sourceGeneratedAt = XmlExportInfo::fromStorage($this->xmlExport)?->lastTransfer;
|
||||
|
||||
$hotels = $this->hotelLoader->loadAll();
|
||||
$pickupMasterData = $this->pickupLoader->loadAll();
|
||||
|
||||
@@ -96,6 +102,7 @@ class TravelExportBuilder
|
||||
$skipped,
|
||||
count($pickupsWithoutMasterData),
|
||||
new \DateTimeImmutable(),
|
||||
$sourceGeneratedAt,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user