phpvms/app/Providers/CronServiceProvider.php

54 lines
1.5 KiB
PHP
Raw Permalink Normal View History

2018-08-20 22:42:54 +08:00
<?php
namespace App\Providers;
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-04 04:17:16 +08:00
use App\Cron\Hourly\ClearExpiredSimbrief;
use App\Cron\Hourly\DeletePireps;
use App\Cron\Hourly\RemoveExpiredBids;
use App\Cron\Hourly\RemoveExpiredLiveFlights;
2018-08-27 00:40:04 +08:00
use App\Cron\Nightly\ApplyExpenses;
use App\Cron\Nightly\NewVersionCheck;
2018-08-27 00:40:04 +08:00
use App\Cron\Nightly\PilotLeave;
use App\Cron\Nightly\RecalculateBalances;
2018-08-20 22:42:54 +08:00
use App\Cron\Nightly\RecalculateStats;
use App\Cron\Nightly\SetActiveFlights;
use App\Events\CronFifteenMinute;
use App\Events\CronFiveMinute;
2018-08-25 01:07:14 +08:00
use App\Events\CronHourly;
2018-08-20 22:42:54 +08:00
use App\Events\CronMonthly;
use App\Events\CronNightly;
use App\Events\CronThirtyMinute;
2018-08-20 22:42:54 +08:00
use App\Events\CronWeekly;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
2018-08-20 22:48:39 +08:00
/**
* All of the hooks for the cron jobs
*/
2018-08-20 22:42:54 +08:00
class CronServiceProvider extends ServiceProvider
{
protected $listen = [
CronFiveMinute::class => [],
CronFifteenMinute::class => [],
CronThirtyMinute::class => [],
CronHourly::class => [
DeletePireps::class,
RemoveExpiredBids::class,
RemoveExpiredLiveFlights::class,
ClearExpiredSimbrief::class,
],
2018-08-20 22:42:54 +08:00
CronNightly::class => [
ApplyExpenses::class,
RecalculateBalances::class,
PilotLeave::class,
SetActiveFlights::class,
RecalculateStats::class,
NewVersionCheck::class,
2018-08-20 22:42:54 +08:00
],
CronWeekly::class => [
],
CronMonthly::class => [
2018-08-27 00:40:04 +08:00
\App\Cron\Monthly\ApplyExpenses::class,
2018-08-20 22:42:54 +08:00
],
];
}