Skip to content

Commit

Permalink
Closes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
philipithomas committed Feb 3, 2016
1 parent 3648d0a commit 02649f5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 0 additions & 10 deletions staffjoy/resources/role.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from ..resource import Resource
from .worker import Worker
from .schedule import Schedule
from .timeclock import Timeclock


class Role(Resource):
Expand All @@ -22,12 +21,3 @@ def get_schedules(self, **kwargs):

def get_schedule(self, id):
return Schedule.get(parent=self, id=id)

def get_timeclocks(self, **kwargs):
return Timeclock.get_all(parent=self, **kwargs)

def get_timeclock(self, id):
return Timeclock.get(parent=self, id=id)

def create_timeclock(self, **kwargs):
return Timeclock.create(parent=self, **kwargs)
2 changes: 1 addition & 1 deletion staffjoy/resources/timeclock.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@


class Timeclock(Resource):
PATH = "organizations/{organization_id}/locations/{location_id}/roles/{role_id}/timeclocks/{timeclock_id}"
PATH = "organizations/{organization_id}/locations/{location_id}/roles/{role_id}/users/{user_id}/timeclocks/{timeclock_id}"
ID_NAME = "timeclock_id"
10 changes: 10 additions & 0 deletions staffjoy/resources/worker.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
from ..resource import Resource
from .timeclock import Timeclock


class Worker(Resource):
"""Organization administrators"""
PATH = "organizations/{organization_id}/locations/{location_id}/roles/{role_id}/users/{user_id}"
ID_NAME = "user_id"

def get_timeclocks(self, **kwargs):
return Timeclock.get_all(parent=self, **kwargs)

def get_timeclock(self, id):
return Timeclock.get(parent=self, id=id)

def create_timeclock(self, **kwargs):
return Timeclock.create(parent=self, **kwargs)

0 comments on commit 02649f5

Please sign in to comment.