1.5 KiB
Executable File
1.5 KiB
Executable File
Checkout Process Implementation
This document describes the implementation of the checkout process with name collection for tickets that require identification.
Implementation Details
The implementation includes:
- Database migration to add first_name and last_name fields to tickets
- Updates to the Ticket model to validate names when required
- New routes and controller actions for name collection
- A new view for collecting ticket holder names
- Updates to the existing JavaScript controller
Running the Migration
Once the Docker environment is fixed, run the following command to apply the database migration:
docker compose exec rails bundle exec rails db:migrate
Testing the Implementation
-
Start the Docker containers:
docker compose up -d -
Visit an event page and select tickets that require identification
-
The checkout process should redirect to the name collection page
-
After submitting names, the user should be redirected to the payment page
-
After successful payment, tickets should be created with the provided names
Code Structure
- Migration:
db/migrate/20250828143000_add_names_to_tickets.rb - Model:
app/models/ticket.rb - Controller:
app/controllers/events_controller.rb - Views:
app/views/events/collect_names.html.erb(new)app/views/events/show.html.erb(updated)app/views/components/_ticket_card.html.erb(updated)
- Routes:
config/routes.rb(updated) - JavaScript:
app/javascript/controllers/ticket_cart_controller.js(no changes needed)