refactor(backend): reorganize domains into Core, Commerce, Ticketing and Shared
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domains\Purchase\Services\Checkout;
|
||||
|
||||
use App\Domains\Purchase\Models\Purchase;
|
||||
|
||||
class PurchaseResponseLoader
|
||||
{
|
||||
public function load(Purchase $purchase): Purchase
|
||||
{
|
||||
$relations = ['tenant', 'items.imageAttachment', 'stockReservation'];
|
||||
|
||||
if (
|
||||
$purchase->status === Purchase::STATUS_IN_REVIEW
|
||||
&& $purchase->payment_method === 'transfer'
|
||||
) {
|
||||
$relations[] = 'telepagosPaymentCandidates.payment';
|
||||
}
|
||||
|
||||
return $purchase->load($relations);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user