1 <?php
2 /* --------------------------------------------------------------
3 CustomerServiceInterface.inc.php 2015-02-18 gm
4 Gambio GmbH
5 http://www.gambio.de
6 Copyright (c) 2015 Gambio GmbH
7 Released under the GNU General Public License (Version 2)
8 [http://www.gnu.org/licenses/gpl-2.0.html]
9 --------------------------------------------------------------
10 */
11
12 /**
13 * Interface CustomerServiceInterface
14 *
15 * @category System
16 * @package Customer
17 * @subpackage Interfaces
18 */
19 interface CustomerServiceInterface
20 {
21 /**
22 * Creates a new customer with the given parameters.
23 *
24 * @param CustomerEmailInterface $email Customer's E-Mail address.
25 * @param CustomerPasswordInterface $password Customer's password.
26 * @param DateTime $dateOfBirth Customer's date of birth.
27 * @param CustomerVatNumberInterface $vatNumber Customer's VAT number.
28 * @param CustomerCallNumberInterface $telephoneNumber Customer's telephone number.
29 * @param CustomerCallNumberInterface $faxNumber Customer's fax number.
30 * @param AddressBlockInterface $addressBlock Customer's address.
31 *
32 * @return Customer Created customer.
33 * @throws UnexpectedValueException On invalid arguments.
34 */
35 public function createNewCustomer(CustomerEmailInterface $email,
36 CustomerPasswordInterface $password,
37 DateTime $dateOfBirth,
38 CustomerVatNumberInterface $vatNumber,
39 CustomerCallNumberInterface $telephoneNumber,
40 CustomerCallNumberInterface $faxNumber,
41 AddressBlockInterface $addressBlock);
42
43
44 /**
45 * Creates a new guest account with the given parameters.
46 *
47 * @param CustomerEmailInterface $email Customer's E-Mail address.
48 * @param DateTime $dateOfBirth Customer's date of birth.
49 * @param CustomerVatNumberInterface $vatNumber Customer's VAT number.
50 * @param CustomerCallNumberInterface $telephoneNumber Customer's telephone number.
51 * @param CustomerCallNumberInterface $faxNumber Customer's fax number.
52 * @param AddressBlockInterface $addressBlock Customer's address.
53 *
54 * @return Customer Created guest customer.
55 * @throws UnexpectedValueException On invalid arguments.
56 */
57 public function createNewGuest(CustomerEmailInterface $email,
58 DateTime $dateOfBirth,
59 CustomerVatNumberInterface $vatNumber,
60 CustomerCallNumberInterface $telephoneNumber,
61 CustomerCallNumberInterface $faxNumber,
62 AddressBlockInterface $addressBlock);
63
64
65 /**
66 * Checks if the email address of the registree already exists.
67 *
68 * @param CustomerEmailInterface $email Customer's E-Mail address.
69 *
70 * @return bool Does the provided E-Mail address already exist?
71 */
72 public function registreeEmailExists(CustomerEmailInterface $email);
73
74
75 /**
76 * Updates customer data.
77 *
78 * @param CustomerInterface $customer Customer.
79 *
80 * @return CustomerInterface Updated customer.
81 */
82 public function updateCustomer(CustomerInterface $customer);
83
84
85 /**
86 * Checks if address is the default address of the customer.
87 *
88 * @param CustomerAddressInterface $customerAddress Customer's address.
89 *
90 * @return bool Is the provided address the customer's default address?
91 */
92 public function addressIsDefaultCustomerAddress(CustomerAddressInterface $customerAddress);
93 }