FEAT:🌙 Prefer remote stands overnight for configured airfields#1814
FEAT:🌙 Prefer remote stands overnight for configured airfields#1814MrAdder wants to merge 21 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>
There was a problem hiding this comment.
Pull request overview
Adds an “overnight remote preference” signal to stands and introduces a night-time ordering bias intended to prefer those stands during a configured window.
Changes:
- Adds
stands.overnight_remote_preferredcolumn, model cast/fillable, factory default, and Filament UI toggle/column. - Adds a night-window ORDER BY fragment to prefer
overnight_remote_preferredstands. - Adds functional tests covering “night prefers flagged stand” vs “daytime unchanged”.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
app/Allocator/Stand/SelectsStandsUsingStandardConditions.php |
Introduces night-window ORDER BY bias preferring overnight_remote_preferred. |
config/stands.php |
Adds night window configuration keys. |
database/migrations/2026_02_25_000001_add_overnight_remote_preferred_to_stands.php |
Adds new boolean column + index. |
app/Models/Stand/Stand.php |
Adds fillable + boolean cast for new column. |
database/factories/Stand/StandFactory.php |
Sets factory default for new column. |
app/Filament/Resources/StandResource.php |
Adds toggle to form and boolean column to table. |
lang/en/stands/form.php |
Adds form label/helper copy for new toggle. |
lang/en/stands/table.php |
Adds table column label. |
tests/app/Allocator/Stand/FallbackArrivalStandAllocatorTest.php |
Adds tests for night/day ordering behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…dOrderCondition()
There was a problem hiding this comment.
Pull request overview
Adds an opt-in “overnight remote stand” preference to arrival stand allocation, allowing configured airfields to bias allocations during a Europe/London night window toward stands explicitly flagged as overnight-remote.
Changes:
- Introduces
stands.overnight_remote_preferred(DB column + model cast/fillable + factory default) and exposes it in Filament. - Adds a conditional ORDER BY fragment to prefer
overnight_remote_preferredstands during a configured night window for configured destination airfields. - Adds functional tests for in-window vs out-of-window allocation behavior.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/app/Allocator/Stand/FallbackArrivalStandAllocatorTest.php | Adds tests covering overnight preference and non-preference outside the night window. |
| app/Allocator/Stand/SelectsStandsUsingStandardConditions.php | Prepends an optional night-window ORDER BY fragment for overnight_remote_preferred. |
| database/migrations/2026_02_25_000001_add_overnight_remote_preferred_to_stands.php | Adds the new boolean column + index to stands. |
| app/Models/Stand/Stand.php | Makes the new field mass-assignable and casts it to boolean. |
| database/factories/Stand/StandFactory.php | Sets default overnight_remote_preferred to false. |
| app/Filament/Resources/StandResource.php | Adds toggle + table column for the new flag in the admin UI. |
| config/stands.php | Adds configuration for night-window weighting. |
| lang/en/stands/form.php | Adds label/helper text for the new toggle. |
| lang/en/stands/table.php | Adds table column label for the new flag. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
CLC0609
left a comment
There was a problem hiding this comment.
Other than that one comment all looks good!
|
Sure no worries
This email and any files transmitted with it are confidential and contain
privileged or copyright information. It is intended solely for the
individual(s) to whom it is addressed. You must not present this message to
another party without gaining permission from the sender. If you are not
the intended recipient you must not copy, distribute or use this email or
the information contained in it for any purpose other than to notify us.
If you have received this message in error, please notify the sender
immediately, and delete this email from your system. We do not guarantee
that this material is free from viruses or any other defects although due
care has been taken to minimise the risk.
…On Sun, 22 Mar 2026 at 20:41, Coby Chapman ***@***.***> wrote:
***@***.**** requested changes on this pull request.
Other than that one comment all looks good!
------------------------------
In config/stands.php
<#1814 (comment)>
:
> @@ -3,4 +3,13 @@
return [
'auto_allocate' => env('AUTO_ALLOCATE_STANDS', false),
'assignment_acars_message' => env('SEND_STAND_ACARS_MESSAGES', true),
+ // Overnight bias for remote parking.
Could you clean up the comments in this file please. Not sure we need
quite as much detail night_remote_stand_weighting is pretty descriptive
and so is enabled, maybe just one very short comment above the times
saying they are Zulu and incl and excl
—
Reply to this email directly, view it on GitHub
<#1814?email_source=notifications&email_token=AA4XK7DDAFENF63KW4HPNPT4SBFXFA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTGOJYHA2TONZWGYZ2M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#pullrequestreview-3988577663>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA4XK7HNG4XVKBBJRXR74Z34SBFXFAVCNFSM6AAAAACV4WZJ3OVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTSOBYGU3TONRWGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
There was a problem hiding this comment.
Pull request overview
Adds an optional “overnight remote stand” preference to the stand allocator, allowing certain stands to be preferred during a configured night window (intended to be opt-in and scoped per airfield).
Changes:
- Introduces
stands.overnight_remote_preferredand surfaces it in the Stand model, factory defaults, and Filament admin UI. - Adds a time-window-based ORDER BY bias to prefer
overnight_remote_preferredstands overnight. - Adds functional tests asserting overnight preference vs daytime behavior.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/app/Allocator/Stand/FallbackArrivalStandAllocatorTest.php | Adds tests for overnight preference behavior. |
| lang/en/stands/table.php | Adds table column label for the new flag. |
| lang/en/stands/form.php | Adds form label/helper text for the new flag. |
| database/migrations/2026_02_25_000001_add_overnight_remote_preferred_to_stands.php | Adds the overnight_remote_preferred column and index. |
| database/factories/Stand/StandFactory.php | Defaults overnight_remote_preferred to false. |
| config/stands.php | Adds night-window configuration for the weighting feature. |
| app/Models/Stand/Stand.php | Makes the new flag fillable and casts it to boolean. |
| app/Filament/Resources/StandResource.php | Adds toggle + table column for the new flag in the admin UI. |
| app/Allocator/Stand/SelectsStandsUsingStandardConditions.php | Implements the overnight ORDER BY bias in standard allocator ordering. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Updated comments to clarify time zone handling for overnight window.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
database/migrations/2026_02_25_000001_add_overnight_remote_preferred_to_stands.php
Outdated
Show resolved
Hide resolved
|
|
Ok now all sorted dropped the index as suggested by Copilot as its right I do not need it for this to function |



Summary
Adds overnight stand-order weighting so stands marked as overnight-remote are prioritised during configured night hours.
Migration
overnight_remote_preferred(boolean, defaultfalse) tostands.Behavior
stands.night_remote_stand_weighting.enabled.start_hour→end_hour), stands withovernight_remote_preferred = trueare preferred.Why
Provides a simple, data-driven way to support overnight remote-stand preference without airport-specific hard-coding.