|
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
|
|
|
* @codeCoverageIgnore |
|
12
|
|
|
* @package Resova\Models |
|
13
|
|
|
*/ |
|
14
|
|
|
class Basket extends Model |
|
15
|
|
|
{ |
|
16
|
|
|
/** |
|
17
|
|
|
* List of allowed fields |
|
18
|
|
|
* |
|
19
|
|
|
* @return array |
|
20
|
|
|
*/ |
|
21
|
|
|
public function allowed(): array |
|
22
|
|
|
{ |
|
23
|
|
|
return [ |
|
24
|
|
|
'id' => 'int', // The unique id for the basket object. |
|
25
|
|
|
'customer' => 'Customer', // The primary customer for the basket, an instance of the customer object. |
|
26
|
|
|
'price' => 'float', // The subtotal price for the basket. |
|
27
|
|
|
'fee' => 'float', // The fee value of the basket. |
|
28
|
|
|
'discount' => 'float', // The total discount value of the basket. |
|
29
|
|
|
'tax' => 'float', // The tax for the basket. |
|
30
|
|
|
'total' => 'float', // The total for the basket. |
|
31
|
|
|
'due;' => 'float', // The due amount for the basket. |
|
32
|
|
|
'deposit_due' => 'float', // The deposit due, if active, amount for the basket. |
|
33
|
|
|
'expired' => 'bool', // True if the basket has expired. |
|
34
|
|
|
'expires_at' => 'string:timestamp', // The timestamp of when the basket expires. |
|
35
|
|
|
'storage_key' => 'string', // Unique storage key |
|
36
|
|
|
'bookings' => 'array[Booking]', // Array of basket bookings, contains: basket booking object. |
|
37
|
|
|
'promotions' => 'array[Promotion]', // Array of promotions applied to the basket, contains: basket promotion object. |
|
38
|
|
|
'purchases' => 'array[Purchase]', // Array of basket purchases, contains: basket purchase object. |
|
39
|
|
|
'combined_taxes_fees' => 'array', // Array of taxes and fees applied to the basket. |
|
40
|
|
|
]; |
|
41
|
|
|
} |
|
42
|
|
|
} |
|
43
|
|
|
|