Only generate BilletOrder for type=billet with isGeneratedBillet enabled

- Skip reservation_brocante and vote types
- Skip billets with isGeneratedBillet=false

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Serreau Jovann
2026-03-21 20:03:47 +01:00
parent 4ad694ed59
commit 2364abe0cf

View File

@@ -34,10 +34,15 @@ class BilletOrderService
public function generateOrderTickets(BilletBuyer $order): void
{
foreach ($order->getItems() as $item) {
$billet = $item->getBillet();
if (!$billet || 'billet' !== $billet->getType() || !$billet->isGeneratedBillet()) {
continue;
}
for ($i = 0; $i < $item->getQuantity(); ++$i) {
$ticket = new BilletOrder();
$ticket->setBilletBuyer($order);
$ticket->setBillet($item->getBillet());
$ticket->setBillet($billet);
$ticket->setBilletName($item->getBilletName());
$ticket->setUnitPriceHT($item->getUnitPriceHT());
$ticket->setSecurityKey(BilletOrder::generateSecurityKey($ticket->getReference(), $this->appSecret));