feat: Expose source of stand assignment in API#1817
Draft
MrAdder wants to merge 1 commit intoVATSIM-UK:mainfrom
Draft
feat: Expose source of stand assignment in API#1817MrAdder wants to merge 1 commit intoVATSIM-UK:mainfrom
MrAdder wants to merge 1 commit intoVATSIM-UK:mainfrom
Conversation
|
Contributor
Author
|
Currently draft while I look into the Plugin side of things will also need changes in Lists_SMR and Lists as looking into adding this as a tag item |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes #1745
🧾 Summary of changes (Expose “reservation allocator” source on stand assignments)
🔎 API responses now indicate if an assignment came from the reservation allocator
StandControllerresponses to include a new boolean:assigned_by_reservation_allocatorThis flag is set by checking the latest assignment history record and detecting whether the
typestarts with:App\\Allocator\\Stand\\UserRequestedArrivalStandAllocator🚚
GET /stand/assignment(all assignments)StandAssignment::with('assignmentHistory')->get()callsignstand_idassigned_by_reservation_allocator(true/false)GET /stand/assignment/{callsign}(single assignment)id,airfield,identifierassigned_by_reservation_allocator🧩 Model enhancement: latest assignment history relationship
StandAssignment::assignmentHistory()relationship:hasOne(StandAssignmentsHistory::class, 'callsign', 'callsign')->latestOfMany('assigned_at')⚙️ Service optimisation
StandAssignmentsService::assignmentForCallsign()now eager-loads:assignmentHistory🧪 Tests added/updated
assigned_by_reservation_allocator => falseby defaulttestItReturnsReservationAllocatorSourceInStandAssignmentstestItReturnsReservationAllocatorSourceForSingleAssignmentRouteStandAssignmentsHistory::create()with typeApp\Allocator\Stand\UserRequestedArrivalStandAllocatorto assert the flag becomestrue.✅ Net effect
Consumers (UI / plugin / API clients) can now distinguish normal user/auto assignments from those created via the reservation allocator, without changing existing endpoints or payload structure beyond the additive boolean field.