feat: implement multi-tenant cart functionality and add image validation helper

This commit is contained in:
2026-07-01 15:38:12 -03:00
parent 3285015841
commit 4943e68606
5 changed files with 69 additions and 17 deletions

View File

@@ -48,6 +48,7 @@ class CartItemResource extends JsonResource
'cantidad' => $this->cantidad,
'precio_unitario' => $this->formatMoney($product?->precio),
'product_id' => $product?->id,
'product_variant_id' => $this->producto_variante_id,
'product' => $product === null ? null : [
'nombre' => $productName,
'imagen' => $imageUrl,

View File

@@ -21,6 +21,10 @@ class ImageOrBase64Rule implements ValidationRule
if (is_string($value)) {
$payload = trim($value);
if (\Illuminate\Support\Str::isUuid($payload)) {
return;
}
if ($payload === '') {
$fail("The :attribute must not be empty.");
return;