feat(events): associate purchases and integrations with events
This commit is contained in:
@@ -14,6 +14,7 @@ class PurchaseResponseLoader
|
||||
=== StorefrontWebsiteType::CHECKOUT_SUMMARY_EVENT;
|
||||
$relations = [
|
||||
'tenant',
|
||||
'event.attachment',
|
||||
'items.sourceCatalogItem.event.attachment',
|
||||
'stockReservation',
|
||||
];
|
||||
|
||||
@@ -206,6 +206,7 @@ class StartCheckoutService
|
||||
fn (array $line): float => $line['selection']->getPrice() * $line['quantity'],
|
||||
),
|
||||
$cart->getKey(),
|
||||
$cartItems->first()?->catalogItem?->event_id,
|
||||
);
|
||||
$cart->update(['current_purchase_id' => $purchase->getKey()]);
|
||||
$this->reservations->attachToPurchase($cart, $purchase, $this->checkoutExpiration());
|
||||
@@ -273,6 +274,7 @@ class StartCheckoutService
|
||||
$purchaseData,
|
||||
$cart->getTotalAmount(),
|
||||
$cart->getKey(),
|
||||
$cartItems->first()?->catalogItem?->event_id,
|
||||
);
|
||||
$cart->update(['current_purchase_id' => $purchase->getKey()]);
|
||||
$this->reservations->attachToPurchase($cart, $purchase, $this->checkoutExpiration());
|
||||
@@ -410,10 +412,12 @@ class StartCheckoutService
|
||||
array $purchaseData,
|
||||
float $total,
|
||||
?int $cartId,
|
||||
?int $eventId,
|
||||
): Purchase {
|
||||
return Purchase::query()->create([
|
||||
...$purchaseData,
|
||||
'cart_id' => $cartId,
|
||||
'event_id' => $eventId,
|
||||
'tenant_codigo' => $tenant->codigo,
|
||||
'user_id' => $userId,
|
||||
'status' => Purchase::STATUS_CREATED,
|
||||
|
||||
Reference in New Issue
Block a user