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