mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
53 lines
1.6 KiB
PHP
53 lines
1.6 KiB
PHP
<?php
|
|
|
|
|
|
namespace App\Classes\Modules\Transactions\ControllersLogic;
|
|
|
|
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
|
use App\Classes\Modules\PackingLists\Services\FetchesPackingList;
|
|
use App\Classes\Modules\Transactions\Processors\CreateInvoiceTransactionProcessor;
|
|
use Illuminate\Http\JsonResponse;
|
|
use Illuminate\Http\Request;
|
|
|
|
class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
protected function notification():array {
|
|
return [
|
|
'title' => 'Create Supplier Transactions',
|
|
'message' => 'You have successfully created currency supplier transactions'
|
|
];
|
|
}
|
|
|
|
/** @var FetchesPackingList */
|
|
private $fetchesPackingList;
|
|
|
|
/** @var CreateInvoiceTransactionProcessor */
|
|
private $createInvoiceTransactionProcessor;
|
|
|
|
/**
|
|
* @param FetchesPackingList $fetchesPackingList
|
|
* @param CreateInvoiceTransactionProcessor $createInvoiceTransactionProcessor
|
|
*/
|
|
public function __construct(FetchesPackingList $fetchesPackingList, CreateInvoiceTransactionProcessor $createInvoiceTransactionProcessor)
|
|
{
|
|
$this->fetchesPackingList = $fetchesPackingList;
|
|
$this->createInvoiceTransactionProcessor = $createInvoiceTransactionProcessor;
|
|
}
|
|
|
|
public function logic(Request $request) : JsonResponse
|
|
{
|
|
|
|
$packing_list = $this->fetchesPackingList->execute(['id' => $request->input('packing_list_id')]);
|
|
$this->createInvoiceTransactionProcessor->execute($packing_list);
|
|
|
|
return $this->response([]);
|
|
}
|
|
|
|
}
|