From b15866ea1649c9ac2a08d4adf075ab8551e68cac Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Sun, 19 May 2024 23:47:00 +0800 Subject: [PATCH] Vue Polling - Remove comments in code --- app/Http/Resources/GroupForOrderV2Resource.php | 2 +- app/Http/Resources/TransactionResource.php | 2 +- app/Http/Resources/TransactionWithStorageResource.php | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Http/Resources/GroupForOrderV2Resource.php b/app/Http/Resources/GroupForOrderV2Resource.php index cfd2f121..69cce0ed 100644 --- a/app/Http/Resources/GroupForOrderV2Resource.php +++ b/app/Http/Resources/GroupForOrderV2Resource.php @@ -26,7 +26,7 @@ class GroupForOrderV2Resource extends JsonResource 'original_currency' => new CurrencyResource($this->original_currency), 'issuer_name' => $this->issuerCompany->name, 'issuer_id' => $this->issuerCompany->id, - 'amount' => (float) $this->amount, //cief todo: 58 + 'amount' => (float) $this->amount, 'service_charge' => (float) $this->amount, 'currency' => new CurrencyResource($this->currency), 'created_at' => Carbon::parse($this->created_at)->format('d-m-Y h:i:s A'), diff --git a/app/Http/Resources/TransactionResource.php b/app/Http/Resources/TransactionResource.php index 6a21f1d2..d8697f8a 100644 --- a/app/Http/Resources/TransactionResource.php +++ b/app/Http/Resources/TransactionResource.php @@ -52,7 +52,7 @@ class TransactionResource extends JsonResource 'documents' => $groupTransactions ? DocumentResource::collection($this->documents->where('status', ApprovalStatus::PENDING_VERIFICATION)) : DocumentResource::collection($this->documents), 'type' => (int) $this->type, 'bill_no' => $this->bill_no, - 'amount' => (double) $this->amount, //cief todo: 58 + 'amount' => (double) $this->amount, 'payment_method' => (int) $this->payment_method, 'payment_reference' => $this->payment_reference, 'outstanding' => (double) $this->amount - ($this->transactions()->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->sum('amount')), diff --git a/app/Http/Resources/TransactionWithStorageResource.php b/app/Http/Resources/TransactionWithStorageResource.php index fe71d674..dd307ad8 100644 --- a/app/Http/Resources/TransactionWithStorageResource.php +++ b/app/Http/Resources/TransactionWithStorageResource.php @@ -59,7 +59,7 @@ class TransactionWithStorageResource extends JsonResource if ($ts) { $paymentTransaction = Transaction::where('payment_reference', $ts->reference)->whereIn('status', [ApprovalStatus::PENDING_SUBMISSION])->first(); if($paymentTransaction){ - $groupTotalAmount = (double) $this->amount; //cief todo: 58 + $groupTotalAmount = (double) $this->amount; foreach ($group_payment_history as $key => $value) { if ($value->id === $ts->id && $value->reference === $ts->reference) { @@ -88,10 +88,10 @@ class TransactionWithStorageResource extends JsonResource 'documents' => $groupTransactions ? DocumentResource::collection($this->documents->where('status', ApprovalStatus::PENDING_VERIFICATION)) : DocumentResource::collection($this->documents), 'type' => (int) $this->type, 'bill_no' => $this->bill_no, - 'amount' => (double) $this->amount, //cief todo: 58 + 'amount' => (double) $this->amount, 'payment_method' => (int) $this->payment_method, 'payment_reference' => $this->payment_reference, - 'outstanding' => (double) $this->amount - ($this->transactions()->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->sum('amount')), //cief todo: 58 + 'outstanding' => (double) $this->amount - ($this->transactions()->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->sum('amount')), 'floating' => $group_payment_attempts ? $groupTotalAmount : (double) $this->transactions()->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::PENDING_SUBMISSION, ApprovalStatus::PENDING_VERIFICATION])->sum('amount'), 'service_charge' => (double) $this->service_charge, 'tax' => (double) $this->tax,