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:
+11
-9
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
@@ -79,7 +80,7 @@ class Phase extends Model
|
||||
return null;
|
||||
}
|
||||
$end = $this->actual_end ?? now()->toDateString();
|
||||
|
||||
|
||||
return $this->planned_end->diffInDays($end, false);
|
||||
}
|
||||
|
||||
@@ -92,31 +93,31 @@ class Phase extends Model
|
||||
return null;
|
||||
}
|
||||
$start = $this->actual_start ?? now()->toDateString();
|
||||
|
||||
|
||||
return $this->planned_start->diffInDays($start, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Planned progress at a given date (linear interpolation)
|
||||
*/
|
||||
public function getPlannedProgressAtAttribute(?\Carbon\Carbon $date = null): float
|
||||
public function getPlannedProgressAtAttribute(?Carbon $date = null): float
|
||||
{
|
||||
$date = $date ?? now();
|
||||
|
||||
|
||||
if (! $this->planned_start || ! $this->planned_end) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if ($date <= $this->planned_start) {
|
||||
return 0;
|
||||
}
|
||||
if ($date >= $this->planned_end) {
|
||||
return 100;
|
||||
}
|
||||
|
||||
|
||||
$totalDays = $this->planned_start->diffInDays($this->planned_end);
|
||||
$elapsedDays = $this->planned_start->diffInDays($date);
|
||||
|
||||
|
||||
return round(($elapsedDays / $totalDays) * 100, 2);
|
||||
}
|
||||
|
||||
@@ -127,11 +128,11 @@ class Phase extends Model
|
||||
{
|
||||
$pv = $this->planned_progress_at; // Planned Value
|
||||
$ev = $this->progress_percent; // Earned Value (current progress)
|
||||
|
||||
|
||||
if ($pv <= 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
return round($ev / $pv, 2);
|
||||
}
|
||||
|
||||
@@ -144,6 +145,7 @@ class Phase extends Model
|
||||
if ($spi === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $spi >= 0.95;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user