Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: Timesheets #315

Closed
nikolauskrismer opened this issue Sep 21, 2018 · 2 comments · Fixed by #332
Closed

API: Timesheets #315

nikolauskrismer opened this issue Sep 21, 2018 · 2 comments · Fixed by #332

Comments

@nikolauskrismer
Copy link

Is your feature request related to a problem? Please describe.
I want to be able to query for open timesheets in order to update existing time sheets (set end date) or to create new timesheets within a shell script (using curl).

Describe the solution you'd like
Add three REST endpoints:

  1. GET /api/timesheets ->
    Similar to the existing EPRs such as /api/activities and return all timesheets. As far as I can see a new model needs to be defined here (or at least added to the API documentaiton). Some kind of filter function would be great here (something like adding a get parameter "enddate"="" or "startdate"=2018/09/21" or startdate="21.09.2018"), so that only non-finished timesheets are returned. Maybe it makes sense to return only parts of the model (maybe only id/startdate/enddate while skipping comments)
  2. GET /api/timesheets/{id}
    Delivers all the details for a single timesheet (including comments). Can also be used to check if id already exists (HTTP 404 if id is not used... HTTP 200 including details in any other case)
  3. PUT /api/timesheets/{id}
    Either creates a new timesheet (if id was not used before) or updates an existing one

Describe alternatives you've considered
Not much... However, I can think of various implementations of the filter method suggested for the GET /api/timesheets. One could either use get parameters or maybe various endpoints (something like GET /api/timesheets/open, /api/timesheets/closed, ...). I personally would prefer get parameters...

Additional context
The new EPRs should also support the authentication mechanisms of the existing REST endpoints.

@kevinpapst
Copy link
Member

Hey @nikolauskrismer and @ bastilimbach,

I started working on the Timesheet endpoint. The PR #332 currently contains ONLY fetching a collection of all entries for the logged-in user and one endpoint to fetch a single entry.
There is a lot missing by, but a starting point if you want to test and/or add your own ideas.

@kevinpapst kevinpapst added this to the 0.6 - Permissions milestone Sep 26, 2018
@kevinpapst kevinpapst removed this from the 0.6 - Global activities milestone Nov 17, 2018
@kevinpapst kevinpapst added this to the 0.6 - Global activities milestone Nov 18, 2018
@lock
Copy link

lock bot commented Jan 17, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. If you use Kimai on a daily basis, please consider donating to support further development of Kimai.

@lock lock bot locked and limited conversation to collaborators Jan 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants