Skip to content

FEAT: VAA Event Stand Planning#1810

Open
MrAdder wants to merge 70 commits intoVATSIM-UK:mainfrom
MrAdder:issue-1763
Open

FEAT: VAA Event Stand Planning#1810
MrAdder wants to merge 70 commits intoVATSIM-UK:mainfrom
MrAdder:issue-1763

Conversation

@MrAdder
Copy link
Contributor

@MrAdder MrAdder commented Feb 15, 2026

Fixes #1763

🛠️ Summary of Changes in FEAT: VAA Event Stand Planning (#1810)

This PR introduces a complete stand reservation plan submission and approval workflow with backend logic, API endpoints, and admin UI support.

✨ New Features

  • Stand Reservation Plan Workflow

    • Added StandReservationPlan model to store JSON payloads, approval metadata, and reservation counts.
    • Includes new scopes (pending, pendingWithinApprovalWindow) and a new migration for the stand_reservation_plans table.
  • New VAA Role

    • Added new enum RoleKeys::VAA.
    • Migration creates the vaa role if not present.
    • Only users with this role can submit stand reservation plans.
  • JSON Support for Importing Stand Reservations

    • stand-reservations:import console command now supports .json files and root-level arrays.
    • Extraction supports default or explicit date fields.
  • Refactored Import Logic

    • StandReservationsImport now:
      • Supports indexed JSON rows.
      • Extracts and validates fields including cid, origin, destination.
      • Outputs optional progress and returns the count of created reservations.
      • Skips invalid rows with warnings.

📡 API Endpoints Added

  • POST /stand/reservations/plan: Submit a new plan (VAA role required).
  • GET /stand/reservations/plan/pending: List pending plans.
  • PATCH /stand/reservations/plan/{id}/approve: Approve a pending plan within its approval window, import reservations, and update approval metadata.

🧑‍💼 Admin UI (Filament)

  • Added StandReservationPlanSubmission page for authorised roles (VAA, Web Team, Ops Team, Division Staff):
    • Validates JSON format
    • Allows plan submission
    • Shows success notifications

🧪 Tests Updated

  • Console command test updated to rename assertion and ensure success return code.
  • Added missing Collection import for tests.

Overall, this PR implements a robust stand reservation planning feature with role-based submissions, import support for JSON, administrative UI, and approval workflows.

@kristiankunc kristiankunc self-requested a review February 15, 2026 16:51
@kristiankunc
Copy link
Contributor

  1. I very much dislike this UI, can we use the filament builtins?
image
  1. We probably gotta document the accepted format a bit more somewhere

  2. After I approve a stand plan - it seems to disappear, we probably need some better flow

Instead of multiple pages, I suggest creating a single one for uploading, reviewing and history tracking. Take a look at the recently added SMR WIP area management - those are decent and you just gotta add the approval flow.

@MrAdder
Copy link
Contributor Author

MrAdder commented Feb 20, 2026

Just a couple of updates, uses the filament builtins, approved stand are now included,

image

Started some documentation aswell (zoomed out screenshot due to not having my snapshot tool for entire page)

Removed useless pages
Made into single page format with filament builtins (Ref Screenshot in PR)
started some documentation
shows Review history
@kristiankunc
Copy link
Contributor

kristiankunc commented Feb 20, 2026

Looks much better - maybe we could publish a JSON schema? Probably would make it clear and we could have the users validate their data beforehand / know the exact spect we're looking for.

@MrAdder
Copy link
Contributor Author

MrAdder commented Feb 20, 2026

Requested the issue creator to look at the Images and the doc's that I have modified to check it ticks the boxes for what was proposed, from a backend side is to make sure it actually reserves the stand for the user and if we need to make modifications to the plugin itself.

@kristiankunc
Copy link
Contributor

Plugin changes should not be required, stand assignments are handled on the server + given some of the stand reservation logic is already present we can assume that it works.

@MrAdder
Copy link
Contributor Author

MrAdder commented Feb 25, 2026

Plugin changes should not be required, stand assignments are handled on the server + given some of the stand reservation logic is already present we can assume that it works.

Good to here no response from Issue poster so at your discretion if your happy with the changes feel free with the merge

@cpawley
Copy link

cpawley commented Feb 25, 2026

I dont think I have strong opinions about how it might work

main concerns are

is it documented well - looks like it is
can we add a 3rd party the (temporary) authority to do this - looks like it isnt

if we give VAA's stand assignment authority we have to be able to protect ourselves from them abusing this

thanks for moving this forward :)

@MrAdder
Copy link
Contributor Author

MrAdder commented Feb 25, 2026

I dont think I have strong opinions about how it might work

