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