Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
67.57% |
25 / 37 |
|
69.23% |
9 / 13 |
CRAP | |
0.00% |
0 / 1 |
GraphDefaults | |
67.57% |
25 / 37 |
|
69.23% |
9 / 13 |
18.77 | |
0.00% |
0 / 1 |
defaultFormat | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getWorkstation | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
getWorkstationWithProvider | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
getAvailability | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
getAvailabilityTimes | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
getScope | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
getDepartment | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
getRequest | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
getFreeProcessList | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
getCalendar | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
getProcess | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
getPickup | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
getFreeProcess | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace BO\Zmsadmin\Helper; |
4 | |
5 | class GraphDefaults |
6 | { |
7 | protected static function defaultFormat($string) |
8 | { |
9 | return preg_replace('#\s+#m', ' ', trim($string)); |
10 | } |
11 | |
12 | /** |
13 | * workstation reduced response data |
14 | */ |
15 | public static function getWorkstation() |
16 | { |
17 | $default = <<< EOS |
18 | { |
19 | id, |
20 | name, |
21 | scope { |
22 | id, |
23 | shortName |
24 | source, |
25 | cluster, |
26 | contact { |
27 | name |
28 | } |
29 | preferences { |
30 | appointment |
31 | client |
32 | workstation |
33 | ticketprinter |
34 | } |
35 | status |
36 | }, |
37 | queue { |
38 | clusterEnabled |
39 | appointmentsOnly |
40 | } |
41 | useraccount { |
42 | rights |
43 | } |
44 | } |
45 | EOS; |
46 | return static::defaultFormat($default); |
47 | } |
48 | |
49 | public static function getWorkstationWithProvider() |
50 | { |
51 | $default = <<< EOS |
52 | { |
53 | id, |
54 | name, |
55 | scope { |
56 | provider { |
57 | id |
58 | contact |
59 | name |
60 | data { |
61 | payment |
62 | slotTimeInMinutes |
63 | } |
64 | }, |
65 | id, |
66 | shortName |
67 | source, |
68 | contact { |
69 | name |
70 | } |
71 | preferences { |
72 | appointment |
73 | client |
74 | workstation |
75 | ticketprinter |
76 | } |
77 | status |
78 | }, |
79 | queue { |
80 | clusterEnabled |
81 | appointmentsOnly |
82 | } |
83 | useraccount { |
84 | rights |
85 | } |
86 | } |
87 | EOS; |
88 | return static::defaultFormat($default); |
89 | } |
90 | |
91 | /** |
92 | * availability reduced response data |
93 | */ |
94 | public static function getAvailability() |
95 | { |
96 | $default = <<< EOS |
97 | { |
98 | id, |
99 | weekday, |
100 | repeat |
101 | startDate, |
102 | endDate, |
103 | startTime, |
104 | endTime, |
105 | type, |
106 | bookable, |
107 | workstationCount, |
108 | lastChange, |
109 | multipleSlotsAllowed, |
110 | slotTimeInMinutes, |
111 | description, |
112 | scope { |
113 | id, |
114 | source, |
115 | dayoff { |
116 | date |
117 | }, |
118 | preferences { |
119 | appointment |
120 | } |
121 | } |
122 | } |
123 | EOS; |
124 | return static::defaultFormat($default); |
125 | } |
126 | |
127 | /** |
128 | * availability reduced response data |
129 | */ |
130 | public static function getAvailabilityTimes() |
131 | { |
132 | $default = <<< EOS |
133 | { |
134 | weekday, |
135 | repeat |
136 | startDate, |
137 | endDate, |
138 | startTime, |
139 | endTime, |
140 | type, |
141 | scope { |
142 | dayoff { |
143 | date |
144 | } |
145 | } |
146 | } |
147 | EOS; |
148 | return static::defaultFormat($default); |
149 | } |
150 | |
151 | /** |
152 | * scope reduced response data |
153 | */ |
154 | public static function getScope() |
155 | { |
156 | $default = <<< EOS |
157 | { |
158 | id |
159 | source |
160 | contact |
161 | shortName |
162 | hint |
163 | dayoff { |
164 | date |
165 | } |
166 | preferences |
167 | provider { |
168 | id |
169 | contact |
170 | name |
171 | data { |
172 | payment |
173 | slotTimeInMinutes |
174 | } |
175 | } |
176 | queue |
177 | status |
178 | } |
179 | EOS; |
180 | return static::defaultFormat($default); |
181 | } |
182 | |
183 | /** |
184 | * scope reduced response data |
185 | */ |
186 | public static function getDepartment() |
187 | { |
188 | $default = <<< EOS |
189 | { |
190 | id |
191 | name |
192 | preferences |
193 | } |
194 | EOS; |
195 | return static::defaultFormat($default); |
196 | } |
197 | |
198 | |
199 | /** |
200 | * requests reduced response data |
201 | */ |
202 | public static function getRequest() |
203 | { |
204 | $default = <<< EOS |
205 | { |
206 | id |
207 | name |
208 | link |
209 | timeSlotCount |
210 | data { |
211 | locations { |
212 | appointment |
213 | } |
214 | } |
215 | } |
216 | |
217 | |
218 | EOS; |
219 | return static::defaultFormat($default); |
220 | } |
221 | |
222 | /** |
223 | * free process list reduced response data |
224 | */ |
225 | public static function getFreeProcessList() |
226 | { |
227 | $default = <<< EOS |
228 | { |
229 | scope { |
230 | id |
231 | source |
232 | contact |
233 | provider { |
234 | contact |
235 | name |
236 | data { |
237 | payment |
238 | } |
239 | } |
240 | preferences { |
241 | appointment |
242 | } |
243 | } |
244 | appointments { |
245 | date |
246 | } |
247 | } |
248 | EOS; |
249 | return static::defaultFormat($default); |
250 | } |
251 | |
252 | /** |
253 | * calendar output for day select page |
254 | */ |
255 | public static function getCalendar() |
256 | { |
257 | $default = <<< EOS |
258 | { |
259 | firstDay |
260 | lastDay |
261 | days |
262 | freeProcesses |
263 | requests { |
264 | id |
265 | name |
266 | link |
267 | } |
268 | scopes { |
269 | id |
270 | source |
271 | provider { |
272 | contact |
273 | name |
274 | data { |
275 | payment |
276 | } |
277 | } |
278 | preferences { |
279 | appointment |
280 | } |
281 | } |
282 | } |
283 | EOS; |
284 | return static::defaultFormat($default); |
285 | } |
286 | |
287 | /** |
288 | * reduced process response data |
289 | */ |
290 | public static function getProcess() |
291 | { |
292 | $default = <<< EOS |
293 | { |
294 | amendment |
295 | customTextfield |
296 | authKey |
297 | id |
298 | status |
299 | createTimestamp |
300 | timeoutTime |
301 | reminderTimestamp |
302 | appointments{ |
303 | date |
304 | slotCount |
305 | availability{ |
306 | slotTimeInMinutes |
307 | } |
308 | } |
309 | clients{ |
310 | familyName |
311 | |
312 | surveyAccepted |
313 | telephone |
314 | } |
315 | queue{ |
316 | arrivalTime, |
317 | withAppointment, |
318 | number, |
319 | status, |
320 | waitingTimeEstimate, |
321 | waitingTimeOptimistic, |
322 | waitingTime, |
323 | wayTime, |
324 | callCount |
325 | } |
326 | processingTime |
327 | waitingTime |
328 | wayTime |
329 | services |
330 | name |
331 | withAppointment |
332 | requests{ |
333 | id |
334 | link |
335 | name |
336 | source |
337 | } |
338 | scope{ |
339 | id |
340 | shortName |
341 | source |
342 | contact |
343 | provider{ |
344 | contact |
345 | name |
346 | data { |
347 | payment |
348 | } |
349 | } |
350 | preferences{ |
351 | client |
352 | appointment |
353 | survey |
354 | } |
355 | } |
356 | } |
357 | EOS; |
358 | return static::defaultFormat($default); |
359 | } |
360 | |
361 | /** |
362 | * reduced process response data |
363 | */ |
364 | public static function getPickup() |
365 | { |
366 | $default = <<< EOS |
367 | { |
368 | amendment |
369 | customTextfield |
370 | id |
371 | appointments{ |
372 | date |
373 | } |
374 | clients{ |
375 | familyName |
376 | |
377 | telephone |
378 | } |
379 | queue{ |
380 | arrivalTime, |
381 | withAppointment, |
382 | number |
383 | } |
384 | requests{ |
385 | name |
386 | } |
387 | } |
388 | EOS; |
389 | return static::defaultFormat($default); |
390 | } |
391 | |
392 | /** |
393 | * reduced process response data |
394 | */ |
395 | public static function getFreeProcess() |
396 | { |
397 | $default = <<< EOS |
398 | { |
399 | appointments{ |
400 | date |
401 | slotCount |
402 | } |
403 | scope{ |
404 | id |
405 | } |
406 | } |
407 | EOS; |
408 | return static::defaultFormat($default); |
409 | } |
410 | } |