Reaching out for help from the community as I can’t work out how to make this work. I have a resource booking process that requires resources added through an M2M relational field. On this field I want to filter against any booked our resource for that day. I currently have the following filter which works for any resources that has bookings with clear start dates within the dates of the new booking. But not for resources where there is a booking that bridges over the requested booking (i.e. request start date > booking start date && request end date < booking end date. Can anyone help me think of an additional filter that would fit that criteria? Almost needs to be able to query both a singular booking request start and end date fields at the same time which I am not sure can be done currently?
{
"_and": [
{
"status": {
"_eq": "active"
}
},
{
"booking_requests": {
"_none": {
"booking_request_id": {
"end_date": {
"_between": [
"{{start_date}}",
"{{end_date}}"
]
}
}
}
}
},
{
"booking_requests": {
"_none": {
"booking_request_id": {
"start_date": {
"_between": [
"{{start_date}}",
"{{end_date}}"
]
}
}
}
}
}
]
}