Added Transaction job new events..

This commit is contained in:
Cüneyt Şentürk
2022-08-09 18:13:12 +03:00
parent a423be8cdd
commit cadfff459c
9 changed files with 180 additions and 1 deletions

View File

@ -3,6 +3,8 @@
namespace App\Jobs\Banking;
use App\Abstracts\Job;
use App\Events\Banking\DocumentTransactionCreated;
use App\Events\Banking\DocumentTransactionCreating;
use App\Jobs\Banking\CreateTransaction;
use App\Jobs\Document\CreateDocumentHistory;
use App\Events\Document\PaidAmountCalculated;
@ -27,6 +29,8 @@ class CreateBankingDocumentTransaction extends Job implements ShouldCreate
public function handle(): Transaction
{
event(new DocumentTransactionCreating($this->model, $this->request));
$this->prepareRequest();
$this->checkAmount();
@ -46,6 +50,8 @@ class CreateBankingDocumentTransaction extends Job implements ShouldCreate
$this->createHistory();
});
event(new DocumentTransactionCreated($this->model, $this->transaction));
return $this->transaction;
}