2 Commits

Author SHA1 Message Date
root
967a429595 Merge branch 'master' of https://git.iotsignin.com/poc/pds 2025-08-26 16:35:02 +05:30
root
7f0d138383 WIP: local changes before pull 2025-08-26 16:21:53 +05:30
2 changed files with 12 additions and 11 deletions

View File

@@ -14,7 +14,8 @@ return new class extends Migration
$sql = <<<'SQL' $sql = <<<'SQL'
CREATE TABLE alert_mail_rules ( CREATE TABLE alert_mail_rules (
id BIGINT GENERATED always AS IDENTITY PRIMARY KEY, id BIGINT GENERATED always AS IDENTITY PRIMARY KEY,
plant BIGINT NOT NULL DEFAULT (0),
plant BIGINT NOT NULL DEFAULT(0),
module TEXT NOT NULL, module TEXT NOT NULL,
rule_name TEXT NOT NULL, rule_name TEXT NOT NULL,

View File

@@ -9,17 +9,17 @@ Artisan::command('inspire', function () {
$this->comment(Inspiring::quote()); $this->comment(Inspiring::quote());
})->purpose('Display an inspiring quote'); })->purpose('Display an inspiring quote');
// Schedule::command('send:invoice-report'); // Schedule::command('send:invoice-report');
// Schedule::command('send:production-report'); // Schedule::command('send:production-report');
app()->booted(function () { app()->booted(function () {
$schedule = app(Schedule::class); $schedule = app(Schedule::class);
//Production report scheduling // Production report scheduling
$productionRules = AlertMailRule::where('module', 'ProductionQuantities') $productionRules = AlertMailRule::where('module', 'ProductionQuantities')
->where('rule_name', 'ProductionMail') ->where('rule_name', 'ProductionMail')
//->select('plant', 'schedule_type') ->select('plant', 'schedule_type')
->select('plant', 'schedule_type') ->select('plant', 'schedule_type')
->distinct() ->distinct()
->get(); ->get();
@@ -31,7 +31,7 @@ Artisan::command('inspire', function () {
$command = $schedule->command('send:production-report', [$type, $plantId]); $command = $schedule->command('send:production-report', [$type, $plantId]);
switch ($type) { switch ($type) {
case 'Live': case 'Live':
$command->everyMinute(); $command->everyMinute();
break; break;
case 'Hourly': case 'Hourly':
@@ -65,8 +65,8 @@ Artisan::command('inspire', function () {
case 'Daily': case 'Daily':
$command->dailyAt('07:59'); $command->dailyAt('07:59');
break; break;
} }
} }
}); });