feat: implement multi-tenant cart system with stock reservation and inventory tracking

This commit is contained in:
2026-07-01 16:21:53 -03:00
parent 230ea57ce0
commit 6a0b08c9d7
8 changed files with 144 additions and 18 deletions

View File

@@ -34,7 +34,10 @@ class ProductResource extends JsonResource
'variants_map' => $this->whenLoaded('variants', fn () => $this->variants
->map(fn ($variant) => [
'variant_id' => $variant->id,
'stock' => $variant->stock,
'stock' => $variant->stock_tecnico,
'stock_real' => $variant->stock_real,
'stock_reservado' => $variant->stock_reservado,
'stock_tecnico' => $variant->stock_tecnico,
'attributes' => $variant->definitions
->mapWithKeys(fn ($definition) => [
$definition->productAttribute?->attribute?->codigo => $definition->value,

View File

@@ -18,7 +18,10 @@ class ProductVariantResource extends JsonResource
{
return [
'id' => $this->id,
'stock' => $this->stock,
'stock' => $this->stock_tecnico,
'stock_real' => $this->stock_real,
'stock_reservado' => $this->stock_reservado,
'stock_tecnico' => $this->stock_tecnico,
'product' => ProductResource::make($this->whenLoaded('product')),
'definitions' => $this->whenLoaded(
'definitions',