added pointer interfaces for jobs

This commit is contained in:
Denis Duliçi
2021-09-06 11:53:57 +03:00
parent abd55133f1
commit c08a8cfc4e
63 changed files with 635 additions and 1524 deletions

View File

@ -3,9 +3,11 @@
namespace App\Jobs\Document;
use App\Abstracts\Job;
use App\Interfaces\Job\ShouldCreate;
use App\Models\Document\Document;
use App\Models\Document\DocumentHistory;
class CreateDocumentHistory extends Job
class CreateDocumentHistory extends Job implements ShouldCreate
{
protected $document;
@ -13,26 +15,16 @@ class CreateDocumentHistory extends Job
protected $description;
/**
* Create a new job instance.
*
* @param $document
* @param $notify
* @param $description
*/
public function __construct($document, $notify = 0, $description = null)
public function __construct(Document $document, $notify = 0, $description = null)
{
$this->document = $document;
$this->notify = $notify;
$this->description = $description;
parent::__construct($document, $notify, $description);
}
/**
* Execute the job.
*
* @return DocumentHistory
*/
public function handle()
public function handle(): DocumentHistory
{
$description = $this->description ?: trans_choice('general.payments', 1);