From 3e123b282c3a4ad531987f130688baf2b249d00e Mon Sep 17 00:00:00 2001 From: kaioken Date: Mon, 5 Aug 2024 18:27:11 -0400 Subject: [PATCH] refact: synz --- .../Connectors/Zoho/Actions/SyncLeadToZohoAction.php | 6 ++---- .../Connectors/Zoho/Workflows/ZohoLeadActivity.php | 8 ++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Domains/Connectors/Zoho/Actions/SyncLeadToZohoAction.php b/src/Domains/Connectors/Zoho/Actions/SyncLeadToZohoAction.php index 1f4c916f0..8d0dfb4e4 100644 --- a/src/Domains/Connectors/Zoho/Actions/SyncLeadToZohoAction.php +++ b/src/Domains/Connectors/Zoho/Actions/SyncLeadToZohoAction.php @@ -5,7 +5,6 @@ namespace Kanvas\Connectors\Zoho\Actions; use Baka\Contracts\AppInterface; -use Baka\Contracts\CompanyInterface; use Kanvas\Companies\Models\Companies; use Kanvas\Connectors\Zoho\Client; use Kanvas\Connectors\Zoho\DataTransferObject\ZohoLead; @@ -14,7 +13,6 @@ use Kanvas\Guild\Agents\Models\Agent; use Kanvas\Guild\Leads\Models\Lead; use Throwable; -use Webleit\ZohoCrmApi\Models\Model; use Webleit\ZohoCrmApi\Modules\Leads as ZohoLeadModule; class SyncLeadToZohoAction @@ -25,7 +23,7 @@ public function __construct( ) { } - public function execute(): Model + public function execute(): array { $zohoLead = ZohoLead::fromLead($this->lead); $zohoData = $zohoLead->toArray(); @@ -63,7 +61,7 @@ public function execute(): Model $this->uploadAttachments($zohoCrm->leads, $lead); - return $zohoLead; + return $zohoData; } protected function assignAgent( diff --git a/src/Domains/Connectors/Zoho/Workflows/ZohoLeadActivity.php b/src/Domains/Connectors/Zoho/Workflows/ZohoLeadActivity.php index ce532c067..db73a5248 100644 --- a/src/Domains/Connectors/Zoho/Workflows/ZohoLeadActivity.php +++ b/src/Domains/Connectors/Zoho/Workflows/ZohoLeadActivity.php @@ -28,16 +28,16 @@ class ZohoLeadActivity extends Activity implements WorkflowActivityInterface public function execute(Model $lead, AppInterface $app, array $params): array { $this->overwriteAppService($app); - $zohoLead = ZohoLead::fromLead($lead); - $zohoData = $zohoLead->toArray(); + //$zohoLead = ZohoLead::fromLead($lead); + //$zohoData = $zohoLead->toArray(); //$company = Companies::getById($lead->companies_id); $syncLeadWithZoho = new SyncLeadToZohoAction($app, $lead); $zohoLead = $syncLeadWithZoho->execute(); return [ - 'zohoLeadId' => $zohoLead->getId(), - 'zohoRequest' => $zohoData, + 'zohoLeadId' => $lead->getId(), + 'zohoRequest' => $zohoLead, 'leadId' => $lead->getId(), 'status' => $lead->status()->first()->name, ];