fix: store opened_at and closed_at as DATETIME (not DATE)

DATE columns lose time information, causing timeline to show 00:00 for
car reception and WO closure. Migrated both columns to DATETIME and
updated: model casts (date → datetime), form pickers (DatePicker →
DateTimePicker with seconds:false), default to now() instead of today(),
and cleaned up defensive Carbon::parse() in getTimeline().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-09-11 04:52:03 +00:00
parent ce9f082612
commit 5a3275c2cf
4 changed files with 29 additions and 6 deletions
@@ -0,0 +1,23 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
public function up(): void
{
Schema::table('work_orders', function (Blueprint $table) {
$table->dateTime('opened_at')->nullable()->change();
$table->dateTime('closed_at')->nullable()->change();
});
}
public function down(): void
{
Schema::table('work_orders', function (Blueprint $table) {
$table->date('opened_at')->nullable()->change();
$table->date('closed_at')->nullable()->change();
});
}
};