-
Notifications
You must be signed in to change notification settings - Fork 5
/
openapi.yaml
1642 lines (1462 loc) · 47.1 KB
/
openapi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.3
info:
title: Timmi Timesheet API
description: |
Welcome on the documentation for the Timmi Timesheet API.
version: '1.0'
contact:
name: Timmi
url: https://www.lucca.fr
email: developers@lucca.fr
x-konfig-ignore:
potential-incorrect-type: true
servers:
- description: Your production environment (France)
url: https://example.ilucca.net
- description: Your test environment (France)
url: https://example.ilucca-test.net
tags:
- description: TimeEntries are the actual working hours observed by a user.
name: TimeEntries
- description: All actions regarding the approval process of timesheets.
name: Workflow
- description: Reporting features of Timmi Timesheet.
name: Reports
- description: Collection of time-entries for a User over a week / month.
name: Timesheets
- description: Time-entries referencing axis-sections to describe what the user has done.
name: Activities
- description: Time-entries indicating working hours.
name: Attendance
paths:
/api/v3/timeentries:
parameters: []
get:
tags:
- TimeEntries
summary: List TimeEntries
operationId: TimeEntries_listTimeEntries
description: >-
Retrieve a list of TimeEntries.
The `startsAt` query parameter can operate comparisons with a given
date-time value:
- `?startsAt=2021-01-01`: strict equality.
- `?startsAt=since,2021-01-01`: greater than or equal.
- `?startsAt=until,2021-01-01`: lower than or equal.
- `?startsAt=between,2021-01-01,2021-01-31`: comprised between two
dates.
To retrieve the total count of all TimeEntries (on all pages), please
include the field `?field=collection.count`.
parameters:
- $ref: '#/components/parameters/paging'
- description: User's identifier
schema:
type: array
items:
description: >-
WARNING: Missing items property in array schema. Missing items
property has been filled with this AnyType schema.
in: query
name: ownerId
style: form
- description: '{comparator},{date-time}'
schema:
type: string
example: between,2021-01-01,2021-02-01
in: query
name: startsAt
- description: Filter on a comma-separated list of AxisSections identifiers.
schema:
type: array
items:
description: >-
WARNING: Missing items property in array schema. Missing items
property has been filled with this AnyType schema.
in: query
name: axisSections.id
style: form
- description: Filter on a comma-separated list of AxisSections codes.
schema:
type: array
items:
description: >-
WARNING: Missing items property in array schema. Missing items
property has been filled with this AnyType schema.
in: query
name: axisSections.code
style: form
- description: '{comparator},{date-time}'
schema:
type: string
example: since,2021-01-01T08:45:23Z
in: query
name: modifiedAt
- description: '{comparator},{date-time}'
schema:
type: string
example: since,2021-01-01T08:45:23Z
in: query
name: archivedAt
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/TimeEntriesListTimeEntriesResponse'
'400':
$ref: '#/components/responses/ResponseProblem'
'401':
$ref: '#/components/responses/ResponseProblem'
'404':
$ref: '#/components/responses/ResponseProblem'
'500':
$ref: '#/components/responses/ResponseProblem'
post:
tags:
- TimeEntries
summary: Create new TimeEntries
operationId: TimeEntries_createMultiple
description: >-
<!-- theme: warning -->
>#### Warning
> This endpoint will soon be deprecated, please use [Timmi Timesheet v4
API](Timmi-Timesheet.yaml/paths/~1timmi-timesheet~1services~1time-entries/put)
You can create a single or multiple TimeEntries for a given user.
Beware, a new TimeEntry cannot intersect with a submitted or approved
timesheet.
requestBody:
description: Create a single of multiple TimeEntry (toggle body type).
content:
application/json:
schema:
$ref: '#/components/schemas/TimeEntriesCreateMultipleRequest'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/TimeEntriesCreateMultipleResponse'
'400':
$ref: '#/components/responses/ResponseProblem'
'401':
$ref: '#/components/responses/ResponseProblem'
'403':
$ref: '#/components/responses/ResponseProblem'
'404':
$ref: '#/components/responses/ResponseProblem'
'500':
$ref: '#/components/responses/ResponseProblem'
put:
tags:
- TimeEntries
summary: Update multiple TimeEntries
operationId: TimeEntries_updateMultiple
description: >-
<!-- theme: warning -->
>#### Warning
> This endpoint will soon be deprecated, please use [Timmi Timesheet v4
API](Timmi-Timesheet.yaml/paths/~1timmi-timesheet~1services~1time-entries/put)
Update one or several TimeEntries. The "id" field must be sent and
correspond to an existing TimeEntry.
requestBody:
description: >-
You can either update a single or multiple TimeEntries. Pick the
correct body type accordingly.
content:
application/json:
schema:
$ref: '#/components/schemas/TimeEntriesUpdateMultipleRequest'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/TimeEntriesUpdateMultipleResponse'
'400':
$ref: '#/components/responses/ResponseProblem'
'401':
$ref: '#/components/responses/ResponseProblem'
'403':
$ref: '#/components/responses/ResponseProblem'
'500':
$ref: '#/components/responses/ResponseProblem'
deprecated: true
delete:
tags:
- TimeEntries
summary: Delete multiple TimeEntries
operationId: TimeEntries_deleteMultiple
description: >-
<!-- theme: warning -->
>#### Warning
> This endpoint will soon be deprecated, please use [Timmi Timesheet v4
API](Timmi-Timesheet.yaml/paths/~1timmi-timesheet~1services~1time-entries/put)
Delete one or several TimeEntries. The "id" field of each TimeEntry must
be sent and correspond to an existing TimeEntry.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TimeEntriesDeleteMultipleRequest'
responses:
'200':
description: OK
'400':
$ref: '#/components/responses/ResponseProblem'
'401':
$ref: '#/components/responses/ResponseProblem'
'403':
$ref: '#/components/responses/ResponseProblem'
'404':
$ref: '#/components/responses/ResponseProblem'
'500':
$ref: '#/components/responses/ResponseProblem'
/api/v3/timeentries/{timeEntryId}:
parameters:
- description: Identifier of the TimeEntry.
schema:
type: integer
name: timeEntryId
in: path
required: true
get:
tags:
- TimeEntries
summary: Get a TimeEntry by id
operationId: TimeEntries_getById
description: Retrieve a single TimeEntry identified by its unique identifier.
parameters: []
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/TimeEntriesGetByIdResponse'
'400':
$ref: '#/components/responses/ResponseProblem'
'401':
$ref: '#/components/responses/ResponseProblem'
'404':
$ref: '#/components/responses/ResponseProblem'
'500':
$ref: '#/components/responses/ResponseProblem'
put:
tags:
- TimeEntries
summary: Update a TimeEntry by id
operationId: TimeEntries_updateById
description: >-
<!-- theme: warning -->
>#### Warning
> This endpoint will soon be deprecated, please use [Timmi Timesheet v4
API](Timmi-Timesheet.yaml/paths/~1timmi-timesheet~1services~1time-entries/put)
Update fields of a single TimeEntry identified by its unique id.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TimeEntry'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/TimeEntriesUpdateByIdResponse'
'400':
$ref: '#/components/responses/ResponseProblem'
'401':
$ref: '#/components/responses/ResponseProblem'
'403':
$ref: '#/components/responses/ResponseProblem'
'404':
$ref: '#/components/responses/ResponseProblem'
'500':
$ref: '#/components/responses/ResponseProblem'
delete:
tags:
- TimeEntries
summary: Delete a TimeEntry by id
operationId: TimeEntries_removeById
description: >-
<!-- theme: warning -->
>#### Warning
> This endpoint will soon be deprecated, please use [Timmi Timesheet v4
API](Timmi-Timesheet.yaml/paths/~1timmi-timesheet~1services~1time-entries/put)
Delete a single TimeEntry. Deletion is irrevocable.
responses:
'200':
description: OK
'400':
$ref: '#/components/responses/ResponseProblem'
'401':
$ref: '#/components/responses/ResponseProblem'
'403':
$ref: '#/components/responses/ResponseProblem'
'404':
$ref: '#/components/responses/ResponseProblem'
'500':
$ref: '#/components/responses/ResponseProblem'
/api/v3/timmitimesheets:
parameters: []
get:
tags:
- Timesheets
summary: List timesheets
operationId: Timesheets_list
description: List all timesheets satisfying query filters.
parameters:
- description: User's identifier.
schema:
type: array
items:
$ref: '#/components/schemas/Timesheet/properties/ownerId'
in: query
name: ownerId
style: form
- description: Filter on the start date of the timesheet.
schema:
type: string
example: between,2022-01-01,2022-02-01
in: query
name: startsOn
- description: Filter on the timesheet workflow status.
schema:
type: array
items:
$ref: '#/components/schemas/Timesheet/properties/status'
in: query
name: status
style: form
- description: Filter on the end date of the timesheet.
schema:
type: string
example: until,2022-01-01
in: query
name: endsOn
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/TimesheetsListResponse'
'400':
$ref: '#/components/responses/ResponseProblem'
'401':
$ref: '#/components/responses/ResponseProblem'
'404':
$ref: '#/components/responses/ResponseProblem'
'500':
$ref: '#/components/responses/ResponseProblem'
/api/v3/timmitimesheets/remindable:
get:
tags:
- Timesheets
summary: List due timesheets
operationId: Timesheets_listDue
description: >-
List timesheet that are not yet submitted (status: 0).
You must filter on either `ownerIds`, `managerIds` or `legalEntityIds`.
As long as a timesheet is not submitted, its unique identifier is equal
to zero.
parameters:
- description: List unique identifier of submitters.
name: ownerIds
in: query
schema:
type: array
items:
type: integer
- description: List unique identifier of submitters' legal establishments.
name: legalEntityIds
in: query
schema:
type: array
items:
type: integer
- description: List unique identifier of submitters' manager.
name: managerIds
in: query
schema:
type: array
items:
type: integer
- description: Prevent older timesheets to be returned.
schema:
type: string
format: date
in: query
name: start
- description: >-
Prevent earlier timesheets to be returned (date excluded). Defaults
to today when not sent.
schema:
type: string
format: date
in: query
name: end
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/TimesheetsListDueResponse'
'400':
$ref: '#/components/responses/ResponseProblem'
'401':
$ref: '#/components/responses/ResponseProblem'
'500':
$ref: '#/components/responses/ResponseProblem'
/timmi/services/workflow/remind:
parameters: []
post:
tags:
- Workflow
summary: Remind Timesheets
operationId: Workflow_sendReminderEmail
description: Remind user of a due timesheet. Sends him/her an email.
requestBody:
description: Timesheets are identified by startsAt, endsAt & ownerId.
content:
application/json:
schema:
$ref: '#/components/schemas/WorkflowSendReminderEmailRequest'
responses:
'200':
$ref: '#/components/responses/ResponseWorkflowService'
'400':
$ref: '#/components/responses/ResponseWorkflowService'
'401':
$ref: '#/components/responses/ResponseWorkflowService'
'403':
$ref: '#/components/responses/ResponseWorkflowService'
'404':
$ref: '#/components/responses/ResponseWorkflowService'
'500':
$ref: '#/components/responses/ResponseWorkflowService'
/timmi/services/workflow/submit:
parameters: []
post:
tags:
- Workflow
summary: Submit Timesheets
operationId: Workflow_submitTimesheet
description: >-
<!-- theme: warning -->
> #### Warning
> This endpoint will soon be deprecated, please use [Timmi Timesheet v4
API](../reference/Timmi-Timesheet.yaml/paths/~1timmi-timesheet~1api~1timesheets~1submit/post)
Timesheet is created and its status is set to `1` (pending approval). In
some cases, timesheet may then be automatically approved (`status: 2`),
depending on the application settings.
Once submitted, all comprised TimeEntries for user can no longer be
modified. In order to be able to modify them, the timesheet must first
be rejected through `cancel`, `deny` or `invalidate` operations (depends
on the current timesheet status).
requestBody:
description: Timesheets are identified by startsAt, endsAt & ownerId.
content:
application/json:
schema:
$ref: '#/components/schemas/WorkflowSubmitTimesheetRequest'
responses:
'200':
$ref: '#/components/responses/ResponseWorkflowService'
'400':
$ref: '#/components/responses/ResponseWorkflowService'
'401':
$ref: '#/components/responses/ResponseWorkflowService'
'403':
$ref: '#/components/responses/ResponseWorkflowService'
'404':
$ref: '#/components/responses/ResponseWorkflowService'
'500':
$ref: '#/components/responses/ResponseWorkflowService'
/timmi/services/workflow/cancel:
parameters: []
post:
tags:
- Workflow
summary: Cancel Timesheets by id
operationId: Workflow_cancelTimesheetById
description: >-
<!-- theme: warning -->
>#### Warning
> This endpoint will soon be deprecated, please use [Timmi Timesheet v4
API](../reference/Timmi-Timesheet.yaml/paths/~1timmi-timesheet~1api~1timesheets~1{id}~1cancel/post)
Cancel a timesheet's submission. Can only be achieved by the original
submitter as long as the timesheet's not approved.
Sets the timesheet status to `3` (rejected).
requestBody:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/WorkflowCancelTimesheetByIdRequest'
responses:
'200':
$ref: '#/components/responses/ResponseWorkflowService'
'400':
$ref: '#/components/responses/ResponseWorkflowService'
'401':
$ref: '#/components/responses/ResponseWorkflowService'
'403':
$ref: '#/components/responses/ResponseWorkflowService'
'404':
$ref: '#/components/responses/ResponseWorkflowService'
'500':
$ref: '#/components/responses/ResponseWorkflowService'
/timmi/services/workflow/approve:
parameters: []
post:
tags:
- Workflow
summary: Approve Timesheets by id
operationId: Workflow_approveTimesheetsById
description: >-
<!-- theme: warning -->
>#### Warning
> This endpoint will soon be deprecated, please use [Timmi Timesheet v4
API](../reference/Timmi-Timesheet.yaml/paths/~1timmi-timesheet~1api~1timesheets~1{id}~1approve/post)
Multiple approvals can be required, depending on the configuration.
Once all approvals needed are satisfied, the timesheet status is set to
`2: Approved`.
Comprised TimeEntries can only be modified by rejecting the timesheet
through the "invalidate" operation.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/WorkflowApproveTimesheetsByIdRequest'
responses:
'200':
$ref: '#/components/responses/ResponseWorkflowService'
'400':
$ref: '#/components/responses/ResponseWorkflowService'
'401':
$ref: '#/components/responses/ResponseWorkflowService'
'403':
$ref: '#/components/responses/ResponseWorkflowService'
'404':
$ref: '#/components/responses/ResponseWorkflowService'
'500':
$ref: '#/components/responses/ResponseWorkflowService'
/timmi/services/workflow/deny:
parameters: []
post:
tags:
- Workflow
summary: Deny Timesheets by id
operationId: Workflow_denyTimesheetById
description: >-
<!-- theme: warning -->
>#### Warning
> This endpoint will soon be deprecated, please use [Timmi Timesheet v4
API](../reference/Timmi-Timesheet.yaml/paths/~1timmi-timesheet~1api~1timesheets~1{id}~1deny/post)
Denies a submitted timesheet pending approval. Sets its status to `3`
(rejected) and a new timesheet may be submitted for this User and
[StartsOn - EndsOn[.
Comment is mandatory.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/WorkflowDenyTimesheetByIdRequest'
responses:
'200':
$ref: '#/components/responses/ResponseWorkflowService'
'400':
$ref: '#/components/responses/ResponseWorkflowService'
'401':
$ref: '#/components/responses/ResponseWorkflowService'
'403':
$ref: '#/components/responses/ResponseWorkflowService'
'404':
$ref: '#/components/responses/ResponseWorkflowService'
'500':
$ref: '#/components/responses/ResponseWorkflowService'
/timmi/services/workflow/invalidate:
parameters: []
post:
tags:
- Workflow
summary: Invalidate Timesheets by id
operationId: Workflow_invalidateTimesheetById
description: >-
<!-- theme: warning -->
>#### Warning
> This endpoint will soon be deprecated, please use [Timmi Timesheet v4
API](../reference/Timmi-Timesheet.yaml/paths/~1timmi-timesheet~1api~1timesheets~1{id}~1invalidate/post)
Rejects an approved timesheet. Sets its status to `3` (rejected). A new
timesheet may then be submitted for this User and [StartsOn - EndsOn[.
Comment is mandatory.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/WorkflowInvalidateTimesheetByIdRequest'
responses:
'200':
$ref: '#/components/responses/ResponseWorkflowService'
'400':
$ref: '#/components/responses/ResponseWorkflowService'
'401':
$ref: '#/components/responses/ResponseWorkflowService'
'403':
$ref: '#/components/responses/ResponseWorkflowService'
'404':
$ref: '#/components/responses/ResponseWorkflowService'
'500':
$ref: '#/components/responses/ResponseWorkflowService'
/timmi-timesheet/api/reports:
post:
tags:
- Reports
summary: Create a new Report
operationId: Reports_createBasedOnTemplate
description: >-
<!-- theme: info -->
> This endpoint does not adhere to the "v3 API endpoints" principles.
The "fields" query parameter is not supported, but all fields are
systematically returned.
A report can only be created based on an existing report-template. So
you first need to retrieve the report-template unique identifier
`templateId`.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Report'
responses:
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/Report'
'401':
description: Unauthorized
'500':
description: Internal Server Error
/timmi-timesheet/api/reports/{reportId}/download-csv:
parameters:
- description: Identifier of the report.
schema:
type: integer
name: reportId
in: path
required: true
get:
tags:
- Reports
summary: Download Report as CSV
operationId: Reports_downloadCsvReport
description: >-
<!-- theme: info -->
> This endpoint does not adhere to the "v3 API endpoints" principles.
Download a report content as an CSV file `.csv`.
Column delimiter and numbers formating depends on the authentified
user's culture.
responses:
'200':
description: OK
content:
application/octet-stream:
schema:
$ref: '#/components/schemas/ReportsDownloadCsvReportResponse'
'401':
description: Unauthorized
'404':
description: Not Found
'500':
description: Internal Server Error
/timmi-timesheet/api/reports/{reportId}/download-excel:
parameters:
- description: Identifier of the report.
schema:
type: integer
name: reportId
in: path
required: true
get:
tags:
- Reports
summary: Download Report as Excel
operationId: Reports_downloadExcelReport
description: >-
<!-- theme: info -->
> This endpoint does not adhere to the "v3 API endpoints" principles.
Download a report content as an Excel file `.xls`.
Column delimiter and numbers formating depends on the authentified
user's culture.
responses:
'200':
description: OK
content:
application/octet-stream:
schema:
$ref: '#/components/schemas/ReportsDownloadExcelReportResponse'
'401':
description: Unauthorized
'404':
description: Not Found
'500':
description: Internal Server Error
components:
parameters:
paging:
description: '{offset},{limit}. Defaults to 0,1000.'
name: paging
in: query
required: true
schema:
type: string
example: 100,0
responses:
ResponseProblem:
description: Problem
content:
application/json:
schema:
$ref: '#/components/schemas/TimeEntriesDeleteMultipleResponse'
ResponseWorkflowService:
description: Workflow response
content:
application/json:
schema:
$ref: '#/components/schemas/WorkflowSendReminderEmailResponse'
schemas:
TimeEntry:
title: The Time Entry resource
description: >-
TimeEntries are the working time sequences spent by a user on any given
day.
These ressources are exposed in the `/api/v3/timeentries` endpoint.
TimeEntries come in different **units** and **submission modes**.
## About units & duration
Timmi Timesheet supports up to 3 different units when it comes to
entering TimeEntries. These are:
- `0: Days` In this case, the user does not enter the exact hours he/she
started working, but rather the total duration spent as a fraction of a
day. For example: "John worked half a day on Monday".
- `1: Hours` In this case, the user still does not enter the exact
hours, but only the duration spent in hours. For example: "John worked
7h30min yesterday".
- `2: Time` In this unit, the user has to enter the actual time he/she
started working, as well as the end time. For example: "John started
working at 08:00 for 3 hours, thus ending at 11:00".
```csharp
enum TimeEntryUnit:
{
Days = 0,
Hours = 1,
Time = 2
}
```
Whichever the unit, the TimeEntry is mainly determined by three
properties:
- `(int) ownerId`: The user it belongs to.
- `(date-time) startsAt`: The date and time when the user started
working. In `Days` and `Hours` units, the time part can only be
`00:00:00` for "morning" (AM) or `12:00:00` for the "afternoon" (PM).
- `(duration) duration`: The total time spent by the user from the time
he/she started. In all units, this property is serialized as a string
compliant with the Timespan formating: `d.hh:mm:ss` where `d` is the
number of days (can be omitted if equal to zero which is in most cases),
`hh` the number of hours, `mm` the number of minutes, and `ss` the
number of seconds.
<!-- theme: warning -->
> #### StartsAt and timezones
> The `startsAt` date-time property must be considered a
[floating](https://www.w3.org/International/wiki/FloatingTime)
date-time. As such, no UTC offset should be sent when creating or
editing a TimeEntry.
<!-- theme: warning -->
> #### Max duration
> A TimeEntry cannot have a duration longer than 24h00 (ie one full
day).
Some examples :
```js
// TIME UNIT
// Case: "John (id: 416) worked between 09:45 and 12:15 on January, 1st
2021."
var timeEntry = {
"ownerId": 416,
"startsAt": "2021-01-01 09:45:00",
"duration: "02:30:00",
"unit": 2
};
// HOURS UNIT
// Case: "John (id: 416) spent 4h45min working on January, 1st 2021 in
the morning"
var timeEntry = {
"ownerId": 416,
"startsAt": "2021-01-01 00:00:00",
"duration: "04:45:00",
"unit": 1
}
// DAYS UNIT
// Case: "John (id: 416) worked on the afternoon of January, 1st 2021"
var timeEntry = {
"ownerId": 416,
"startsAt": "2021-01-01 12:00:00",
"duration: "12:00:00",
"unit": 0
}
```
## About submission modes
There are 2 submission modes in Timmi Timesheet:
- **Attendance**: the user is expected to enter the sequences of work
without much detail.
- **Activities**: the user is expected to enter the time spent on each
task / project / whatever.
Therefore, TimeEntries in activities mode have a supplementary property:
the set of task / project / cost center / ... the user worked on. These
analytical items are called AxisSections. [More info
here](docs/General/Resources/010.AxisSection.md).
```json
{
"ownerId": 416,
"startsAt": "2021-01-01 00:00:00",
"duration: "04:45:00",
"unit": 1,
"axisSections": [
{
"name": "R&D",
"axis": {
"name": "Cost centers"
}
},
{
"name": "My awesome project",
"axis": {
"name": "Projects"
}
},
{
"name": "Testing",
"axis": {
"name": "Tasks"
}
}
]
}
```
## About time types
Each time-entry can reference a time type via its `timeTypeId` property.
Time types are a configured working time classification. It is generally
used as a way of discriminating different types of working hours
regarding compensation:
- Attendance
- Travels
- etc...