As a general rule, allowing a certain number of conflicts collides with checking for conflicts.
As I already said, exceptions should be handled separately.
If you get the feeling that there are too many exceptions, it's time to revise the whole data model.
Sounds like you've got a field called "NumConflicts"? And a self join relationship relatedTable:: If so, make a new field, "Max Num Conflicts" =
this.max = NumConflict ;
other.max = Max ( relatedTable::NumConflicts ) ;
max.conflicts = Max ( this.max ; other.max ) ] ;
This is different problem from "should't conflict"
Mon Tue Wed Thu Fri A A A A A B B C C
A has 2 conflicts as you wrote, but this may be allowd on "you have 2 cameras" case, not reached "up to 2 conflicting reservations".
Yes, that is correct. However my calculations right now just count the number of conflicts across the relationships and compare that to the quantity (total stock) of any one piece of equipment. I don't know how to check for conflicts on only a certain day like you can show in that table. I provided only a simple example—in reality I'm verifying reservations by timestamp. The same situation could occur all within one day
I think this method could work, but wouldn't I want Minimum Number of conflicts instead? My maximum conflicts is simply determined by the total stock of a product. In my example Reservation A should see that only 2 of the 3 cameras are reserved.
It really depends on what the user experience is supposed to be. What is happening? Is a user entering a reservation in with a timestamp and getting alerted if there aren't enough cameras? Is a user opening up the system in the morning and seeing a list of conflicts? Looking at a calendar and seeing flags on conflict days? What's the implementation?
Most of the time the user is entering a set of start and end timestamps and then needs to see a list of what's available. I have logic that prevents users from adding items to the reservation if they conflict (they are shown as "out of stock"). There is also cases where the user will change the end timestamp of the reservation to check for conflicts, and an alert will warn them if that change caused a new conflict.