Projekt

Obecné

Profil

API v0 » Historie » Verze 3

Lukáš Černý, 2019-05-09 17:16

1 1 Lukáš Černý
h1. API v0
2
3
<pre><code class="text">
4
GET /users?status=[<AUTHORIZED, PENDING, REJECTED>] [{
5
	id: number,
6
	name {
7
		first: string,
8
		last: string,
9
	},
10
	photo: url,
11
	calendar: [	// + a - 7 dni 
12
		{
13
			date: dd/MM/yyyy,
14
			from: hh:mm,
15
			to: hh:mm,
16
			type: <VACATION, SICKDAY>
17
		}
18
	],
19
}]
20
21
GET /user/<id>/profile {
22
	id: number,
23
	name {
24
		first: string,
25
		last: string,
26
	},
27
	photo: url,
28
	settings: {
29
		notiffication: timestamp
30
		
31
	}
32
	vacation: {
33
		value: number,
34
		unit: <DAY, HOUR>
35
	},
36
	sickday: {
37
		value: number,
38
		unit: <DAY, HOUR>
39
	},
40
	status: <AUTHORIZED, PENDING, REJECTED>
41
	role: <EMPLOYEE, EMPLOYER>
42
}
43
44
GET /users/requests?type=<VACATION, AUTHORIZATION> {
45
	vacation: [
46
		{
47
			id: long,
48
			user: {
49
				name: {
50
					first: string,
51
					last: string,
52
				}
53
			},
54
			date: dd/MM/yyyy,
55
			from: hh:mm,
56
			to: hh:mm,
57
			type: <VACATION, SICKDAY>
58
			status: <ACCEPTED, PENDING, REJECTED>
59
		}
60
	],
61
	authorization: [
62
		{
63
			id: long,
64
			user: {
65
				name: {
66
					first: string,
67
					last: string,
68
				}
69
			},
70
			date: timestamp,
71
		}
72
	]
73
}
74
75
GET /user/<id>/calendar
76
GET /user/calendar?viewType=<MONTH,WEEK>, value=? {
77
	[
78
		{
79
			date: dd/MM/yyyy,
80
			from: hh:mm,
81
			to: hh:mm,
82
			type: <VACATION, SICKDAY>
83
			status: <ACCEPTED, PENDING, REJECTED>
84
		}
85
	]
86
}
87
88
GET /settings/default {
89
	sickday: {
90
		value: number,
91
		unit: <DAY, HOUR>
92
	},
93
	notiffication: timestamp
94
}
95
96
97
POST /settings/default {
98
	sickday: {
99
		value: number,
100
		unit: <DAY, HOUR>
101
	},
102
	notiffication: timestamp
103
}
104
105 2 Dominik Poch
POST /user/id/calendar {
106 1 Lukáš Černý
	[
107
		{
108
			date: dd/MM/yyyy,
109
			from: hh:mm,
110
			to: hh:mm,
111
			type: <VACATION, SICKDAY>
112
		}
113
	]
114
}
115
116 3 Lukáš Černý
POST /user/requests {
117
	id: long,
118
        type=<VACATION, SICK_DAY, AUTHORIZATION>,
119
	status: <ACCEPTED, PENDING, REJECTED>
120 1 Lukáš Černý
}
121
122
123
POST /user/<id>/settings {
124
	role: <EMPLOYEE, EMPLOYER>,
125
	vacation: {
126
		value: number,
127
		unit: <DAY, HOUR>
128
	},
129
	sickday: {
130
		value: number,
131
		unit: <DAY, HOUR>
132
	}
133
}
134
135
136
</code></pre>