{"id":25938629,"url":"https://github.com/michaeljscript/availability","last_synced_at":"2025-10-24T14:45:54.067Z","repository":{"id":87448301,"uuid":"377637343","full_name":"michaeljscript/availability","owner":"michaeljscript","description":null,"archived":false,"fork":false,"pushed_at":"2021-06-16T21:57:16.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-04T03:37:43.245Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michaeljscript.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-06-16T21:56:10.000Z","updated_at":"2021-06-16T21:57:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"b7507109-9ce4-44d9-b65c-cd3c9e2b306a","html_url":"https://github.com/michaeljscript/availability","commit_stats":null,"previous_names":["michaeljscript/availability"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/michaeljscript/availability","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeljscript%2Favailability","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeljscript%2Favailability/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeljscript%2Favailability/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeljscript%2Favailability/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaeljscript","download_url":"https://codeload.github.com/michaeljscript/availability/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeljscript%2Favailability/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266263057,"owners_count":23901354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-04T03:37:44.853Z","updated_at":"2025-10-24T14:45:54.017Z","avatar_url":"https://github.com/michaeljscript.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Desana Task\n\n## Background\n\nWhen a user comes to book a coworking space, the apps fetch the available dates and times that the coworking space can be booked.\n\n## The problem\n\nOur coworking space operators would like to be able to specify how many minutes advance notice they get before a user can book their coworking space. For instance, if it's 09:00 now and the coworking space operator wants at least 30 minutes advance notice, the earliest the user should be able to create a booking for is 09:30.\n\nTimes returned in the response should always be in increments of 15 minutes.\n\nFor instance, if it's currently 09:05 and the minimum advance notice is 30 minutes, the next available booking time will be 09:45.\n\n## The existing data structures\n\n### A Space\n\n```json\n{\n  \"name\": \"Super Space\",\n  \"minimumNotice\": 30,\n  \"openingTimes\": {\n    \"1\": {\n      \"open\": {\n        \"hour\": 9,\n        \"minute\": 0\n      },\n      \"close\": {\n        \"hour\": 17,\n        \"minute\": 0\n      }\n    },\n    \"2\": {\n      \"open\": {\n        \"hour\": 8,\n        \"minute\": 30\n      },\n      \"close\": {\n        \"hour\": 17,\n        \"minute\": 0\n      }\n    },\n    \"3\": {\n      \"open\": {\n        \"hour\": 9,\n        \"minute\": 0\n      },\n      \"close\": {\n        \"hour\": 17,\n        \"minute\": 0\n      }\n    },\n    \"4\": {\n      \"open\": {\n        \"hour\": 9,\n        \"minute\": 0\n      },\n      \"close\": {\n        \"hour\": 17,\n        \"minute\": 0\n      }\n    },\n    \"5\": {\n      \"open\": {\n        \"hour\": 9,\n        \"minute\": 0\n      },\n      \"close\": {\n        \"hour\": 16,\n        \"minute\": 30\n      }\n    },\n    \"6\": {}, // Closed\n    \"7\": {} // Closed\n  }\n}\n```\n\n### The availability response\n\nThe returned data structure looks like this, with 6 June representing a day when a coworking space is open between 09:00 and 17:00 and 7 June representing a closed day:\n\n```json\n{\n  \"2020-06-01\": {\n    \"open\": {\n      \"hour\": 9,\n      \"minute\": 0\n    },\n    \"close\": {\n      \"hour\": 17,\n      \"minute\": 0\n    }\n  },\n  \"2020-07-01\": {}\n}\n```\n\n## The task\n\nYou should write the logic to be able to calculate the availability for a space given the time now and taking into account the minimum advance notice period.\n\nFeel free to use any libraries you see fit.\n\nFeel free to add additional tests if you see fit.\n\n## The logistics\n\nIf there's anything you don't fully understand, please reach out to us as soon as possible.\n\nPlease place your logic in `src/index.ts` and ensure the tests are passing before returning the completed task to us.\n\nYou can either host the task on Github and send us the Github link, or feel free to archive the project folder (without `node_modules`!) and send it back to us.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaeljscript%2Favailability","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaeljscript%2Favailability","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaeljscript%2Favailability/lists"}