automatically complete tasks

This commit is contained in:
Omair Saleh
2023-06-15 06:07:13 +08:00
parent 1b43e4d1e3
commit c0dcdfd942
@@ -20,8 +20,8 @@ class TransactionToPerfexCRMProcessorV2
public function execute(Transaction $model, int $status)
{
try {
if($model->owner instanceof \App\Models\Booking) {
$bookingInfo = $this->extractBookingInfo($model);
if(in_array($model->type, [TransactionType::PAYMENT, TransactionType::BILL, TransactionType::PURCHASE_ORDER])) {
$bookingInfo = $this->extractBookingInfo($model->type === TransactionType::BILL ? $model->owner : $model);
$projectName = 'Exchange | ' . $bookingInfo['serviceTypeName'] . ' | ' . $bookingInfo['bookingMarking'];
$tasks = $this->defineTasks($model, $status);