Skip to content
This repository has been archived by the owner on Nov 2, 2024. It is now read-only.

🐛 Fix Denied bookings causing conflict warning #1151

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

p1173x
Copy link
Contributor

@p1173x p1173x commented Jun 9, 2023

Close #1098

@p1173x p1173x requested a review from danieladugyan June 9, 2023 14:23
@danieladugyan
Copy link
Contributor

@julialovisakarlsson Any input on this from Head of Faculties? :) All these colours and if-statements are incredibly confusing.
image

@julialovisakarlsson
Copy link

julialovisakarlsson commented Aug 10, 2023

Okay so, the issue right now is this:

Skärmavbild 2023-08-10 kl  15 52 47

As you can see, the denied (purple) booking is still causing the following three bookings to appear as if they are conflicting with a not yet accepted booking (yellow). When a booking has been denied, the ones that would conflict with it should no longer be yellow, as they should no longer regard that booking as something they can conflict with since it essentially is "gone".

Expected behaviour in this case is that the yellow bookings should be red, since they are both accepted and conflict with each other. If they were not conflicting, they should return to pink since they are not active yet.


A booking is supposed to be marked yellow if it is accepted AND there exists another conflicting booking which is not yet accepted OR denied (untouched). The untouched booking which conflicts with the first one should be red.

Example:

Booking 1: Kitchen at 12-14: accepted, pink
New booking, Booking 2: kitchen at 13-14: neither accepted or denied (untouched), red. Booking 1 turns yellow.

  • If booking 2 is denied: it turns purple, booking 1 goes back to pink.
  • If booking 2 is accepted: it keeps being red, booking 1 turns red. This is because both of them conflicts with another accepted booking.

If there are two conflicting bookings where both of them are untouched, they should both be yellow until one booking's state is changed. If one of the bookings is accepted, see the example above starting from the second row. If it is denied, treat it as if the booking no longer exists when checking for conflicts. In other words, the remaining booking should turn blue, since it no longer conflicts with any other booking, and is awaiting a decision.

Green should not override a red or yellow booking if it is active. This makes for easier overview of which bookings actually conflict with each other.

I hope this clears things up 😅 let me know if you need anything else!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Denied bookings still cause conflict warning
3 participants