add proportional stockThreshold
This commit is contained in:
parent
3ee87a6f04
commit
9391a37a1e
10 changed files with 47 additions and 21 deletions
|
|
@ -102,7 +102,8 @@ function createMapadoEventRequest($page) {
|
|||
"subfields" => [
|
||||
["name" => "startDate"],
|
||||
["name" => "endDate"],
|
||||
["name" => "notInStockContingentBookableStock"]
|
||||
["name" => "notInStockContingentBookableStock"],
|
||||
["name" => "totalStock"]
|
||||
]
|
||||
],
|
||||
]
|
||||
|
|
@ -116,6 +117,7 @@ function saveMapadoEvent($mapadoEvent, $page) {
|
|||
$kirby->impersonate('kirby');
|
||||
|
||||
$duration = '';
|
||||
$totalStock = null;
|
||||
$sessionsToSave = [];
|
||||
|
||||
if ($mapadoEvent->{"@type"} === 'hydra:Error') {
|
||||
|
|
@ -132,6 +134,9 @@ function saveMapadoEvent($mapadoEvent, $page) {
|
|||
|
||||
|
||||
foreach ($mapadoEvent->eventDateList as $session) {
|
||||
if (!$totalStock) {
|
||||
$totalStock = $session->totalStock;
|
||||
}
|
||||
|
||||
$sessionMonth = substr($session->startDate, 0, 7);
|
||||
|
||||
|
|
@ -158,7 +163,8 @@ function saveMapadoEvent($mapadoEvent, $page) {
|
|||
"mapadoSlug" => $mapadoEvent->slug,
|
||||
"remoteDuration" => $duration,
|
||||
"remoteSessions" => $sessionsToSave,
|
||||
"eventDateId" => $eventDateId
|
||||
"eventDateId" => $eventDateId,
|
||||
"totalStock" => $totalStock
|
||||
];
|
||||
|
||||
$page->update($dataToSave);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue