Admin Workflow - Fix new unclear workflow requirement

This commit is contained in:
Dillon Ngo
2025-02-25 10:44:38 +08:00
parent cc558b0af9
commit 3b0f81c842
2 changed files with 16 additions and 19 deletions
@@ -104,17 +104,15 @@ class FetchNextQuestionV1AdminWFProcessor
if($question_number !== ""){
//Check if question exists
$questions = $this->listsQuestions->execute(['questionnaire_set_id' => $questionnaireSetId, 'question_number' => $question_number]);
if($previousAnswer['answer'] === '1688_underpaid_overpaid' && count($questions) == 0){
if($previousAnswer['answer'] === '1688_order_verified' && count($questions) == 0){
$questionMetadata = $questionContext['questionMetadata'] ?? null;
// $processed = round((floatval($questionMetadata['amount_processed']) + PHP_FLOAT_EPSILON) * 1000) / 1000;
// $amount = round((floatval($questionMetadata['amount']) + PHP_FLOAT_EPSILON) * 1000) / 1000;
$processed = $questionMetadata['amount_processed'];
$amount = $questionMetadata['amount'];
$wallet = $booking->company->wallets()->first();
$walletAmount = $wallet->amount;
if ($processed === $amount) {
$question_number = '1688_order_paid_precisely';
$question_number = '1688_proceed_order';
}
else if ($processed < $amount) {
$outstanding = $this->calculatesBookingOutstanding->execute($booking) + $this->calculatesBookingRefundAmount->execute($booking, $booking->fix_currency_id);
@@ -126,7 +124,6 @@ class FetchNextQuestionV1AdminWFProcessor
$underpay = $configurations->getTotal();
if($underpay > round($outstanding, 2)) {
// throw new MalformedRequestException('Your payment must not be greater than '. $outstanding .'.');
$question_number = '1688_underpaid_order_3';
}
else if($walletAmount > $underpay) {