<?php


namespace App\Classes\Modules\Transactions\ControllersLogic;

use App\Classes\Jobs\GenerateGroupTransactionsPurchaseOrder;
use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
use App\Classes\General\Abstracts\AbstractControllerLogic;

class CreateBulkPurchaseOrderDocumentLogic extends AbstractControllerLogic
{


    /**
     * @return array
     */
    protected function notification(): array
    {
        return [
            'title' => 'Generate Bulk Purchase Order',
            'message' => 'You have successfully generated bulk purchase order'
        ];
    }

    /** @var GenerateGroupTransactionsPurchaseOrder */
    private $generateGroupTransactionsPurchaseOrder;

    /**
     * CreateBulkPurchaseOrderDocumentLogic constructor.
     * @param GenerateGroupTransactionsPurchaseOrder $generateGroupTransactionsPurchaseOrder
     */
    public function __construct(GenerateGroupTransactionsPurchaseOrder $generateGroupTransactionsPurchaseOrder)
    {
        $this->generateGroupTransactionsPurchaseOrder = $generateGroupTransactionsPurchaseOrder;
    }

    /**
     * @param Request $request
     * @return JsonResponse
     */
    public function logic(Request $request): JsonResponse
    {
        $this->generateGroupTransactionsPurchaseOrder::dispatch();

        return $this->response([]);
    }
}
