# Task 05: Cart System

## Goal
Manage cart. Check `isAvailableToOrder()` before adding physical items.
Snapshot prices with discount.

## Files
- `app/Services/Ecommerce/CartService.php`
- `app/Http/Controllers/Api/CartController.php`
- `app/Http/Resources/Ecommerce/CartResource.php`
- `app/Http/Resources/Ecommerce/CartItemResource.php`
- `resources/views/cart/index.blade.php`

## Steps
1. `CartService::addItem()`:
   - Validate product active + type has price
   - For physical: call `product->isAvailableToOrder()` → reject if false
   - Snapshot `original_price`, `discount_amount`, `price`
   - Enforce `quantity = 1` for digital
2. `CartService::updateQuantity()`:
   - Reject for digital with ValidationException
   - Check `isAvailableToOrder()` for new qty
3. `CartItemResource`: expose `original_price`, `discount_amount`, `price`, `subtotal`, `stock_label`
4. Register routes under `auth` middleware
