Recipient Bank Details to follow payment overriding the default attached to Booking

This commit is contained in:
Dillon Ngo
2024-08-07 06:46:17 +08:00
parent e80ad9a6ec
commit 3bd708ed0e
36 changed files with 1193 additions and 116 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ class CompanyResource extends JsonResource
'last_payment' => $lastPayment ? $lastPayment->created_at->diffForHumans() : 'No Payments',
'personal_banks' => BankResource::collection($this->banks->where('type', BankAccountType::PERSONAL)),
'recipient_banks' => [
'accounts' => BankResource::collection($this->banks->whereIn('type', [BankAccountType::EXTERNAL, BankAccountType::ALIPAY_1688, BankAccountType::ALIPAY_RECIPIENT])),
'accounts' => BankResource::collection($this->banks->whereIn('type', [BankAccountType::EXTERNAL, BankAccountType::ALIPAY_1688, BankAccountType::ALIPAY_RECIPIENT])->whereIn('creator_type', [null])),
'default' => new BankResource($this->banks->where('type', BankAccountType::EXTERNAL)->where('default', true)->first())
],
'segments' => SegmentResource::collection($this->segments),