Skip to content

Commit

Permalink
p
Browse files Browse the repository at this point in the history
  • Loading branch information
shopizer-ecommerce committed Jun 22, 2022
2 parents d8ec452 + 5f64ae7 commit bdd5e3a
Show file tree
Hide file tree
Showing 109 changed files with 2,154 additions and 2,000 deletions.
4 changes: 0 additions & 4 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,9 @@ Upgrade
Spring boot 2.5.5



Fixes

CVE-2022-23063
#727





13 changes: 6 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>com.shopizer</groupId>
<artifactId>shopizer</artifactId>
<packaging>pom</packaging>
<version>3.0.2</version>
<version>3.2.0</version>

<name>shopizer</name>
<url>http://ww.shopizer.com</url>
Expand All @@ -22,7 +22,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.5</version>
<version>2.5.12</version>
</parent>

<modules>
Expand Down Expand Up @@ -97,22 +97,22 @@
<dependency>
<groupId>com.shopizer</groupId>
<artifactId>sm-core</artifactId>
<version>3.0.2</version>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>com.shopizer</groupId>
<artifactId>sm-core-model</artifactId>
<version>3.0.2</version>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>com.shopizer</groupId>
<artifactId>sm-core-modules</artifactId>
<version>3.0.2</version>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>com.shopizer</groupId>
<artifactId>sm-shop-model</artifactId>
<version>3.0.2</version>
<version>3.2.0</version>
</dependency>

<!-- https://mvnrepository.com/artifact/javax.inject/javax.inject -->
Expand Down Expand Up @@ -181,7 +181,6 @@
<version>${shopizer.search.version}</version>
</dependency>


<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
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 @@ -5,7 +5,7 @@
<parent>
<groupId>com.shopizer</groupId>
<artifactId>shopizer</artifactId>
<version>3.0.2</version>
<version>3.2.0</version>
</parent>

<!-- https://mvnrepository.com/artifact/com.shopizer/shopizer-parent -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class ServiceException extends Exception {
private int exceptionType = 0;//regular error



public final static int EXCEPTION_ERROR = 500;

public final static int EXCEPTION_VALIDATION = 99;
public final static int EXCEPTION_PAYMENT_DECLINED = 100;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,22 @@ public void setOwner(Customer owner) {
this.owner = owner;
}

public Set<ProductInstance> getInstances() {
return instances;
}

public void setInstances(Set<ProductInstance> instances) {
this.instances = instances;
}

public void setAvailable(boolean available) {
this.available = available;
}

public void setProductShipeable(boolean productShipeable) {
this.productShipeable = productShipeable;
}




Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.salesmanager.core.model.catalog.product.attribute;

public interface Optionable {

ProductOption getProductOption();
void setProductOption(ProductOption option);

ProductOptionValue getProductOptionValue();
void setProductOptionValue(ProductOptionValue optionValue);

}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*
*/

