Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
67.57% covered (warning)
67.57%
25 / 37
69.23% covered (warning)
69.23%
9 / 13
CRAP
0.00% covered (danger)
0.00%
0 / 1
GraphDefaults
67.57% covered (warning)
67.57%
25 / 37
69.23% covered (warning)
69.23%
9 / 13
18.77
0.00% covered (danger)
0.00%
0 / 1
 defaultFormat
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getWorkstation
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
 getWorkstationWithProvider
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
 getAvailability
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
 getAvailabilityTimes
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
 getScope
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
 getDepartment
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
 getRequest
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
 getFreeProcessList
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
 getCalendar
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
 getProcess
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
 getPickup
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
 getFreeProcess
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace BO\Zmsadmin\Helper;
4
5class 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}
45EOS;
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}
87EOS;
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}
123EOS;
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}
147EOS;
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}
179EOS;
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}
194EOS;
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
218EOS;
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}
248EOS;
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}
283EOS;
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    priority
299    id
300    status
301    createTimestamp
302    timeoutTime
303    reminderTimestamp
304    appointments{
305        date
306        slotCount
307        availability{
308            slotTimeInMinutes
309        }
310    }
311    clients{
312        familyName
313        email
314        surveyAccepted
315        telephone
316    }
317    queue{
318        arrivalTime,
319        withAppointment,
320        number,
321        status,
322        waitingTimeEstimate,
323        waitingTimeOptimistic,
324        waitingTime,
325        wayTime,
326        callCount
327    }
328    processingTime
329    waitingTime
330    wayTime
331    services
332    name
333    withAppointment
334    requests{
335        id
336        link
337        name
338        source
339    }
340    scope{
341        id
342        shortName
343        source
344        contact
345        provider{
346            contact 
347            name 
348            data { 
349                payment 
350            }
351        }
352        preferences{
353            client
354            appointment
355            survey
356        }
357    }
358}
359EOS;
360        return static::defaultFormat($default);
361    }
362
363    /**
364     *  reduced process response data
365     */
366    public static function getPickup()
367    {
368        $default = <<< EOS
369{
370    amendment
371    customTextfield
372    customTextfield2
373    id
374    appointments{
375        date
376    }
377    clients{
378        familyName
379        email
380        telephone
381    }
382    queue{
383        arrivalTime,
384        withAppointment,
385        number
386    }
387    requests{
388        name
389    }
390}
391EOS;
392        return static::defaultFormat($default);
393    }
394
395/**
396 *  reduced process response data
397 */
398    public static function getFreeProcess()
399    {
400        $default = <<< EOS
401{
402    appointments{
403        date
404        slotCount
405    }
406    scope{
407        id
408    }
409}
410EOS;
411        return static::defaultFormat($default);
412    }
413}