Conversation
Adds all aircraft without any assignments as available for link editing, even if home airport is not the same as link.from Automatically attempts to move aircraft if home airport does not match link.from
spencerm
left a comment
There was a problem hiding this comment.
This is a great QoL feature / idea, however this would add many database calls.
I haven't tried this / looked into it at all – but can we just have a fake "pool" airport for unused aircraft? New planes get added to the pool airport and then assigned to an actual airport when then they're assigned. Would also make explaining the deprecation under "other income" easier.
| return BadRequest(s"Cannot insert link - airplane $airplane is not based in ${incomingLink.from}") | ||
| if (airplane.home.id != incomingLink.from.id) { // plane home airport does not match link origin airport | ||
| // check if it is unused and can be moved | ||
| val currentAssignments = AirplaneSource.loadAirplaneLinkAssignmentsByAirplaneId(airplane.id) // load fresh assignments |
There was a problem hiding this comment.
This is going to add an additional database operation for every single airplane as long as the airports don't match.
There was a problem hiding this comment.
true, but you only do that operation like once for each airplane you buy and then later assign, I don't expect airports not matching to be a relatively common thing to see
|
|
||
| // Perform airplane moves before link update | ||
| if (airplanesToUpdate.nonEmpty) { | ||
| AirplaneSource.updateAirplanesDetails(airplanesToUpdate.toList) |
There was a problem hiding this comment.
This is a bit awkward where we're moving planes (and more problematically, doing a db operation) even if they don't need to move.
|
for context, this new AI agent service gave me $50 in free credits and I gave it my github account and it looked for open PRs I had with comments on them to fix, this came up first, so I tried using it... |
Let you select all unused aircraft when making/editing routes, even if the airplane is not at the origin airport. If you try to edit a route by adding an unused airplane that's in another airport, the game automatically tries to move that airplane first, then does the change.