# Smart Mining ERP — Acceptance Criteria Mapping (plan §81)

All answers must come from real system data (reports API / domain aggregates).

| # | Business question | Data source |
|---|-------------------|-------------|
| 1 | How much material was produced? | `production` table via `ReportService::production` / `/api/v1/reports/production` |
| 2 | How much material is currently available? | `stock` cached quantities via `ReportService::inventory` / stock API |
| 3 | Where is the material? | `stock` + `dumping_points` (site via dumping point) |
| 4 | How many trips were completed? | `trips` aggregates (`driver-trips`, `dumper-trips`, `truck-trips`, daily/monthly) |
| 5 | Which driver completed them? | `trips.driver_id` → `ReportService::driverTrips` |
| 6 | Which machine worked how many hours? | `machine_hours` → `ReportService::machineHours` |
| 7 | How much fuel was consumed? | `fuel_transactions` → `ReportService::fuel` |
| 8 | How much material was delivered to each factory? | `deliveries` → `ReportService::factoryDeliveries` |
| 9 | How much has each factory/customer paid? | `payments` + party ledgers (`customer-ledger`, `factory-ledger`) |
| 10 | How much is outstanding? | `ReportService::receivables` / `payables` |
| 11 | How much did the business spend? | `expenses` + fuel cost in P&L / monthly report |
| 12 | How much stock is available? | `stock` + `inventory_items` inventory report |
| 13 | Which machines need maintenance? | `machine_maintenance.next_service_date` + `mining:maintenance-alert` |
| 14 | What was today's production? | `ReportService::daily` (defaults to today) |
| 15 | What was this month's production? | `ReportService::monthly` |
| 16 | What is the estimated profit? | `ReportService::profitAndLoss` |
| 17 | What needs attention today? | Automation alerts: maintenance, payments, low stock, document expiry, backup status |

## Verification

```bash
php artisan migrate --force
php artisan test
```
