# Favorite Places (Step 38)

Customer-owned saved locations. Independent CRUD — not linked to RideRequest.

Flutter loads places via this API, then sends normal `pickupLatitude` /
`pickupLongitude` / `pickupAddress` (and destination equivalents) when creating
a ride. There are no `pickupFavoritePlaceId` / `destinationFavoritePlaceId`
fields on ride creation.

## Endpoints

All require JWT + `customer` role. Ownership comes from the token only.

| Method | Path | Description |
|--------|------|-------------|
| POST | `/users/me/favorite-places` | Create |
| GET | `/users/me/favorite-places` | List own |
| GET | `/users/me/favorite-places/:id` | Get own |
| PATCH | `/users/me/favorite-places/:id` | Update own |
| DELETE | `/users/me/favorite-places/:id` | Delete own |

## Rules

- Unique types (one per customer): `HOME`, `WORK`, `OFFICE`, `AIRPORT`, `SCHOOL`, `GYM`
- `OTHER` may have multiple entries
- Max **20** places per customer (`MAX_FAVORITE_PLACES`)
- Cross-user access returns **404**

## Migration

`1744324000000-CreateFavoritePlaces.ts`

Or apply locally:

```bash
node scripts/apply-favorite-places.js
```
