feat: add ticket fields to Product and ProductVariant models, requests, and resources

This commit is contained in:
2026-07-14 15:19:53 -03:00
parent 0e9f7faaf1
commit cababe1a43
8 changed files with 87 additions and 1 deletions

View File

@@ -26,6 +26,7 @@ class ProductResource extends JsonResource
'precio' => $this->precio,
'category' => $this->whenLoaded('category', fn () => $this->category?->nombre),
'brand' => $this->whenLoaded('brand', fn () => $this->brand?->nombre),
'images' => $this->whenLoaded('attachments', fn () => $this->attachments
->map(fn ($attachment) => $attachment->getTemporaryUrl(1440))
->values()

View File

@@ -19,6 +19,9 @@ class ProductVariantResource extends JsonResource
return [
'id' => $this->id,
'cantidad_maxima' => $this->stock_tecnico,
'has_tickets' => $this->has_tickets,
'minimum_use_date' => $this->minimum_use_date,
'maximum_use_date' => $this->maximum_use_date,
'product' => ProductResource::make($this->whenLoaded('product')),
'definitions' => $this->whenLoaded(
'definitions',