feat(cart): implement cart editing policies and update related functionality

This commit is contained in:
2026-08-19 10:15:37 -03:00
parent 67e6211857
commit 014b5bb012
20 changed files with 305 additions and 39 deletions

View File

@@ -0,0 +1,23 @@
<?php
namespace App\Domains\Tenant\Resources;
use App\Domains\Tenant\Enums\CartEditingPolicy;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
/** @mixin CartEditingPolicy */
class CartEditingPolicyResource extends JsonResource
{
/** @return array<string, bool|string> */
public function toArray(Request $request): array
{
return [
'code' => $this->resource->value,
'allow_modify' => $this->resource->allowsModification(),
'allow_delete' => $this->resource->allowsRemoval(),
'allow_update_quantity' => $this->resource->allowsQuantityChanges(),
'allow_update_variant' => $this->resource->allowsVariantChanges(),
];
}
}