feat: updates

This commit is contained in:
JP
2024-08-11 20:03:49 +08:00
parent 140e821e0c
commit 52431a2c61
45 changed files with 1152 additions and 287 deletions

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Commands\Account;
use App\Commands\Command;
use App\Models\Account;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\DB;
class CreateAccountCommand implements Command
{
public function execute(array $data): mixed
{
return DB::transaction(
callback: fn () => Account::query()->updateOrCreate([
'id' => $data['id'] ?? null,
'client_id' => $data['client_id'],
], Arr::except($data, ['starting_balance', 'branch_id'])),
attempts: 2
);
}
}