Jegyértékesítő platform
Jegyvásárlástól a beléptetésig és az utókommunikációig: webes rendszer fizetéssel, számlázással, mobil API-val és közösségi réteggel.
public function handle(): void
{
$order = Order::with(['billingAddress', 'user', 'items'])->find($this->orderId);
// On-site (POS) sales are invoiced through another flow and have no billing address.
if (Str::startsWith($order?->order_number ?? '', 'POS-')) {
return;
}
// What was actually paid is authoritative, not the list price of the items:
// a fully discounted order has total_amount = 0 and must not be invoiced.
if ((float) ($order?->total_amount ?? 0) <= 0) {
Log::info('Invoice skipped: order total is zero', ['order_id' => $this->orderId]);
return;
}
if (empty($order?->billingAddress)) {
Log::error('Invoice skipped: billing address is empty', ['order_id' => $this->orderId]);
return;
}
// ... build the invoice and hand it to the provider configured for this organiser
}