Completed
Push — master ( 0b05ef...ba9f5c )
by Mr
02:22
created

Booking::allowed()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 18
c 0
b 0
f 0
dl 0
loc 20
ccs 0
cts 20
cp 0
rs 9.6666
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Resova\Objects;
4
5
/**
6
 * The basket booking object
7
 * The booking object allows you to manage bookings for a basket.
8
 *
9
 * @package Resova\Objects
10
 */
11
class Booking
12
{
13
    /**
14
     * List of allowed fields
15
     *
16
     * @return array
17
     */
18
    public function allowed(): array
19
    {
20
        return [
21
            'id'             => 'int',    // The unique id for the booking object.
22
            'item'           => 'object', // The item associated with the booking, an instance of the item object.
23
            'time'           => 'object', // The time associated with the booking, an instance of the time object
24
            'booking_date'   => 'string', // The date of the basket booking.
25
            'booking_time'   => 'string', // The time of the basket booking.
26
            'booking_end'    => 'string', // The end time of the basket booking.
27
            'duration'       => 'int',    // The duration of the basket booking.
28
            'total_quantity' => 'int',    // The total quantity of spaces for the basket booking.
29
            'quantities'     => 'array:Quantity', // The quantities of item pricing categories for this basket booking.
30
            'extras'         => 'array:Extra', // The item extras for this basket booking.
31
            'price'          => 'float',  // The basket booking subtotal.
32
            'discount'       => 'float',  // The total discount value of the basket.
33
            'fee'            => 'float',  // The fee value of the basket.
34
            'tax'            => 'float',  // The tax value of the basket.
35
            'total'          => 'float',  // The total for the basket.
36
            'questions'      => 'array:Question', // The item booking questions for this basket booking.
37
            'participants'   => 'array',  // The participants for this basket booking.
38
        ];
39
    }
40
}
41