44
55# TimeEntry Model
66time_entry = ns .model ('TimeEntry' , {
7- 'id' : fields .String (readOnly = True ,
8- required = True ,
9- title = 'Identifier' ,
10- description = 'The unique id of the time entry' ),
11- 'project_id' : fields .String (required = True ,
12- title = 'Project' ,
13- max_length = 64 ,
14- description = 'The id of the selected project' ),
15- 'activity_id' : fields .String (required = False ,
16- title = 'Activity' ,
17- max_length = 64 ,
18- description = 'The id of the selected activity' ),
19- 'technologies' : fields .String (required = True ,
20- title = 'Technologies' ,
21- max_length = 64 ,
22- description = 'Canonical names of the used technologies during this period' ),
23- 'description' : fields .String (title = 'Comments' ,
24- description = 'Comments about the time entry' ),
25- 'start_date' : fields .DateTime (required = True ,
26- title = 'Start date' ,
27- description = 'When the user started doing this activity' ),
28- 'end_date' : fields .DateTime (required = True ,
29- title = 'End date' ,
30- description = 'When the user ended doing this activity' ),
7+ 'id' : fields .String (
8+ readOnly = True ,
9+ required = True ,
10+ title = 'Identifier' ,
11+ description = 'The unique id of the time entry' ),
12+ 'project_id' : fields .String (
13+ required = True ,
14+ title = 'Project' ,
15+ max_length = 64 ,
16+ description = 'The id of the selected project' ),
17+ 'activity_id' : fields .String (
18+ required = False ,
19+ title = 'Activity' ,
20+ max_length = 64 ,
21+ description = 'The id of the selected activity' ),
22+ 'technologies' : fields .String (
23+ required = True ,
24+ title = 'Technologies' ,
25+ max_length = 64 ,
26+ description = 'Canonical names of the used technologies during this period' ),
27+ 'description' : fields .String (
28+ title = 'Comments' ,
29+ description = 'Comments about the time entry' ),
30+ 'start_date' : fields .DateTime (
31+ required = True ,
32+ title = 'Start date' ,
33+ description = 'When the user started doing this activity' ),
34+ 'end_date' : fields .DateTime (
35+ required = True ,
36+ title = 'End date' ,
37+ description = 'When the user ended doing this activity' ),
3138
32- 'user_id' : fields .String (required = True ,
33- title = 'Tenant' ,
34- max_length = 64 ,
35- description = 'The user who created this time entry' ),
36- 'tenant_id' : fields .String (required = True ,
37- title = 'Tenant' ,
38- max_length = 64 ,
39- description = 'The tenant this time entry belongs to' ),
39+ 'user_id' : fields .String (
40+ required = True ,
41+ title = 'Tenant' ,
42+ max_length = 64 ,
43+ description = 'The user who created this time entry' ),
44+ 'tenant_id' : fields .String (
45+ required = True ,
46+ title = 'Tenant' ,
47+ max_length = 64 ,
48+ description = 'The tenant this time entry belongs to' ),
4049})
4150
4251time_entry_response = ns .inherit ('TimeEntryResponse' , time_entry , {
4655})
4756
4857
49- @ns .route ('/ ' )
58+ @ns .route ('' )
5059class TimeEntries (Resource ):
5160 @ns .doc ('list_time_entries' )
5261 @ns .marshal_list_with (time_entry_response , code = 200 )
@@ -88,7 +97,7 @@ def put(self, id):
8897 return ns .payload
8998
9099
91- @ns .route ('/stop/ <string:id>' )
100+ @ns .route ('<string:id>/stop ' )
92101@ns .response (404 , 'Running time entry not found' )
93102@ns .param ('id' , 'The unique identifier of a running time entry' )
94103class StopTimeEntry (Resource ):
@@ -99,7 +108,7 @@ def post(self, id):
99108 return None , 204
100109
101110
102- @ns .route ('/continue/ <string:id>' )
111+ @ns .route ('<string:id>/continue ' )
103112@ns .response (404 , 'Stopped time entry not found' )
104113@ns .param ('id' , 'The unique identifier of a stopped time entry' )
105114class ContinueTimeEntry (Resource ):
0 commit comments