fix: Replace Prawn with Grover for PDF ticket generation

- Replace Prawn PDF generation with Grover (Chrome headless) for better compatibility
- Add HTML-based ticket template with embedded CSS styling
- Implement robust Grover loading with fallback to HTML download
- Add QR code generation methods to Ticket model
- Remove legacy TicketPdfGenerator service and tests
- Update PDF generation in TicketsController with proper error handling

The new implementation provides:
- Better HTML/CSS rendering for ticket layouts
- More reliable PDF generation using Chrome engine
- Fallback mechanism for better user experience
- Cleaner separation of template rendering and PDF conversion

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
kbe
2025-09-06 00:04:02 +02:00
parent 974edce238
commit 7ef934d8a8
10 changed files with 372 additions and 425 deletions

View File

@@ -127,6 +127,8 @@ GEM
raabro (~> 1.4)
globalid (1.2.1)
activesupport (>= 6.1)
grover (1.2.3)
nokogiri (~> 1)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
io-console (0.8.1)
@@ -221,16 +223,8 @@ GEM
parser (3.3.9.0)
ast (~> 2.4.1)
racc
pdf-core (0.10.0)
pp (0.6.2)
prettyprint
prawn (2.5.0)
matrix (~> 0.4)
pdf-core (~> 0.10.0)
ttfunk (~> 1.8)
prawn-qrcode (0.5.2)
prawn (>= 1)
rqrcode (>= 1.0.0)
prettyprint (0.2.0)
prism (1.4.0)
propshaft (1.2.1)
@@ -378,8 +372,6 @@ GEM
thruster (0.1.15-aarch64-linux)
thruster (0.1.15-x86_64-linux)
timeout (0.4.3)
ttfunk (1.8.0)
bigdecimal (~> 3.1)
turbo-rails (2.0.16)
actionpack (>= 7.1.0)
railties (>= 7.1.0)
@@ -423,6 +415,7 @@ DEPENDENCIES
debug
devise (~> 4.9)
dotenv-rails
grover
jbuilder
jsbundling-rails
kamal
@@ -431,8 +424,6 @@ DEPENDENCIES
minitest-reporters (~> 1.7)
mocha
mysql2 (~> 0.5)
prawn (~> 2.5)
prawn-qrcode (~> 0.5)
propshaft
puma (>= 5.0)
rails (~> 8.0.2, >= 8.0.2.1)