Completed
Push — master ( e96a0c...fa76da )
by Mr
01:59
created

Transaction::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 1
Bugs 1 Features 0
Metric Value
cc 1
eloc 18
c 1
b 1
f 0
nc 1
nop 0
dl 0
loc 20
ccs 0
cts 2
cp 0
crap 2
rs 9.6666
1
<?php
2
3
namespace Resova\Models;
4
5
use Resova\Model;
6
7
class Transaction extends Model
8
{
9
    public function allowed(): array
10
    {
11
        return [
12
            'id'                  => 'int',      // The unique id for the transaction object.
13
            'reference'           => 'string',   // The unique reference for the transaction object.
14
            'customer'            => 'Customer', // The primary customer for the transaction, an instance of the customer object.
15
            'price'               => 'float',    // The subtotal price for the transaction.
16
            'fee'                 => 'float',    // The fee value of the transaction.
17
            'discount'            => 'float',    // The total discount value of the transaction.
18
            'tax'                 => 'float',    // The tax value of the transaction.
19
            'total'               => 'float',    // The total for the transaction.
20
            'paid'                => 'float',    // The paid value of the transaction.
21
            'refunded'            => 'float',    // The refunded value of the transaction.
22
            'due'                 => 'float',    // The due value of the transaction.
23
            'overpaid'            => 'boolean',  // True if transaction is overpaid.
24
            'status'              => 'boolean',  // True if transaction is active.
25
            'combined_taxes_fees' => 'array',    // Array of taxes and fees applied to the transaction.
26
            'bookings'            => 'array[Booking]', // Array of bookings applied to the transaction, contains: booking object.
27
            'payments'            => 'array[Booking]', // Array of payments applied to the transaction, contains: payment object.
28
            'promotions'          => 'array[Booking]', // Array of promotions applied to the transaction, contains: promotion object.
29
        ];
30
    }
31
}
32