feat: update product resource and seeder to support variant groups and remove unused fields

This commit is contained in:
2026-06-30 16:11:18 -03:00
parent fdeba7540b
commit 1d0f9e323d
3 changed files with 105 additions and 46 deletions

View File

@@ -17,7 +17,6 @@ class ProductResource extends JsonResource
{
return [
'id' => $this->id,
'tenant_codigo' => $this->tenant_codigo,
'category_id' => $this->categoria_id,
'brand_id' => $this->brand_id,
'slug' => $this->slug,

View File

@@ -273,6 +273,7 @@ class ProductService
}
$product->setRelation('attachments', $resolvedAttachment ? collect([$resolvedAttachment]) : collect());
$product->unsetRelation('variants');
}
return $products;