nabeelio / phpvms

virtual airline management
http://www.phpvms.net
BSD 3-Clause "New" or "Revised" License
172 stars 143 forks source link

Update SimBrief model with Pirep PreFile too (and more) #1210

Closed FatihKoz closed 3 years ago

FatihKoz commented 3 years ago

Is your feature request related to a problem? Please describe. No, it is another brilliant idea to enhance core :)

Describe the solution you'd like Once a sb pack is generated, we do have the flight and aircraft details too, we can use these two important data to keep that aircraft somehow "booked" for that simbrief pack and the user generated it.

To achieve something like this, we need to update simbrief model with the pirep_id during prefile too 'cause we need to check simbrief.expire_time with hours not with days like now. And the cron deletes simbrief packs if they do not have pirep_id's. Imagine a long flight started and then cron kicks in (with hourl checks instead of days) and deletes that simbrief pack.

To prevent this we need the pirep_id applied to sb model during prefile. Then when the flight ends we need to remove the flight_id as we are doing now.

Of course this needs some changes to other areas too (like PirepService to not allow that aircraft to be used by others and to Simbrief controller to remove used/booked aircrafts to not be listed in the dropdown etc).

If the va is not using simbrief at all, it will have no affect but if simbrief is actively being used, then this improvement would be pretty close to aircraft booking (combined with flight booking).

Describe alternatives you've considered Keep using current logic

nabeelio commented 3 years ago

Makes sense to me, we can work on this one soon

FatihKoz commented 3 years ago

Already started working on some bits of it though

FatihKoz commented 3 years ago

PR ready, tested all features except Acars related ones due to licence check issues (restore still ongoing). Will check that part too with some live tests and then send in the PR.