Passed
Push — master ( e9a045...995df3 )
by Mr
02:09
created

Basket   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 18
dl 0
loc 26
ccs 0
cts 19
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A allowed() 0 19 1
1
<?php
2
3
namespace Resova\Models;
4
5
use Resova\Model;
6
7
/**
8
 * The basket object
9
 * The baskets object allows you to manage shopping baskets that can be used to create Transactions.
10
 *
11
 * @package Resova\Models
12
 */
13
class Basket extends Model
14
{
15
    /**
16
     * List of allowed fields
17
     *
18
     * @return array
19
     */
20
    public function allowed(): array
21
    {
22
        return [
23
            'id'                  => 'int',    // The unique id for the basket object.
24
            'customer'            => 'Customer', // The primary customer for the basket, an instance of the customer object.
25
            'price'               => 'float',  // The subtotal price for the basket.
26
            'fee'                 => 'float',  // The fee value of the basket.
27
            'discount'            => 'float',  // The total discount value of the basket.
28
            'tax'                 => 'float',  // The tax for the basket.
29
            'total'               => 'float',  // The total for the basket.
30
            'due;'                => 'float',  // The due amount for the basket.
31
            'deposit_due'         => 'float',  // The deposit due, if active, amount for the basket.
32
            'expired'             => 'bool',   // True if the basket has expired.
33
            'expires_at'          => 'string:timestamp', // The timestamp of when the basket expires.
34
            'storage_key'         => 'string', // Unique storage key
35
            'bookings'            => 'array[Booking]', // Array of basket bookings, contains: basket booking object.
36
            'promotions'          => 'array[Promotion]', // Array of promotions applied to the basket, contains: basket promotion object.
37
            'purchases'           => 'array[Purchase]', // Array of basket purchases, contains: basket purchase object.
38
            'combined_taxes_fees' => 'array', // Array of taxes and fees applied to the basket.
39
        ];
40
    }
41
}
42