main concerns are

is it documented well - looks like it is can we add a 3rd party the (temporary) authority to do this - looks like it isnt

if we give VAA's stand assignment authority we have to be able to protect ourselves from them abusing this

thanks for moving this forward :)

@cpawley VAA role has only Upload permissions, authority of Approval is done by the other roles from Web/Admin team of UKCP potentially may add another role for Events team to approve but that is a different discussion

I can look at adding Temporary role placement for the VAA role as well as the static role for verified VAA's (eg: BAV)

@cpawley
Copy link

cpawley commented Feb 25, 2026

then perfect, concept wise im happy :) this adds a huge amount of flexibility to our system and offers VAA's the chance to be actively involved in events where they take the driving seat :)

thanks!

@MrAdder
Copy link
Contributor Author

MrAdder commented Feb 25, 2026

I just realised a small flaw in my code in regards to the slot planning, It is currently set PER slot for one callsign for the entire event period but in regards to as an Example Speedbird24 its multiple different callsigns at a "Slot" so need to tweak the JSON formatting to accommodate this and the System on the backend.

So currently this is how it works

BAW1234 is expected between 9:00 and 9:30 so Stand 531 is reserved for them
BAW4321 is expected between 9:31 and 10:00 on Stand 531 and the stand according to the system is still reserved for BAW1234

The system currently reserves the slot for the entire Period of the Event for BAW1234

Proposed change to how it will work

BAW1234 is expected between 9:00 and 9:30 on Stand 531 and the stand is reserved for them
BAW4321 is expected between 9:31 and 10:00 on Stand 531 and the stand is reserved for them

System Picks up the change from within the plan that's uploaded by the VAA and so VATUK can limit (if they wish) the amount of Stands an Event can use, and can also assist planning teams of the VAA

@cpawley
Copy link

cpawley commented Feb 25, 2026

since some events can be 8->24 hrs this would need to be adopted - they need to assign stands for multiple time periods in the day

@MrAdder
Copy link
Contributor Author

MrAdder commented Feb 25, 2026

since some events can be 8->24 hrs this would need to be adopted - they need to assign stands for multiple time periods in the day

Downside of thinking about code while watching movies with the family

Copy link
Contributor

@CLC0609 CLC0609 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, looking good, A few more points.

Could you take a look through at any comments you've added and make sure they are needed please. There seem to be quite a few comments in there that explain things that don't really need explaining, or are explaining why you have changed something. Just eager to keep the codebase clean

MrAdder and others added 4 commits March 2, 2026 20:55
Co-authored-by: Coby Chapman <cobylc.121@gmail.com>
Co-authored-by: Coby Chapman <cobylc.121@gmail.com>
Co-authored-by: Coby Chapman <cobylc.121@gmail.com>
Co-authored-by: Coby Chapman <cobylc.121@gmail.com>
@MrAdder
Copy link
Contributor Author

MrAdder commented Mar 2, 2026

Did that all in a batch but it didnt do it .... hmmmm

@MrAdder
Copy link
Contributor Author

MrAdder commented Mar 9, 2026

Removed the optional Origin/Destination so ties with the 0. Airport and this should be all of the changes you requested

Copilot AI review requested due to automatic review settings March 16, 2026 06:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements an event stand reservation plan workflow (submission, approval, activation, and assignment syncing) with JSON-schema validation, new VAA role support, and admin/Filament UI for reviewing plans—addressing the need to upload external stand plans ahead of events.

Changes:

  • Added StandReservationPlan model + migrations, new API endpoints, and Filament UI to submit/review/approve plans.
  • Added a lightweight JSON Schema validator and canonical schemas/docs for stand plan payloads.
  • Extended stand reservation importing/activation and introduced scheduled syncing of active reservation-based stand assignments.

Reviewed changes