public class ProductAttribute extends SalesManagerEntity<Long, ProductAttribute> {
public class ProductAttribute extends SalesManagerEntity<Long, ProductAttribute> implements Optionable {
private static final long serialVersionUID = 1L;

@Id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,24 @@
@Entity
@EntityListeners(value = AuditListener.class)
@Table(name = "PRODUCT_INSTANCE",
uniqueConstraints = @UniqueConstraint(columnNames = { "PRODUCT_ID",
uniqueConstraints =
@UniqueConstraint(columnNames = {
"PRODUCT_ID",
"SKU" }))
public class ProductInstance extends SalesManagerEntity<Long, ProductInstance> implements Auditable {
private static final long serialVersionUID = 1L;

@Id
@Column(name = "PRODUCT_INSTANCE_ID", unique = true, nullable = false)
@TableGenerator(name = "TABLE_GEN", table = "SM_SEQUENCER", pkColumnName = "SEQ_NAME", valueColumnName = "SEQ_COUNT", pkColumnValue = "PRODUCT_SEQ_NEXT_VAL")
@TableGenerator(name = "TABLE_GEN",
table = "SM_SEQUENCER",
pkColumnName = "SEQ_NAME",
valueColumnName = "SEQ_COUNT",
pkColumnValue = "PRODUCT_INST_SEQ_NEXT_VAL")
@GeneratedValue(strategy = GenerationType.TABLE, generator = "TABLE_GEN")
private Long id;


@Embedded
private AuditSection auditSection = new AuditSection();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@
import com.salesmanager.core.model.generic.SalesManagerEntity;
import com.salesmanager.core.model.merchant.MerchantStore;


@Entity
@EntityListeners(value = AuditListener.class)
@Table(name="PRODUCT_INSTANCE_GROUP")
/**
* Extra properties on a group of instances
* @author carlsamson
*
*/


@Entity
@EntityListeners(value = AuditListener.class)
@Table(name="PRODUCT_INSTANCE_GROUP")
public class ProductInstanceGroup extends SalesManagerEntity<Long, ProductInstanceGroup> {

private static final long serialVersionUID = 1L;


@Id
@Column(name = "PRODUCT_INSTANCE_GROUP_ID", unique=true, nullable=false)
@TableGenerator(name = "TABLE_GEN", table = "SM_SEQUENCER", pkColumnName = "SEQ_NAME", valueColumnName = "SEQ_COUNT", pkColumnValue = "PRODUCT_INST_GROUP_SEQ_NEXT_VAL")
@TableGenerator(name = "TABLE_GEN",
table = "SM_SEQUENCER",
pkColumnName = "SEQ_NAME",
valueColumnName = "SEQ_COUNT", pkColumnValue = "PRODUCT_INST_GROUP_SEQ_NEXT_VAL")
@GeneratedValue(strategy = GenerationType.TABLE, generator = "TABLE_GEN")
private Long id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ public void setProductInstanceGroup(ProductInstanceGroup productInstanceGroup) {

@Id
@Column(name = "PRODUCT_INST_IMAGE_ID")
@TableGenerator(name = "TABLE_GEN", table = "SM_SEQUENCER", pkColumnName = "SEQ_NAME", valueColumnName = "SEQ_COUNT", pkColumnValue = "PRD_VAR_IMG_SEQ_NEXT_VAL")
@TableGenerator(name = "TABLE_GEN",
table = "SM_SEQUENCER",
pkColumnName = "SEQ_NAME",
valueColumnName = "SEQ_COUNT",
pkColumnValue = "PRD_INST_IMG_SEQ_NEXT_VAL")
@GeneratedValue(strategy = GenerationType.TABLE, generator = "TABLE_GEN")
private Long id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import javax.persistence.UniqueConstraint;
import javax.validation.constraints.NotEmpty;

import com.salesmanager.core.model.catalog.product.attribute.Optionable;
import com.salesmanager.core.model.catalog.product.attribute.ProductOption;
import com.salesmanager.core.model.catalog.product.attribute.ProductOptionValue;
import com.salesmanager.core.model.common.audit.AuditListener;
Expand All @@ -37,7 +38,7 @@
@EntityListeners(value = AuditListener.class)
@Table(name = "PRODUCT_VARIATION", uniqueConstraints=
@UniqueConstraint(columnNames = {"MERCHANT_ID", "PRODUCT_OPTION_ID", "OPTION_VALUE_ID"}))
public class ProductVariation extends SalesManagerEntity<Long, ProductVariation> implements Auditable {
public class ProductVariation extends SalesManagerEntity<Long, ProductVariation> implements Optionable, Auditable {

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import javax.persistence.TableGenerator;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.salesmanager.core.constants.SchemaConstant;
import com.salesmanager.core.model.generic.SalesManagerEntity;
import com.salesmanager.core.model.order.Order;

Expand All @@ -32,7 +31,7 @@ public class OrderProduct extends SalesManagerEntity<Long, OrderProduct> {
@GeneratedValue(strategy = GenerationType.TABLE, generator = "TABLE_GEN")
private Long id;

@Column (name="PRODUCT_SKU") //yess !!! rename to code
@Column (name="PRODUCT_SKU")
private String sku;

@Column (name="PRODUCT_NAME" , length=64 , nullable=false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import javax.persistence.Transient;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.salesmanager.core.constants.SchemaConstant;
import com.salesmanager.core.model.catalog.product.attribute.ProductAttribute;
import com.salesmanager.core.model.common.audit.AuditListener;
import com.salesmanager.core.model.common.audit.AuditSection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import javax.persistence.Transient;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.salesmanager.core.constants.SchemaConstant;
import com.salesmanager.core.model.catalog.product.Product;
import com.salesmanager.core.model.catalog.product.price.FinalPrice;
import com.salesmanager.core.model.common.audit.AuditListener;
Expand Down Expand Up @@ -52,21 +51,28 @@ public class ShoppingCartItem extends SalesManagerEntity<Long, ShoppingCartItem>
private ShoppingCart shoppingCart;

@Column(name="QUANTITY")
private Integer quantity = new Integer(1);

private Integer quantity = 1;

@Embedded
private AuditSection auditSection = new AuditSection();

@Column(name="PRODUCT_ID", nullable=false) //TODO CODE
private Long productId;
@Deprecated //Use sku
@Column(name="PRODUCT_ID", nullable=false)
private Long productId;

//SKU
@Column(name="SKU", nullable=true)
private String sku;

@JsonIgnore
@Transient
private boolean productVirtual;

@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "shoppingCartItem")
private Set<ShoppingCartAttributeItem> attributes = new HashSet<ShoppingCartAttributeItem>();

@Column(name="PRODUCT_INSTANCE", nullable=true)
private Long productInstance;

@JsonIgnore
@Transient
Expand Down Expand Up @@ -130,8 +136,6 @@ public void setId(Long id) {

}



public void setAttributes(Set<ShoppingCartAttributeItem> attributes) {
this.attributes = attributes;
}
Expand All @@ -156,8 +160,6 @@ public Integer getQuantity() {
return quantity;
}



public ShoppingCart getShoppingCart() {
return shoppingCart;
}
Expand Down Expand Up @@ -229,4 +231,20 @@ public void setProductVirtual(boolean productVirtual) {
this.productVirtual = productVirtual;
}

public String getSku() {
return sku;
}

public void setSku(String sku) {
this.sku = sku;
}

public Long getProductInstance() {
return productInstance;
}

public void setProductInstance(Long productInstance) {
this.productInstance = productInstance;
}

}
2 changes: 1 addition & 1 deletion sm-core-modules/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>3.0.2</version>
<version>3.2.0</version>
</parent>


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>3.0.2</version>
<version>3.2.0</version>
</parent>

<artifactId>sm-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.salesmanager.core.business.configuration.events;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.ApplicationEventMulticaster;
import org.springframework.context.event.SimpleApplicationEventMulticaster;
import org.springframework.core.task.SimpleAsyncTaskExecutor;

/**
* Events will be asynchronous (in a different thread)
* @author carlsamson
*
*/
@Configuration
public class AsynchronousEventsConfiguration {

@Bean(name = "applicationEventMulticaster")
public ApplicationEventMulticaster simpleApplicationEventMulticaster() {
SimpleApplicationEventMulticaster eventMulticaster
= new SimpleApplicationEventMulticaster();

eventMulticaster.setTaskExecutor(new SimpleAsyncTaskExecutor());
return eventMulticaster;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.salesmanager.core.business.configuration.events.products;

import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
* Index product in opensearch if it is confugured to do so !
* @author carlsamson
*
*/
@Component
public class IndexProductEventListener implements ApplicationListener<ProductEvent> {

@Override
public void onApplicationEvent(ProductEvent event) {
// TODO Auto-generated method stub

}

}
Loading

0 comments on commit bdd5e3a

Please sign in to comment.