diff --git a/docs/api/work.md b/docs/api/work.md index bc25cb9ada072160c802f77a6d7bba13652d061e..5d9a73de75a882ce5e3fd1c9682818885c92fac7 100644 --- a/docs/api/work.md +++ b/docs/api/work.md @@ -1 +1,48 @@ ## Work + +### GET `/work` [requires authentication] + +Get the information on the currently open work item of the authenticated user. If no item is open, +404 will be returned. + +#### Response body + +```typescript +interface Body { + status: string; + work: { + id: string; + task: string; + user: string; + started: number; + finished?: number; + }; +} +``` + +### POST `/work/start` [requires authentication] + +Create a new work item with the given data. All open work items for the authenticated user will +also be closed in turn. On successful creation the id of the new work item will be returned. + +#### Request body + +```typescript +interface Body { + task: string; +} +``` + +#### Response body + +```typescript +interface Body { + status: string; + id: string; +} +``` + +### PUT `/work/finish` [requires authentication] + +Finish the currently open work of the authenticated user. If no item is open, 404 will be returned. +