Skip to content

Instantly share code, notes, and snippets.

@alexrothenberg
Last active February 5, 2016 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexrothenberg/5c269ef1e64b66dbb4b9 to your computer and use it in GitHub Desktop.
Save alexrothenberg/5c269ef1e64b66dbb4b9 to your computer and use it in GitHub Desktop.
// What should we call the things under each day?
// Its kinda like a recurring event but not quite
// "WeeklyScheduleEventThingy"? We can do better!
// http://delorean/schedules?staff_member_uid=asdfasdfasfd
// create, update, index, show
{
"schedule": {
"start_date": "2016-01-01",
"end_date": "2016-12-31",
"timezone": "America/Chicago",
"sunday": [
],
"monday": [
{"uid":"abc123", "location": "Burlington", "start_time": "09:00", "end_time": "17:00"}
],
"tuesday": [
{"uid":"abc222", "location": "Burlington", "start_time": "09:00", "end_time": "17:00"}
],
"wednesday": [
{"uid":"abc333", "location": "Burlington", "start_time": "09:00", "end_time": "17:00"}
],
"thursday": [
{"uid":"abc444", "location": "Burlington", "start_time": "09:00", "end_time": "12:00"},
{"uid":"abc555", "location": "Dorchester", "start_time": "13:00", "end_time": "17:00"}
],
"friday": [
{"uid":"abc666", "location": "Dorchester", "start_time": "09:00", "end_time": "17:00"}
],
"saturday": [
],
}
}
#SAVE
scheduling ember app
utc <---> americas/nyc --- display
schedule api
create:
1. turn the "things" in thursday into recurring events
a. 9:00(thursday start time) + america/new york(sched time zone) + 1/1/2016(sched start date) -> 1/5/2016 14:00UTC
b. add other recurring event fields ("every thursday", etc)
2. call recurring event creator on each one
recurring events creator
recurring events table & events table
#GET
scheduling ember app
utc <---> americas/nyc --- display
schedule api
index:
0. call recurring event model query
1. slot into days of the week
2. change "14:00 utc" to "09:00"
recurring events table & events table
@GrrrD
Copy link

GrrrD commented Feb 5, 2016

Proposed change: change location to be the location uid, don't put uid on the blown chunks, but put it on the schedule:

{
  "schedule":{
    "uid":"UID9",
    "start_date":"2016-01-31",
    "end_date":null,
    "timezone":"US/Arizona",
    "sunday":[],
    "monday":[
      {"location_id":"LOC123","start_time":"05:00","end_time":"07:00"},
      {"location_id":"LOC234","start_time":"08:00","end_time":"18:00"}
    ],
    "tuesday":[],
    "wednesday":[
      {"location_id":"LOC123","start_time":"08:00","end_time":"18:00"}
    ],
    "thursday":[],
    "friday":[],
    "saturday":[]
  }
}

@GrrrD
Copy link

GrrrD commented Feb 5, 2016

Another proposed change, return who the schedule is for

{
  "schedule":{
    "uid":"UID9",
    "start_date":"2016-01-31",
    "end_date":null,
    "timezone":"US/Arizona",
    "schedulable_type":"practice_user",
    "schedulable_id":"UID12345",
    "sunday":[],
    "monday":[
      {"location_id":"LOC123","start_time":"05:00","end_time":"07:00"},
      {"location_id":"LOC234","start_time":"08:00","end_time":"18:00"}
    ],
    "tuesday":[],
    "wednesday":[
      {"location_id":"LOC123","start_time":"08:00","end_time":"18:00"}
    ],
    "thursday":[],
    "friday":[],
    "saturday":[]
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment