Projekt

Obecné

Profil

Stáhnout (12.5 KB) Statistiky
| Větev: | Tag: | Revize:
1
#%RAML 1.0
2
title: YManager
3
mediaType: application/json
4
securedBy: [oauth_2_0]
5

    
6
securitySchemes:
7
  oauth_2_0:
8
    description: Accessible with OAuth2 authentication token.
9
    type: OAuth 2.0
10

    
11
types:
12
  UserDTO:
13
    type: object
14
    properties:
15
      id:
16
        type: integer
17
        description: the user's id
18
      firstName:
19
        type: string
20
        description:  the user's first name
21
      lastName:
22
        type: string
23
        description: the user's last name
24
      photo:
25
        type: string
26
        description: the URL of a photo
27
      calendar:
28
        type: VacationDayDTO[]
29
        description: the list of selected vacation in +-7 days
30
  CreateVacationDayDTO:
31
    type: object
32
    properties:
33
      date:
34
        type: string
35
        description: the date of the vacation/sick day in yyyy/mm/dd format
36
      from:
37
        type: string | nil
38
        description: the start of the vacation, null for sick days
39
      to:
40
        type: string | nil
41
        description: the end of the vacation, null for sick days
42
      type:
43
        type: string
44
        enum: [VACATION, SICK_DAY]
45
  VacationDayDTO:
46
    type: object
47
    properties:
48
      id:
49
        type: integer
50
        description: the id of the vacation/sick day
51
      date:
52
        type: string
53
        description: the date of the vacation/sick day in yyyy/mm/dd format
54
      from:
55
        type: string | nil
56
        description: the start of the vacation, null for sick days
57
      to:
58
        type: string | nil
59
        description: the end of the vacation, null for sick days
60
      type:
61
        type: string
62
        enum: [VACATION, SICK_DAY]
63
      status:
64
        type: string
65
        enum: [ACCEPTED, PENDING, REJECTED]
66
  BasicRequestDTO:
67
    type: object
68
    properties:
69
      id:
70
        type: integer
71
        description: the id of the vacation/sick day
72
      status:
73
        type: string
74
        enum: [ACCEPTED, PENDING, REJECTED]
75
  UserVacationRequestDTO:
76
    type: object
77
    properties:
78
      id:
79
        type: integer
80
        description: the user's id
81
      firstName:
82
        type: string
83
        description:  the user's first name
84
      lastName:
85
        type: string
86
        description: the user's last name
87
      date:
88
        type: string
89
        description: the date of the vacation/sick day in yyyy/mm/dd format
90
      from:
91
        type: string | nil
92
        description: the start of the vacation, null for sick days
93
      to:
94
        type: string | nil
95
        description: the end of the vacation, null for sick days
96
      type:
97
        type: string
98
        enum: [VACATION, SICK_DAY]
99
        description: the approval status of the request
100
      status:
101
        type: string
102
        enum: [ACCEPTED, PENDING, REJECTED]
103
      timestamp:
104
        type: string
105
        description: the creation of the request in yyyy/mm/dd hh:mm:ss format
106
  UserAuthorizationRequestDTO:
107
    type: object
108
    properties:
109
      id:
110
        type: integer
111
        description: the user's id
112
      firstName:
113
        type: string
114
        description:  the user's first name
115
      lastName:
116
        type: string
117
        description: the user's last name
118
      status:
119
        type: string
120
        enum: [ACCEPTED, PENDING, REJECTED]
121
        description: the status of the authorisation
122
      timestamp:
123
        type: string
124
        description: the creation of the request in yyyy/mm/dd hh:mm:ss format
125
  FullUserDTO:
126
    type: object
127
    properties:
128
      id:
129
        type: integer
130
        description: the user's id
131
      firstName:
132
        type: string
133
        description:  the user's first name
134
      lastName:
135
        type: string
136
        description: the user's last name
137
      photo:
138
        type: string
139
        description: the URL of a photo
140
      vacationCount:
141
        type: number
142
        description: the number of available vacations
143
      sickDayCount:
144
        type: integer
145
        description: the number of assigned sick days
146
      takenSickDayCount:
147
        type: integer
148
        description: the number of taken sick days
149
      status:
150
        type: string
151
        enum: [ACCEPTED, PENDING, REJECTED]
152
        description: the authorisation status
153
      role:
154
        type: string
155
        enum: [EMPLOYEE, EMPLOYER]
156
        description: the user role
157
      notification:
158
        type: string
159
        description:  the notification of an incoming reset of remaining vacations and sick days in yyyy/mm/dd hh:mm:ss format
160
      email:
161
        type: string
162
        description: the user's email address
163
    example: |
164
      {
165
        "id": 4,
166
        "firstName": "Pavel",
167
        "lastName": "Fidransky",
168
        "photo": "https://st2.depositphotos.com/9223672/12056/v/950/depositphotos_120568236-stock-illustration-male-face-avatar-logo-template.jpg",
169
        "vacationCount": 0.0,
170
        "sickDayCount": 5,
171
        "takenSickDayCount": 0,
172
        "status": "ACCEPTED",
173
        "role": "EMPLOYEE",
174
        "notification": "2019/12/01 12:00:00",
175
        "email": "pavel.fidransky@yoso.fi"
176
      }
177
  SettingsDTO:
178
    type: object
179
    properties:
180
      sickDayCount:
181
        type: integer
182
        description: the number of assigned sick days
183
      notification:
184
        type: string
185
        description: the notification of an incoming reset of remaining vacations and sick days in yyyy/mm/dd hh:mm:ss format
186
    example: |
187
      {
188
        "sickDayCount": 5,
189
        "notification": "2019/12/01 12:00:00"
190
      }
191
  UserSettingsDTO:
192
    type: object
193
    properties:
194
      id:
195
        type: integer
196
        description: the user's ID
197
      vacationCount:
198
        type: number
199
        description: the remaining vacations
200
      sickDayCount:
201
        type: integer
202
        description: the number of assigned sick days
203
      role:
204
        type: string
205
        enum: [EMPLOYEE, EMPLOYER]
206
        description: the user role
207
      notification:
208
        type: string
209
        description: the date and time of sending an email warning about an incoming reset of remaining overtimes and sick days
210
    example: |
211
      {
212
        "id": 4,
213
        "vacationCount": 0.0,
214
        "sickDayCount": 5,
215
        "role": "EMPLOYEE",
216
        "notification": "2019/12/01 12:00:00"
217
      }
218
  CalendarDTO:
219
    type: object
220
    properties:
221
      id:
222
        type: integer
223
        description: the id of the vacation/sick day
224
      date:
225
        type: string
226
        description: the date of the vacation/sick day in yyyy/mm/dd format
227
      from:
228
        type: string | nil
229
        description: the start of the vacation, null for sick days
230
      to:
231
        type: string | nil
232
        description: the end of the vacation, null for sick days
233

    
234
/users:
235
  get:
236
    description: Employer only.
237
    queryParameters:
238
      status:
239
        type: string
240
        enum: [ACCEPTED, PENDING, REJECTED]
241
        required: false
242
    responses:
243
      200:
244
        description: OK.
245
        body: UserDTO
246
      400:
247
        description: Bad request. Check query parameters.
248
      401:
249
        description: Not authenticated.
250
      403:
251
        description: Not authorized.
252
      500:
253
        description: Internal server error.
254
  /requests:
255
    /vacation:
256
      get:
257
        description: Employer only.
258
        queryParameters:
259
          status:
260
            type: string
261
            enum: [ACCEPTED, PENDING, REJECTED]
262
            required: false
263
        responses:
264
          200:
265
            description: OK.
266
            body: UserVacationRequestDTO[]
267
          400:
268
            description: Bad request. Check query parameters.
269
          401:
270
            description: Not authenticated.
271
          403:
272
            description: Not authorized.
273
          500:
274
            description: Internal server error.
275
    /authorization:
276
      get:
277
        description: Employer only.
278
        queryParameters:
279
          status:
280
            type: string
281
            enum: [ACCEPTED, PENDING, REJECTED]
282
            required: false
283
        responses:
284
          200:
285
            description: OK.
286
            body: UserAuthorizationRequestDTO[]
287
          400:
288
            description: Bad request. Check query parameters.
289
          401:
290
            description: Not authenticated.
291
          403:
292
            description: Not authorized.
293
          500:
294
            description: Internal server error.
295
  /current:
296
    /profile:
297
      get:
298
        responses:
299
          200:
300
            description: OK.
301
            body: FullUserDTO
302
          401:
303
            description: Not authenticated.
304
          500:
305
            description: Internal server error.
306
  /{id}:
307
    uriParameters:
308
      id:
309
        type: integer
310
        description: the user's id
311
    /profile:
312
      get:
313
        responses:
314
          200:
315
            description: OK.
316
            body: FullUserDTO
317
          400:
318
            description: Bad request. Check URI parameters.
319
          401:
320
            description: Not authenticated.
321
          403:
322
            description: Not authorized.
323
          404:
324
            description: User with given ID doesn't exist.
325
          500:
326
            description: Internal server error.
327
/user:
328
  /{id}:
329
    uriParameters:
330
      id:
331
        type: integer
332
        description: the user's id
333
    /calendar:
334
      get:
335
        description: Employer or calendar owner only.
336
        queryParameters:
337
          from:
338
            type: string
339
            description: yyyy/mm/dd
340
            required: true
341
          to:
342
            type: string
343
            description: yyyy/mm/dd
344
            required: false
345
          status:
346
            type: string
347
            enum: [ACCEPTED, PENDING, REJECTED]
348
            required: false
349
        responses:
350
          200:
351
            description: OK.
352
            body: VacationDayDTO[]
353
          400:
354
            description: Bad request. Check query parameters.
355
          401:
356
            description: Not authenticated.
357
          403:
358
            description: Not authorized.
359
          404:
360
            description: User with given ID doesn't exist.
361
          500:
362
            description: Internal server error.
363

    
364
  /calendar:
365
    /create:
366
      post:
367
        description: Employer or calendar owner only.
368
        body: CreateVacationDayDTO
369
        responses:
370
          200:
371
            description: OK.
372
          400:
373
            description: Bad request. Check request body.
374
          401:
375
            description: Not authenticated.
376
          403:
377
            description: Not authorized.
378
          500:
379
            description: Internal server error.
380
    /edit:
381
      put:
382
        description: Denied to all.
383
        body: CalendarDTO
384
        responses:
385
          403:
386
            description: Not authorized.
387
  /settings:
388
    put:
389
      description: Employer or calendar owner only.
390
      body: UserSettingsDTO
391
      responses:
392
        200:
393
          description: OK.
394
        400:
395
          description: Bad request. Check request body.
396
        401:
397
          description: Not authenticated.
398
        403:
399
          description: Not authorized.
400
        500:
401
          description: Internal server error.
402
  /requests:
403
    put:
404
      description: Employer only.
405
      queryParameters:
406
        type:
407
          type: string
408
          enum: [VACATION, AUTHORIZATION]
409
          required: true
410
      body: BasicRequestDTO
411
      responses:
412
        200:
413
          description: OK.
414
        400:
415
          description: Bad request. Check query parameters and request body.
416
        401:
417
          description: Not authenticated.
418
        403:
419
          description: Not authorized.
420
        404:
421
          description: Neither vacation nor authorization request with given ID exists.
422
        500:
423
          description: Internal server error.
424

    
425
/settings:
426
  get:
427
    responses:
428
      200:
429
        description: OK.
430
        body: SettingsDTO
431
      500:
432
        description: Internal server error.
433
  post:
434
    description: Employer only.
435
    body: SettingsDTO
436
    responses:
437
      200:
438
        description: OK.
439
      401:
440
        description: Not authenticated.
441
      403:
442
        description: Not authorized.
443
      500:
444
        description: Internal server error.
445

    
446
/calendar:
447
  /{id}:
448
    uriParameters:
449
      id:
450
        type: integer
451
        description: the calendar's id
452
    /delete:
453
      delete:
454
        description: Employer or vacation owner only.
455
        responses:
456
          200:
457
            description: OK.
458
          400:
459
            description: Bad request. Check URI parameters and request body.
460
          401:
461
            description: Not authenticated.
462
          403:
463
            description: Not authorized.
464
          404:
465
            description: Vacation with given ID doesn't exist.
466
          500:
467
            description: Internal server error.
468

    
469
/import:
470
  /xls:
471
    post:
472
      body:
473
        type: file
474
      responses:
475
        200:
476
          description: OK.
477

    
478
/export:
479
  /pdf:
480
    get:
481
      responses:
482
        200:
483
          description: OK.
(2-2/3)