how to find overbooking

I'd like to find if a certain item(day based) on a certain day has an overbooking.

/api/3.0/item/cal?start_date=2019-01-19&end_date=2019-01-19

returns

  "item": {
    "item_id": 2,
    "cal": {
      "available": -2,
      "booked": 3,
      "status": "A",
      "span_closed": 1,
      "unit": "D",
      "20190119": 0
    }
  }

So I can know there are two overbookings.

But if I want to find it for a month, I have to repeat this query for 30 or 31 times.

I tried duration query and it returned the following.

  "item": {
    "item_id": 2,
    "cal": {
      "available": 1,
      "booked": 3,
      "status": "E",
      "span_closed": 1,
      "unit": "D",
      "20190114": 1,
      "20190115": 0,
      "20190116": 0,
      "20190117": 0,
      "20190118": 1,
      "20190119": 0,
      "20190120": 1,
      "20190121": 1,
      "20190122": 1,
      "20190123": 1,
      "20190124": 0,
      "20190125": 0
    }
  }

This does not show which day has an overbooking.

Is there any way to know the overbooking by one query?

Thank you.

Makoto



Sign In or Register to comment.