Skip to content

Commit

Permalink
tag 2.16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
shopizer-ecommerce committed Dec 1, 2020
1 parent 3560e6e commit 87550d8
Show file tree
Hide file tree
Showing 12 changed files with 97 additions and 26 deletions.
13 changes: 2 additions & 11 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
Tag changes in version 2.15.0
Tag changes in version 2.16.0

Arabic translation [thanks to ialibrahim]
Support for Oracle database *
Support for Postgres database *


**
when running against an existing schema, please run this command

ALTER TABLE `SALESMANAGER`.`USER`
RENAME TO `SALESMANAGER`.`USERS` ;
Spring boot 2.3.6


6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.shopizer</groupId>
<artifactId>shopizer</artifactId>
<version>2.15.0</version>
<version>2.16.0</version>
<packaging>pom</packaging>

<name>shopizer</name>
Expand All @@ -22,7 +22,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.3.RELEASE</version>
<version>2.3.6.RELEASE</version>
</parent>

<modules>
Expand All @@ -44,7 +44,7 @@
<m2eclipse.wtp.contextRoot>/</m2eclipse.wtp.contextRoot>

<!--shopizer version -->
<shopizer.version>2.15.0</shopizer.version>
<shopizer.version>2.16.0</shopizer.version>
<shopizer.search.version>2.11.1</shopizer.search.version>
<shopizer-canadapost.version>2.11.0</shopizer-canadapost.version>

Expand Down
2 changes: 1 addition & 1 deletion sm-core-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.shopizer</groupId>
<artifactId>shopizer</artifactId>
<version>2.15.0</version>
<version>2.16.0</version>
</parent>

<artifactId>sm-core-model</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion sm-core-modules/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.shopizer</groupId>
<artifactId>shopizer</artifactId>
<version>2.15.0</version>
<version>2.16.0</version>
</parent>

<name>sm-core-modules</name>
Expand Down
2 changes: 1 addition & 1 deletion sm-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.shopizer</groupId>
<artifactId>shopizer</artifactId>
<version>2.15.0</version>
<version>2.16.0</version>
</parent>

<artifactId>sm-core</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion sm-shop-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.shopizer</groupId>
<artifactId>shopizer</artifactId>
<version>2.15.0</version>
<version>2.16.0</version>
</parent>

