RasmusRossetti / TimeLockBeta

0 stars 0 forks source link

Bug: cannot book the same day of a month across months #9

Open joelhellman opened 1 year ago

joelhellman commented 1 year ago

If I try to book a time the 2th of May, and I have booked a time the 2th of June, I get a warning I have already booked a time in that day.

Expected behavior To check for duplicate bookings within a day, it considers the full date, I can book both 5th of May and 5th of June without issues,.

Actual behavior If I first book 2th of may, then I get an error trying to book 2th of June. Or vice versa.

20230507_6aqe9XlCDj

joelhellman commented 1 year ago

I think we have an issue with how the booking system is designed that makes this issue happen.

What would you say it is? How would you go about fixing it, if you would describe it in text?

RasmusRossetti commented 1 year ago

Yes definiately is the design of the bookig system. The reason this is happening is because all the collections of the months contains all the dates and then the timeslots of 4 times per day, And the timeslots doesnt have any unique field that tells it belongs to a certain month. One way would be fixing this issue is to add another field that says that this timeslot for example 11:00 - 15:00 belongs to april month etc. so the field would be named month: april

RasmusRossetti commented 1 year ago

And then its an easy comparison with the local variable of month[dbMonth] to compare it with the new field if they match then booking a timeslot will not work and if the months comparison are different then the user will be able to book the timeslot even tho the date is the same