- Add Active Storage migrations for file attachments
- Update Event model to handle image uploads with validation
- Replace image URL fields with file upload in forms
- Add client-side image preview with validation
- Update all views to display uploaded images properly
- Fix JSON serialization to prevent stack overflow in API
- Add custom image validation methods for format and size
- Include image processing variants for different display sizes
- Fix promotion code test infrastructure and Stripe configuration
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add comprehensive promotion code methods to Order model
- Implement Stripe invoice integration for promotion code discounts
- Display promotion codes on invoice with proper discount breakdown
- Fix and enhance all unit tests for promotion code functionality
- Add discount calculation with capping to prevent negative totals
- Ensure promotion codes work across entire order lifecycle
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Update StripeInvoiceServiceTest to match the implementation that no longer adds service fees to customer invoices
- Remove duplicated Stimulus data attributes in events/show.html.erb that were causing warnings
- Align tests with the hybrid fee model where fees are deducted from promoter payouts
- Remove 1€ fixed fee from orders and Stripe invoices
- Add platform_fee_cents, promoter_payout_cents methods to Order model
- Update views to show clean ticket totals without added fees
- Update tests for new fee calculation logic
- Update pricing docs with implemented model
Ruby on Rails Test / rails-test (push) Successful in 1m7s
- Added dedicated CartsController for session-based cart storage
- Refactored routes to use POST /api/v1/carts/store
- Updated ticket selection JS to use dynamic data attributes for URLs
- Fixed CSRF protection in API and checkout payment increment
- Made checkout button URLs dynamic via data attributes
- Updated tests for new cart storage endpoint
- Removed obsolete store_cart from EventsController
- Translate French comments to English in controllers and tests
- Fix test failures: route helpers, validations, MySQL transaction issues
- Add Timecop for time-dependent tests and update database config for isolation
- 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>
- 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>
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>
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>
- 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>
- Tests authentication requirements for all actions
- Tests new order form with cart validation
- Tests order creation with ticket data
- Tests show and checkout actions
- Tests retry payment functionality
- Tests AJAX payment attempt increment
- Tests error handling for missing resources
- Added Mocha gem and Devise test helpers
- 21 tests with 13 passing, covering core functionality
- Some session handling tests need further refinement
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Tests all validations, associations, and scopes
- Tests business logic methods like can_retry_payment?, expired?, etc.
- Tests callbacks and state transitions
- Tests payment retry logic and expiry handling
- 42 tests covering all Order model functionality
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
The test was expecting ticket creation to fail without a QR code, but the
Ticket model has a callback that automatically generates QR codes. Updated
the test to verify the automatic QR code generation behavior instead.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Create new TicketsController with actions for name collection, creation, and checkout
- Add dedicated ticket views (new.html.erb, checkout.html.erb, show.html.erb)
- Update ticket_selection_controller.js to handle form submission via AJAX
- Add store_cart endpoint in EventsController for session-based cart management
- Update routes to support new ticket flow: /tickets/new, /create, /checkout
- Fix attribute name consistency across views (title→name, starts_at→start_time)
- Add Stripe checkout integration with proper error handling
- Remove deprecated collect_names flow in favor of streamlined approach
The flow is now: Event selection → AJAX cart storage → Name collection → Checkout → Payment
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit refactors the entire application to replace the 'parties' concept with 'events'. All controllers, models, views, and related files have been updated to reflect this change. The parties table has been replaced with an events table, and all related functionality has been updated accordingly.
- Add first_name and last_name fields to User model with validations
- Configure Devise registrations controller to accept name parameters
- Update registration form with name fields and improved styling
- Replace Twitter Bootstrap pagination with custom Tailwind components
- Add French locale translations for pagination and models
- Update header styling with responsive design improvements
- Add EditorConfig for consistent code formatting
- Fix logout controller URL handling and improve JavaScript
- Update seed data and test fixtures with name attributes
- Add comprehensive model tests for name validations
- Add test.sh script for easier test execution
💘 Generated with Crush
Co-Authored-By: Crush <crush@charm.land>
Add a QWEN.md file to establish project context, preferences,
and behavior guidelines for Qwen Code interactions with the
aperonight Ruby on Rails project. This helps ensure consistent
and appropriate responses tailored to this specific project setup.
This change follows the convention of using a QWEN.md file to
customize AI assistant behavior in development environments.
- Create detailed unit tests for Party, TicketType, Ticket, User, and ApplicationRecord models
- Add fixture files for all models with valid test data
- Fix enum syntax in Party model for Rails 8 compatibility
- Add 60 total model tests covering validations, associations, and business logic
- Ensure all tests pass successfully
This provides full test coverage for the application's data models.
- Create TicketType model with Party association and Ticket relationship
- Add comprehensive validations for name, description, pricing, and date ranges
- Generate migration for ticket_types table with all required fields
- Add Alpine.js import to fix dropdown menu functionality
- Update ticket model with validations for qr_code, price, and status