mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
Merge branch 'dillon/44-customer-satisfaction-feedback-project-b' into 'master'
Preparation for help menu See merge request CIEFWorldwideSdnBhd/shipping-portal!175
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Exceptions;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\HttpStatus;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
final class ConnectionErrorException extends ServiceApiException {
|
||||
public function __construct(?string $message = null, ?string $exceptionMessage = null, ?string $payload = null, ?string $exceptionTrace = null) {
|
||||
Log::error($message. ": ". $exceptionMessage);
|
||||
if($payload){
|
||||
Log::error('Payload: '.$payload);
|
||||
}
|
||||
if($exceptionTrace){
|
||||
Log::error($exceptionTrace);
|
||||
}
|
||||
parent::__construct($message ?? 'A connection error has occurred. Please check application logs for more information.',
|
||||
HttpStatus::SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
@@ -75,7 +75,8 @@ class UpdateNextQuestionQALogic extends AbstractControllerLogic
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
* @throws ErrorException
|
||||
* @throws MalformedRequestException
|
||||
* @throws ResourceNotFoundException
|
||||
*/
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
|
||||
@@ -25,6 +25,14 @@ class DeleteAnswerQAProcessor
|
||||
$this->listsHelpMenuUserAnswerSelected = $listsHelpMenuUserAnswerSelected;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $userId
|
||||
* @param int $questionId
|
||||
* @param Request $request
|
||||
* @return void
|
||||
* @throws ResourceNotFoundException
|
||||
*/
|
||||
public function execute($userId, $questionId, $request){
|
||||
if ($request->has('isPrevious')) {
|
||||
//Get current and previous question's answer
|
||||
|
||||
@@ -23,7 +23,7 @@ class FetchFirstQuestionQAProcessor
|
||||
|
||||
public function execute(Request $request){
|
||||
try {
|
||||
$query = $this->fetchesHelpMenuQuestion->execute(['questionnaire_set_id' => 1]);
|
||||
$query = $this->fetchesHelpMenuQuestion->execute(['questionnaire_set_id' => $request->route('set_id')]);
|
||||
return $query;
|
||||
} catch (\Exception $exception){
|
||||
throw new ErrorException($exception->getMessage(), $exception->getCode());
|
||||
|
||||
@@ -38,6 +38,7 @@ class FetchNextQuestionQAProcessor
|
||||
$nextQuestionNumber = 0;
|
||||
$nextNestedQuestion = 0;
|
||||
$nextMainQuestion= 0;
|
||||
$questionnaireSetId = 0;
|
||||
$currentQuestion = $request->question;
|
||||
$questionType = QAType::DEFAULT;
|
||||
$returnQuestion = null;
|
||||
@@ -48,7 +49,9 @@ class FetchNextQuestionQAProcessor
|
||||
$questionType = $currentQuestion['question_type'];
|
||||
$nextNestedQuestion = $currentQuestion['next_nested_question'];
|
||||
$nextMainQuestion = $currentQuestion['next_main_question'];
|
||||
$questionnaireSetId = $currentQuestion['questionnaire_set_id'];
|
||||
}
|
||||
|
||||
if ($request->has('answerObj')) {
|
||||
$nextQuestionNumber = $request->answerObj['next_question_number'];
|
||||
}
|
||||
@@ -58,7 +61,7 @@ class FetchNextQuestionQAProcessor
|
||||
$previousAnswer = $this->listsHelpMenuUserAnswerSelected->execute(['user_id' => $userId, 'order_by' => (object)['column' => 'id','DESC' => true]])[0];
|
||||
|
||||
//Get previous question
|
||||
$previousQuestion = $this->fetchesHelpMenuQuestion->execute(['questionnaire_set_id' => 1, 'id' => $previousAnswer['question_id']]);
|
||||
$previousQuestion = $this->fetchesHelpMenuQuestion->execute(['questionnaire_set_id' => $questionnaireSetId, 'id' => $previousAnswer['question_id']]);
|
||||
$returnQuestion = $previousQuestion;
|
||||
}
|
||||
else{
|
||||
@@ -79,11 +82,11 @@ class FetchNextQuestionQAProcessor
|
||||
$returnQuestion = null;
|
||||
}
|
||||
else if($question_number != 0){
|
||||
$nextQuestion = $this->fetchesHelpMenuQuestion->execute(['questionnaire_set_id' => 1, 'question_number' => $question_number]);
|
||||
$nextQuestion = $this->fetchesHelpMenuQuestion->execute(['questionnaire_set_id' => $questionnaireSetId, 'question_number' => $question_number]);
|
||||
$returnQuestion = $nextQuestion;
|
||||
}
|
||||
else if (array_key_exists('id', $request->input('question'))) {
|
||||
$nextQuestion = $this->fetchesHelpMenuQuestion->execute(['questionnaire_set_id' => 1, 'id_next' => $questionId, 'next_main_question' => null]);
|
||||
$nextQuestion = $this->fetchesHelpMenuQuestion->execute(['questionnaire_set_id' => $questionnaireSetId, 'id_next' => $questionId, 'next_main_question' => null]);
|
||||
$returnQuestion = $nextQuestion;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\PerfexCRM\Services;
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Exceptions\ConnectionErrorException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class ConvertsPerfexCRMLeadToCustomer
|
||||
@@ -27,8 +28,13 @@ class ConvertsPerfexCRMLeadToCustomer
|
||||
Log::error('ConvertsPerfexCRMLeadToCustomer: '.$response);
|
||||
return null;
|
||||
}
|
||||
}catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server' . $exception->getMessage());
|
||||
}
|
||||
catch(\Illuminate\Http\Client\ConnectionException $exception){
|
||||
$error = 'Failed to connect to CRM';
|
||||
throw new ConnectionErrorException($error, $exception->getMessage(), $email, $exception->getTraceAsString());
|
||||
}
|
||||
catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server: ' . $exception->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\PerfexCRM\Services;
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Exceptions\ConnectionErrorException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class CreatesPerfexCRMCustomer
|
||||
@@ -30,8 +31,13 @@ class CreatesPerfexCRMCustomer
|
||||
Log::error('CreatesPerfexCRMCustomer: '.$response);
|
||||
return null;
|
||||
}
|
||||
}catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server' . $exception->getMessage());
|
||||
}
|
||||
catch(\Illuminate\Http\Client\ConnectionException $exception){
|
||||
$error = 'Failed to connect to CRM';
|
||||
throw new ConnectionErrorException($error, $exception->getMessage(), $companyName, $exception->getTraceAsString());
|
||||
}
|
||||
catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server: ' . $exception->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace App\Classes\Modules\PerfexCRM\Services;
|
||||
use App\Classes\Modules\PerfexCRM\DataTransferObjects\CustomerContactObject;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Exceptions\ConnectionErrorException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class CreatesPerfexCRMCustomerContact
|
||||
@@ -37,8 +38,13 @@ class CreatesPerfexCRMCustomerContact
|
||||
Log::error('CreatesPerfexCRMCustomerContact: '.$response);
|
||||
return null;
|
||||
}
|
||||
}catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server' . $exception->getMessage());
|
||||
}
|
||||
catch(\Illuminate\Http\Client\ConnectionException $exception){
|
||||
$error = 'Failed to connect to CRM';
|
||||
throw new ConnectionErrorException($error, $exception->getMessage(), "", $exception->getTraceAsString());
|
||||
}
|
||||
catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server: ' . $exception->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\PerfexCRM\Services;
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Exceptions\ConnectionErrorException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class CreatesPerfexCRMCustomerProject
|
||||
@@ -36,8 +37,13 @@ class CreatesPerfexCRMCustomerProject
|
||||
Log::error('CreatesPerfexCRMCustomerProject: '.$response);
|
||||
return null;
|
||||
}
|
||||
}catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server' . $exception->getMessage());
|
||||
}
|
||||
catch(\Illuminate\Http\Client\ConnectionException $exception){
|
||||
$error = 'Failed to connect to CRM';
|
||||
throw new ConnectionErrorException($error, $exception->getMessage(), "", $exception->getTraceAsString());
|
||||
}
|
||||
catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server: ' . $exception->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\PerfexCRM\Services;
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Exceptions\ConnectionErrorException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use App\Classes\Modules\PerfexCRM\DataTransferObjects\InvoicePerfexCRMObject;
|
||||
|
||||
@@ -56,8 +57,13 @@ class CreatesPerfexCRMInvoice
|
||||
Log::error('CreatesPerfexCRMInvoice: '.$response);
|
||||
return null;
|
||||
}
|
||||
}catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server' . $exception->getMessage());
|
||||
}
|
||||
catch(\Illuminate\Http\Client\ConnectionException $exception){
|
||||
$error = 'Failed to connect to CRM';
|
||||
throw new ConnectionErrorException($error, $exception->getMessage(), "", $exception->getTraceAsString());
|
||||
}
|
||||
catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server: ' . $exception->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\PerfexCRM\Services;
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Exceptions\ConnectionErrorException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use App\Classes\Modules\PerfexCRM\DataTransferObjects\InvoicePaymentPerfexCRMObject;
|
||||
|
||||
@@ -36,8 +37,13 @@ class CreatesPerfexCRMInvoicePayment
|
||||
Log::error('CreatesPerfexCRMInvoicePayment: '.$response);
|
||||
return null;
|
||||
}
|
||||
}catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server' . $exception->getMessage());
|
||||
}
|
||||
catch(\Illuminate\Http\Client\ConnectionException $exception){
|
||||
$error = 'Failed to connect to CRM';
|
||||
throw new ConnectionErrorException($error, $exception->getMessage(), "", $exception->getTraceAsString());
|
||||
}
|
||||
catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server: ' . $exception->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\PerfexCRM\Services;
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Exceptions\ConnectionErrorException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use App\Classes\Modules\PerfexCRM\DataTransferObjects\CreateLeadPerfexCRMObject;
|
||||
|
||||
@@ -43,8 +44,13 @@ class CreatesPerfexCRMLead
|
||||
Log::error('CreatesPerfexCRMLead: '.$response);
|
||||
return null;
|
||||
}
|
||||
}catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server ' . $exception->getMessage());
|
||||
}
|
||||
catch(\Illuminate\Http\Client\ConnectionException $exception){
|
||||
$error = 'Failed to connect to CRM';
|
||||
throw new ConnectionErrorException($error, $exception->getMessage(), "", $exception->getTraceAsString());
|
||||
}
|
||||
catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server: ' . $exception->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\PerfexCRM\Services;
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Exceptions\ConnectionErrorException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class CreatesPerfexCRMMilestone
|
||||
@@ -39,8 +40,13 @@ class CreatesPerfexCRMMilestone
|
||||
Log::error('CreatesPerfexCRMMilestone: '.$response);
|
||||
return null;
|
||||
}
|
||||
}catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server' . $exception->getMessage());
|
||||
}
|
||||
catch(\Illuminate\Http\Client\ConnectionException $exception){
|
||||
$error = 'Failed to connect to CRM';
|
||||
throw new ConnectionErrorException($error, $exception->getMessage(), "", $exception->getTraceAsString());
|
||||
}
|
||||
catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server: ' . $exception->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\PerfexCRM\Services;
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Exceptions\ConnectionErrorException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class CreatesPerfexCRMSupportTicket
|
||||
@@ -36,9 +37,15 @@ class CreatesPerfexCRMSupportTicket
|
||||
Log::error($response);
|
||||
return null;
|
||||
}
|
||||
}catch(\Exception $exception){
|
||||
$error = 'Support Ticket creation failed: ' . $exception->getMessage();
|
||||
Log::error($error.'\nPayload to create ticket: '.json_encode($data));
|
||||
}
|
||||
catch(\Illuminate\Http\Client\ConnectionException $exception){
|
||||
$error = 'Failed to connect to CRM';
|
||||
throw new ConnectionErrorException($error, $exception->getMessage(), "", $exception->getTraceAsString());
|
||||
}
|
||||
catch(\Exception $exception){
|
||||
$error = 'Support Ticket creation failed';
|
||||
Log::error($error. ": ". $exception->getMessage());
|
||||
Log::error('Payload: '.json_encode($data));
|
||||
throw new MalformedRequestException($error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\PerfexCRM\Services;
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Exceptions\ConnectionErrorException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use App\Classes\ValueObjects\Constants\PerfexCRMCustomFields;
|
||||
use App\Classes\Modules\PerfexCRM\DataTransferObjects\CreateTaskPerfexCRMObject;
|
||||
@@ -60,8 +61,13 @@ class CreatesPerfexCRMTask
|
||||
Log::error('CreatesPerfexCRMTask: '.$response);
|
||||
return null;
|
||||
}
|
||||
}catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server' . $exception->getMessage());
|
||||
}
|
||||
catch(\Illuminate\Http\Client\ConnectionException $exception){
|
||||
$error = 'Failed to connect to CRM';
|
||||
throw new ConnectionErrorException($error, $exception->getMessage(), "", $exception->getTraceAsString());
|
||||
}
|
||||
catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server: ' . $exception->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\PerfexCRM\Services;
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Exceptions\ConnectionErrorException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class FetchesPerfexCRMCustomer
|
||||
@@ -27,8 +28,15 @@ class FetchesPerfexCRMCustomer
|
||||
Log::error('FetchesPerfexCRMCustomer: '.$response);
|
||||
return null;
|
||||
}
|
||||
}catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server: ' . $exception->getMessage());
|
||||
}
|
||||
catch(\Illuminate\Http\Client\ConnectionException $exception){
|
||||
$error = 'Failed to connect to CRM';
|
||||
throw new ConnectionErrorException($error, $exception->getMessage(), $email, $exception->getTraceAsString());
|
||||
}
|
||||
catch(\Exception $exception){
|
||||
$error = 'Unable to get correct response from Perfex CRM server: ' . $exception->getMessage();
|
||||
Log::error($error);
|
||||
throw new MalformedRequestException($error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\PerfexCRM\Services;
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Exceptions\ConnectionErrorException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class FetchesPerfexCRMInvoice
|
||||
@@ -29,7 +30,12 @@ class FetchesPerfexCRMInvoice
|
||||
Log::error('FetchesPerfexCRMInvoice: '.$response);
|
||||
return null;
|
||||
}
|
||||
}catch(\Exception $exception){
|
||||
}
|
||||
catch(\Illuminate\Http\Client\ConnectionException $exception){
|
||||
$error = 'Failed to connect to CRM';
|
||||
throw new ConnectionErrorException($error, $exception->getMessage(), "", $exception->getTraceAsString());
|
||||
}
|
||||
catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server: ' . $exception->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\PerfexCRM\Services;
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Exceptions\ConnectionErrorException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class FetchesPerfexCRMLead
|
||||
@@ -27,7 +28,12 @@ class FetchesPerfexCRMLead
|
||||
Log::error('FetchesPerfexCRMLead: '.$response);
|
||||
return null;
|
||||
}
|
||||
}catch(\Exception $exception){
|
||||
}
|
||||
catch(\Illuminate\Http\Client\ConnectionException $exception){
|
||||
$error = 'Failed to connect to CRM';
|
||||
throw new ConnectionErrorException($error, $exception->getMessage(), $email, $exception->getTraceAsString());
|
||||
}
|
||||
catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server: ' . $exception->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\PerfexCRM\Services;
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Exceptions\ConnectionErrorException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class FetchesPerfexCRMMilestone
|
||||
@@ -33,8 +34,13 @@ class FetchesPerfexCRMMilestone
|
||||
Log::error('FetchesPerfexCRMMilestone: '.$response);
|
||||
return null;
|
||||
}
|
||||
}catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server' . $exception->getMessage());
|
||||
}
|
||||
catch(\Illuminate\Http\Client\ConnectionException $exception){
|
||||
$error = 'Failed to connect to CRM';
|
||||
throw new ConnectionErrorException($error, $exception->getMessage(), "", $exception->getTraceAsString());
|
||||
}
|
||||
catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server: ' . $exception->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\PerfexCRM\Services;
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Exceptions\ConnectionErrorException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class FetchesPerfexCRMProject
|
||||
@@ -33,8 +34,13 @@ class FetchesPerfexCRMProject
|
||||
Log::error('FetchesPerfexCRMProject: '.$response);
|
||||
return null;
|
||||
}
|
||||
}catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server' . $exception->getMessage());
|
||||
}
|
||||
catch(\Illuminate\Http\Client\ConnectionException $exception){
|
||||
$error = 'Failed to connect to CRM';
|
||||
throw new ConnectionErrorException($error, $exception->getMessage(), "", $exception->getTraceAsString());
|
||||
}
|
||||
catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server: ' . $exception->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\PerfexCRM\Services;
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Exceptions\ConnectionErrorException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use App\Classes\General\Helper;
|
||||
|
||||
@@ -47,8 +48,13 @@ class FetchesPerfexCRMTask
|
||||
Helper::debugLogger($response);
|
||||
return null;
|
||||
}
|
||||
}catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server' . $exception->getMessage());
|
||||
}
|
||||
catch(\Illuminate\Http\Client\ConnectionException $exception){
|
||||
$error = 'Failed to connect to CRM';
|
||||
throw new ConnectionErrorException($error, $exception->getMessage(), "", $exception->getTraceAsString());
|
||||
}
|
||||
catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server: ' . $exception->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\PerfexCRM\Services;
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Exceptions\ConnectionErrorException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use App\Classes\ValueObjects\Constants\PerfexCRMCustomFields;
|
||||
use App\Classes\General\Helper;
|
||||
@@ -41,8 +42,13 @@ class UpdatesPerfexCRMCustomer
|
||||
// Helper::debugLogger($response);
|
||||
return null;
|
||||
}
|
||||
}catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server' . $exception->getMessage());
|
||||
}
|
||||
catch(\Illuminate\Http\Client\ConnectionException $exception){
|
||||
$error = 'Failed to connect to CRM';
|
||||
throw new ConnectionErrorException($error, $exception->getMessage(), "", $exception->getTraceAsString());
|
||||
}
|
||||
catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server: ' . $exception->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\PerfexCRM\Services;
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Exceptions\ConnectionErrorException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class UpdatesPerfexCRMInvoice
|
||||
@@ -63,7 +64,12 @@ class UpdatesPerfexCRMInvoice
|
||||
Log::error('UpdatesPerfexCRMInvoice: '.$response);
|
||||
return null;
|
||||
}
|
||||
}catch(\Exception $exception){
|
||||
}
|
||||
catch(\Illuminate\Http\Client\ConnectionException $exception){
|
||||
$error = 'Failed to connect to CRM';
|
||||
throw new ConnectionErrorException($error, $exception->getMessage(), "", $exception->getTraceAsString());
|
||||
}
|
||||
catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server: ' . $exception->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\PerfexCRM\Services;
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Exceptions\ConnectionErrorException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use App\Classes\ValueObjects\Constants\PerfexCRMCustomFields;
|
||||
|
||||
@@ -44,7 +45,12 @@ class UpdatesPerfexCRMLead
|
||||
Log::error('UpdatesPerfexCRMLead: '.$response);
|
||||
return null;
|
||||
}
|
||||
}catch(\Exception $exception){
|
||||
}
|
||||
catch(\Illuminate\Http\Client\ConnectionException $exception){
|
||||
$error = 'Failed to connect to CRM';
|
||||
throw new ConnectionErrorException($error, $exception->getMessage(), "", $exception->getTraceAsString());
|
||||
}
|
||||
catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server: ' . $exception->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\PerfexCRM\Services;
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Exceptions\ConnectionErrorException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class UpdatesPerfexCRMProject
|
||||
@@ -36,7 +37,12 @@ class UpdatesPerfexCRMProject
|
||||
Log::error('UpdatesPerfexCRMProject: '.$response);
|
||||
return null;
|
||||
}
|
||||
}catch(\Exception $exception){
|
||||
}
|
||||
catch(\Illuminate\Http\Client\ConnectionException $exception){
|
||||
$error = 'Failed to connect to CRM';
|
||||
throw new ConnectionErrorException($error, $exception->getMessage(), "", $exception->getTraceAsString());
|
||||
}
|
||||
catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server: ' . $exception->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\PerfexCRM\Services;
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Exceptions\ConnectionErrorException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class UpdatesPerfexCRMTask
|
||||
@@ -41,8 +42,13 @@ class UpdatesPerfexCRMTask
|
||||
Log::error('UpdatesPerfexCRMTask: '.$response);
|
||||
return null;
|
||||
}
|
||||
}catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server' . $exception->getMessage());
|
||||
}
|
||||
catch(\Illuminate\Http\Client\ConnectionException $exception){
|
||||
$error = 'Failed to connect to CRM';
|
||||
throw new ConnectionErrorException($error, $exception->getMessage(), "", $exception->getTraceAsString());
|
||||
}
|
||||
catch(\Exception $exception){
|
||||
throw new MalformedRequestException('Unable to get correct response from Perfex CRM server: ' . $exception->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<div class="parentContainer">
|
||||
<div class="floating-button">
|
||||
<button class="requestModal round-button" data-type="helpMenu">
|
||||
<i class="fa fa-info"></i>
|
||||
<span class="beta-label">Beta</span>
|
||||
</button>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="helpMenu">
|
||||
<help-menu-form-component></help-menu-form-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.floating-button {
|
||||
position: fixed;
|
||||
z-index: 9999;
|
||||
bottom: 95px;
|
||||
right: 24px;
|
||||
}
|
||||
|
||||
|
||||
.round-button {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
background-color: #007bff;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 50%;
|
||||
font-size: 24px;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.round-button:hover {
|
||||
background-color: #0056b3;
|
||||
}
|
||||
|
||||
.beta-label {
|
||||
position: absolute;
|
||||
top: 44px;
|
||||
left: 88%;
|
||||
transform: translateX(-50%);
|
||||
background-color: #ffee00;
|
||||
color: black;
|
||||
padding: 0px 4px;
|
||||
border-radius: 5px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
@media (max-height: 600px) {
|
||||
.floating-button {
|
||||
bottom: 85px;
|
||||
right: 14px;
|
||||
}
|
||||
|
||||
.round-button {
|
||||
width: 54px;
|
||||
height: 54px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -77,16 +77,6 @@
|
||||
<script>
|
||||
import { required } from "vuelidate/lib/validators";
|
||||
export default {
|
||||
props: {
|
||||
data:{
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
module_type: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
section: 'helpMenuForm',
|
||||
@@ -132,7 +122,7 @@
|
||||
},
|
||||
methods: {
|
||||
fetchFirstQuestion(){
|
||||
this.submit(route('api.helpmenu.first.question'), 'get', this.section, false, false);
|
||||
this.submit(route('api.helpmenu.first.question', 4), 'get', this.section, false, false);
|
||||
},
|
||||
successHandler(response){
|
||||
this.$store.dispatch('completeList', {'name': this.section, 'data': []});
|
||||
@@ -144,7 +134,8 @@
|
||||
}
|
||||
},
|
||||
errorHandler(error){
|
||||
this.error = error.message;
|
||||
// this.error = error.message;
|
||||
this.error = 'We are sorry, something went wrong. Please contact us via live chat.';
|
||||
},
|
||||
submitForm(direction) {
|
||||
this.parameters = {}
|
||||
@@ -173,7 +164,7 @@
|
||||
else{
|
||||
if(this.question.is_end){
|
||||
if(this.question.question_type === 5){
|
||||
this.submit(this.route('api.helpmenu.next.question'), 'post', this.section, true, true);
|
||||
this.submit(this.route('api.helpmenu.next.question'), 'post', this.section, false, false);
|
||||
this.closeModal();
|
||||
this.reset();
|
||||
}
|
||||
@@ -192,7 +183,7 @@
|
||||
}
|
||||
}
|
||||
else{
|
||||
this.submit(this.route('api.helpmenu.next.question'), 'post', this.section, true, true);
|
||||
this.submit(this.route('api.helpmenu.next.question'), 'post', this.section, false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -200,7 +191,7 @@
|
||||
this.formTouched = false;
|
||||
this.parameters.question = this.question;
|
||||
this.parameters.isPrevious = true;
|
||||
this.submit(this.route('api.helpmenu.next.question'), 'post', this.section, true, true);
|
||||
this.submit(this.route('api.helpmenu.next.question'), 'post', this.section, false, false);
|
||||
}
|
||||
},
|
||||
reset() {
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<change-order-number-form-component :section="section" :data="order"></change-order-number-form-component>
|
||||
</modal-component>
|
||||
<!-- <modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="helpMenu">
|
||||
<help-menu-form-component module_type="Order" :data="order"></help-menu-form-component>
|
||||
<help-menu-form-component></help-menu-form-component>
|
||||
</modal-component> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<change-order-number-form-component :section="section" :data="order"></change-order-number-form-component>
|
||||
</modal-component>
|
||||
<!-- <modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="helpMenu">
|
||||
<help-menu-form-component module_type="Order" :data="order"></help-menu-form-component>
|
||||
<help-menu-form-component></help-menu-form-component>
|
||||
</modal-component> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -99,6 +99,7 @@
|
||||
</div>
|
||||
</div>
|
||||
@include('partials.footer')
|
||||
<!-- @include('partials.helpmenu') -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<help-menu-component></help-menu-component>
|
||||
@@ -3,7 +3,7 @@
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::group(['prefix' => 'helpmenu', 'as' => 'helpmenu.', 'namespace' => 'HelpMenu'], function () {
|
||||
Route::get('/question', 'FetchQuestionQAController@fetch')->name('first.question');
|
||||
Route::get('/question/{set_id}', 'FetchQuestionQAController@fetch')->name('first.question');
|
||||
Route::post('/question', 'UpdateNextQuestionQAController@fetch')->name('next.question');
|
||||
Route::post('/generate', 'GenerateFeedbackUrlController@generate')->name('feedback.url.generate');
|
||||
Route::get('/list', 'ListQuestionsAnswersQAController@list')->name('list.questions.answers');
|
||||
|
||||
Reference in New Issue
Block a user