1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Resova\Models; |
4
|
|
|
|
5
|
|
|
use Resova\Model; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Class Customer |
9
|
|
|
* |
10
|
|
|
* @codeCoverageIgnore |
11
|
|
|
* @package Resova\Models |
12
|
|
|
*/ |
13
|
|
|
class Customer extends Model |
14
|
|
|
{ |
15
|
|
|
|
16
|
|
|
/* |
17
|
|
|
* id integer The unique id for the customer object. |
18
|
|
|
ref reference string The unique reference for the customer. |
19
|
|
|
ip string // The ip of the customer. |
20
|
|
|
first_name string The first name of the customer. |
21
|
|
|
last_name string The last name of the customer. |
22
|
|
|
email string The email for the customer. |
23
|
|
|
mobile string The mobile number for the customer. |
24
|
|
|
telephone string The telephone number for the customer. |
25
|
|
|
address string The address of the customer. |
26
|
|
|
address2 string The address2 of the customer. |
27
|
|
|
city string The city of the customer. |
28
|
|
|
county string The county of the customer. |
29
|
|
|
postcode string The postcode of the customer. |
30
|
|
|
country string The country of the customer. |
31
|
|
|
|
32
|
|
|
*/ |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* List of allowed fields |
36
|
|
|
* |
37
|
|
|
* @return array |
38
|
|
|
*/ |
39
|
|
|
public function allowed(): array |
40
|
|
|
{ |
41
|
|
|
return [ |
42
|
|
|
'id' => 'int', // The unique id for the customer object. |
43
|
|
|
'ref' => 'string', // The unique reference for the customer. |
44
|
|
|
'ip' => 'string', // The ip of the customer. |
45
|
|
|
'first_name' => 'string', // The first name of the customer. |
46
|
|
|
'last_name' => 'string', // The last name of the customer. |
47
|
|
|
'email' => 'string', // The email for the customer. |
48
|
|
|
'mobile' => 'string', // The mobile number for the customer. |
49
|
|
|
'telephone' => 'string', // The telephone number for the customer. |
50
|
|
|
'password' => 'string', // The password for the customer. |
51
|
|
|
'address' => 'string', // The address line 1 of the customer. |
52
|
|
|
'address2' => 'string', // The address line 2 of the customer. |
53
|
|
|
'city' => 'string', // The city of the customer. |
54
|
|
|
'county' => 'string', // The county of the customer. |
55
|
|
|
'postcode' => 'string', // The postcode of the customer. |
56
|
|
|
'country' => 'string', // The country of the customer. |
57
|
|
|
'image' => 'string', // The profile image of the customer. |
58
|
|
|
'sales_total' => 'float', // The sales (bookings/purchases) total for the customer. |
59
|
|
|
'paid_total' => 'float', // The paid total for the customer. |
60
|
|
|
'due_total' => 'float', // The due total for the customer. |
61
|
|
|
// TODO: implement validation like "array of objects" |
62
|
|
|
'custom_fields' => 'array[CustomField]', // The custom fields for this customer, as dictated by the customers settings. Pass an array of objects. |
63
|
|
|
'credit_total' => 'float', // The total amount of credit for the customer. |
64
|
|
|
'waiver_signed' => 'bool', // If the customer has signed the waiver, if applicable. |
65
|
|
|
'waiver' => 'bool', // If signed, the waiver object for the customer . |
66
|
|
|
]; |
67
|
|
|
} |
68
|
|
|
} |
69
|
|
|
|