Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/geowarin/doctolib-javascript
https://github.com/geowarin/doctolib-javascript
Last synced: about 4 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/geowarin/doctolib-javascript
- Owner: geowarin
- Created: 2020-01-11T17:56:37.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-11T10:32:26.000Z (over 3 years ago)
- Last Synced: 2023-04-09T10:55:23.181Z (over 1 year ago)
- Language: TypeScript
- Size: 507 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## getAvailabilities(date)
`getAvailabilities` returns 7 days of slots, including date of request.
- Each day must be generated using events of type `opening` by dividing the period between `starts_at` and `ends_at`
into 30 minutes slots
- if an appointment exists between those hours, subtract it from availabilities
- `weekly_recurring` openings must be taken into account## Questions
- Do `starts_at` and `ends_at` always fall on 1/2h dates
- Do `starts_at` and `ends_at` happen on the same day
- How long should we look backwards for a `weekly_recurring` event ?## Hypothesises
- Yes => this should be enforced by the database
- Yes => this should be enforced by the database
- For the purpose of the exercise, all `weekly_recurring` event should be used. IRL, we should probably consider
those of the current year maybe?## TODO
- Sanitize argument date (should be a date without time)
- Ensure slots are valid (datetime - 1/2h periods)
- Validate edge cases (midnight cases, openings or appointments spanning multiple days)
- Especially: Verify where query with `starts_at` and `ends_at`
- Validate overlapping opening/ appointments
- Timezones: the provided test uses the system TZ. Should we use UTC instead ?
- Optimize queries