hatchways/team-matcha

Calculate and parse info for availability

Closed this issue · 0 comments

Calendar API is considered a sensitive info and will need additional permission
Kenny’s bit idea for determining time slots
/freeBusy timeMin, timeMax (https://developers.google.com/calendar/v3/reference/freebusy/query)

Bonnie's first thoughts:
/freeBusy google calendar api required timeMin and timeMax. for timeMin, we should really just care about today until the end of current month.

once we get the response from the API, we probably need to do some parsing.

based on user's availability, we can already rule out those days (for example, not avail on Saturday and Sunday), no need to calculate those days, just ignore and mark as no availability.

start parsing out based on event's duration. for example 60 mins.

what you want to return to the frontend is something that may look like this

timeMin: 23843792,
timeMax: 4983204839204,
availableDates: [
  {
    datetime: 234323234,
    availableSlots: [{timeStart: 298374892, timeEnd: 29387432}, {timeStart:9823742, timeEnd: 9283482}]
  }
]

(those random integers are suposed to be valid datetimes haha)