feat: Merge PDF ticket generation functionality from feat/pdf-ticket branch

- Add TicketPdfGenerator service for creating PDF tickets with QR codes
- Implement download_ticket action in TicketsController
- Update ticket routes to support both ID and QR code access
- Add to_pdf method to Ticket model using TicketPdfGenerator
- Resolve conflicts between email notifications and PDF ticket features
- Maintain backward compatibility with existing QR code routes

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
kbe
2025-09-06 20:51:06 +02:00
5 changed files with 62 additions and 18 deletions

View File

@@ -32,13 +32,18 @@ class TicketPdfGenerator
# Ticket info box
pdf.stroke_color "E5E7EB"
pdf.fill_color "F9FAFB"
pdf.rounded_rectangle [ 0, pdf.cursor ], 310, 120, 10
pdf.rounded_rectangle [ 0, pdf.cursor ], 310, 150, 10
pdf.fill_and_stroke
pdf.move_down 10
pdf.fill_color "000000"
pdf.font "Helvetica", size: 12
# Customer name
pdf.text "Ticket Holder:", style: :bold
pdf.text "#{ticket.first_name} #{ticket.last_name}"
pdf.move_down 8
# Ticket details
pdf.text "Ticket Type:", style: :bold
pdf.text ticket.ticket_type.name
@@ -89,8 +94,8 @@ class TicketPdfGenerator
raise "QR code data must be a valid string"
end
qrcode = RQRCode::QRCode.new(qr_code_data)
pdf.print_qr_code(qrcode, extent: 120, align: :center)
# Generate QR code - prawn-qrcode expects the data string directly
pdf.print_qr_code(qr_code_data, extent: 120, align: :center)
pdf.move_down 15