refactor: migrate payment success views to orders system and add promoter seed data
All checks were successful
Ruby on Rails Test / rails-test (push) Successful in 1m48s
All checks were successful
Ruby on Rails Test / rails-test (push) Successful in 1m48s
This commit is contained in:
77
db/seeds.rb
77
db/seeds.rb
@@ -112,3 +112,80 @@ events.each_with_index do |event, index|
|
||||
end
|
||||
|
||||
puts "Created #{User.count} users, #{Event.count} events, and #{TicketType.count} ticket types"
|
||||
|
||||
# Create regular user as promoter
|
||||
promoter = User.find_or_create_by!(email: "kbataille@vivaldi.net") do |u|
|
||||
u.password = "lareunion974!"
|
||||
u.password_confirmation = "lareunion974!"
|
||||
u.last_name = nil
|
||||
u.first_name = nil
|
||||
u.is_professionnal = true
|
||||
end
|
||||
|
||||
belle_epoque_event = Event.find_or_create_by!(name: "LA BELLE ÉPOQUE PAR SISLEY ÉVENTS") do |e|
|
||||
e.slug = "la-belle-epoque-par-sisley-events"
|
||||
e.state = :draft
|
||||
e.description = "
|
||||
Sisley évents Présente :
|
||||
SAM 13 SEPT
|
||||
LA BELLE ÉPOQUE de 18H à 2H
|
||||
sur le Rooftop LE PATIO
|
||||
ÉVÈNEMENT EN PLEIN AIR
|
||||
Ambiance Rétro / old school : zouk , Ragga , kompa , Dancehall , hip hop , Groove , Rnb …
|
||||
Restauration disponible sur place : Accras ,Allocos , specialités asiatique , japonaise et une large carte de choix de Pizzas pour vous régaler !
|
||||
TARIF D'ENTRÉE : 10€ SUR PLACE UNIQUEMENT
|
||||
Réservée aux + de 30 ans
|
||||
Suivez nous sur Instagram : Sisley Évents
|
||||
Le patio
|
||||
38 avenue Leon Gaumont , Montreuil
|
||||
Parking du Décathlon disponible , rue de la république, à 100m du Patio
|
||||
"
|
||||
e.venue_name = "Le Patio Rooftop"
|
||||
e.venue_address = "38 Av. Léon Gaumont, 93100 Montreuil"
|
||||
e.latitude = 48.862336
|
||||
e.longitude = 2.441218
|
||||
e.start_time = 3.days.from_now
|
||||
e.end_time = 3.days.from_now + 8.hours
|
||||
e.featured = false
|
||||
e.image = "https://data.bizouk.com/cache1/events/images/10/78/87/b801a9a43266b4cc54bdda73bf34eec8_700_800_auto_97.jpg"
|
||||
e.user = promoter
|
||||
e.allow_booking_during_event = true
|
||||
end
|
||||
|
||||
belle_epoque_event.update!(start_time: 3.days.from_now, end_time: 3.days.from_now + 8.hours)
|
||||
|
||||
|
||||
# Create ticket types for "La belle époque" event
|
||||
belle_epoque_event = Event.find_by!(slug: "la-belle-epoque-par-sisley-events")
|
||||
|
||||
TicketType.find_or_create_by!(event: belle_epoque_event, name: "Free invitation valid before 7 p.m.") do |tt|
|
||||
tt.description = "Free invitation ticket valid before 7 p.m. for La Belle Époque"
|
||||
tt.price_cents = 0
|
||||
tt.quantity = 50
|
||||
tt.sale_start_at = Time.current
|
||||
tt.sale_end_at = belle_epoque_event.start_time
|
||||
tt.minimum_age = 30
|
||||
tt.requires_id = true
|
||||
end
|
||||
|
||||
TicketType.find_or_create_by!(event: belle_epoque_event, name: "ENTRY 10€ TO BE PAYED ON SITE ONLY") do |tt|
|
||||
tt.description = "Entry ticket to be paid on site only (free in system)"
|
||||
tt.price_cents = 0
|
||||
tt.quantity = 100
|
||||
tt.sale_start_at = Time.current
|
||||
tt.sale_end_at = belle_epoque_event.start_time
|
||||
tt.minimum_age = 30
|
||||
tt.requires_id = true
|
||||
end
|
||||
|
||||
TicketType.find_or_create_by!(event: belle_epoque_event, name: "Paid Entry 10€") do |tt|
|
||||
tt.description = "Paid entry ticket for La Belle Époque at 10€"
|
||||
tt.price_cents = 1000 # 10€
|
||||
tt.quantity = 200
|
||||
tt.sale_start_at = Time.current
|
||||
tt.sale_end_at = belle_epoque_event.start_time
|
||||
tt.minimum_age = 30
|
||||
tt.requires_id = true
|
||||
end
|
||||
|
||||
puts "Created 1 promoter, 1 draft event with ticket types"
|
||||
|
||||
Reference in New Issue
Block a user