]> git.mxchange.org Git - pizzaservice-war.git/blob - src/java/org/mxchange/pizzaapplication/beans/customer/PizzaCustomerWebSessionController.java
Continued again with customer:
[pizzaservice-war.git] / src / java / org / mxchange / pizzaapplication / beans / customer / PizzaCustomerWebSessionController.java
1 /*
2  * Copyright (C) 2016 Roland Haeder
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Affero General Public License as
6  * published by the Free Software Foundation, either version 3 of the
7  * License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU Affero General Public License for more details.
13  *
14  * You should have received a copy of the GNU Affero General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 package org.mxchange.pizzaapplication.beans.customer;
18
19 import java.io.Serializable;
20 import java.util.List;
21 import org.mxchange.jcontacts.contact.Contact;
22 import org.mxchange.jcustomercore.events.AdminAddedCustomerEvent;
23 import org.mxchange.jcustomercore.model.customer.Customer;
24
25 /**
26  * An interface for customer beans
27  * <p>
28  * @author Roland Haeder<roland@mxchange.org>
29  */
30 public interface PizzaCustomerWebSessionController extends Serializable {
31
32         /**
33          * Adds customer instance to list. The customer should be an updated
34          * instance (with id number).
35          * <p>
36          * @param customer Customer instance
37          */
38         void addCustomer (final Customer customer);
39
40         /**
41          * Observes events being fired when an administrator has added a new
42          * customer
43          * <p>
44          * @param event Event being fired
45          */
46         void afterAdminAddedCustomer (final AdminAddedCustomerEvent event);
47
48         /**
49          * Returns a list of all selectable contacts for user creation. Contacts
50          * from already existing users are excluded in this list.
51          * <p>
52          * @return A list of all selectable contacts
53          */
54         List<Contact> selectableContacts ();
55
56         /**
57          * Checks whether the given contact is a customer
58          * <p>
59          * @param contact Contact to check
60          *
61          * @return Whether the contact is a customer
62          */
63         boolean isContactFound (final Contact contact);
64
65         /**
66          * All customer
67          * <p>
68          * @return A list of all customer profiles
69          */
70         List<Customer> allCustomers ();
71
72         /**
73          * Checks whether customers are registered
74          * <p>
75          * @return Whether customers are registered
76          */
77         boolean hasCustomers ();
78
79 }