<artifactId>sm-shop-model</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public class IntegrationModuleEntity {

private String code;
private boolean active;
private boolean configured;
private String image;

public String getCode() {
Expand All @@ -25,5 +26,11 @@ public String getImage() {
public void setImage(String image) {
this.image = image;
}
public boolean isConfigured() {
return configured;
}
public void setConfigured(boolean configured) {
this.configured = configured;
}

}
Binary file modified sm-shop/SALESMANAGER.h2.db
Binary file not shown.
Binary file modified sm-shop/files/store/DownlaodRepository.dat
Binary file not shown.
2 changes: 1 addition & 1 deletion sm-shop/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.shopizer</groupId>
<artifactId>shopizer</artifactId>
<version>2.15.0</version>
<version>2.16.0</version>
</parent>

<artifactId>sm-shop</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.salesmanager.shop.store.api.v1.payment;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import org.slf4j.Logger;
Expand All @@ -14,6 +15,7 @@
import com.salesmanager.core.business.services.payments.PaymentService;
import com.salesmanager.core.model.merchant.MerchantStore;
import com.salesmanager.core.model.reference.language.Language;
import com.salesmanager.core.model.system.IntegrationConfiguration;
import com.salesmanager.core.model.system.IntegrationModule;
import com.salesmanager.shop.model.system.IntegrationModuleEntity;
import com.salesmanager.shop.store.api.exception.ServiceRuntimeException;
Expand Down Expand Up @@ -61,7 +63,10 @@ public List<IntegrationModuleEntity> paymentModules(

try {
List<IntegrationModule> modules = paymentService.getPaymentMethods(merchantStore);
return modules.stream().map(m -> this.integrationModule(m)).collect(Collectors.toList());

//configured modules
Map<String,IntegrationConfiguration> configuredModules = paymentService.getPaymentModulesConfigured(merchantStore);
return modules.stream().map(m -> this.integrationModule(m, configuredModules)).collect(Collectors.toList());

} catch (ServiceException e) {
LOGGER.error("Error getting payment modules", e);
Expand All @@ -71,12 +76,17 @@ public List<IntegrationModuleEntity> paymentModules(

}

private IntegrationModuleEntity integrationModule(IntegrationModule module) {
IntegrationModuleEntity readable = new IntegrationModuleEntity();
readable.setActive(true);
readable.setCode(module.getModule());
readable.setImage(module.getImage());
private IntegrationModuleEntity integrationModule(IntegrationModule module, Map<String,IntegrationConfiguration> configuredModules) {

IntegrationModuleEntity readable = null;
readable = new IntegrationModuleEntity();

readable.setCode(module.getCode());
readable.setImage(module.getImage());
if(configuredModules.containsKey(module.getCode())) {
IntegrationConfiguration conf = configuredModules.get(module.getCode());
readable.setConfigured(true);
}
return readable;

}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.salesmanager.shop.store.api.v1.shipping;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
Expand All @@ -10,6 +9,7 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
Expand All @@ -18,16 +18,24 @@
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;

import com.salesmanager.core.business.exception.ServiceException;
import com.salesmanager.core.business.services.shipping.ShippingService;
import com.salesmanager.core.model.merchant.MerchantStore;
import com.salesmanager.core.model.reference.language.Language;
import com.salesmanager.core.model.shipping.PackageDetails;
import com.salesmanager.core.model.system.IntegrationConfiguration;
import com.salesmanager.core.model.system.IntegrationModule;
import com.salesmanager.shop.constants.Constants;
import com.salesmanager.shop.model.references.PersistableAddress;
import com.salesmanager.shop.model.references.ReadableAddress;
import com.salesmanager.shop.model.system.IntegrationModuleEntity;
import com.salesmanager.shop.store.api.exception.ServiceRuntimeException;
import com.salesmanager.shop.store.controller.shipping.facade.ShippingFacade;
import com.salesmanager.shop.utils.AuthorizationUtils;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.SwaggerDefinition;
import io.swagger.annotations.Tag;
Expand All @@ -48,6 +56,9 @@ public class ShippingConfigurationApi {
@Autowired
private ShippingFacade shippingFacade;

@Autowired
private ShippingService shippingService;

@ApiOperation(httpMethod = "GET", value = "Get shipping origin for a specific merchant store",
notes = "", produces = "application/json", response = ReadableAddress.class)
@RequestMapping(value = { "/private/shipping/origin" }, method = RequestMethod.GET)
Expand Down Expand Up @@ -183,6 +194,58 @@ public void deletePackage(

}



/**
* Get available shipping modules
* @param merchantStore
* @param language
* @return
*/
@GetMapping("/private/modules/shipping")
@ApiOperation(
httpMethod = "GET",
value = "List list of shipping modules",
notes = "Requires administration access",
produces = "application/json",
response = List.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "store", dataType = "string", defaultValue = "DEFAULT")
})
public List<IntegrationModuleEntity> paymentModules(
@ApiIgnore MerchantStore merchantStore,
@ApiIgnore Language language) {

try {
List<IntegrationModule> modules = shippingService.getShippingMethods(merchantStore);

//configured modules
Map<String,IntegrationConfiguration> configuredModules = shippingService.getShippingModulesConfigured(merchantStore);
return modules.stream().map(m -> this.integrationModule(m, configuredModules)).collect(Collectors.toList());

} catch (ServiceException e) {
LOGGER.error("Error getting shipping modules", e);
throw new ServiceRuntimeException("Error getting shipping modules", e);
}


}

private IntegrationModuleEntity integrationModule(IntegrationModule module, Map<String,IntegrationConfiguration> configuredModules) {

IntegrationModuleEntity readable = null;
readable = new IntegrationModuleEntity();

readable.setCode(module.getCode());
readable.setImage(module.getImage());
if(configuredModules.containsKey(module.getCode())) {
IntegrationConfiguration conf = configuredModules.get(module.getCode());
readable.setConfigured(true);
}
return readable;

}

//Module configuration
/**
* private String moduleCode;
Expand Down

0 comments on commit 87550d8

Please sign in to comment.