Multiple bookings in a timeslot

Hello, dear Sharetribe community,

I hope you all are doing good in these terrible times,
I’m trying to modify a marketplace so that people will be able to book a listing regardless of other people booking the same listing in the same timeslot.

Basically I’m trying to remove a validation step which makes sure no other booking exists in the time range user requests to book a listing.

Any idea how to make that happen?

Thanks.

After some digging I found a working solution.
Note: It works only for per hour availability & I don’t know if this is the best way but it works for me.

1- update method “validate_booking_per_hour_timeslots” from app/services/transaction_service/validation.rb

replace

if listing.working_hours_covers_booking?(booking) && listing.bookings.covers_another_booking(booking).empty?
  Result::Success.new(tx_params)

with

if listing.working_hours_covers_booking?(booking)
  Result::Success.new(tx_params)

2- update method “availability_per_hour_calculate_blocked_dates” from app/presenters/concerns/listing_availability_manage.rb

remove/ comment out

option[:disabled] = true