chore: update document approval workflow and bug fixes

This commit is contained in:
2026-05-25 13:05:20 +08:00
parent d573c02893
commit 39a8e1d4cd
910 changed files with 49994 additions and 1010 deletions

View File

@@ -0,0 +1,63 @@
<?php
namespace App\Http\Controllers;
use Inertia\Inertia;
use Illuminate\Http\Request;
class DashboardController extends Controller
{
public function index(Request $request)
{
// For Phase 1, we return structured mock data tailored for a Site Execution Dashboard.
// Once the frontend is wired up, we can replace these with actual Eloquent queries
// to Modules\ProjectManagement\Models\Task and MaterialLogistics models.
$weather = [
'condition' => 'Scattered Thunderstorms',
'temp' => '84°F',
'high' => '88°F',
'low' => '72°F',
'forecast' => 'Rain expected at 2:00 PM. High winds (15mph).',
'color' => 'amber' // alert indicator
];
$activities = [
['id' => 1, 'time' => '07:00 AM', 'title' => 'Site Opens & Safety Toolbox Talk', 'status' => 'completed'],
['id' => 2, 'time' => '09:00 AM', 'title' => 'Concrete Pour (Foundation Sec B)', 'status' => 'in_progress'],
['id' => 3, 'time' => '01:00 PM', 'title' => 'Steel Delivery (Supplier A)', 'status' => 'pending'],
['id' => 4, 'time' => '03:30 PM', 'title' => 'City Inspector Walk-through', 'status' => 'pending'],
];
$blockers = [
['id' => 101, 'type' => 'RFI', 'title' => 'RFI #42: Balcony Rebar Specifications Unclear', 'urgency' => 'high'],
['id' => 102, 'type' => 'Material', 'title' => 'Delayed Cement Delivery (Truck breakdown)', 'urgency' => 'critical'],
['id' => 103, 'type' => 'Safety', 'title' => 'Guardrails missing on 3rd floor west wing', 'urgency' => 'high'],
];
$resources = [
'labor' => [
'expected' => 45,
'actual' => 42,
'trades' => ['Carpenters' => 12, 'Electricians' => 6, 'Laborers' => 24]
],
'equipment' => [
'active' => 3,
'maintenance' => 1,
'idle' => 2,
'list' => [
['name' => 'Excavator Cat 320', 'status' => 'active'],
['name' => 'Tower Crane 1', 'status' => 'active'],
['name' => 'Skid Steer', 'status' => 'maintenance'],
]
]
];
return Inertia::render('Dashboard', [
'weather' => $weather,
'activities' => $activities,
'blockers' => $blockers,
'resources' => $resources,
]);
}
}