From 316a7d79926d5fa79b12f98b5e6020b07e45be8f Mon Sep 17 00:00:00 2001 From: kaioken Date: Sat, 27 Jul 2024 10:19:44 -0400 Subject: [PATCH] feat: add new command --- .../Zoho/ZohoLeadsDownloadCommand.php | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 app/Console/Commands/Connectors/Zoho/ZohoLeadsDownloadCommand.php diff --git a/app/Console/Commands/Connectors/Zoho/ZohoLeadsDownloadCommand.php b/app/Console/Commands/Connectors/Zoho/ZohoLeadsDownloadCommand.php new file mode 100644 index 000000000..b0d5541b0 --- /dev/null +++ b/app/Console/Commands/Connectors/Zoho/ZohoLeadsDownloadCommand.php @@ -0,0 +1,52 @@ +argument('app_id')); + $this->overwriteAppService($app); + $company = Companies::getById((int) $this->argument('company_id')); + $leadReceiver = LeadReceiver::getByIdFromCompanyApp((int) $this->argument('receiver_id'), $company, $app); + $page = (int) $this->argument('page'); + $leadsPerPage = (int) $this->argument('leadsPerPage'); + + $downloadAllLeads = new DownloadAllZohoLeadAction($app, $company, $leadReceiver); + $downloadAllLeads->execute($page, $leadsPerPage); + + $this->info($downloadAllLeads->getTotalLeadsProcessed() . ' leads downloaded from Zoho to ' . $leadReceiver->name); + + return; + } +}