mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-23 22:44:03 +00:00
Merge branch 'dillon/crm-create-task-2' into development
This commit is contained in:
@@ -13,6 +13,8 @@ use App\Classes\Modules\Bookings\Services\CreatesBooking;
|
||||
use App\Classes\Modules\Bookings\Services\GeneratesBookingMarking;
|
||||
|
||||
use App\Classes\Modules\Bookings\DataTransferObjects\BookingObject;
|
||||
use App\Classes\Modules\PerfexCRM\Processors\BookingToPerfexCRMProcessor;
|
||||
|
||||
use App\Http\Resources\BookingResource;
|
||||
|
||||
use ErrorException;
|
||||
@@ -44,19 +46,24 @@ class CreateBookingLogic extends AbstractControllerLogic
|
||||
/** @var FetchesCompany */
|
||||
private $fetchesCompany;
|
||||
|
||||
/** @var BookingToPerfexCRMProcessor */
|
||||
private $bookingToPerfexCRMProcessor;
|
||||
|
||||
/**
|
||||
* CreateBookingLogic constructor.
|
||||
* @param CanCreateBooking $canCreateBooking
|
||||
* @param CreatesBooking $createsBooking
|
||||
* @param GeneratesBookingMarking $generatesBookingMarking
|
||||
* @param FetchesCompany $fetchesCompany
|
||||
* @param BookingToPerfexCRMProcessor $bookingToPerfexCRMProcessor
|
||||
*/
|
||||
public function __construct(CanCreateBooking $canCreateBooking, CreatesBooking $createsBooking, GeneratesBookingMarking $generatesBookingMarking, FetchesCompany $fetchesCompany)
|
||||
public function __construct(CanCreateBooking $canCreateBooking, CreatesBooking $createsBooking, GeneratesBookingMarking $generatesBookingMarking, FetchesCompany $fetchesCompany, BookingToPerfexCRMProcessor $bookingToPerfexCRMProcessor)
|
||||
{
|
||||
$this->canCreateBooking = $canCreateBooking;
|
||||
$this->createsBooking = $createsBooking;
|
||||
$this->generatesBookingMarking = $generatesBookingMarking;
|
||||
$this->fetchesCompany = $fetchesCompany;
|
||||
$this->bookingToPerfexCRMProcessor = $bookingToPerfexCRMProcessor;
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +84,11 @@ class CreateBookingLogic extends AbstractControllerLogic
|
||||
|
||||
$booking = $this->createsBooking->execute($company, $object);
|
||||
|
||||
if(config('perfexcrm.is_enabled') == 'true'){
|
||||
$this->bookingToPerfexCRMProcessor->execute($booking);
|
||||
}
|
||||
|
||||
return $this->resourceResponse(new BookingResource($booking));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+11
-2
@@ -9,6 +9,7 @@ use App\Classes\Modules\Companies\Services\UpdatesCompanyStatus;
|
||||
use App\Classes\Modules\Documents\DataTransferObjects\DocumentObject;
|
||||
use App\Classes\Modules\Documents\Services\CreatesDocument;
|
||||
use App\Classes\Modules\Documents\Services\CreatesFiles;
|
||||
use App\Classes\Modules\PerfexCRM\Processors\NewLeadTaskToPerfexCRMProcessor;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\CompanyType;
|
||||
use App\Classes\ValueObjects\Constants\DocumentType;
|
||||
@@ -42,6 +43,8 @@ class CreateIdentificationDocumentLogic extends AbstractControllerLogic
|
||||
/** @var UpdatesCompanyStatus */
|
||||
private $updatesCompanyStatus;
|
||||
|
||||
/** @var NewLeadTaskToPerfexCRMProcessor */
|
||||
private $newLeadTaskToPerfexCRMProcessor;
|
||||
|
||||
/**
|
||||
* CreateIdentificationDocumentLogic constructor.
|
||||
@@ -49,13 +52,15 @@ class CreateIdentificationDocumentLogic extends AbstractControllerLogic
|
||||
* @param CreatesDocument $createsDocument
|
||||
* @param CreatesFiles $createsFile
|
||||
* @param UpdatesCompanyStatus $updatesCompanyStatus
|
||||
* @param NewLeadTaskToPerfexCRMProcessor $newLeadTaskToPerfexCRMProcessor
|
||||
*/
|
||||
public function __construct(FetchesCompany $fetchesCompany, CreatesDocument $createsDocument, CreatesFiles $createsFile, UpdatesCompanyStatus $updatesCompanyStatus)
|
||||
public function __construct(FetchesCompany $fetchesCompany, CreatesDocument $createsDocument, CreatesFiles $createsFile, UpdatesCompanyStatus $updatesCompanyStatus, NewLeadTaskToPerfexCRMProcessor $newLeadTaskToPerfexCRMProcessor)
|
||||
{
|
||||
$this->fetchesCompany = $fetchesCompany;
|
||||
$this->createsDocument = $createsDocument;
|
||||
$this->createsFile = $createsFile;
|
||||
$this->updatesCompanyStatus = $updatesCompanyStatus;
|
||||
$this->newLeadTaskToPerfexCRMProcessor = $newLeadTaskToPerfexCRMProcessor;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -78,7 +83,11 @@ class CreateIdentificationDocumentLogic extends AbstractControllerLogic
|
||||
|
||||
$this->updatesCompanyStatus->execute($company, ApprovalStatus::PENDING_VERIFICATION);
|
||||
|
||||
if(config('perfexcrm.is_enabled') == 'true'){
|
||||
$this->newLeadTaskToPerfexCRMProcessor->execute($company);
|
||||
}
|
||||
|
||||
return $this->response([]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,9 @@ class InitialPerfexCRMObject implements DataTransferObject
|
||||
/** @var string */
|
||||
private $projectName;
|
||||
|
||||
/** @var int */
|
||||
private $projectStatus;
|
||||
|
||||
/** @var array */
|
||||
private $milestoneNames;
|
||||
|
||||
@@ -32,7 +35,7 @@ class InitialPerfexCRMObject implements DataTransferObject
|
||||
private $taskNames;
|
||||
|
||||
|
||||
public function __construct(string $companyName, string $companyReference, string $contactName, string $contactEmail, string $bookingMarking, string $projectName, array $milestoneNames, array $taskNames)
|
||||
public function __construct(string $companyName, string $companyReference, string $contactName, string $contactEmail, string $bookingMarking, string $projectName, int $projectStatus, array $milestoneNames, array $taskNames)
|
||||
{
|
||||
|
||||
$this->companyName = $companyName;
|
||||
@@ -41,6 +44,7 @@ class InitialPerfexCRMObject implements DataTransferObject
|
||||
$this->contactEmail = $contactEmail;
|
||||
$this->bookingMarking = $bookingMarking;
|
||||
$this->projectName = $projectName;
|
||||
$this->projectStatus = $projectStatus;
|
||||
$this->milestoneNames = $milestoneNames;
|
||||
$this->taskNames = $taskNames;
|
||||
}
|
||||
@@ -93,6 +97,14 @@ class InitialPerfexCRMObject implements DataTransferObject
|
||||
return $this->projectName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getProjectStatus(): int
|
||||
{
|
||||
return $this->projectStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
|
||||
@@ -13,6 +13,9 @@ class UpdatePerfexCRMObject implements DataTransferObject
|
||||
/** @var string */
|
||||
private $companyReference;
|
||||
|
||||
/** @var string */
|
||||
private $contactName;
|
||||
|
||||
/** @var string */
|
||||
private $contactEmail;
|
||||
|
||||
@@ -22,23 +25,28 @@ class UpdatePerfexCRMObject implements DataTransferObject
|
||||
/** @var string */
|
||||
private $projectName;
|
||||
|
||||
/** @var string */
|
||||
private $milestoneName;
|
||||
/** @var int */
|
||||
private $projectStatus;
|
||||
|
||||
/** @var string */
|
||||
private $taskName;
|
||||
/** @var array */
|
||||
private $milestoneNames;
|
||||
|
||||
/** @var array */
|
||||
private $taskNames;
|
||||
|
||||
|
||||
public function __construct(string $companyName, string $companyReference, string $contactEmail, string $bookingMarking, string $projectName, string $milestoneName, string $taskName)
|
||||
public function __construct(string $companyName, string $companyReference, string $contactName, string $contactEmail, string $bookingMarking, string $projectName, int $projectStatus, array $milestoneNames, array $taskNames)
|
||||
{
|
||||
|
||||
$this->companyName = $companyName;
|
||||
$this->companyReference = $companyReference;
|
||||
$this->contactName = $contactName;
|
||||
$this->contactEmail = $contactEmail;
|
||||
$this->bookingMarking = $bookingMarking;
|
||||
$this->projectName = $projectName;
|
||||
$this->milestoneName = $milestoneName;
|
||||
$this->taskName = $taskName;
|
||||
$this->projectStatus = $projectStatus;
|
||||
$this->milestoneNames = $milestoneNames;
|
||||
$this->taskNames = $taskNames;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,6 +65,14 @@ class UpdatePerfexCRMObject implements DataTransferObject
|
||||
return $this->companyReference;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getContactName(): string
|
||||
{
|
||||
return $this->contactName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
@@ -82,19 +98,27 @@ class UpdatePerfexCRMObject implements DataTransferObject
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return int
|
||||
*/
|
||||
public function getMilestoneName(): string
|
||||
public function getProjectStatus(): int
|
||||
{
|
||||
return $this->milestoneName;
|
||||
return $this->projectStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return array
|
||||
*/
|
||||
public function getTaskName(): string
|
||||
public function getMilestoneNames(): array
|
||||
{
|
||||
return $this->taskName;
|
||||
return $this->milestoneNames;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getTaskNames(): array
|
||||
{
|
||||
return $this->taskNames;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\PerfexCRM\Processors;
|
||||
|
||||
use App\Classes\Modules\PerfexCRM\DataTransferObjects\UpdatePerfexCRMObject;
|
||||
use App\Classes\Jobs\UpdatePerfexCRM;
|
||||
use App\Models\Booking;
|
||||
use App\Classes\ValueObjects\Constants\PerfexCRMProjectStatus;
|
||||
|
||||
class BookingToPerfexCRMProcessor
|
||||
{
|
||||
/**
|
||||
* @param Booking $booking
|
||||
* @return \Illuminate\Database\Eloquent\Model
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
*/
|
||||
public function execute(Booking $booking)
|
||||
{
|
||||
$companyReference = $booking->company->reference;
|
||||
$companyName = $booking->company->name;
|
||||
$employee = $booking->company->employees()->first();
|
||||
$contactEmail = $employee->email;
|
||||
$contactName = $employee->name;
|
||||
$bookingMarking = $booking->marking;
|
||||
|
||||
$serviceTypeName = $booking->company->services()->where('id', $booking->service_id)->first()->name;
|
||||
$projectName = 'Exchange | '.$serviceTypeName.' | '.$bookingMarking;
|
||||
|
||||
$updatePerfexCRMObject = new UpdatePerfexCRMObject(
|
||||
$companyName,
|
||||
$companyReference,
|
||||
$contactName,
|
||||
$contactEmail,
|
||||
$bookingMarking,
|
||||
$projectName,
|
||||
PerfexCRMProjectStatus::NOT_STARTED,
|
||||
[],
|
||||
[]
|
||||
);
|
||||
UpdatePerfexCRM::dispatch($updatePerfexCRMObject);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -7,9 +7,11 @@ use App\Classes\Modules\PerfexCRM\Services\CreatesPerfexCRMInvoice;
|
||||
use App\Classes\Modules\PerfexCRM\Services\CreatesPerfexCRMInvoicePayment;
|
||||
use App\Classes\Modules\PerfexCRM\Services\ConvertsPerfexCRMLeadToCustomer;
|
||||
use App\Classes\Modules\PerfexCRM\Services\FetchesPerfexCRMProject;
|
||||
use App\Classes\Modules\PerfexCRM\Services\CreatesPerfexCRMCustomerProject;
|
||||
use App\Classes\Modules\PerfexCRM\DataTransferObjects\InvoicePerfexCRMObject;
|
||||
use App\Classes\Modules\PerfexCRM\DataTransferObjects\InvoicePaymentPerfexCRMObject;
|
||||
use App\Classes\Modules\PerfexCRM\DataTransferObjects\InvoiceSingleItemPerfexCRMObject;
|
||||
use App\Classes\ValueObjects\Constants\PerfexCRMProjectStatus;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class CreatePerfexCRMInvoiceProcessor
|
||||
@@ -27,6 +29,9 @@ class CreatePerfexCRMInvoiceProcessor
|
||||
/** @var FetchesPerfexCRMProject */
|
||||
private $fetchesPerfexCRMProject;
|
||||
|
||||
/** @var CreatesPerfexCRMCustomerProject */
|
||||
private $createsPerfexCRMCustomerProject;
|
||||
|
||||
/**
|
||||
* CreatePerfexCRMInvoiceProcessor constructor.
|
||||
* @param CreatesPerfexCRMInvoice $createsPerfexCRMInvoice
|
||||
@@ -34,12 +39,14 @@ class CreatePerfexCRMInvoiceProcessor
|
||||
public function __construct(CreatesPerfexCRMInvoice $createsPerfexCRMInvoice,
|
||||
CreatesPerfexCRMInvoicePayment $createsPerfexCRMInvoicePayment,
|
||||
ConvertsPerfexCRMLeadToCustomer $convertsPerfexCRMLeadToCustomer,
|
||||
FetchesPerfexCRMProject $fetchesPerfexCRMProject)
|
||||
FetchesPerfexCRMProject $fetchesPerfexCRMProject,
|
||||
CreatesPerfexCRMCustomerProject $createsPerfexCRMCustomerProject)
|
||||
{
|
||||
$this->createsPerfexCRMInvoice = $createsPerfexCRMInvoice;
|
||||
$this->createsPerfexCRMInvoicePayment = $createsPerfexCRMInvoicePayment;
|
||||
$this->convertsPerfexCRMLeadToCustomer = $convertsPerfexCRMLeadToCustomer;
|
||||
$this->fetchesPerfexCRMProject = $fetchesPerfexCRMProject;
|
||||
$this->createsPerfexCRMCustomerProject = $createsPerfexCRMCustomerProject;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -97,6 +104,12 @@ class CreatePerfexCRMInvoiceProcessor
|
||||
if(!is_null($project)){
|
||||
$projectId = $project->id;
|
||||
}
|
||||
else{
|
||||
$result = $this->createsPerfexCRMCustomerProject->execute($projectName, PerfexCRMProjectStatus::NOT_STARTED, $clientId);
|
||||
if(isset($result->payload)){ //Here means project creation successful
|
||||
$projectId = $result->payload['project_id'];
|
||||
}
|
||||
}
|
||||
|
||||
//newitems
|
||||
foreach ($purchaseOrder->transactionDetails as $key => $transaction_detail){
|
||||
|
||||
@@ -18,7 +18,7 @@ use App\Classes\Modules\PerfexCRM\DataTransferObjects\InitialPerfexCRMObject;
|
||||
use App\Classes\Modules\PerfexCRM\DataTransferObjects\UpdatePerfexCRMObject;
|
||||
use App\Classes\ValueObjects\Constants\PerfexCRMMilestones;
|
||||
use App\Classes\ValueObjects\Constants\PerfexCRMTasks;
|
||||
use App\Classes\ValueObjects\Constants\PerfexCRMStatus;
|
||||
use App\Classes\ValueObjects\Constants\PerfexCRMTaskStatus;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -149,7 +149,7 @@ class InitializePerfexCRMProcessor
|
||||
}
|
||||
|
||||
// Get existing or create project, project has to exist first before milestone can appear under it
|
||||
$result = $this->createsPerfexCRMCustomerProject->execute($initialPerfexCRMObject->getProjectName(), $crmClientId);
|
||||
$result = $this->createsPerfexCRMCustomerProject->execute($initialPerfexCRMObject->getProjectName(), $initialPerfexCRMObject->getProjectStatus(), $crmClientId);
|
||||
if(isset($result->payload)){ //Here means project creation successful
|
||||
$projectId = $result->payload['project_id'];
|
||||
}
|
||||
@@ -157,8 +157,9 @@ class InitializePerfexCRMProcessor
|
||||
$projectId = $this->fetchesPerfexCRMProject->execute($initialPerfexCRMObject->getProjectName(), $crmClientId)->id;
|
||||
}
|
||||
|
||||
if(!is_null($result)){
|
||||
$tasks = $initialPerfexCRMObject->getTaskNames();
|
||||
|
||||
$tasks = $initialPerfexCRMObject->getTaskNames();
|
||||
if(count($tasks) > 0){
|
||||
|
||||
//Create tasks with milestone
|
||||
for($count=0; $count < count($tasks); $count++) {
|
||||
@@ -177,16 +178,18 @@ class InitializePerfexCRMProcessor
|
||||
}
|
||||
}
|
||||
|
||||
$taskStatus = PerfexCRMStatus::NOT_STARTED;
|
||||
$taskStatus = PerfexCRMTaskStatus::NOT_STARTED;
|
||||
if($tasks[$count]['status'] != ''){
|
||||
$taskStatus = $tasks[$count]['status'];
|
||||
}
|
||||
|
||||
// Get existing or create task
|
||||
$result = $this->createsPerfexCRMTask->execute($tasks[$count]['name'], $tasks[$count]['description'], '', $milestoneId, $projectId, $tasks[$count]['reference'], $tasks[$count]['on_task_completion'], $taskStatus);
|
||||
if(is_null($result)){
|
||||
break; //Breaking the rest of the tasks in array assuming that they are all created as a batch previously
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,28 +3,32 @@
|
||||
namespace App\Classes\Modules\PerfexCRM\Processors;
|
||||
|
||||
use App\Classes\Modules\PerfexCRM\DataTransferObjects\CreateTaskPerfexCRMObject;
|
||||
use App\Classes\ValueObjects\Constants\PerfexCRMStatus;
|
||||
use App\Classes\Jobs\CreatePerfexCRMSingleTask;
|
||||
use App\Classes\ValueObjects\Constants\PerfexCRMTasks;
|
||||
use App\Models\Company;
|
||||
|
||||
class NewLeadTaskToPerfexCRMProcessor
|
||||
{
|
||||
/**
|
||||
* @param None
|
||||
* @param Company $company
|
||||
* @return true
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
*/
|
||||
public function execute()
|
||||
public function execute(Company $company)
|
||||
{
|
||||
$employee = $company->employees()->first();
|
||||
$contactEmail = $employee->email;
|
||||
|
||||
$createTaskPerfexCRMObject = new CreateTaskPerfexCRMObject(
|
||||
"dillontest1@gmail.com",
|
||||
"test is the name of the task",
|
||||
"this is the description of the task",
|
||||
$contactEmail,
|
||||
PerfexCRMTasks::TASK_IDENTIFICATION_1['name'],
|
||||
PerfexCRMTasks::TASK_IDENTIFICATION_1['description'],
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
PerfexCRMStatus::NOT_STARTED
|
||||
PerfexCRMTasks::TASK_IDENTIFICATION_1['status']
|
||||
);
|
||||
|
||||
CreatePerfexCRMSingleTask::dispatch($createTaskPerfexCRMObject);
|
||||
|
||||
@@ -2,40 +2,17 @@
|
||||
|
||||
namespace App\Classes\Modules\PerfexCRM\Processors;
|
||||
|
||||
use App\Classes\Modules\PerfexCRM\Processors\UpdatePerfexCRMProcessor;
|
||||
use App\Classes\Modules\PerfexCRM\Processors\InitializePerfexCRMProcessor;
|
||||
use App\Classes\Modules\Companies\Services\FetchesCompany;
|
||||
use App\Classes\Modules\PerfexCRM\DataTransferObjects\InitialPerfexCRMObject;
|
||||
use App\Classes\Modules\PerfexCRM\DataTransferObjects\UpdatePerfexCRMObject;
|
||||
use App\Classes\ValueObjects\Constants\PerfexCRMTasks;
|
||||
use App\Models\Transaction;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\Jobs\InitializePerfexCRM;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Classes\ValueObjects\Constants\PerfexCRMProjectStatus;
|
||||
use App\Classes\ValueObjects\Constants\PerfexCRMTaskStatus;
|
||||
use App\Classes\Jobs\UpdatePerfexCRM;
|
||||
use App\Models\Transaction;
|
||||
|
||||
class TransactionToPerfexCRMProcessor
|
||||
{
|
||||
/** @var FetchesCompany */
|
||||
private $fetchesCompany;
|
||||
|
||||
/** @var UpdatePerfexCRMProcessor */
|
||||
private $updatePerfexCRMProcessor;
|
||||
|
||||
/** @var InitializePerfexCRMProcessor */
|
||||
private $initializePerfexCRMProcessor;
|
||||
|
||||
/**
|
||||
* TransactionToPerfexCRMProcessor constructor.
|
||||
* @param UpdatePerfexCRMProcessor $updatePerfexCRMProcessor
|
||||
* @param InitializePerfexCRMProcessor $initializePerfexCRMProcessor
|
||||
* @param FetchesCompany $fetchesCompany
|
||||
*/
|
||||
public function __construct(UpdatePerfexCRMProcessor $updatePerfexCRMProcessor, InitializePerfexCRMProcessor $initializePerfexCRMProcessor, FetchesCompany $fetchesCompany)
|
||||
{
|
||||
$this->updatePerfexCRMProcessor = $updatePerfexCRMProcessor;
|
||||
$this->initializePerfexCRMProcessor = $initializePerfexCRMProcessor;
|
||||
$this->fetchesCompany = $fetchesCompany;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Transaction $model
|
||||
* @param int $status
|
||||
@@ -44,7 +21,8 @@ class TransactionToPerfexCRMProcessor
|
||||
*/
|
||||
public function execute(Transaction $model, int $status)
|
||||
{
|
||||
if($model->owner instanceof \App\Models\Booking && $status == ApprovalStatus::APPROVED){
|
||||
// dd(json_encode($status));
|
||||
if($model->owner instanceof \App\Models\Booking) {
|
||||
$companyReference = $model->owner->company->reference;
|
||||
$companyName = $model->owner->company->name;
|
||||
$employee = $model->owner->company->employees()->first();
|
||||
@@ -54,64 +32,96 @@ class TransactionToPerfexCRMProcessor
|
||||
|
||||
$serviceTypeName = $model->owner->company->services()->where('id', $model->owner->service_id)->first()->name;
|
||||
$projectName = 'Exchange | '.$serviceTypeName.' | '.$bookingMarking;
|
||||
$tasks = [
|
||||
PerfexCRMTasks::TASK_1
|
||||
];
|
||||
if($model->owner->service_id == 1){
|
||||
$tasks = [
|
||||
PerfexCRMTasks::TASK_1,
|
||||
PerfexCRMTasks::TASK_1_DAY_TRANSFER_1,
|
||||
PerfexCRMTasks::TASK_1_DAY_TRANSFER_2,
|
||||
PerfexCRMTasks::TASK_1_DAY_TRANSFER_3,
|
||||
PerfexCRMTasks::TASK_1_DAY_TRANSFER_4,
|
||||
PerfexCRMTasks::TASK_1_DAY_TRANSFER_5,
|
||||
PerfexCRMTasks::TASK_1_DAY_TRANSFER_6,
|
||||
];
|
||||
}
|
||||
else if($model->owner->service_id == 3){
|
||||
$tasks = [
|
||||
PerfexCRMTasks::TASK_1,
|
||||
PerfexCRMTasks::TASK_3_DAY_TRANSFER_1,
|
||||
PerfexCRMTasks::TASK_3_DAY_TRANSFER_2,
|
||||
PerfexCRMTasks::TASK_3_DAY_TRANSFER_3,
|
||||
PerfexCRMTasks::TASK_3_DAY_TRANSFER_4,
|
||||
PerfexCRMTasks::TASK_3_DAY_TRANSFER_5,
|
||||
PerfexCRMTasks::TASK_3_DAY_TRANSFER_6,
|
||||
];
|
||||
}
|
||||
else if($model->owner->service_id == 4){
|
||||
$tasks = [
|
||||
PerfexCRMTasks::TASK_1,
|
||||
PerfexCRMTasks::TASK_1688_PAYMENT_1,
|
||||
PerfexCRMTasks::TASK_1688_PAYMENT_2,
|
||||
PerfexCRMTasks::TASK_1688_PAYMENT_3,
|
||||
PerfexCRMTasks::TASK_1688_PAYMENT_4,
|
||||
PerfexCRMTasks::TASK_1688_PAYMENT_5,
|
||||
PerfexCRMTasks::TASK_1688_PAYMENT_6,
|
||||
PerfexCRMTasks::TASK_1688_PAYMENT_7,
|
||||
PerfexCRMTasks::TASK_1688_PAYMENT_8,
|
||||
PerfexCRMTasks::TASK_1688_PAYMENT_9,
|
||||
PerfexCRMTasks::TASK_1688_PAYMENT_10,
|
||||
PerfexCRMTasks::TASK_1688_PAYMENT_11,
|
||||
PerfexCRMTasks::TASK_1688_PAYMENT_12,
|
||||
PerfexCRMTasks::TASK_1688_PAYMENT_13,
|
||||
|
||||
];
|
||||
}
|
||||
$initialPerfexCRMObject = new InitialPerfexCRMObject(
|
||||
$companyName,
|
||||
$companyReference,
|
||||
$contactName,
|
||||
$contactEmail,
|
||||
$bookingMarking,
|
||||
$projectName,
|
||||
[],
|
||||
$tasks
|
||||
);
|
||||
if($status == ApprovalStatus::APPROVED)
|
||||
{
|
||||
if($model->type == TransactionType::PAYMENT){
|
||||
$tasks = [
|
||||
PerfexCRMTasks::TASK_1
|
||||
];
|
||||
if($model->owner->service_id == 1){
|
||||
$tasks = [
|
||||
PerfexCRMTasks::TASK_1,
|
||||
PerfexCRMTasks::TASK_1_DAY_TRANSFER_1,
|
||||
PerfexCRMTasks::TASK_1_DAY_TRANSFER_2,
|
||||
PerfexCRMTasks::TASK_1_DAY_TRANSFER_3,
|
||||
PerfexCRMTasks::TASK_1_DAY_TRANSFER_4,
|
||||
PerfexCRMTasks::TASK_1_DAY_TRANSFER_5,
|
||||
PerfexCRMTasks::TASK_1_DAY_TRANSFER_6,
|
||||
];
|
||||
}
|
||||
else if($model->owner->service_id == 3){
|
||||
$tasks = [
|
||||
PerfexCRMTasks::TASK_1,
|
||||
PerfexCRMTasks::TASK_3_DAY_TRANSFER_1,
|
||||
PerfexCRMTasks::TASK_3_DAY_TRANSFER_2,
|
||||
PerfexCRMTasks::TASK_3_DAY_TRANSFER_3,
|
||||
PerfexCRMTasks::TASK_3_DAY_TRANSFER_4,
|
||||
PerfexCRMTasks::TASK_3_DAY_TRANSFER_5,
|
||||
PerfexCRMTasks::TASK_3_DAY_TRANSFER_6,
|
||||
];
|
||||
}
|
||||
else if($model->owner->service_id == 4){
|
||||
$tasks = [
|
||||
PerfexCRMTasks::TASK_1,
|
||||
PerfexCRMTasks::TASK_1688_PAYMENT_1,
|
||||
PerfexCRMTasks::TASK_1688_PAYMENT_2,
|
||||
PerfexCRMTasks::TASK_1688_PAYMENT_3,
|
||||
PerfexCRMTasks::TASK_1688_PAYMENT_4,
|
||||
PerfexCRMTasks::TASK_1688_PAYMENT_5,
|
||||
PerfexCRMTasks::TASK_1688_PAYMENT_6,
|
||||
PerfexCRMTasks::TASK_1688_PAYMENT_7,
|
||||
PerfexCRMTasks::TASK_1688_PAYMENT_8,
|
||||
PerfexCRMTasks::TASK_1688_PAYMENT_9,
|
||||
PerfexCRMTasks::TASK_1688_PAYMENT_10,
|
||||
PerfexCRMTasks::TASK_1688_PAYMENT_11,
|
||||
PerfexCRMTasks::TASK_1688_PAYMENT_12,
|
||||
PerfexCRMTasks::TASK_1688_PAYMENT_13,
|
||||
|
||||
//$this->initializePerfexCRMProcessor->execute($initialPerfexCRMObject);
|
||||
InitializePerfexCRM::dispatch($initialPerfexCRMObject);
|
||||
];
|
||||
}
|
||||
$updatePerfexCRMObject = new UpdatePerfexCRMObject(
|
||||
$companyName,
|
||||
$companyReference,
|
||||
$contactName,
|
||||
$contactEmail,
|
||||
$bookingMarking,
|
||||
$projectName,
|
||||
PerfexCRMProjectStatus::IN_PROGRESS,
|
||||
[],
|
||||
$tasks
|
||||
);
|
||||
UpdatePerfexCRM::dispatch($updatePerfexCRMObject);
|
||||
}
|
||||
}
|
||||
else if($status == ApprovalStatus::PENDING_VERIFICATION){
|
||||
if($model->type == TransactionType::PURCHASE_ORDER){
|
||||
$tasks = [];
|
||||
if($model->owner->service_id == 1 || $model->owner->service_id == 3){
|
||||
$tasks = [
|
||||
PerfexCRMTasks::TASK_PURCHASE_ORDER_1,
|
||||
PerfexCRMTasks::TASK_PURCHASE_ORDER_2,
|
||||
];
|
||||
}
|
||||
|
||||
if(count($tasks) > 0){
|
||||
$updatePerfexCRMObject = new UpdatePerfexCRMObject(
|
||||
$companyName,
|
||||
$companyReference,
|
||||
$contactName,
|
||||
$contactEmail,
|
||||
$bookingMarking,
|
||||
$projectName,
|
||||
PerfexCRMProjectStatus::IN_PROGRESS,
|
||||
[],
|
||||
$tasks
|
||||
);
|
||||
UpdatePerfexCRM::dispatch($updatePerfexCRMObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,10 +12,13 @@ use App\Classes\Modules\PerfexCRM\Services\FetchesPerfexCRMTask;
|
||||
use App\Classes\Modules\PerfexCRM\Services\CreatesPerfexCRMCustomer;
|
||||
use App\Classes\Modules\PerfexCRM\Services\CreatesPerfexCRMCustomerContact;
|
||||
use App\Classes\Modules\PerfexCRM\Services\UpdatesPerfexCRMTask;
|
||||
use App\Classes\Modules\PerfexCRM\Services\UpdatesPerfexCRMCustomer;
|
||||
use App\Classes\Modules\PerfexCRM\Services\UpdatesPerfexCRMProject;
|
||||
use App\Classes\Modules\PerfexCRM\DataTransferObjects\CustomerContactObject;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Modules\PerfexCRM\DataTransferObjects\UpdatePerfexCRMObject;
|
||||
use App\Classes\ValueObjects\Constants\PerfexCRMStatus;
|
||||
use App\Classes\ValueObjects\Constants\PerfexCRMTaskStatus;
|
||||
use App\Classes\ValueObjects\Constants\PerfexCRMProjectStatus;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -52,6 +55,11 @@ class UpdatePerfexCRMProcessor
|
||||
/** @var UpdatesPerfexCRMTask */
|
||||
private $updatesPerfexCRMTask;
|
||||
|
||||
/** @var UpdatesPerfexCRMCustomer */
|
||||
private $updatesPerfexCRMCustomer;
|
||||
|
||||
/** @var UpdatesPerfexCRMProject */
|
||||
private $updatesPerfexCRMProject;
|
||||
|
||||
/**
|
||||
* @param ConvertsPerfexCRMLeadToCustomer $convertsPerfexCRMLeadToCustomer
|
||||
@@ -64,6 +72,8 @@ class UpdatePerfexCRMProcessor
|
||||
* @param CreatesPerfexCRMCustomer $createsPerfexCRMCustomer
|
||||
* @param CreatesPerfexCRMCustomerContact $createsPerfexCRMCustomerContact
|
||||
* @param UpdatesPerfexCRMTask $updatesPerfexCRMTask
|
||||
* @param UpdatesPerfexCRMCustomer $updatesPerfexCRMCustomer
|
||||
* @param UpdatesPerfexCRMProject $updatesPerfexCRMProject
|
||||
*/
|
||||
public function __construct(ConvertsPerfexCRMLeadToCustomer $convertsPerfexCRMLeadToCustomer,
|
||||
CreatesPerfexCRMCustomerProject $createsPerfexCRMCustomerProject,
|
||||
@@ -74,7 +84,9 @@ class UpdatePerfexCRMProcessor
|
||||
FetchesPerfexCRMTask $fetchesPerfexCRMTask,
|
||||
CreatesPerfexCRMCustomer $createsPerfexCRMCustomer,
|
||||
CreatesPerfexCRMCustomerContact $createsPerfexCRMCustomerContact,
|
||||
UpdatesPerfexCRMTask $updatesPerfexCRMTask)
|
||||
UpdatesPerfexCRMTask $updatesPerfexCRMTask,
|
||||
UpdatesPerfexCRMCustomer $updatesPerfexCRMCustomer,
|
||||
UpdatesPerfexCRMProject $updatesPerfexCRMProject)
|
||||
{
|
||||
$this->convertsPerfexCRMLeadToCustomer = $convertsPerfexCRMLeadToCustomer;
|
||||
$this->createsPerfexCRMCustomerProject = $createsPerfexCRMCustomerProject;
|
||||
@@ -86,10 +98,12 @@ class UpdatePerfexCRMProcessor
|
||||
$this->createsPerfexCRMCustomer = $createsPerfexCRMCustomer;
|
||||
$this->createsPerfexCRMCustomerContact = $createsPerfexCRMCustomerContact;
|
||||
$this->updatesPerfexCRMTask = $updatesPerfexCRMTask;
|
||||
$this->updatesPerfexCRMCustomer = $updatesPerfexCRMCustomer;
|
||||
$this->updatesPerfexCRMProject = $updatesPerfexCRMProject;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param PerfexCRMObject $perfexCRMObject
|
||||
* @param UpdatePerfexCRMObject $updatePerfexCRMObject
|
||||
* @return null|object
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
*/
|
||||
@@ -97,43 +111,100 @@ class UpdatePerfexCRMProcessor
|
||||
|
||||
// Customer has to exist first before Project can appear under it
|
||||
// Check with Perfex CRM, if this user (email) was previously a lead, should automatically now become a customer
|
||||
$crmCompany = $updatePerfexCRMObject->getCompanyName();
|
||||
$result = $this->convertsPerfexCRMLeadToCustomer->execute($updatePerfexCRMObject->getContactEmail());
|
||||
|
||||
if(isset($result->payload)){
|
||||
$crmClientId = $result->payload['client_id'];
|
||||
$crmClientId = $result->payload['client_id'];
|
||||
if (isset($result->payload['company'])) {
|
||||
$crmCompany = $result->payload['company'];
|
||||
}
|
||||
}
|
||||
else{
|
||||
//if reach this point, this means this user is not a official customer nor is a lead in crm
|
||||
//Create Customer has 2 parts: Create Company (client), Create Contact
|
||||
$result = $this->createsPerfexCRMCustomer->execute($crmCompany);
|
||||
if(is_null($result)){
|
||||
$crmCompany = $crmCompany." 2";
|
||||
$result = $this->createsPerfexCRMCustomer->execute($crmCompany);
|
||||
}
|
||||
$crmClientId = $result->payload['clientId'];
|
||||
|
||||
$customerContactObject = new CustomerContactObject(
|
||||
$crmClientId,
|
||||
$updatePerfexCRMObject->getContactName(),
|
||||
$updatePerfexCRMObject->getContactName(),
|
||||
$updatePerfexCRMObject->getContactEmail(),
|
||||
"pU^T@sC#9Q",
|
||||
"on",
|
||||
"on"
|
||||
);
|
||||
$result = $this->createsPerfexCRMCustomerContact->execute($customerContactObject);
|
||||
}
|
||||
|
||||
// Get existing or create project, project has to exist first before milestone can appear under it
|
||||
$result = $this->createsPerfexCRMCustomerProject->execute($updatePerfexCRMObject->getProjectName(), $crmClientId);
|
||||
if(isset($result->payload)){
|
||||
$projectId = $result->payload['project_id'];
|
||||
}
|
||||
else{
|
||||
$projectId = $this->fetchesPerfexCRMProject->execute($updatePerfexCRMObject->getProjectName(), $crmClientId)->id;
|
||||
}
|
||||
//Update custom fields to identify company reference from exchange or shipping portal
|
||||
$value_exists = false;
|
||||
if (isset($result->payload['customfields'])) {
|
||||
foreach ($result->payload['customfields'] as $element) {
|
||||
if ($element['value'] === $updatePerfexCRMObject->getCompanyReference()) {
|
||||
$value_exists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!$value_exists);
|
||||
{
|
||||
$result = $this->updatesPerfexCRMCustomer->execute($crmClientId, $crmCompany, $updatePerfexCRMObject->getCompanyReference());
|
||||
}
|
||||
|
||||
// Get existing or create milestone, milestone has to exist first before task can appear under it
|
||||
$result = $this->createsPerfexCRMMilestone->execute($updatePerfexCRMObject->getMilestoneName(), $projectId);
|
||||
if(isset($result->payload)){
|
||||
$milestoneId = $result->payload['milestone_id'];
|
||||
}
|
||||
else{
|
||||
$milestone = $this->fetchesPerfexCRMMilestone->execute($updatePerfexCRMObject->getMilestoneName(), $projectId);
|
||||
$array = json_decode(json_encode($milestone), true);
|
||||
$milestoneId = $array[0]['id'];
|
||||
}
|
||||
// Get existing or create project, project has to exist first before milestone can appear under it
|
||||
$result = $this->createsPerfexCRMCustomerProject->execute($updatePerfexCRMObject->getProjectName(), $updatePerfexCRMObject->getProjectStatus(), $crmClientId);
|
||||
if(isset($result->payload)){ //Here means project creation successful
|
||||
$projectId = $result->payload['project_id'];
|
||||
}
|
||||
else{
|
||||
$project = $this->fetchesPerfexCRMProject->execute($updatePerfexCRMObject->getProjectName(), $crmClientId);
|
||||
$projectId = $project->id;
|
||||
//if the project status is anything but PerfexCRMProjectStatus::NOT_STARTED, update the project
|
||||
if($updatePerfexCRMObject->getProjectStatus() != PerfexCRMProjectStatus::NOT_STARTED)
|
||||
{
|
||||
$this->updatesPerfexCRMProject->execute($project, $updatePerfexCRMObject->getProjectStatus());
|
||||
}
|
||||
}
|
||||
|
||||
// Get existing or create task
|
||||
$result = $this->createsPerfexCRMTask->execute($updatePerfexCRMObject->getTaskName(), $milestoneId, $projectId);
|
||||
if(isset($result->payload)){
|
||||
$taskId = $result->payload['task_id'];
|
||||
}
|
||||
else{
|
||||
$taskId = $this->fetchesPerfexCRMTask->execute($updatePerfexCRMObject->getTaskName(), $milestoneId)->id;
|
||||
}
|
||||
|
||||
$this->updatesPerfexCRMTask->execute($taskId, $updatePerfexCRMObject->getTaskName(), $milestoneId, $projectId, PerfexCRMStatus::COMPLETED);
|
||||
$tasks = $updatePerfexCRMObject->getTaskNames();
|
||||
if(count($tasks) > 0){
|
||||
|
||||
return null;
|
||||
//Create tasks with milestone
|
||||
for($count=0; $count < count($tasks); $count++) {
|
||||
$milestoneId = 0; //By default milestoneId is 0, having this set at individual task is optional
|
||||
if($tasks[$count]['milestone'] != "") //Create milestone only if it is defined
|
||||
{
|
||||
// Get existing or create milestone, milestone has to exist first before task can appear under it
|
||||
$result = $this->createsPerfexCRMMilestone->execute($tasks[$count]['milestone'], $projectId, $count);
|
||||
if(isset($result->payload)){
|
||||
$milestoneId = $result->payload['milestone_id'];
|
||||
}
|
||||
else{
|
||||
$milestone = $this->fetchesPerfexCRMMilestone->execute($tasks[$count]['milestone'], $projectId);
|
||||
$array = json_decode(json_encode($milestone), true);
|
||||
$milestoneId = $array[0]['id'];
|
||||
}
|
||||
}
|
||||
|
||||
$taskStatus = PerfexCRMTaskStatus::NOT_STARTED;
|
||||
if($tasks[$count]['status'] != ''){
|
||||
$taskStatus = $tasks[$count]['status'];
|
||||
}
|
||||
|
||||
// Get existing or create task
|
||||
$result = $this->createsPerfexCRMTask->execute($tasks[$count]['name'], $tasks[$count]['description'], '', $milestoneId, $projectId, $tasks[$count]['reference'], $tasks[$count]['on_task_completion'], $taskStatus);
|
||||
if(is_null($result)){
|
||||
break; //Breaking the rest of the tasks in array assuming that they are all created as a batch previously
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ class CreatesPerfexCRMCustomerProject
|
||||
* @return null|object
|
||||
* @throws MalformedRequestException
|
||||
*/
|
||||
public function execute(string $projectName, string $clientId) {
|
||||
public function execute(string $projectName, int $status, string $clientId) {
|
||||
try{
|
||||
$data = [
|
||||
'name' => $projectName,
|
||||
@@ -22,7 +22,7 @@ class CreatesPerfexCRMCustomerProject
|
||||
'billing_type' => 1,
|
||||
'clientid' => $clientId,
|
||||
'start_date' => date('Y-m-d'),
|
||||
'status' => 1
|
||||
'status' => $status
|
||||
];
|
||||
|
||||
$response = Http::asForm()->withHeaders([
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\PerfexCRM\Services;
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class UpdatesPerfexCRMProject
|
||||
{
|
||||
/**
|
||||
* @param $project
|
||||
* @param int $status
|
||||
* @return null|object
|
||||
* @throws MalformedRequestException
|
||||
*/
|
||||
public function execute($project, int $status) {
|
||||
try{
|
||||
$data = [
|
||||
'name' => $project->name,
|
||||
'clientid' => $project->clientid,
|
||||
// 'rel_type' => 'customer',
|
||||
'billing_type' => 1,
|
||||
'start_date' => $project->start_date,
|
||||
'status' => $status
|
||||
];
|
||||
|
||||
$response = Http::asJson()->withHeaders([
|
||||
'authtoken' => config('perfexcrm.api_key')])
|
||||
->put(config('perfexcrm.base_url').'/api/projects/'.$project->id, $data);
|
||||
|
||||
if($response->successful()){
|
||||
$data = $response->json();
|
||||
return (object) $data;
|
||||
}else{
|
||||
Log::error($response);
|
||||
return null;
|
||||
}
|
||||
}catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server: ' . $exception->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\ValueObjects\Constants;
|
||||
|
||||
final class PerfexCRMProjectStatus {
|
||||
|
||||
public const NOT_STARTED = 1;
|
||||
|
||||
public const IN_PROGRESS = 2;
|
||||
|
||||
public const ON_HOLD = 3;
|
||||
|
||||
public const FINISHED = 4;
|
||||
|
||||
public const CANCELLED = 5;
|
||||
}
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Classes\ValueObjects\Constants;
|
||||
|
||||
final class PerfexCRMStatus {
|
||||
final class PerfexCRMTaskStatus {
|
||||
|
||||
public const NOT_STARTED = 1;
|
||||
|
||||
@@ -11,7 +11,7 @@ final class PerfexCRMStatus {
|
||||
public const TESTING = 3;
|
||||
|
||||
public const IN_PROGRESS = 4;
|
||||
|
||||
|
||||
public const COMPLETED = 5;
|
||||
|
||||
}
|
||||
@@ -10,7 +10,7 @@ class PerfexCRMTasks
|
||||
'milestone' => 'MILESTONE 1 - Customer Paid',
|
||||
'reference' => '',
|
||||
'on_task_completion' => '',
|
||||
'status' => PerfexCRMStatus::COMPLETED
|
||||
'status' => PerfexCRMTaskStatus::COMPLETED
|
||||
];
|
||||
|
||||
public const TASK_1_DAY_TRANSFER_1 = [
|
||||
@@ -26,7 +26,7 @@ class PerfexCRMTasks
|
||||
'milestone' => '',
|
||||
'reference' => 'TASK_1_DAY_TRANSFER_1',
|
||||
'on_task_completion' => 'TASK_1_DAY_TRANSFER_2',
|
||||
'status' => PerfexCRMStatus::IN_PROGRESS
|
||||
'status' => PerfexCRMTaskStatus::IN_PROGRESS
|
||||
];
|
||||
public const TASK_1_DAY_TRANSFER_2 = [
|
||||
'name' => 'Approve Payment',
|
||||
@@ -119,7 +119,7 @@ class PerfexCRMTasks
|
||||
'milestone' => '',
|
||||
'reference' => 'TASK_3_DAY_TRANSFER_1',
|
||||
'on_task_completion' => 'TASK_3_DAY_TRANSFER_2',
|
||||
'status' => PerfexCRMStatus::IN_PROGRESS
|
||||
'status' => PerfexCRMTaskStatus::IN_PROGRESS
|
||||
];
|
||||
public const TASK_3_DAY_TRANSFER_2 = [
|
||||
'name' => 'Approve Payment',
|
||||
@@ -214,7 +214,7 @@ class PerfexCRMTasks
|
||||
'milestone' => '',
|
||||
'reference' => 'TASK_1688_PAYMENT_1',
|
||||
'on_task_completion' => 'TASK_1688_PAYMENT_2',
|
||||
'status' => PerfexCRMStatus::IN_PROGRESS
|
||||
'status' => PerfexCRMTaskStatus::IN_PROGRESS
|
||||
];
|
||||
public const TASK_1688_PAYMENT_2 = [
|
||||
'name' => 'Approve Payment',
|
||||
@@ -402,4 +402,54 @@ class PerfexCRMTasks
|
||||
'status' => ''
|
||||
];
|
||||
|
||||
|
||||
|
||||
public const TASK_PURCHASE_ORDER_1 = [
|
||||
'name' => 'Approve Purchase Order',
|
||||
'description' => '○ Purpose: To check that the customer submitted a purchase order that complies with our company’s guidelines.<br>
|
||||
○ Initial Status: In Progress<br>
|
||||
○ Deadline: Next day<br>
|
||||
○ Responsible department: Operation<br>
|
||||
○ Next step: Change the status of the Approve payment status to "In Progress" upon successful completion of the operation.<br>
|
||||
○ Additional details: ** Any specific requirements or notes for the operation.**<br>
|
||||
○ Dependencies: None<br>
|
||||
○ Outcomes: Bank transaction is mapped successfully, allowing the next steps in the process to be initiated.<br>',
|
||||
'milestone' => '',
|
||||
'reference' => 'TASK_PURCHASE_ORDER_1',
|
||||
'on_task_completion' => 'TASK_PURCHASE_ORDER_2',
|
||||
'status' => PerfexCRMTaskStatus::IN_PROGRESS
|
||||
];
|
||||
|
||||
public const TASK_PURCHASE_ORDER_2 = [
|
||||
'name' => 'Complete Order bookkeeping',
|
||||
'description' => '○ Purpose: To complete the bookkeeping for the booking.<br>
|
||||
○ Initial Status: Not Started<br>
|
||||
○ Deadline: Next day<br>
|
||||
○ Responsible department: Account<br>
|
||||
○ Next step: None<br>
|
||||
○ Additional details: ** Any specific requirements or notes for the operation.**<br>
|
||||
○ Dependencies: Approve Purchase Order and Upload China Bank Slip operation must be completed before this operation can begin.<br>
|
||||
○ Outcomes: A copy of the documents related to the booking should now all be in the google drive relevant folder.<br>',
|
||||
'milestone' => '',
|
||||
'reference' => 'TASK_PURCHASE_ORDER_2',
|
||||
'on_task_completion' => '',
|
||||
'status' => ''
|
||||
];
|
||||
|
||||
|
||||
public const TASK_IDENTIFICATION_1 = [
|
||||
'name' => 'Approve Identification Verification',
|
||||
'description' => '○ Purpose: To ensure the customer submit information matches the information in their identification document.<br>
|
||||
○ Initial Status: In Progress<br>
|
||||
○ Deadline: Same Day<br>
|
||||
○ Responsible department: Operation<br>
|
||||
○ Next step: None<br>
|
||||
○ Additional details: ** Any specific requirements or notes for the operation.**<br>
|
||||
○ Dependencies: None<br>
|
||||
○ Outcomes: Customer account identification is verified<br>',
|
||||
'milestone' => '',
|
||||
'reference' => 'TASK_IDENTIFICATION_1',
|
||||
'on_task_completion' => '',
|
||||
'status' => PerfexCRMTaskStatus::IN_PROGRESS
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user