chore: cleanup dead code + format with Pint

- Remove unused FeaturesController (empty stubs, no routes)
- Remove ConvertSpatialFile CLI command (unused; service used in LayerManager)
- Remove MigrateGeojsonToFeatures CLI command (one-shot migration, not referenced)
- Remove .claude/worktrees/ (11 old agent worktrees from June)
- Apply Laravel Pint formatting across 219 files (style only, no functional changes)

Tests: 101 passing (319 assertions)
API routes: unchanged (8 routes intact)
This commit is contained in:
Javier Braña
2026-08-28 13:04:28 +02:00
parent 2dccd59385
commit 90630379fb
139 changed files with 2888 additions and 2510 deletions
+5 -4
View File
@@ -10,7 +10,7 @@ use Livewire\Component;
class ReportBuilder extends Component
{
public Project $project;
public array $filters = [
'date_from' => null,
'date_to' => null,
@@ -19,8 +19,9 @@ class ReportBuilder extends Component
'include_charts' => false,
'format' => 'html',
];
public bool $showPreview = false;
public ?array $previewData = null;
public function mount(Project $project)
@@ -32,7 +33,7 @@ class ReportBuilder extends Component
public function authorizeAccess(): void
{
$user = auth()->guard()->user();
if (!$user->can('manage all') && !$this->project->users()->where('user_id', $user->id)->exists()) {
if (! $user->can('manage all') && ! $this->project->users()->where('user_id', $user->id)->exists()) {
abort(403);
}
}
@@ -122,4 +123,4 @@ class ReportBuilder extends Component
'availableEntities' => (new ReportFilters)->getAvailableEntities(),
]);
}
}
}
+25 -24
View File
@@ -2,31 +2,32 @@
namespace App\Livewire\Reports;
use Livewire\Component;
use Livewire\Attributes\Layout;
use App\Models\Project;
use App\Models\Phase;
use App\Models\Inspection;
use App\Models\Phase;
use App\Models\Project;
use Carbon\Carbon;
use Livewire\Attributes\Layout;
use Livewire\Component;
#[Layout('layouts.app')]
class ReportsDashboard extends Component
{
public $dateRange = 'month'; // week, month, quarter, year
public $chartData = [];
public function mount()
{
$this->loadChartData();
}
public function loadChartData()
{
// Project progress over time (last 6 months)
$projects = Project::with(['phases' => function($query) {
$projects = Project::with(['phases' => function ($query) {
$query->select('project_id', 'progress_percent', 'updated_at');
}])->get();
// Simulate monthly progress data (since we don't have historical stored)
// In a real app, we'd have a progress_history table or similar
$months = [];
@@ -35,7 +36,7 @@ class ReportsDashboard extends Component
$month = $current->copy()->subMonths($i);
$months[] = $month->format('M Y');
}
$projectProgress = [];
foreach ($projects as $project) {
$progressData = [];
@@ -49,54 +50,54 @@ class ReportsDashboard extends Component
}
$projectProgress[] = [
'name' => $project->name,
'data' => $progressData
'data' => $progressData,
];
}
// Inspections by type (last 6 months)
$inspections = Inspection::with(['template', 'feature'])
->whereDate('created_at', '>=', Carbon::now()->subMonths(6))
->get();
$inspectionTypes = $inspections->groupBy(function($inspection) {
$inspectionTypes = $inspections->groupBy(function ($inspection) {
return $inspection->template ? $inspection->template->name : 'Sin plantilla';
})->map(function($group) {
})->map(function ($group) {
return $group->count();
});
// Projects by status
$projectsByStatus = Project::selectRaw('status, count(*) as count')
->groupBy('status')
->pluck('count', 'status')
->toArray();
// Average phase progress by project
$projectPhaseProgress = Project::with(['phases'])
->get()
->map(function($project) {
->map(function ($project) {
return [
'name' => $project->name,
'progress' => $project->phases->avg('progress_percent') ?? 0
'progress' => $project->phases->avg('progress_percent') ?? 0,
];
});
$this->chartData = [
'months' => $months,
'projectProgress' => $projectProgress,
'inspectionTypes' => [
'labels' => $inspectionTypes->keys()->toArray(),
'data' => $inspectionTypes->values()->toArray()
'data' => $inspectionTypes->values()->toArray(),
],
'projectsByStatus' => [
'labels' => array_map(function($status) {
'labels' => array_map(function ($status) {
return ucfirst(str_replace('_', ' ', $status));
}, array_keys($projectsByStatus)),
'data' => array_values($projectsByStatus)
'data' => array_values($projectsByStatus),
],
'projectPhaseProgress' => $projectPhaseProgress
'projectPhaseProgress' => $projectPhaseProgress,
];
}
public function render()
{
return view('livewire.reports.reports-dashboard');