Move cron scripts to root namespace

This commit is contained in:
Nabeel Shahzad
2018-04-06 17:14:01 -05:00
parent 7179910bc6
commit 3e89a53fc1
5 changed files with 8 additions and 8 deletions
+38
View File
@@ -0,0 +1,38 @@
<?php
namespace App\Cron\Nightly;
use App\Events\CronNightly;
use App\Interfaces\Listener;
use App\Models\Enums\ExpenseType;
use App\Services\Finance\RecurringFinanceService;
/**
* Go through and apply any finances that are daily
* @package App\Listeners\Cron\Nightly
*/
class ApplyExpenses extends Listener
{
private $financeSvc;
/**
* ApplyExpenses constructor.
* @param RecurringFinanceService $financeSvc
*/
public function __construct(RecurringFinanceService $financeSvc)
{
$this->financeSvc = $financeSvc;
}
/**
* Apply all of the expenses for a day
* @param CronNightly $event
* @throws \UnexpectedValueException
* @throws \InvalidArgumentException
* @throws \Prettus\Validator\Exceptions\ValidatorException
*/
public function handle(CronNightly $event): void
{
$this->financeSvc->processExpenses(ExpenseType::DAILY);
}
}