feat: refactor cart item handling to use mapped buyable types and improve method signatures

This commit is contained in:
2026-07-14 16:43:00 -03:00
parent 480ee70393
commit c05206cc51
7 changed files with 50 additions and 31 deletions

View File

@@ -8,6 +8,6 @@ Route::prefix('tenants/{tenant:codigo}')
->group(function (): void {
Route::get('cart', [CartController::class, 'show']);
Route::post('cart/items', [CartController::class, 'addItem']);
Route::patch('cart/items/{buyableType}/{buyableId}', [CartController::class, 'updateItemQuantity']);
Route::delete('cart/items/{buyableType}/{buyableId}', [CartController::class, 'removeItem']);
Route::patch('cart/items/{cartItem}', [CartController::class, 'updateItemQuantity']);
Route::delete('cart/items/{cartItem}', [CartController::class, 'removeItem']);
});