Copilot reviewed 38 out of 38 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
tests/app/Services/Stand/ArrivalAllocationServiceTest.php Updates allocator preference + reservation fixtures to include CID.
tests/app/Services/JsonSchema/StandReservationPlanSchemaValidatorTest.php Adds unit tests for schema validation error cases.
tests/app/Imports/Stand/StandReservationsImportTest.php Adds coverage for associative (JSON-style) reservation rows.
tests/app/Http/Controllers/StandReservationPlanApprovalControllerTest.php Adds API tests for listing/approving/auto-denying plans.
tests/app/Http/Controllers/StandControllerTest.php Adds tests for VAA-only plan upload + CID-based reservation override for auto assignment.
tests/app/Filament/Pages/StandReservationPlansTest.php Adds Filament page tests for role access + submit/approve/reject/expire behaviour.
tests/app/Console/Commands/SyncStandReservationAssignmentsTest.php Adds coverage for reservation-driven assignment sync behaviour.
tests/app/Console/Commands/StandReservationsImportTest.php Adds JSON import tests + return-code assertions.
tests/app/Console/Commands/ActivateStandReservationPlansTest.php Adds tests for plan activation/skip/auto-deny behaviour.
tests/app/Allocator/Stand/CidReservedArrivalStandAllocatorTest.php Updates allocator tests to reflect CID-only matching and CID-missing case.
tests/app/Allocator/Stand/CallsignFlightplanReservedArrivalStandAllocatorTest.php Updates callsign allocator tests to ignore route matching (origin/dest).
routes/api.php Adds POST upload endpoint and admin GET/PATCH endpoints for plan approvals.
resources/views/livewire/stand/recently-processed-plans-table.blade.php Adds Livewire view for a “recently processed plans” table.
resources/views/filament/pages/stand-reservation-plans.blade.php Adds Filament page layout for submission + review/history UI.
docs/schemas/stand-reservation-plan.schema.json Introduces canonical JSON Schema for plan payloads.
docs/schemas/stand-reservation-plan-request.schema.json Introduces JSON Schema for API submission body.
docs/schemas/stand-reservation-plan-format.md Adds normative markdown spec for the plan JSON format.
docs/guides/StandAllocation.md Updates allocator docs + adds event plan format section and example.
database/migrations/2026_03_02_000001_add_denied_reason_to_stand_reservation_plans_table.php Adds denied_reason column to plans.
database/migrations/2026_02_15_000003_add_denied_fields_to_stand_reservation_plans_table.php Adds denied metadata fields and FK.
database/migrations/2026_02_15_000002_create_stand_reservation_plans_table.php Creates stand_reservation_plans table.
database/migrations/2026_02_15_000001_add_vaa_role.php Creates vaa role if missing.
app/Services/Stand/StandReservationPayloadRowsBuilder.php Normalises payloads (reservations/stand_slots) into importer-friendly rows.
app/Services/JsonSchema/StructuredSchemaNodeValidator.php Adds structured object/array validation helpers for schemas.
app/Services/JsonSchema/StandReservationPlanSchemaValidator.php Adds schema loading + validation (refs, allOf/anyOf/if-then, etc.).
app/Providers/StandServiceProvider.php Removes callsign-based allocator from the arrival allocator chain.
app/Models/User/RoleKeys.php Adds new RoleKeys::VAA.
app/Models/Stand/StandReservationPlan.php Adds plan model with status scopes and event start parsing.
app/Imports/Stand/StandReservationsImport.php Refactors import logic to support associative JSON rows + returns created count.
app/Http/Livewire/Stand/RecentlyProcessedPlansTable.php Adds Livewire table showing processed plans with role-based visibility.
app/Http/Controllers/StandController.php Adds plan upload/list/approve endpoints + CID-based reservation override for auto assignment.
app/Filament/Pages/StandReservationPlans.php Adds Filament page: submit plans + review actions + auto-expiry logic.
app/Console/Kernel.php Schedules activation and assignment sync commands.
app/Console/Commands/SyncStandReservationAssignments.php Adds scheduled sync of active reservation slots into stand assignments.
app/Console/Commands/StandReservationsImport.php Adds JSON import path using the payload row builder.
app/Console/Commands/ActivateStandReservationPlans.php Adds scheduled command to activate approved plans and auto-deny stale pending plans.
app/Allocator/Stand/CidReservedArrivalStandAllocator.php Switches allocator to CID-only matching (ignores destination) and guards missing CID.
app/Allocator/Stand/CallsignFlightplanReservedArrivalStandAllocator.php Simplifies callsign allocator to ignore origin/destination.

💡 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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements an event stand reservation planning workflow: VAA users can submit JSON stand plans, admins can review/approve them, and approved plans can be imported into stand reservations and used for CID-based stand allocation/assignment syncing.

Changes:

  • Added StandReservationPlan persistence (migrations + model), JSON schemas, and a lightweight schema validator for plan submissions.
  • Added API endpoints + Filament UI to submit/review/approve/reject plans, plus scheduled commands to activate plans and sync reservation-managed assignments.
  • Updated stand allocation logic/tests to prioritise CID-based reservations (and removed callsign/route-based reservation matching from the arrival allocator chain).

Reviewed changes

