Commit Graph

33 Commits

Author SHA1 Message Date
B.Fatih KOZ
17447c6903
Block aircraft with Simbrief (#1213)
* Block Aircraft with SimBrief

Changes aim to have the ability to block an aircraft's usage if it is used to generate a SimBrief OFP.

Unused/Expired briefings will be deleted by cron like before but will now be checked by HourlyCron, so admins can define more precise restrictions for them (and the blockage period of their aircraft)

Owner of the SimBrief OFP will be able to start a flight with acars using that particular aircraft, but pilots will get an Aircraft Not Available error (similar to Aircraft State check)

To prevent SimBrief OFP packs being marked as expired/unused, during pirep prefile, pirep_id will be saved to SimBrief model along with flight_id.

And when a flight is finished (pirep file), flight_id will be removed from SimBrief model as before. Only pirep_id will remain and aircraft will be available for another OFP generation.

* Update PirepController

In case a pirep is being saved/submitted with manual entry (but the va is using simbrief effectively) same logic should be applied during save/submit button selection.
Save will act like a pirep prefile , Submit will be pirep file.

* Manual Pirep Checks

Manual pireps, prefiled from a generated simbrief should be checked too. Also pirep.show blade's submit button should provide the same simbrief checks.

* Update PirepService.php

* Change settings and move sb cron to hourly

* StyleFix (SimBriefService)

* Another StyleFix (SimBriefService)

* Update SimBriefController

Removed null check of pirep_id for aircraft list generation to prevent live flights' aircraft being listed for another ofp generation.
( Active acars flights will have both flight_id and pirep_id at simbrief table)

* Update PirepService.php

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
2021-06-03 16:17:16 -04:00
Nabeel S
edcea258ce
Remove the autoupdater #1133 (#1195)
* Remove the autoupdater #1133

* Remove self-updater package

* Package still needed :|
2021-05-20 11:37:27 -04:00
B.Fatih KOZ
f2be14402f
PirepCancelled Event (Cron Expired Pirep Deletion) (#1178)
* PirepCancelled Event (Cron Expired Pirep Deletion)

While deleting frozen in progress pireps we should at least send a PirepCancelled event for those who are listening.

(or we may have a new PirepDeleted event to be issued in such cases, I think PirepCancelled is enough though)

* StyleFix

* Another StyleFix

* Missing Log

Of course it will not be possible to write log entries without the Log itself.
2021-05-09 18:30:50 -04:00
Nabeel S
bffc4f911c
Add tests for the cron jobs (#1141) 2021-04-14 08:37:48 -04:00
Nabeel S
bfddb2c84d
Make sure all dates are in UTC (#1139) 2021-04-13 09:25:38 -04:00
B.Fatih KOZ
7e9eb08135
Use where iso whereTime (#1137)
Using whereTime may present a problem for flights conducted during utc midnight and some active/live flights may be deleted with whereTime.

Scenario;

now = today-01:00  utc
setting = 2 hours
date = yesterday-23:00 utc

Any live pireps will/may be deleted with whereTime 'cause their last updated TIME will be maximum 00:59 which is smaller than 23:00.
2021-04-13 09:08:50 -04:00
B.Fatih KOZ
6c3992e781
Fix for Hourly Crons (#1127)
* Fix for Hourly Cron

We should be using whereTime instead of whereDate

https://laravel.com/docs/8.x/queries#additional-where-clauses
`The whereDate method may be used to compare a column's value against a date`

* Fix for RemoveExpiredBids

I used where to do check 'cause people may set 48 hours to remove a bid, thus neither whereDate nor whereTime will give a correct results.

* Fix for DeletePireps

I used where to do check 'cause people may set 48 hours to delete cancelled or rejected pireps, thus neither whereDate nor whereTime will give a correct results.
2021-04-09 19:15:22 -04:00
Nabeel S
936cd2efd3
Implement PIREP deletion #1014 (#1055)
* Implement PIREP deletion #1014

* Style fixes

* Add delete button to PIREP listing page

* Remove extra import
2021-03-02 15:43:34 -05:00
Nabeel S
cbb7d6e274
Fix pilot leave calculation #1022 (#1035)
* Fix pilot leave calculation #1022

* Remove unused imports

* Add logging where fares are being saved
2021-02-17 18:54:18 -05:00
Nabeel S
a2916bf536
Cleanup visible flight logic (#1000)
* Cleanup visible flight logic

* Add transfer_time to API response
2021-01-21 11:11:11 -05:00
Nabeel Shahzad
0578f98b58 Force flight to visible before day checks 2021-01-21 10:57:51 -05:00
Nabeel S
9e5386264f
SimBrief integration #405 (#635)
* SimBrief integration #405

* Add briefing as API response; add acars_xml field #405
2020-03-23 09:31:35 -04:00
Nabeel S
07a75de0bf
Recalcuate aircraft stats in nightly cron and importer #585 #443 (#587) 2020-02-24 19:35:28 -05:00
Nabeel S
893e28eb3a
Fix import during flight cron #532 (#535) 2020-02-01 13:54:30 -05:00
Nabeel S
dc51897314
Additional logging for the stats recalculation (#358)
* Additional logging for the stats recalculation

* style fix
2019-08-10 20:42:35 -04:00
Nabeel S
e12188b7d3
Issue/327 versioning (#345)
* Switch to semver format

* Rewrite new version check to use Github Releases and cron

* Styling

* Remove v from in front of version

* New version check test fix

* Uncomment test case
2019-08-06 17:48:00 -04:00
Nabeel S
95147e31bf
Fix issue where user stats aren't incremented on PIREP auto accept (#335)
* Fix issue where user stats aren't incremented on PIREP auto accept

* Formatting
2019-08-01 15:23:59 -04:00
Nabeel Shahzad
dd946d4cdd Reorder imports 2019-07-15 15:51:35 -04:00
Nabeel Shahzad
a720f12e0b Rename Interfaces to Contracts to better match Laravel conventions 2019-07-15 15:44:31 -04:00
Kevin
075d4b3069 Add missing php extension 2018-09-21 06:46:44 +08:00
Kevin
d40c9ba91f Hide expired live flight from live map and remove from DB 2018-09-21 02:27:39 +08:00
Nabeel Shahzad
9596d88b48 Apply fixes from StyleCI 2018-08-26 16:40:04 +00:00
Kevin
36d91265d3 Adding newline at end of file 2018-08-25 01:14:35 +08:00
Kevin
796053cfa5 Implement cron to remove expired bids 2018-08-25 01:07:14 +08:00
Nabeel Shahzad
89baf34824 Initial user stats recalculation #254 2018-08-20 09:42:54 -05:00
Nabeel Shahzad
b2cc818b7a Extra logging about cron 2018-07-24 14:58:12 -05:00
Nabeel Shahzad
26061deced Fix flight visibility for day 2018-07-13 07:43:27 -05:00
Nabeel Shahzad
4596ddae58 Undo null check for flight 2018-07-12 22:40:39 -05:00
Nabeel Shahzad
1b51bc8c04 Log error 2018-07-12 22:32:56 -05:00
Nabeel Shahzad
0af85a3fff Only show flights if they're also marked as visible 2018-07-12 22:29:50 -05:00
Nabeel Shahzad
4ca58ed754 Extra logging for cron and add flight visible field 2018-07-12 22:23:45 -05:00
Nabeel Shahzad
9d3d284df7 Check start/end/days of week in cron and active/deactivate flights accordingly 2018-04-12 16:12:32 -05:00
Nabeel Shahzad
3e89a53fc1 Move cron scripts to root namespace 2018-04-06 17:14:01 -05:00