- Add database migrations for plans, subscriptions, notification preferences, and notification log tables - Implement DispatchUserNotificationJob to handle channel resolution, daily limits, and logging (sent/tier_restricted/daily_limit) - Add SendScheduledWhatsAppJob for scheduled notification delivery - Create PlanFeatures service to resolve tier capabilities, check daily limits, and validate fuel
36 lines
1.1 KiB
PHP
36 lines
1.1 KiB
PHP
<?php
|
|
|
|
use App\Jobs\SendScheduledWhatsAppJob;
|
|
use Illuminate\Foundation\Inspiring;
|
|
use Illuminate\Support\Facades\Artisan;
|
|
use Illuminate\Support\Facades\Schedule;
|
|
|
|
Artisan::command('inspire', function () {
|
|
$this->comment(Inspiring::quote());
|
|
})->purpose('Display an inspiring quote');
|
|
|
|
// Poll for price changes every 15 minutes
|
|
Schedule::command('fuel:poll')
|
|
->everyFifteenMinutes()
|
|
->withoutOverlapping()
|
|
->onOneServer()
|
|
->runInBackground();
|
|
|
|
// Full refresh (station metadata + prices) once daily at 3am
|
|
Schedule::command('fuel:poll --full')
|
|
->dailyAt('03:00')
|
|
->withoutOverlapping()
|
|
->onOneServer()
|
|
->runInBackground();
|
|
|
|
// Fetch FRED prices and generate oil price prediction daily at 7am
|
|
Schedule::command('oil:predict --fetch')
|
|
->dailyAt('07:00')
|
|
->withoutOverlapping()
|
|
->onOneServer()
|
|
->runInBackground();
|
|
|
|
// Scheduled WhatsApp updates — morning and evening
|
|
Schedule::job(new SendScheduledWhatsAppJob('morning'))->dailyAt('07:30')->onOneServer();
|
|
Schedule::job(new SendScheduledWhatsAppJob('evening'))->dailyAt('18:00')->onOneServer();
|