Find some complex slots available in a timetable of multiple people (nodejs)

I'm working on a beauty salon app, and I have to find some complex available slot in a day of multiple professionals

Let's assume that the customer would like to schedule 4 services: haircut, manicure, pedicure and eyebrows. Each of these services can be a different professional or not. (3 professionals and 4 services)

here are some rules:

  • I can cut my hair and do my nails at the same time.
  • I can NOT cut my hair and make eyebrows at the same time
  • I can NOT do manicure and pedicure at the same time IF both are with the same professional

for example:

  • haircuts and manicure from 11:00am to 11:40 am
  • eyebrow and pedicure from 11:40am to 12:20 pm

some more problems, sometimes I may not have all the professionals available to do these sequential/parallel services straight, so if there is no straight slot available to schedule, then I must return the closest slot within a maximum wait of 20 min. Let's imagine there is no slot available to make it straight, the would be something like:

  • haircut from 11:00am until 11:40am
  • eyebrow and pedicure from 11:40am to 12:20pm
  • manicure from 12:35pm to 12:55pm (closest available slot is 15 min after the last one)

I'm studying if rrule can help me