- 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>
36 lines
1.2 KiB
PHP
36 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class UserDetailResource extends JsonResource
|
|
{
|
|
public function toArray(Request $request): array
|
|
{
|
|
$relation = $this->profileRelation();
|
|
$profile = $relation ? $this->{$relation} : null;
|
|
|
|
return [
|
|
'id' => $this->uuid,
|
|
'db_id' => $this->id,
|
|
'email' => $this->email,
|
|
'phone' => $this->phone,
|
|
'first_name' => $this->first_name,
|
|
'middle_name' => $this->middle_name,
|
|
'last_name' => $this->last_name,
|
|
'full_name' => $this->full_name,
|
|
'role' => $this->role,
|
|
'status' => $this->status,
|
|
'preferred_language' => $this->preferred_language,
|
|
'avatar_path' => $this->avatar_path,
|
|
'email_verified_at' => $this->email_verified_at?->toIso8601String(),
|
|
'phone_verified_at' => $this->phone_verified_at?->toIso8601String(),
|
|
'last_login_at' => $this->last_login_at?->toIso8601String(),
|
|
'created_at' => $this->created_at?->toIso8601String(),
|
|
'profile' => $profile?->toArray(),
|
|
];
|
|
}
|
|
}
|