mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-30 01:43:59 +00:00
update list all customer transactions
This commit is contained in:
@@ -5,6 +5,7 @@ namespace App\Http\Resources;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Models\Booking;
|
||||
use Carbon\Carbon;
|
||||
use App\Models\Wallet;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class PaymentTransactionResource extends JsonResource
|
||||
@@ -20,9 +21,19 @@ class PaymentTransactionResource extends JsonResource
|
||||
|
||||
$booking = in_array((int)$this->type, [TransactionType::BILL, TransactionType::REFUND])? $this->owner->owner : $this->owner;
|
||||
|
||||
$booking_marking = '';
|
||||
switch ($this->owner_type) {
|
||||
case Booking::class:
|
||||
$booking_marking = $booking->marking;
|
||||
break;
|
||||
case Wallet::class:
|
||||
$booking_marking = $this->booking->marking;
|
||||
break;
|
||||
}
|
||||
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'booking_marking' => $booking->marking,
|
||||
'booking_marking' => $booking_marking,
|
||||
'type' => (int) $this->type,
|
||||
'bill_no' => $this->bill_no,
|
||||
'payment_reference' => $this->payment_reference,
|
||||
|
||||
Reference in New Issue
Block a user