# Tank Track — Gas Station Reviews

Logged-in users can rate registered gas stations (**1–5 stars** + optional comment). Station owners cannot review their own station. Multiple reviews per user are allowed.

## Auth

```http
Authorization: Bearer <jwt>
Content-Type: application/json
```

Use registered station MongoDB `id` / `_id` (not Google `place_id`).

---

## 1. Create review

```http
POST /api/v1/gas-stations/:gasStationId/reviews
```

```json
{
  "rating": 5,
  "comment": "Clean pumps, friendly staff"
}
```

| Field | Required | Notes |
|-------|----------|--------|
| `rating` | yes | Integer 1–5 |
| `comment` | no | Max 500 chars |

**Success:** review object with `user` summary (`_id`, `fullName`, `email`, `image`).

| HTTP | When |
|------|------|
| 400 | Own station / station unavailable |
| 404 | Station not found |

---

## 2. List reviews

```http
GET /api/v1/gas-stations/:gasStationId/reviews?page=1&limit=20
```

```json
{
  "data": [ { "_id": "...", "rating": 5, "comment": "...", "user": { ... }, "createdAt": "..." } ],
  "total": 12,
  "page": 1,
  "totalPages": 1,
  "averageRating": 4.5,
  "totalReviews": 12
}
```

---

## 3. Delete own review

```http
DELETE /api/v1/gas-stations/:gasStationId/reviews/:reviewId
```

| HTTP | When |
|------|------|
| 403 | Not the author |
| 404 | Review not found |

---

## Out of scope (v1)

Edit review, photos, owner reply, admin moderation.
