Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for month based availability generation on the availabilities API. #1282

Open
gabrielfin opened this issue Jul 7, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@gabrielfin
Copy link

Currently, the /availabilities endpoint only returns the available hour slots for a specific date. I would like to submit a PR that adds a new endpoint that would return the days with availabilities for a certain month or date range. Something like:

/availabilities/dates?month=2022-07&providerId=xx&serviceId=xx

which returns either an array of available dates:

["2022-07-05", "2022-07-14", "2022-07-22"]

or perhaps an array of dates and slots:

[
   {
      date: "2022-07-05",
      hours: ["08:00", "11:30", "15:00"]
   },
   {
      date: "2022-07-14",
      hours: ["09:30", "11:30"]
   },
]

Would that be OK?

@alextselegidis
Copy link
Owner

Hello!

This sounds like a good idea, but please consider the following:

  • Make your PR based on the code of the develop branch
  • Change the endpoint to /api/v1/availabilities?date=2022-07&providerId=<id>&serviceId=<id>
  • Change the end result to the following JSON structure
[
  "2022-07-01": [
    "08:00",
    "09:00"
  ],
  "2022-07-02": [
    "08:00",
    "09:00"
  ],
  ... 
]
Alex Tselegidis, Easy!Appointments Creator
Need a customization? Get a free quote!

@alextselegidis alextselegidis changed the title [Rest API] Add endpoint to obtain available dates Add support for month based availability generation on the availabilities API. Jul 11, 2022
@alextselegidis alextselegidis added the enhancement New feature or request label Jul 11, 2022
@gabrielfin
Copy link
Author

Change the endpoint to /api/v1/availabilities?date=2022-07&providerId=&serviceId=

Do you mean I should replace the current existing endpoint? Because /api/v1/availabilities already exists. Or you just meant that the new endpoint should begin with /api/v1/?

@alextselegidis
Copy link
Owner

Hello!

Sorry, I accidentally skipped this one.

Do you mean I should replace the current existing endpoint?

Yes, I'd say for simplicity's sake, that we use the same endpoint without specifying and exact date.

Alex Tselegidis, Easy!Appointments Creator
Need a customization? Get a free quote!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants