feat: updates on expenses
This commit is contained in:
22
app/Actions/Balances/CreateBalanceAction.php
Normal file
22
app/Actions/Balances/CreateBalanceAction.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Actions\Balances;
|
||||
|
||||
use App\Actions\BaseAction;
|
||||
use App\Commands\Balances\CreateBalanceCommand;
|
||||
use Closure;
|
||||
use Spatie\LaravelData\Data;
|
||||
|
||||
class CreateBalanceAction extends BaseAction
|
||||
{
|
||||
public function __construct(
|
||||
private CreateBalanceCommand $createBalanceCommand
|
||||
) {}
|
||||
|
||||
public function __invoke(Data $payload, Closure $next)
|
||||
{
|
||||
$this->createBalanceCommand->execute($payload->balanceDTO->except('amount')->toArray());
|
||||
|
||||
return $next($payload);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user