23 lines
693 B
PHP
23 lines
693 B
PHP
<?php
|
|
|
|
namespace App\Modules\Notifications\Presentation\Console;
|
|
|
|
use App\Modules\Notifications\Application\UseCases\NotifyMaintenanceDue;
|
|
use Illuminate\Console\Attributes\Description;
|
|
use Illuminate\Console\Attributes\Signature;
|
|
use Illuminate\Console\Command;
|
|
|
|
#[Signature('notifications:maintenance-due')]
|
|
#[Description('Notify the responsible persons of machines whose maintenance is coming up or late (run daily at 7.00)')]
|
|
class NotifyMaintenanceDueCommand extends Command
|
|
{
|
|
public function handle(NotifyMaintenanceDue $notify): int
|
|
{
|
|
$added = $notify->execute();
|
|
|
|
$this->components->info("{$added} notifications added.");
|
|
|
|
return self::SUCCESS;
|
|
}
|
|
}
|