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

GiftVoucher   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 17
ccs 0
cts 10
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A allowed() 0 10 1
1
<?php
2
3
namespace Resova\Models;
4
5
use Resova\Model;
6
7
/**
8
 * The gift voucher object
9
 * Gift vouchers are types of gifts that can be purchased by customers,
10
 * ie "Gift voucher for £10.00", which when purchased will generated
11
 * a redeemable gift code.
12
 *
13
 * @package Resova\Models
14
 */
15
class GiftVoucher extends Model
16
{
17
    /**
18
     * List of allowed fields
19
     *
20
     * @return array
21
     */
22
    public function allowed(): array
23
    {
24
        return [
25
            'id'           => 'int',    // The unique id for the object.
26
            'name'         => 'string', // The name of the gift voucher.
27
            'amount'       => 'float',  // The purchase amount for this gift voucher.
28
            'voucher_type' => 'string', // Can be: value or spaces.
29
            'discount'     => 'float',  // The discountable amount for a gift code belonging to this voucher.
30
            'description'  => 'string', // The description of how the gift voucher is applied.
31
            'status'       => 'bool',   // True if the gift voucher is active.
32
        ];
33
    }
34
}
35