use of com.salesmanager.shop.model.customer.UserAlreadyExistException in project shopizer by shopizer-ecommerce.
the class CustomerFacadeImpl method registerCustomer.
@Override
public PersistableCustomer registerCustomer(final PersistableCustomer customer, final MerchantStore merchantStore, Language language) throws Exception {
LOG.info("Starting customer registration process..");
if (userExist(customer.getUserName())) {
throw new UserAlreadyExistException("User already exist");
}
Customer customerModel = getCustomerModel(customer, merchantStore, language);
if (customerModel == null) {
LOG.equals("Unable to create customer in system");
// throw new CustomerRegistrationException( "Unable to register customer" );
throw new Exception("Unable to register customer");
}
LOG.info("About to persist customer to database.");
customerService.saveOrUpdate(customerModel);
LOG.info("Returning customer data to controller..");
// return customerEntityPoulator(customerModel,merchantStore);
customer.setId(customerModel.getId());
return customer;
}
Aggregations