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 | customTextfield2 |
297 | authKey |
298 | id |
299 | status |
300 | createTimestamp |
301 | timeoutTime |
302 | reminderTimestamp |
303 | appointments{ |
304 | date |
305 | slotCount |
306 | availability{ |
307 | slotTimeInMinutes |
308 | } |
309 | } |
310 | clients{ |
311 | familyName |
312 | |
313 | surveyAccepted |
314 | telephone |
315 | } |
316 | queue{ |
317 | arrivalTime, |
318 | withAppointment, |
319 | number, |
320 | status, |
321 | waitingTimeEstimate, |
322 | waitingTimeOptimistic, |
323 | waitingTime, |
324 | wayTime, |
325 | callCount |
326 | } |
327 | processingTime |
328 | waitingTime |
329 | wayTime |
330 | services |
331 | name |
332 | withAppointment |
333 | requests{ |
334 | id |
335 | link |
336 | name |
337 | source |
338 | } |
339 | scope{ |
340 | id |
341 | shortName |
342 | source |
343 | contact |
344 | provider{ |
345 | contact |
346 | name |
347 | data { |
348 | payment |
349 | } |
350 | } |
351 | preferences{ |
352 | client |
353 | appointment |
354 | survey |
355 | } |
356 | } |
357 | } |
358 | EOS; |
359 | return static::defaultFormat($default); |
360 | } |
361 | |
362 | /** |
363 | * reduced process response data |
364 | */ |
365 | public static function getPickup() |
366 | { |
367 | $default = <<< EOS |
368 | { |
369 | amendment |
370 | customTextfield |
371 | customTextfield2 |
372 | id |
373 | appointments{ |
374 | date |
375 | } |
376 | clients{ |
377 | familyName |
378 | |
379 | telephone |
380 | } |
381 | queue{ |
382 | arrivalTime, |
383 | withAppointment, |
384 | number |
385 | } |
386 | requests{ |
387 | name |
388 | } |
389 | } |
390 | EOS; |
391 | return static::defaultFormat($default); |
392 | } |
393 | |
394 | /** |
395 | * reduced process response data |
396 | */ |
397 | public static function getFreeProcess() |
398 | { |
399 | $default = <<< EOS |
400 | { |
401 | appointments{ |
402 | date |
403 | slotCount |
404 | } |
405 | scope{ |
406 | id |
407 | } |
408 | } |
409 | EOS; |
410 | return static::defaultFormat($default); |
411 | } |
412 | } |