Completed
Push — master ( fc4efe...2a0cb3 )
by Mr
02:09
created

BookingRequest::allowed()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 9
nc 1
nop 0
dl 0
loc 14
ccs 0
cts 11
cp 0
crap 2
rs 9.9666
c 0
b 0
f 0
1
<?php
2
3
namespace Resova\Models;
4
5
use Resova\Model;
6
7
/**
8
 * Class BookingRequest
9
 *
10
 * @package Resova\Models
11
 */
12
class BookingRequest extends Model
13
{
14
    /**
15
     * List of allowed fields
16
     *
17
     * @return array
18
     */
19
    public function allowed(): array
20
    {
21
        return [
22
            'instance_id'  => 'int', // The instance id for the date, item and time.
23
            // TODO: implement validation like "array of objects"
24
            'quantities'   => 'array[Quantity]', // The quantities of item pricing categories for this basket booking. Pass an array of objects.
25
            'booking_time' => 'string', // The custom start time of the booking, can result in the creation of a time adjustment or an error if that time is unvavailable .
26
            'booking_end'  => 'string', // The custom end time of the booking, can result in the creation of a time adjustment or an error if that time is unvavailable.
27
            'fee_exempt'   => 'string', // True if this basket booking is fee exempt.
28
            'tax_exempt'   => 'string', // True if this basket booking is tax exempt.
29
            // TODO: implement validation like "array of objects"
30
            'extras'       => 'array[Extra]', // The item extras for this basket booking. Pass an array of objects.
31
            // TODO: implement validation like "array of objects"
32
            'questions'    => 'array[Question]', // The item booking questions for this basket booking. Pass an array of objects.
33
        ];
34
    }
35
}
36