DavidBergevoet / Setup-Reservation

0 stars 1 forks source link

Selecting the start time for a reservation #3

Open InzeNL opened 3 weeks ago

InzeNL commented 3 weeks ago

Right now, I am limited in selecting the start time for my reservation. It's either right now, or right after all the active reservations end.

It would be nice to be able to enter a start time (and maybe date), so I can reserve a spot ahead of time, for right after the break, for example.

If no start time/date is entered, assume it's "right now"

This would require some maths around placing reservations. When a reservation is placed, there will need to be a check to see if there is an overlap between the new reservation and existing ones.

Potential bug: If two people reserve a timeslot, it might accept them as placed, meaning there's two reservations on the list

It might be better to split this up into separate smaller features, as this will become way too big otherwise.

InzeNL commented 3 weeks ago
InzeNL commented 3 weeks ago

Potential bug: If three people reserve a timeslot without defining a start time, and the second person cancels, there would be a gap in-between

Example: Inze, David, and Wouter each reserve 15 minutes, in order. After that, the queue will look like this:

If David now cancels his reservation, the list with the "Register start time and end time with a reservation" would look like this:

As opposed to that. Without this implementation, it would turn out like this:


Maybe this is expected behaviour. Otherwise, your timeslot might shift without you expecting it. For example, if Wouter knows his reservation starts at 12:30, he might pick up work to perform until then. However, in the latter implementation, he would then arrive at 12:30 to find his reservation already expired.

@DavidBergevoet

InzeNL commented 3 weeks ago

For reserving time, it would make sense to always round down to the minute. This prevents someone reserving a time from 12:15:15 to 12:30:15, and then someone being unable to reserve a time from 12:30:00

InzeNL commented 3 weeks ago

https://github.com/DavidBergevoet/Setup-Corn-Reservation/issues/8#issuecomment-2157827559