diff --git a/prototype/e-commerce.db.old b/prototype/e-commerce.db.old new file mode 100644 index 0000000..d50844c Binary files /dev/null and b/prototype/e-commerce.db.old differ diff --git a/prototype/src/main/java/org/hso/ecommerce/action/user/UpdateUserSettingsAction.java b/prototype/src/main/java/org/hso/ecommerce/action/user/UpdateUserSettingsAction.java index ba17181..682649b 100644 --- a/prototype/src/main/java/org/hso/ecommerce/action/user/UpdateUserSettingsAction.java +++ b/prototype/src/main/java/org/hso/ecommerce/action/user/UpdateUserSettingsAction.java @@ -48,7 +48,7 @@ public class UpdateUserSettingsAction { public UpdateResult updateShippingInfo(String salutation, String name, String address) { this.user.salutation = salutation; - this.user.name = name; + this.user.defaultDeliveryAddress.name = name; this.user.defaultDeliveryAddress.addressString = address; this.repository.save(this.user); return new UpdateResult(true); diff --git a/prototype/src/main/java/org/hso/ecommerce/components/AdminInitializer.java b/prototype/src/main/java/org/hso/ecommerce/components/AdminInitializer.java index 579bbe3..4c51129 100644 --- a/prototype/src/main/java/org/hso/ecommerce/components/AdminInitializer.java +++ b/prototype/src/main/java/org/hso/ecommerce/components/AdminInitializer.java @@ -1,6 +1,7 @@ package org.hso.ecommerce.components; import org.hso.ecommerce.entities.booking.PaymentMethod; +import org.hso.ecommerce.entities.shop.Address; import org.hso.ecommerce.entities.user.User; import org.hso.ecommerce.repos.user.UserRepository; import org.springframework.beans.factory.annotation.Autowired; @@ -23,7 +24,8 @@ public class AdminInitializer { // create first admin user User firstAdmin = new User(); firstAdmin.created = new Timestamp(System.currentTimeMillis()); - firstAdmin.name = "admin"; + firstAdmin.defaultDeliveryAddress = new Address(); + firstAdmin.defaultDeliveryAddress.name = "admin"; firstAdmin.defaultPayment = new PaymentMethod(); firstAdmin.defaultPayment.creditCardNumber = ""; //set empty number firstAdmin.email = "admin"; diff --git a/prototype/src/main/java/org/hso/ecommerce/entities/user/User.java b/prototype/src/main/java/org/hso/ecommerce/entities/user/User.java index e08c2ee..5b031f4 100644 --- a/prototype/src/main/java/org/hso/ecommerce/entities/user/User.java +++ b/prototype/src/main/java/org/hso/ecommerce/entities/user/User.java @@ -24,9 +24,6 @@ public class User { @Column(unique = true) public String email; - @Column(insertable = false, updatable = false) - public String name; - public String salutation; public String passwordHash; diff --git a/prototype/src/main/resources/templates/intern/customers/id.html b/prototype/src/main/resources/templates/intern/customers/id.html index 57263dc..6e76a3c 100644 --- a/prototype/src/main/resources/templates/intern/customers/id.html +++ b/prototype/src/main/resources/templates/intern/customers/id.html @@ -41,7 +41,7 @@ Name - + E-Mail diff --git a/prototype/src/main/resources/templates/intern/customers/index.html b/prototype/src/main/resources/templates/intern/customers/index.html index cd95093..f06cd1b 100644 --- a/prototype/src/main/resources/templates/intern/customers/index.html +++ b/prototype/src/main/resources/templates/intern/customers/index.html @@ -42,7 +42,7 @@ - + diff --git a/prototype/src/main/resources/templates/user/settings.html b/prototype/src/main/resources/templates/user/settings.html index 3e71125..3022494 100644 --- a/prototype/src/main/resources/templates/user/settings.html +++ b/prototype/src/main/resources/templates/user/settings.html @@ -70,7 +70,7 @@
-