1
0
forked from poc/pds

chnaged logic for prooduction mail report

This commit is contained in:
dhanabalan
2025-07-09 10:18:57 +05:30
parent 29de91e03d
commit 6d6d3f2d60
2 changed files with 114 additions and 180 deletions

View File

@@ -142,7 +142,23 @@ app()->booted(function () {
$schedule = app(Schedule::class);
//Always run every minute — the command itself will filter recipients
$schedule->command('send:production-report')->everyMinute();
//$schedule->command('send:production-report')->everyMinute();
// Production Report Scheduling
$productionScheduleType = AlertMailRule::where('module', 'ProductionQuantities')
->where('rule_name', 'ProductionMail')
->value('schedule_type');
if ($productionScheduleType) {
$command = $schedule->command('send:production-report');
match ($productionScheduleType) {
'Live' => $command->everyMinute(),
'Hourly' => $command->hourly(),
'Daily' => $command->dailyAt('07:59'),
default => null,
};
}
});