feat: implement CartService to manage cart lifecycle and guest identity resolution

This commit is contained in:
2026-07-01 12:38:46 -03:00
parent 4aedf7ca86
commit a7dba4dc10

View File

@@ -14,13 +14,13 @@ class CartService
{
public function show(Tenant $tenant, Request $request): Cart
{
$identity = $this->resolveIdentity($request);
$resolvedIdentity = $this->resolveIdentity($request);
if ($identity === null) {
if ($resolvedIdentity === null) {
return $this->makeEmptyCart($tenant);
}
$cart = $this->findCart($tenant, $identity);
$cart = $this->findCart($tenant, $resolvedIdentity['identity']);
if ($cart === null) {
return $this->makeEmptyCart($tenant);