# DPSVR Phase 1 API Examples

## Login

```http
POST /api/v1/auth/login
Content-Type: application/json

{
  "email": "admin@example.com",
  "password": "password"
}
```

## Create Station

```http
POST /api/v1/stations
Authorization: Bearer TOKEN
Content-Type: application/json

{
  "station_name": "Arepo Station",
  "station_code": "ARP-001",
  "address": "NUJ Estate Road, Arepo, Ogun State",
  "state": "Ogun",
  "lga": "Obafemi Owode",
  "region": "South West"
}
```

## Create Tank

```http
POST /api/v1/fuel-tanks
Authorization: Bearer TOKEN
Content-Type: application/json

{
  "station_id": 1,
  "fuel_product_id": 1,
  "tank_label": "Tank A",
  "capacity_litres": 45000,
  "allowable_variance_pct": 0.005
}
```

## Set Price

```http
POST /api/v1/price-history
Authorization: Bearer TOKEN
Content-Type: application/json

{
  "station_id": 1,
  "fuel_tank_id": 1,
  "price_per_litre_ngn": 699,
  "effective_from": "2026-06-12 06:00:00"
}
```

## Create Shift

```http
POST /api/v1/shifts
Authorization: Bearer TOKEN
Content-Type: application/json

{
  "station_id": 1,
  "shift_date": "2026-06-12",
  "shift_number": 1,
  "shift_start_time": "06:00",
  "shift_end_time": "14:00",
  "attendant_user_id": 5,
  "supervisor_user_id": 3
}
```

## Submit Tank Reading

```http
POST /api/v1/readings
Authorization: Bearer TOKEN
Content-Type: application/json

{
  "shift_id": 1,
  "fuel_tank_id": 1,
  "opening_dip_litres": 18500.00,
  "closing_dip_litres": 12300.00,
  "deliveries_litres": 0.00,
  "pump_meter_open": 456789.50,
  "pump_meter_close": 463189.50
}
```

## Submit Blind Cash Declaration

```http
POST /api/v1/blind-cash-declarations
Authorization: Bearer TOKEN
Content-Type: application/json

{
  "shift_id": 1,
  "cash_declared_ngn": 3000000,
  "pos_card_total_ngn": 900000,
  "transfer_total_ngn": 430000
}
```

## Generate Variance Report

```http
POST /api/v1/reports/variance/shift/1
Authorization: Bearer TOKEN
```
