Files
shipping-portal/app/Console/Kernel.php

168 lines
6.0 KiB
PHP

<?php
namespace App\Console;
use App\Classes\Jobs\FetchContainersStatusUpdateFromVTPortalJob;
use App\Classes\Jobs\FetchDeliveryListFromVTPortalJob;
use App\Classes\Jobs\FetchLoadedContainersFromVTPortalJob;
use App\Classes\Jobs\FetchPackingListFromVTPortalJob;
use App\Classes\Jobs\FetchWarehouseReceiveListFromVTPortalJob;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
//Commands Version 2: Laravel Vapor with AWS
$isEnabled = env('COMMANDS_V2_ENABLED', false);
if($isEnabled){
// $schedule->command('dummy-command')
// ->everyFiveMinutes()
// ->withoutOverlapping();
$schedule->command('housekeeping-s3-files-command')
->dailyAt('01:00')
->withoutOverlapping();
$schedule->command('password-reset-token-expriration-check-command')
->everySixHours()
->withoutOverlapping();
$schedule->command('new-user-registration-expire-check-command')
->everySixHours()
->withoutOverlapping();
if(env('APP_ENV') === 'production'){
$schedule->command('curl-vt-command')
->cron('0 8 * * *')
->withoutOverlapping();
// $schedule->command('curl-yd-order-list-command')
// ->cron('0 9-18/3 * * *')
// ->withoutOverlapping();
$schedule->command('process-yd-by-traking-no-data-command')
->cron('0 8,11,14,17 * * *')
->withoutOverlapping();
$schedule->command('process-yd-portal-data-command')
->cron('0 9,12,15,18 * * *') //->cron('0 9-18/3 * * *')
->withoutOverlapping();
$schedule->command('fix-packinglist-command')
->cron('30 9-18/3 * * *')
->withoutOverlapping();
$schedule->command('fix-duplicate-container-reference-command')
->cron('0 1 * * *')
->withoutOverlapping();
$schedule->command('invoice-generate-command')
->hourly()
->withoutOverlapping();
$schedule->command('billplz-failed-callback-fix-command')
->hourly()
->withoutOverlapping();
$schedule->command('check-storage-invoices-group-transactions-command')
->dailyAt('0:01')
->withoutOverlapping();
$schedule->command('permits-reminder-send-command')
->dailyAt('09:30')
->withoutOverlapping();
$schedule->command('process-delayed-jobs-command')
->everyFiveMinutes()
->withoutOverlapping();
}
else if (env('APP_ENV') === 'development'){
$schedule->command('process-delayed-jobs-command')
->everyTwoHours()
->withoutOverlapping();
}
}
//Commands Version 1: Before AWS
else
{
// $schedule->command('command:curlVTCommand')
// ->cron('0 8 * * *')
// ->withoutOverlapping()
// ->appendOutputTo (storage_path().'/logs/curlvt.log');
// $schedule->command('command:curlYdOrderListCommand')
// ->cron('30 9-18/3 * * *')
// ->withoutOverlapping()
// ->appendOutputTo (storage_path().'/logs/curlyd.log');
$schedule->command('fix-packinglist')
->cron('30 9-18/3 * * *')
->withoutOverlapping()
->appendOutputTo (storage_path().'/logs/fix_packinglist.log');
// $schedule->command('command:curlYdOrderListCommand')
// ->cron('0 9 * * *')
// ->withoutOverlapping()
// ->appendOutputTo (storage_path().'/logs/departure_email.log');
$schedule->command('fix-duplicate-container-reference')
->cron('0 1 * * *')
->withoutOverlapping()
->appendOutputTo (storage_path().'/logs/fix_duplicate_container_reference.log');
$schedule->command('invoice:generate')
->hourly()
->withoutOverlapping()
->appendOutputTo (storage_path().'/logs/auto_generate_invoice.log');
$schedule->command('approve:invoice')
->hourly()
->withoutOverlapping()
->appendOutputTo (storage_path().'/logs/approve_invoice.log');
$schedule->command('billplz-failed-callback:fix')
->hourly()
->withoutOverlapping()
->appendOutputTo (storage_path().'/logs/fix_failed_callback_from_billplz.log');
$schedule->command('check-storage-invoices-group-transactions')
->dailyAt('0:01')
->withoutOverlapping()
->appendOutputTo(storage_path().'/logs/check_storage_invoices.log');
$schedule->command('permitsReminder:send')
->dailyAt('09:30')
->withoutOverlapping()
->appendOutputTo(storage_path().'/logs/permits-reminder-send.log');
}
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
$this->load(__DIR__.'/Commands/V2');
require base_path('routes/console.php');
}
}