phpvms/app/Observers
Nabeel Shahzad 337e4ab79d
refactor(routeforge): bulk-insert commit pipeline
Replace per-row Flight::create() loop in RouteForgeService::commit with
single multi-row Flight::insert + DB::table flight_subfleet/flight_fare
bulk inserts. 100-row commit drops from ~700 queries to <=5.

Drop Flight::withoutEvents wrapper: query-builder bulk insert bypasses
Eloquent events natively, so no per-flight LogsActivity spam.

Move ICAO uppercase/trim from App\Observers\FlightObserver to Flight
model dpt_airport_id/arr_airport_id Attribute mutators; delete the
observer. Single-row write paths flow through the mutators; bulk-insert
path normalizes explicitly via Flight::fill + getAttributes so casts +
mutators run uniformly per row.

Drop synchronous SetVisibleFlights::runForBundle post-commit. Visibility
settles via the queued RecomputeBundleVisibility job: BundleObserver
::created handles create-new mode, RouteForgeService dispatches
explicitly in attach-existing mode (observer does not fire when no new
bundle is persisted).

New tests: ICAO mutator unit coverage, bulk-insert query-count budget,
Queue::fake() dispatch assertions for both bundle modes.

Refs OpenSpec change routeforge-commit-bulk-insert.
2026-05-25 13:57:32 -05:00
..
AircraftObserver.php [8.x] feature: upgrade to Laravel 13 (#2204) 2026-05-06 11:27:21 -05:00
AirportObserver.php [8.x] feature: upgrade to Laravel 13 (#2204) 2026-05-06 11:27:21 -05:00
BundleObserver.php feat(schema-modernization): foundations for RouteForge 2026-05-23 12:05:09 -05:00
JournalObserver.php [8.x] Refactor models and tests for slug handling and resource consistency (#2191) 2026-05-03 11:38:30 -05:00
JournalTransactionObserver.php [8.x] Refactor models and tests for slug handling and resource consistency (#2191) 2026-05-03 11:38:30 -05:00
SettingObserver.php [8.x] Refactor models and tests for slug handling and resource consistency (#2191) 2026-05-03 11:38:30 -05:00
SimBriefObserver.php [8.x] Refactor models and tests for slug handling and resource consistency (#2191) 2026-05-03 11:38:30 -05:00
SubfleetObserver.php [8.x] feature: upgrade to Laravel 13 (#2204) 2026-05-06 11:27:21 -05:00
UserObserver.php [8.x] feature: upgrade to Laravel 13 (#2204) 2026-05-06 11:27:21 -05:00