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