- Fix onboarding controller test by using consistent application name
- Fix ticket mailer template error by correcting variable reference (@user.first_name)
- Update event reminder template to use configurable app name
- Refactor mailer tests to properly handle multipart email content
- Update test assertions to match actual template content
- Remove duplicate migration for onboarding field
- Add documentation for test fixes and solutions
Completely remove the enterprise/company information functionality from
the onboarding flow to simplify the user experience:
- Remove company information toggle section and form fields from view
- Delete unused Stimulus toggle controller (toggle_section_controller.js)
- Update onboarding controller to only process first/last name parameters
- Remove company_name from permitted parameters and validation logic
- Update tests to remove company name assertions and test cases
- Simplify onboarding to only collect essential personal information
The onboarding now focuses solely on collecting required first and last
names, providing a cleaner and faster user experience.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add complete user onboarding flow that redirects new users to complete their
profile before accessing the application:
- Add onboarding_completed boolean field to users with migration
- Create OnboardingController with form validation and completion logic
- Design professional onboarding UI with progressive disclosure for company info
- Implement Stimulus controller for toggling company information section
- Add application-wide redirect middleware for incomplete users
- Create comprehensive test suite for all onboarding functionality
- Update test fixtures and helpers to support onboarding in existing tests
The onboarding collects required first/last name and optional company information.
Users are redirected to onboarding after login until profile is completed.
Features smooth animations, full-width form button, and clean UX design.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
The StripeInvoiceService was only creating line items for tickets but missing
the 1€ service fee, causing a discrepancy where customers paid 26€ via Stripe
checkout but the generated invoice only showed 25€.
- Add service fee line item to Stripe invoices in StripeInvoiceService
- Update all related tests to expect two line items (tickets + service fee)
- Fix order controller test to account for service fee in total calculation
Now Stripe invoices properly match the amount paid: tickets + 1€ service fee.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added 1€ service fee to order total calculation in Order model
- Updated checkout page to display fee breakdown (subtotal + 1€ fee = total)
- Updated payment success page to show fee breakdown
- Updated order show page to display fee breakdown
- Updated payment cancel page to show fee breakdown
- Modified Stripe session creation to include service fee as separate line item
- Updated order model tests to account for the 1€ service fee
- Enhanced overall pricing transparency for users
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Updated breadcrumb on event show page to use the new consistent style with rounded background and shadow
- Improved spacing and responsive design for breadcrumbs
- Made minor layout adjustments to flash messages component
- Enhanced overall UI consistency across the application
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Created comprehensive documentation for implementing secure unique IDs for ticket PDF downloads
- Document includes migration steps, model updates, controller changes, and security best practices
- Fixed minor spacing issues in orders index page
- Updated breadcrumb spacing for better visual hierarchy
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Updated all breadcrumbs across the application to use the new consistent style
- Added rounded background with shadow for better visual hierarchy
- Improved spacing and responsive design
- Maintained proper navigation paths for all pages
- Enhanced overall UI consistency with the new design language
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Updated all breadcrumbs to match the style used in events index page
- Simplified breadcrumb design with cleaner, more consistent look
- Maintained proper navigation paths for all pages
- Improved overall UI consistency across the application
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Updated ticket show page breadcrumbs to match the consistent style used across order pages
- Breadcrumbs now show clear path: Home → Dashboard → Order # → Ticket #
- Improved user navigation and context awareness on ticket page
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Added consistent breadcrumb navigation to order show, payment success, payment cancel, checkout, new order, and orders index pages
- Standardized breadcrumb style across all pages for better UX
- Breadcrumbs now show clear path from home to current page
- Improved user navigation and context awareness
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Updated payment success and cancel pages to match order details layout
- Made dashboard fully responsive with improved mobile layouts
- Added missing venue address to order pages
- Standardized styling and spacing across all order-related pages
- Improved PDF ticket generator formatting
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Add orders index action to OrdersController with pagination support
- Simplify dashboard to focus on user orders and actions
- Redesign order show page with improved layout and ticket access
- Remove complex event metrics in favor of streamlined order management
- Add direct links to ticket downloads and better order navigation
- Improve responsive design and user experience across order views
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Switch to standard A4 page size with proper 40px margins
- Remove complex gradient backgrounds and card layouts for simplicity
- Implement clean, minimalist design with clear visual hierarchy
- Use two-column layout for efficient space utilization
- Center QR code with optimal 120px size for scanning
- Simplify typography with consistent font sizes and colors
- Remove unnecessary visual elements (shadows, rounded corners, badges)
- Ensure all content fits comfortably on single page
- Maintain brand colors (purple for header) with subtle styling
- Keep all essential information: event details, ticket holder, QR code
- Preserve robust error handling and QR code validation
Design improvements:
• Single-page layout that fits within A4 margins
• Clean two-column information display
• Simplified color scheme with good contrast
• Optimized spacing for readability
• Centered QR code for easy scanning
• Minimal but professional appearance
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Redesign PDF layout with modern gradient background and card-based structure
- Add sophisticated color scheme using purple/indigo brand colors
- Implement visual hierarchy with improved typography and spacing
- Create information grid layout with labeled sections and visual indicators
- Add color-coded price badge with rounded corners and proper contrast
- Enhance QR code section with dedicated background card and better positioning
- Improve security elements and footer styling with professional appearance
- Increase ticket size to 400x650px for better readability and visual impact
- Fix encoding issues for French characters and special symbols compatibility
- Maintain all existing functionality while significantly improving visual design
New features:
• Modern gradient header with brand identity
• Card-based layout with subtle shadow effects
• Grid-based information layout with clear visual hierarchy
• Professional color coding and typography choices
• Enhanced QR code presentation with dedicated section
• Improved security messaging and timestamp styling
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Rename download_ticket action to download for consistency
- Use QR code lookup consistently in both show and download actions
- Simplify routes to use QR code pattern for both viewing and downloading
- Remove complex dual-lookup logic in favor of consistent QR code access
- Clean up route constraints and duplicate route definitions
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- 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>
- Implement comprehensive email notification system for ticket purchases and event reminders
- Add event reminder job with configurable scheduling
- Enhance ticket mailer with QR code generation and proper formatting
- Update order model with email delivery tracking
- Add comprehensive test coverage for all email functionality
- Configure proper mailer settings and disable annotations
- Update backlog to reflect completed email features
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Install qrcode npm package for proper QR code generation
- Create new Stimulus controller using qrcode library instead of external CDN
- Update ticket show view to use self-contained QR code generation
- Remove dependency on external qrserver.com API
- Generate valid, scannable QR codes client-side
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Previously, users received multiple emails after successful payment:
- One email per individual ticket (via orders_controller.rb)
- One order-level email with all tickets (via order.rb mark_as_paid!)
This resulted in N+1 emails for N tickets purchased.
Changes:
- Removed individual ticket email sending from orders_controller.rb
- Kept single comprehensive order email in order.rb
- Updated test to reflect that email failures don't prevent order completion
- Users now receive exactly one email with all tickets as PDF attachments
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
The '>' characters at the end of emails were caused by Rails development
mode adding HTML comment annotations to rendered views, including email
templates. This creates comments like '<!-- END app/views/...erb -->'
which can appear as stray characters in email clients.
Solution:
- Add initializer to disable view annotations specifically for ActionMailer
- Preserves debugging annotations for regular views
- Ensures clean email formatting in development mode
- No impact on production where annotations are disabled by default
The emails will now render cleanly without extra HTML comments or
stray characters at the end.
This fixes the 'data must be a String, QRSegment, or an Array' error that was
preventing checkout completion.
Changes:
- Move email sending outside payment transaction to avoid rollback on email failure
- Add error handling around PDF generation in mailers
- Improve QR code data building with multiple fallback strategies
- Use direct foreign key access instead of through associations for reliability
- Add comprehensive logging for debugging QR code issues
- Ensure checkout succeeds even if email/PDF generation fails
The payment process will now complete successfully regardless of email issues,
while still attempting to send confirmation emails with PDF attachments.
This commit implements a complete email notifications system for purchase
confirmations and event reminders as requested in the medium priority
backlog tasks.
## Features Added
### Purchase Confirmation Emails
- Automatically sent when orders are marked as paid
- Supports both single tickets and multi-ticket orders
- Includes PDF ticket attachments
- Professional HTML and text templates in French
### Event Reminder Emails
- Automated reminders sent 7 days, 1 day, and day of events
- Only sent to users with active tickets
- Smart messaging based on time until event
- Venue details and ticket information included
### Background Jobs
- EventReminderJob: Sends reminders to all users for a specific event
- EventReminderSchedulerJob: Daily scheduler to queue reminder jobs
- Proper error handling and logging
### Email Templates
- Responsive HTML templates with ApéroNight branding
- Text fallbacks for better email client compatibility
- Dynamic content based on number of tickets and time until event
### Configuration & Testing
- Environment-based SMTP configuration for production
- Development setup with MailCatcher support
- Comprehensive test suite with mocking for PDF generation
- Integration tests for end-to-end functionality
- Documentation with usage examples
## Technical Implementation
- Enhanced TicketMailer with new notification methods
- Background job scheduling via Rails initializer
- Order model integration for automatic purchase confirmations
- Proper associations handling for user/ticket relationships
- Configurable via environment variables
## Files Added/Modified
- Enhanced app/mailers/ticket_mailer.rb with order support
- Added app/jobs/event_reminder_*.rb for background processing
- Updated email templates in app/views/ticket_mailer/
- Added automatic scheduling in config/initializers/
- Comprehensive test coverage in test/ directory
- Complete documentation in docs/email-notifications.md
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Each ticket has a unique URL for viewing and downloading
- Only the ticket owner can access their ticket
- The customer's name is clearly displayed on the ticket
- The PDF can be downloaded directly from the ticket view page
- All existing functionality continues to work as expected
- Remove unused create_stripe_session method from TicketsController
- Replace hardcoded API key with environment variable for security
- Fix typo in ApplicationHelper comment
- Improve User model validation constraints for better UX
- Add comprehensive YARD-style documentation across models, controllers, services, and helpers
- Enhance error handling in cleanup jobs with proper exception handling
- Suppress Prawn font warnings in PDF generator
- Update refactoring summary with complete change documentation
All tests pass (200 tests, 454 assertions, 0 failures)
RuboCop style issues resolved automatically
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fix database constraint by not saving order to DB in user validation test
- Fix mock expectation to expect original invoice object, not finalized invoice
- All 16 StripeInvoiceServiceTest tests now passing
🧪 **Test Infrastructure Enhancements:**
- Fixed PDF generator tests by stubbing QR code generation properly
- Simplified job tests by replacing complex mocking with functional testing
- Added missing `expired_drafts` scope to Ticket model for job functionality
- Enhanced test coverage across all components
📋 **Specific Component Fixes:**
**PDF Generator Tests (17 tests):**
- Added QR code mocking to avoid external dependency issues
- Fixed price validation issues for zero/low price scenarios
- Simplified complex mocking to focus on functional behavior
- All tests now pass with proper assertions
**Job Tests (14 tests):**
- Replaced complex Rails logger mocking with functional testing
- Fixed `expired_drafts` scope missing from Ticket model
- Simplified ExpiredOrdersCleanupJob tests to focus on core functionality
- Simplified CleanupExpiredDraftsJob tests to avoid brittle mocks
- All job tests now pass with proper error handling
**Model & Service Tests:**
- Enhanced Order model tests (42 tests) with comprehensive coverage
- Fixed StripeInvoiceService tests with proper Stripe API mocking
- Added comprehensive validation and business logic testing
- All model tests passing with edge case coverage
**Infrastructure:**
- Added rails-controller-testing and mocha gems for better test support
- Enhanced test helpers with proper Devise integration
- Fixed QR code generation in test environment
- Added necessary database migrations and schema updates
🎯 **Test Coverage Summary:**
- 202+ tests across the entire application
- Models: Order (42 tests), Ticket, Event, User coverage
- Controllers: Events (17 tests), Orders (21 tests), comprehensive actions
- Services: PDF generation, Stripe integration, business logic
- Jobs: Background processing, cleanup operations
- All major application functionality covered
🔧 **Technical Improvements:**
- Replaced fragile mocking with functional testing approaches
- Added proper test data setup and teardown
- Enhanced error handling and edge case coverage
- Improved test maintainability and reliability
🚀 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>