FEAT:🌙 Prefer remote stands overnight for configured airfields#1814
FEAT:🌙 Prefer remote stands overnight for configured airfields#1814MrAdder wants to merge 12 commits intoVATSIM-UK:mainfrom
Conversation
full push of feature
- Fixed the root cause of the failing night-weighting test by correcting the airfield lookup in nightTimeRemoteStandOrderCondition(): it now uses planned_destairport (which is populated on NetworkAircraft) instead of arrival_airfield (which was not), so the night remote weighting can actually activate. - Made the airfield match case-insensitive by normalizing both the aircraft destination and configured airfield list to uppercase before comparison, preventing config/case mismatches from disabling the feature.
|
Would it not be better to define a new property for stands indicating whether they are remote/preferred for overnight parking? Hijacking the assignment priority for this purpose seems a little perverse when it is also used (as I understand it) for marking stands as temporarily out-of-use, or for larger stands in mixed-size stand arrangements |
I can implement that logic instead I just did it this way originally as it seemed logical with what was asked didn't think of this way round |
|
Updated PR Text in regards to changes |
database/migrations/2026_02_25_000001_add_overnight_remote_preferred_to_stands.php
Outdated
Show resolved
Hide resolved
Co-authored-by: Coby Chapman <cobylc.121@gmail.com>
…ferred_to_stands.php Co-authored-by: Coby Chapman <cobylc.121@gmail.com>
Co-authored-by: Coby Chapman <cobylc.121@gmail.com>
|



✨ Summary
This PR adds an optional overnight bias to stand allocation for selected arrival airfields.
When enabled, and during a configured night window (Europe/London), the allocator will prefer stands explicitly marked as overnight-remote via a new
stands.overnight_remote_preferredflag.✅ Default behaviour remains unchanged because the feature is disabled by default.
🔧 What changed
🛬 Allocation ordering update
nightTimeRemoteStandOrderCondition()to:planned_destairport(normalised to uppercase) for airfield matchingstands.night_remote_stand_weighting.enabled+airfieldsstart_hour→end_hour, supports midnight crossing)stands.overnight_remote_preferred = 1Ordering fragment added (prepended when active):
🧱 Schema change (new column)
stands.overnight_remote_preferredboolean column:false2026_02_25_000001_add_overnight_remote_preferred_to_stands.php🧩 Model / factory updates
Standmodel:overnight_remote_preferredto$fillableStandFactorydefault:overnight_remote_preferred => false🖥️ Admin UI (Filament) updates
StandResourceform:overnight_remote_preferredStandResourcetable:overnight_remote_preferred🌍 Config updates
stands.night_remote_stand_weightingfeature flag + time window configremote_priority_threshold(no longer used)Config still includes:
enabled(env:NIGHT_REMOTE_STAND_WEIGHTING_ENABLED, default false)airfieldsstart_hourend_hour🧪 Tests
Adds/updates functional coverage to verify:
overnight_remote_preferred=trueis preferredTests use
Carbon::setTestNow()and reset afterwards.💡 Why
Some airfields prefer remote stands overnight (ops flow, noise/terminal constraints, overnight parking patterns).
This change makes that preference explicit and configurable per stand, rather than inferring “remote-ness” from
assignment_priority.🚀 Rollout / Ops notes
✅ Enable feature (optional)
✅ Mark stands to be preferred overnight
overnight_remote_preferred = truefor relevant stands (via Filament UI or DB update)✅ Limit scope per airfield
stands.night_remote_stand_weighting.airfields🟢 Low risk
🧠 Considerations
Europe/Londontimezone (DST-aware)overnight_remote_preferred📋 Checklist
Fixes #1762