Author: ymartel Date: 2014-02-19 17:15:27 +0100 (Wed, 19 Feb 2014) New Revision: 405 Url: http://chorem.org/projects/chorem/repository/revisions/405 Log: Add some doc about REST API for Task-Timing Added: trunk/chorem-webmotion/src/doc/ trunk/chorem-webmotion/src/doc/REST_API_Timer.txt Added: trunk/chorem-webmotion/src/doc/REST_API_Timer.txt =================================================================== --- trunk/chorem-webmotion/src/doc/REST_API_Timer.txt (rev 0) +++ trunk/chorem-webmotion/src/doc/REST_API_Timer.txt 2014-02-19 16:15:27 UTC (rev 405) @@ -0,0 +1,54 @@ +Project Management : Task Timer interaction +=========================================== + +Need +---- + +- CRUD and List Operations for Tasks +- add/update Time for Task/User + + +Task Operations +--------------- + +GET /projects/{quotationId}/tasks?{user} : Get all the Tasks for an user on a project (quotationId) +PUT /projects/{quotationId}/tasks?{user} : Add a new Task for the project +PUT /projects/{quotationId}/tasks/{taskId}?{user} : Update Task + + +Time Operations +--------------- + +GET /projects/times?{user}&start={startDate}&end={endDtate} : Get all times for a period. Start and end are optional. +PUT /projects/times?{user} : Update/Add Times for an user on several projects + reports = [ {"taskId": "{taskId}", "times": [{"id":"{timeId}", "start": "{startDate}", "end": "{endDate}"}, {"id":"{timeId}", "start": "{startDate}", "end": "{endDate}"}]}, + {"taskId": "{taskId}", "times": [{"id":"{timeId}", "start": "{startDate}", "end": "{endDate}"}, {"id":"{timeId}", "start": "{startDate}", "end": "{endDate}"}]}] +PUT /projects/{quotationId}/tasks/{taskId}/times?{user} : Update/Add Times for an user on a Task (if no Id, create) + times = [ {"id":"{timeId}", "start": "{startDate}", "end": "{endDate}"}, {"id":"{timeId}", "start": "{startDate}", "end": "{endDate}"}] +GET /projects/{quotationId}/tasks/{taskId}/times?{user} : GET all Times corresponding to a Task and an user + + + +More : Generalize REST API for Task +=================================== + +PUT /projects/{quotationId}/tasks/{taskId}?{user} : Delete Task +GET /projects/{quotationId}/tasks/{taskId}/workers?{user} : Get all workers on a Task +PUT /projects/{quotationId}/tasks/{taskId}/workers?{user} : Add a worker for the Task + + +Doubts +====== + +Way to make URL +--------------- + +Should the {user} parameter in URL or just as request parameter ? + + +If want to follow Restfull resources hierarchy, we should have projects > {project} > quotations > {quotation} > tasks > {task} > times (or workers) > {time} (or {worker}) +In this, the user is more a kind of filter on the request, So, I prefer keep it as request parameter + + + +