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

Purchase::allowed()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 13
ccs 0
cts 13
cp 0
rs 9.9
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Resova\Objects;
4
5
/**
6
 * The basket purchase object
7
 * The purchase object allows you to manage purchases for a basket.
8
 *
9
 * @package Resova\Objects
10
 */
11
class Purchase
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 purchase object.
22
            'price'          => 'float',  // The basket purchase subtotal.
23
            'discount'       => 'float',  // The total discount value of the basket purchase.
24
            'fee'            => 'float',  // The fee value of the basket purchase.
25
            'tax'            => 'float',  // The tax value of the basket purchase.
26
            'total'          => 'float',  // The total for the basket.
27
            'total_quantity' => 'int', // The total quantity of the purchase.
28
            'gift_voucher'   => 'object:GiftVoucher',  // The gift voucher object
29
            'gift_email'     => 'string',  // Gift email for the purchase
30
            'gift_message'   => 'string',  // Gift message for the purchase
31
        ];
32
    }
33
34
}
35