mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-09-01 19:04:00 +00:00
dmin Workflow - Fix Reported Issues - Automatically deduct funds from customer wallet when customer underpaid
This commit is contained in:
@@ -26,10 +26,13 @@ class SaveAnswerV1AdminWFProcessor
|
||||
/**
|
||||
* @return QAUserAnswerSelected|\Illuminate\Database\Eloquent\Model
|
||||
*/
|
||||
public function execute($userId, $sourceId, $questionId, $questionType, $questionMetadata, $answerInText, $answerOptionId, $filesUpload, $timeUsedSeconds, $isPrevious, $reference = null){
|
||||
public function execute($userId, $sourceId, $currentQuestion, $questionMetadata, $answerInText, $answerOptionId, $filesUpload, $timeUsedSeconds, $isPrevious, $reference = null){
|
||||
|
||||
$answer = null;
|
||||
$attachments = [];
|
||||
$questionId = $currentQuestion['id'];
|
||||
$questionType = $currentQuestion['question_type'];
|
||||
$questionNumber = $currentQuestion['question_number'];
|
||||
|
||||
if(is_null($answer))
|
||||
{
|
||||
@@ -89,8 +92,15 @@ class SaveAnswerV1AdminWFProcessor
|
||||
];
|
||||
$answer->answer = json_encode($structuredAnswer);
|
||||
}
|
||||
else if($questionType === QAType::FLOAT_MONEY){
|
||||
$answer->answer = floatval(str_replace(',', '', $answerInText));
|
||||
}
|
||||
else {
|
||||
$answer->answer = $answerInText;
|
||||
|
||||
if($questionNumber === '1688_underpaid_order_1_proceed' || $questionNumber === '1688_underpaid_order_1'){
|
||||
$answer->answer = $questionMetadata['amount_to_be_deducted'];
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user