-
Notifications
You must be signed in to change notification settings - Fork 65
Time off request API methods #57
base: master
Are you sure you want to change the base?
Conversation
…olicies method also
Currently adding test cases to support the new API methods 👍 |
if request_data.get('notes') and len(request_data.get('notes')) > 0: | ||
notes = '' | ||
for n in request_data['notes']: | ||
f = n.get('type', 'employee') | ||
t = n.get('text', '') | ||
notes += '\n\t\t<note from="{0}">{1}</note>'.format(f, t) | ||
xml += '\n\t<notes>{0}\n\t</notes>'.format(notes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if request_data.get('notes') and len(request_data.get('notes')) > 0: | |
notes = '' | |
for n in request_data['notes']: | |
f = n.get('type', 'employee') | |
t = n.get('text', '') | |
notes += '\n\t\t<note from="{0}">{1}</note>'.format(f, t) | |
xml += '\n\t<notes>{0}\n\t</notes>'.format(notes) | |
notes = '' | |
for note in request_data.get('notes', []): | |
f = note.get('type', 'employee') | |
t = note.get('text', '') | |
notes += '\n\t\t<note from="{0}">{1}</note>'.format(f, t) | |
xml += '\n\t<notes>{0}\n\t</notes>'.format(notes) |
Same pattern can be used for dates 😉
params['end'] = end_date | ||
if status: | ||
params['status'] = status | ||
# Must set dates or request errors 400 Bad Request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BambooHR's API says it is optional. 🤔
https://www.bamboohr.com/api/documentation/time_off.php#getRequest
start (optional) - Only show time off that occurs on/after the specified start date.
end (optional) - Only show time off that occurs on/before the specified end date.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I plan to use these API's in the future, thanks for the project so far 👍
Add API methods for:
Fix:
start
+end
params in get requestAdd utility method for: