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