mirror of
https://codeberg.org/JasterV/spazio-solazzo.git
synced 2026-04-26 18:20:03 +00:00
chore: update seeds for production & contents
This commit is contained in:
parent
10285e7bd0
commit
d746a16db2
3 changed files with 27 additions and 37 deletions
|
|
@ -4,7 +4,7 @@
|
||||||
booking_label="Booking request"
|
booking_label="Booking request"
|
||||||
price="€35"
|
price="€35"
|
||||||
price_unit="hour"
|
price_unit="hour"
|
||||||
capacity={@space.capacity}
|
capacity="8"
|
||||||
images={[
|
images={[
|
||||||
~p"/images/meeting_room/01.jpg",
|
~p"/images/meeting_room/01.jpg",
|
||||||
~p"/images/meeting_room/02.jpg",
|
~p"/images/meeting_room/02.jpg",
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
booking_label="Booking request"
|
booking_label="Booking request"
|
||||||
price="€50"
|
price="€50"
|
||||||
price_unit="hour"
|
price_unit="hour"
|
||||||
capacity={@space.capacity}
|
capacity="8"
|
||||||
images={[
|
images={[
|
||||||
~p"/images/music_room/01.jpg",
|
~p"/images/music_room/01.jpg",
|
||||||
~p"/images/music_room/02.jpg",
|
~p"/images/music_room/02.jpg",
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ coworking =
|
||||||
"Arcipelago",
|
"Arcipelago",
|
||||||
"arcipelago",
|
"arcipelago",
|
||||||
"Flexible desk spaces for remote work",
|
"Flexible desk spaces for remote work",
|
||||||
10
|
6
|
||||||
)
|
)
|
||||||
|
|
||||||
IO.puts("✓ Created Coworking space")
|
IO.puts("✓ Created Coworking space")
|
||||||
|
|
@ -52,54 +52,44 @@ IO.puts("✓ Created Music Studio space")
|
||||||
|
|
||||||
# Create Coworking Time Slot Templates for each weekday
|
# Create Coworking Time Slot Templates for each weekday
|
||||||
coworking_slots = [
|
coworking_slots = [
|
||||||
%{start_time: ~T[09:00:00], end_time: ~T[13:00:00]},
|
%{start_time: ~T[10:00:00], end_time: ~T[14:00:00]},
|
||||||
%{start_time: ~T[14:00:00], end_time: ~T[18:00:00]}
|
%{start_time: ~T[14:00:00], end_time: ~T[18:00:00]}
|
||||||
]
|
]
|
||||||
|
|
||||||
weekdays = [:monday, :tuesday, :wednesday, :thursday, :friday]
|
for day <- [:monday, :tuesday, :wednesday, :thursday, :friday, :saturday, :sunday],
|
||||||
|
slot <- coworking_slots do
|
||||||
for day <- weekdays, slot <- coworking_slots do
|
|
||||||
BookingSystem.create_time_slot_template!(slot.start_time, slot.end_time, day, coworking.id)
|
BookingSystem.create_time_slot_template!(slot.start_time, slot.end_time, day, coworking.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
IO.puts(
|
IO.puts("✓ Created coworking time slots across weekdays")
|
||||||
"✓ Created #{length(weekdays) * length(coworking_slots)} coworking time slots across weekdays"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create Meeting Room Hourly Slots (9am-6pm) for weekdays
|
for day <- [:monday, :tuesday, :thursday, :friday, :saturday], hour <- 10..17 do
|
||||||
meeting_slots =
|
start_time = Time.new!(hour, 0, 0)
|
||||||
for hour <- 9..17 do
|
end_time = Time.new!(hour + 1, 0, 0)
|
||||||
start_time = Time.new!(hour, 0, 0)
|
|
||||||
end_time = Time.new!(hour + 1, 0, 0)
|
|
||||||
|
|
||||||
%{
|
BookingSystem.create_time_slot_template!(start_time, end_time, day, meeting.id)
|
||||||
start_time: start_time,
|
|
||||||
end_time: end_time
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
for day <- weekdays, slot <- meeting_slots do
|
|
||||||
BookingSystem.create_time_slot_template!(slot.start_time, slot.end_time, day, meeting.id)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
IO.puts(
|
IO.puts(
|
||||||
"✓ Created #{length(weekdays) * length(meeting_slots)} meeting room hourly slots across weekdays"
|
"✓ Created meeting room hourly slots across for monday, tuesday, thursday, friday and saturday"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Create Music Studio Evening Slots for all days of the week
|
for day <- [:wednesday, :sunday], hour <- 14..17 do
|
||||||
music_slots = [
|
start_time = Time.new!(hour, 0, 0)
|
||||||
%{start_time: ~T[18:00:00], end_time: ~T[20:00:00]},
|
end_time = Time.new!(hour + 1, 0, 0)
|
||||||
%{start_time: ~T[20:00:00], end_time: ~T[22:00:00]}
|
BookingSystem.create_time_slot_template!(start_time, end_time, day, meeting.id)
|
||||||
]
|
|
||||||
|
|
||||||
all_days = [:monday, :tuesday, :wednesday, :thursday, :friday, :saturday, :sunday]
|
|
||||||
|
|
||||||
for day <- all_days, slot <- music_slots do
|
|
||||||
BookingSystem.create_time_slot_template!(slot.start_time, slot.end_time, day, music.id)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
IO.puts(
|
IO.puts("✓ Created meeting room hourly slots across for wednesday and sunday")
|
||||||
"✓ Created #{length(all_days) * length(music_slots)} music studio evening slots across all days"
|
|
||||||
)
|
for day <- [:monday, :wednesday, :thursday, :friday, :saturday, :sunday] do
|
||||||
|
BookingSystem.create_time_slot_template!(~T[18:00:00], ~T[21:00:00], day, music.id)
|
||||||
|
end
|
||||||
|
|
||||||
|
for day <- [:wednesday, :sunday] do
|
||||||
|
BookingSystem.create_time_slot_template!(~T[11:00:00], ~T[14:00:00], day, music.id)
|
||||||
|
end
|
||||||
|
|
||||||
|
IO.puts("✓ Created music studio evening slots across the week")
|
||||||
|
|
||||||
IO.puts("\n🎉 Seeding complete!")
|
IO.puts("\n🎉 Seeding complete!")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue