]> git.mxchange.org Git - jcustomer-core.git/commitdiff
added a new enum for account status + updated jars
authorRoland Haeder <roland@mxchange.org>
Fri, 25 Sep 2015 10:39:37 +0000 (12:39 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 25 Sep 2015 10:39:37 +0000 (12:39 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

lib/jcore.jar
lib/jcoreee.jar
src/org/mxchange/jshopcore/model/customer/Customer.java
src/org/mxchange/jshopcore/model/customer/ShopCustomer.java
src/org/mxchange/jshopcore/model/customer/status/CustomerAccountStatus.java [new file with mode: 0644]

index 2223e57f31b8a3d8f755f4d75191b1e49172076b..2fbc389b088701ec28613e7e931fe31f222d2639 100644 (file)
Binary files a/lib/jcore.jar and b/lib/jcore.jar differ
index 37a902e7e287344bf9e0d02609a517bc832822dc..648886a7db3c89adffaf81a8a240feabc2ae530a 100644 (file)
Binary files a/lib/jcoreee.jar and b/lib/jcoreee.jar differ
index cbfe4263b392e3684c8d20ebc86c9c82b2875ec2..ffb8354277cdbc3478e655d0ed9d63568b242f85 100644 (file)
@@ -19,6 +19,7 @@ package org.mxchange.jshopcore.model.customer;
 import java.io.Serializable;
 import java.util.Calendar;
 import org.mxchange.jcore.model.contact.Contact;
+import org.mxchange.jshopcore.model.customer.status.CustomerAccountStatus;
 
 /**
  * A customer interface
@@ -137,12 +138,12 @@ public interface Customer extends Serializable {
         *
         * @return Account status
         */
-       public String getCustomerStatus ();
+       public CustomerAccountStatus getCustomerAccountStatus ();
 
        /**
         * Setter for account status
         *
         * @param customerStatus Account status
         */
-       public void setCustomerStatus (final String customerStatus);
+       public void setCustomerAccountStatus (final CustomerAccountStatus customerStatus);
 }
index 7544264a03fa7105a9d4638d5661aa78592f0061..3ea4c9c9c000a052458c53907f257b3b7c3d6c13 100644 (file)
@@ -30,6 +30,7 @@ import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
 import org.mxchange.jcore.model.contact.Contact;
 import org.mxchange.jcore.model.contact.UserContact;
+import org.mxchange.jshopcore.model.customer.status.CustomerAccountStatus;
 
 /**
  * A shop customer class.
@@ -97,8 +98,8 @@ public class ShopCustomer implements Customer {
         * Account status
         */
        @Basic (optional = false)
-       @Column (name = "customer_status", nullable = false)
-       private String customerStatus;
+       @Column (name = "customer_account_status", nullable = false)
+       private CustomerAccountStatus customerAccountStatus;
 
        /**
         * Default constructor
@@ -115,7 +116,7 @@ public class ShopCustomer implements Customer {
                this.setCustomerConfirmKey(customer.getCustomerConfirmKey());
                this.setCustomerNumber(customer.getCustomerNumber());
                this.setCustomerPasswordHash(customer.getCustomerPasswordHash());
-               this.setCustomerStatus(customer.getCustomerStatus());
+               this.setCustomerAccountStatus(customer.getCustomerAccountStatus());
                this.setCustomerCreated(customer.getCustomerCreated());
                this.setCustomerLocked(customer.getCustomerLocked());
        }
@@ -191,12 +192,12 @@ public class ShopCustomer implements Customer {
        }
 
        @Override
-       public String getCustomerStatus () {
-               return this.customerStatus;
+       public CustomerAccountStatus getCustomerAccountStatus () {
+               return this.customerAccountStatus;
        }
 
        @Override
-       public void setCustomerStatus (final String customerStatus) {
-               this.customerStatus = customerStatus;
+       public void setCustomerAccountStatus (final CustomerAccountStatus customerAccountStatus) {
+               this.customerAccountStatus = customerAccountStatus;
        }
 }
diff --git a/src/org/mxchange/jshopcore/model/customer/status/CustomerAccountStatus.java b/src/org/mxchange/jshopcore/model/customer/status/CustomerAccountStatus.java
new file mode 100644 (file)
index 0000000..5b41557
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2015 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jshopcore.model.customer.status;
+
+import java.io.Serializable;
+
+/**
+ * An enum for customer's account status like confirmed, locked, etc.
+ *
+ * @author Roland Haeder
+ */
+public enum CustomerAccountStatus implements Serializable {
+       /**
+        * Unconfirmed (default)
+        */
+       UNCONFIRMED("CUSTOMER_ACCOUNT_STATUS_UNCONFIRMED"), //NOI18N
+
+       /**
+        * Confirmed (email address validated)
+        */
+       CONFIRMED("CUSTOMER_ACCOUNT_STATUS_CONFIRMED"), //NOI18N
+
+       /**
+        * Locked (maybe violeted T&C)
+        */
+       LOCKED("CUSTOMER_ACCOUNT_STATUS_LOCKED"); //NOI18N
+
+       /**
+        * Message key
+        */
+       private final String messageKey;
+
+       /**
+        * Constructor with i18n translation key
+        *
+        * @param messageKey Message key (i18n)
+        */
+       private CustomerAccountStatus (final String messageKey) {
+               // Set it here
+               this.messageKey = messageKey;
+       }
+
+       /**
+        * Output value (for messages)
+        *
+        * @return the messageKey
+        */
+       public String getMessageKey () {
+               return this.messageKey;
+       }
+}