mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-24 15:04:32 +00:00
52 lines
1.5 KiB
PHP
52 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\PerfexCRM\Processors;
|
|
|
|
use App\Classes\Modules\PerfexCRM\DataTransferObjects\CreateTaskPerfexCRMObject;
|
|
use App\Classes\Jobs\CreatePerfexCRMSingleTask;
|
|
use App\Classes\ValueObjects\Constants\PerfexCRMTaskPriority;
|
|
use App\Classes\ValueObjects\Constants\PerfexCRMTasks;
|
|
use App\Models\Company;
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
|
|
class NewLeadTaskToPerfexCRMProcessor
|
|
{
|
|
/**
|
|
* @param Company $company
|
|
* @return true
|
|
* @throws \App\Classes\Exceptions\MalformedRequestException
|
|
*/
|
|
public function execute(Company $company)
|
|
{
|
|
try {
|
|
$companyModule = $company->companyModules()->first();
|
|
$employee = $companyModule->employees()->first();
|
|
$contactEmail = $employee->email;
|
|
|
|
$createTaskPerfexCRMObject = new CreateTaskPerfexCRMObject(
|
|
$contactEmail,
|
|
PerfexCRMTasks::TASK_IDENTIFICATION_1['name'],
|
|
PerfexCRMTasks::TASK_IDENTIFICATION_1['description'],
|
|
"",
|
|
"",
|
|
"",
|
|
"",
|
|
"",
|
|
PerfexCRMTasks::TASK_IDENTIFICATION_1['status'],
|
|
PerfexCRMTasks::TASK_IDENTIFICATION_1['department'],
|
|
PerfexCRMTaskPriority::DEFAULT,
|
|
"0",
|
|
0
|
|
);
|
|
|
|
CreatePerfexCRMSingleTask::dispatch($createTaskPerfexCRMObject);
|
|
|
|
} catch (\Exception $exception){
|
|
Log::error($exception);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
}
|