feat(admin-stock): apply idempotent availability deltas
This commit is contained in:
@@ -37,7 +37,7 @@ class AccommodationResource extends JsonResource
|
||||
'title' => $options->get($value)?->label ?? $value,
|
||||
'value' => $value,
|
||||
'description' => $variant->descripcion,
|
||||
'stock' => $variant->inventory->real_stock,
|
||||
'stock' => $variant->inventory->availableStock(),
|
||||
'price' => number_format($variant->getPrice(), 2, '.', ''),
|
||||
];
|
||||
})->values(),
|
||||
|
||||
@@ -33,7 +33,7 @@ class EntryResource extends JsonResource
|
||||
'title' => $this->nombre,
|
||||
'description' => $this->descripcion,
|
||||
'event_date_ids' => $variant->selectedEventDates()->pluck('id')->values(),
|
||||
'stock' => $variant->inventory->real_stock,
|
||||
'stock' => $variant->inventory->availableStock(),
|
||||
'price' => $this->precio,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ class FoodResource extends JsonResource
|
||||
'schedule' => $values->get('horario'),
|
||||
'service' => $values->get('servicio'),
|
||||
'description' => $variant->descripcion,
|
||||
'stock' => $variant->inventory->real_stock,
|
||||
'stock' => $variant->inventory->availableStock(),
|
||||
'price' => number_format($variant->getPrice(), 2, '.', ''),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ class MerchandiseResource extends JsonResource
|
||||
'color_value' => $colorValue,
|
||||
'size' => $sizeOptions->get($sizeValue)?->label ?? $sizeValue,
|
||||
'size_value' => $sizeValue,
|
||||
'stock' => $variant->inventory->real_stock,
|
||||
'stock' => $variant->inventory->availableStock(),
|
||||
'price' => number_format($variant->getPrice(), 2, '.', ''),
|
||||
];
|
||||
})->values(),
|
||||
|
||||
Reference in New Issue
Block a user