- Dumpsites + Routes: full create forms (boundary point list, click-to-add ordered stops with reorder controls) - Trucks: list + create - Teams: list + create with conflict detection (override checkbox) - Trips: schedule + list + detail panel showing stops + timeline - Partner Stores: list + create + Issue-Inventory action - Reports: tabbed dashboard (daily collection, trip performance, store sales, compliance CSV export) + rebuild aggregations - Sidebar: moves Teams/Trucks/Trips/Stores/Reports out of "Soon", reorganized groups - Admin resources expose db_id alongside public uuid so admin forms can post integer FKs without a separate lookup endpoint 164 tests still passing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
28 lines
881 B
PHP
28 lines
881 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class TruckResource extends JsonResource
|
|
{
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->uuid,
|
|
'db_id' => $this->id,
|
|
'plate_number' => $this->plate_number,
|
|
'model' => $this->model,
|
|
'capacity_kg' => $this->capacity_kg,
|
|
'status' => $this->status,
|
|
'assigned_team_id' => $this->assigned_team_id,
|
|
'last_known_coordinates' => $this->last_known_coordinates ? [
|
|
'lat' => $this->last_known_coordinates->latitude,
|
|
'lng' => $this->last_known_coordinates->longitude,
|
|
] : null,
|
|
'last_location_updated_at' => $this->last_location_updated_at?->toIso8601String(),
|
|
];
|
|
}
|
|
}
|