update refund ui and logic

This commit is contained in:
edmondlang
2024-02-16 14:59:11 +08:00
parent ddcad4969e
commit f083434390
13 changed files with 208 additions and 146 deletions
@@ -45,6 +45,7 @@ class TransactionResource extends JsonResource
'transaction_refunds' => TransactionResource::collection($this->when((int) $this->type === TransactionType::PAYMENT, $this->transactions()->refunds()->get())),
'expires_on' => Carbon::parse($this->expires_on)->format('d-m-Y h:i:s A'),
'updated_at' => Carbon::parse($this->updated_at)->format('d-m-Y h:i:s A'),
'created_at' => Carbon::parse($this->created_at)->format('d-m-Y h:i:s A'),
'interval' => [
'value' => $days->gt(Carbon::now()) ? '+' : '-',
'duration' => $days->diff(Carbon::now())->format('%d'),