{"id":18809288,"url":"https://github.com/stupidcodefactory/reception_scheduler","last_synced_at":"2026-01-10T05:30:12.395Z","repository":{"id":137704640,"uuid":"137448568","full_name":"StupidCodeFactory/reception_scheduler","owner":"StupidCodeFactory","description":null,"archived":false,"fork":false,"pushed_at":"2018-06-15T07:23:58.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-29T22:42:31.298Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/StupidCodeFactory.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-15T06:18:26.000Z","updated_at":"2018-06-15T07:24:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"de852b0b-7822-4f92-901b-b275ed672730","html_url":"https://github.com/StupidCodeFactory/reception_scheduler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StupidCodeFactory%2Freception_scheduler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StupidCodeFactory%2Freception_scheduler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StupidCodeFactory%2Freception_scheduler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StupidCodeFactory%2Freception_scheduler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StupidCodeFactory","download_url":"https://codeload.github.com/StupidCodeFactory/reception_scheduler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239743273,"owners_count":19689472,"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":"2024-11-07T23:15:52.579Z","updated_at":"2026-01-10T05:30:12.350Z","avatar_url":"https://github.com/StupidCodeFactory.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/StupidCodeFactory/reception_scheduler.svg?branch=master)](https://travis-ci.org/StupidCodeFactory/reception_scheduler)\n\n### Setup\n\nSimply run:\n\n```shell\nbin/setup\n```\n\n### Reception Scheduler\n\nThe service class `Scheduler` is responsible for scheduling slots.\n\n```ruby\n# example from the seeds.rb\n\nestablishment = Establishment.create!(name: 'Soho House')\ndonald = Employee.create!(name: 'Donald Trump')\nkim = Employee.create!(name: 'Kim Jong Un')\n\ndonald_shift = Shift.new(slot: Time.zone.now.midday..(Time.zone.now.midday + 6.hours))\n\nother_shift = Shift.new(slot: donald_shift.slot.end..(donald_shift.slot.end + 4.hours))\n\nscheduler_service = Scheduler.new(establishment)\n\n\nlog = -\u003e (result, shift) do\n  puts result ? \"Scheduled #{shift.employee.name} from #{shift.slot.begin.to_s(:short)} to #{shift.slot.end.to_s(:short)}\" : shift.errors.full_messages.to_sentence(last_word_connector: ' and ')\nend\n\nlog.call(scheduler_service.book(donald, donald_shift), donald_shift) # =\u003e Scheduled Donald Trump from 15 Jun 12:00 to 15 Jun 18:00\nlog.call(scheduler_service.book(kim, other_shift), other_shift) # =\u003e Scheduled Kim Jong Un from 15 Jun 18:00 to 15 Jun 22:00\nlog.call(scheduler_service.book(donald, other_shift), other_shift) # =\u003e Slot has already been alocated\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstupidcodefactory%2Freception_scheduler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstupidcodefactory%2Freception_scheduler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstupidcodefactory%2Freception_scheduler/lists"}