Copilot reviewed 38 out of 38 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
tests/app/Services/Stand/ArrivalAllocationServiceTest.php Updates allocator preference expectations and fixtures for CID-based reservations.
tests/app/Services/JsonSchema/StandReservationPlanSchemaValidatorTest.php Adds unit tests for schema validation error cases.
tests/app/Imports/Stand/StandReservationsImportTest.php Adds coverage for associative (JSON-style) reservation rows and CID persistence.
tests/app/Http/Controllers/StandReservationPlanApprovalControllerTest.php Adds API tests for listing pending plans and approving/auto-expiring.
tests/app/Http/Controllers/StandControllerTest.php Adds API tests for plan upload/validation/authorisation and reservation-priority assignment.
tests/app/Filament/Pages/StandReservationPlansTest.php Adds Filament page tests for role access, submit, approve/reject, and expiry behaviour.
tests/app/Console/Commands/SyncStandReservationAssignmentsTest.php Adds functional tests for syncing stand assignments from active CID reservations.
tests/app/Console/Commands/StandReservationsImportTest.php Extends import command tests for JSON (payload + stand_slots) support and return code.
tests/app/Console/Commands/ActivateStandReservationPlansTest.php Adds functional tests for activating/importing approved plans and auto-expiring pending ones.
tests/app/Allocator/Stand/CidReservedArrivalStandAllocatorTest.php Updates allocator tests for CID-only behaviour and missing-CID handling.
tests/app/Allocator/Stand/CallsignFlightplanReservedArrivalStandAllocatorTest.php Updates tests to reflect relaxed callsign reservation matching semantics.
routes/api.php Adds POST upload route (plugin scope) and admin routes for pending/approve actions.
resources/views/livewire/stand/recently-processed-plans-table.blade.php Adds Livewire wrapper view for the processed-plans table.
resources/views/filament/pages/stand-reservation-plans.blade.php Adds Filament page view for submission + review/history table and processed-plans widget.
docs/schemas/stand-reservation-plan.schema.json Defines canonical plan payload schema (reservations and/or stand_slots).
docs/schemas/stand-reservation-plan-request.schema.json Defines API request schema for plan submission endpoint.
docs/schemas/stand-reservation-plan-format.md Adds normative markdown spec and examples for the plan JSON format.
docs/guides/StandAllocation.md Updates stand allocation guide for reservation-plan format and removes callsign reservation matching docs.
database/migrations/2026_03_02_000001_add_denied_reason_to_stand_reservation_plans_table.php Adds denied_reason field to plan table.
database/migrations/2026_02_15_000003_add_denied_fields_to_stand_reservation_plans_table.php Adds denied_at/denied_by + FK for plan denial tracking.
database/migrations/2026_02_15_000002_create_stand_reservation_plans_table.php Creates stand_reservation_plans table with payload + approval metadata.
database/migrations/2026_02_15_000001_add_vaa_role.php Creates the VAA role if missing.
app/Services/Stand/StandReservationPayloadRowsBuilder.php Normalises plan payload into importer-friendly row collections.
app/Services/JsonSchema/StructuredSchemaNodeValidator.php Adds structured validation helpers (object/array/type checks) for schemas.
app/Services/JsonSchema/StandReservationPlanSchemaValidator.php Implements schema loading, $ref resolution, and node validation.
app/Providers/StandServiceProvider.php Removes callsign-flightplan reservation allocator from arrival allocation chain.
app/Models/User/RoleKeys.php Adds RoleKeys::VAA.
app/Models/Stand/StandReservationPlan.php Introduces plan model, casts, scopes, and event start parsing helper.
app/Imports/Stand/StandReservationsImport.php Refactors importer to support associative JSON rows, CID extraction, and returns created count.
app/Http/Livewire/Stand/RecentlyProcessedPlansTable.php Adds a Filament Table component for approved/denied/expired plan history.
app/Http/Controllers/StandController.php Adds upload/pending/approve plan endpoints and prioritises active reservations in auto-assignment.
app/Filament/Pages/StandReservationPlans.php Adds Filament submission + review flow with approve/reject/auto-expiry behaviour.
app/Console/Kernel.php Registers/schedules plan activation and reservation assignment sync commands.
app/Console/Commands/SyncStandReservationAssignments.php Adds scheduled command to enforce reservation-managed stand assignments by CID.
app/Console/Commands/StandReservationsImport.php Extends import command to support JSON payloads and root-level arrays.
app/Console/Commands/ActivateStandReservationPlans.php Adds scheduled command to auto-expire stale pending plans and import due approved plans.
app/Allocator/Stand/CidReservedArrivalStandAllocator.php Updates allocator to match by CID only and handle missing CID.
app/Allocator/Stand/CallsignFlightplanReservedArrivalStandAllocator.php Updates allocator to match by callsign only (no route matching).

💡 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.

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow upload of (external) stand planning via JSON or some other format

5 participants