Skip to content

Commit 309c8aa

Browse files
Product catalog
1 parent d268d7c commit 309c8aa

36 files changed

+450
-31
lines changed

sm-core-model/src/main/java/com/salesmanager/core/model/catalog/catalog/Catalog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public class Catalog extends SalesManagerEntity<Long, Catalog> implements Audita
7777
private boolean visible;
7878

7979

80-
@Column(name="DEFAULT")
80+
@Column(name="DEFAULT_CATALOG")
8181
private boolean defaultCatalog;
8282

8383
@NotEmpty

sm-core-model/src/main/java/com/salesmanager/core/model/catalog/catalog/CatalogEntry.java

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package com.salesmanager.core.model.catalog.catalog;
22

3+
import javax.persistence.Embedded;
34
import javax.persistence.Entity;
5+
import javax.persistence.EntityListeners;
46
import javax.persistence.GeneratedValue;
57
import javax.persistence.Id;
68
import javax.persistence.JoinColumn;
@@ -12,11 +14,18 @@
1214

1315
import com.salesmanager.core.model.catalog.category.Category;
1416
import com.salesmanager.core.model.catalog.product.Product;
17+
import com.salesmanager.core.model.common.audit.AuditSection;
18+
import com.salesmanager.core.model.common.audit.Auditable;
1519
import com.salesmanager.core.model.generic.SalesManagerEntity;
1620

1721
@Entity
22+
@EntityListeners(value = com.salesmanager.core.model.common.audit.AuditListener.class)
1823
@Table(name="CATALOG_ENTRY")
19-
public class CatalogEntry extends SalesManagerEntity<Long, CatalogEntry> {
24+
public class CatalogEntry extends SalesManagerEntity<Long, CatalogEntry> implements Auditable {
25+
26+
27+
@Embedded
28+
private AuditSection auditSection = new AuditSection();
2029

2130
/**
2231
*
@@ -82,4 +91,15 @@ public void setId(Long id) {
8291

8392
}
8493

94+
@Override
95+
public AuditSection getAuditSection() {
96+
return auditSection;
97+
}
98+
99+
@Override
100+
public void setAuditSection(AuditSection audit) {
101+
auditSection = audit;
102+
103+
}
104+
85105
}

sm-shop-model/src/main/java/com/salesmanager/shop/model/catalog/CatalogEntity.java renamed to sm-shop-model/src/main/java/com/salesmanager/shop/model/catalog/NamedEntity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import com.salesmanager.shop.model.entity.ShopEntity;
66

77

8-
public abstract class CatalogEntity extends ShopEntity implements Serializable {
8+
public abstract class NamedEntity extends ShopEntity implements Serializable {
99

1010
/**
1111
*
@@ -61,4 +61,5 @@ public void setTitle(String title) {
6161
this.title = title;
6262
}
6363

64+
6465
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package com.salesmanager.shop.model.catalog.catalog;
2+
3+
import java.io.Serializable;
4+
5+
import com.salesmanager.shop.model.entity.Entity;
6+
7+
public class CatalogEntity extends Entity implements Serializable {
8+
9+
/**
10+
*
11+
*/
12+
private static final long serialVersionUID = 1L;
13+
14+
private boolean visible;
15+
private boolean defaultCatalog;
16+
private String code;
17+
public boolean isVisible() {
18+
return visible;
19+
}
20+
public void setVisible(boolean visible) {
21+
this.visible = visible;
22+
}
23+
public boolean isDefaultCatalog() {
24+
return defaultCatalog;
25+
}
26+
public void setDefaultCatalog(boolean defaultCatalog) {
27+
this.defaultCatalog = defaultCatalog;
28+
}
29+
public String getCode() {
30+
return code;
31+
}
32+
public void setCode(String code) {
33+
this.code = code;
34+
}
35+
36+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.salesmanager.shop.model.catalog.catalog;
2+
3+
import com.salesmanager.shop.model.entity.Entity;
4+
5+
public class CetalogEntryEntity extends Entity {
6+
7+
/**
8+
*
9+
*/
10+
private static final long serialVersionUID = 1L;
11+
private String catalog;
12+
public String getCatalog() {
13+
return catalog;
14+
}
15+
public void setCatalog(String catalog) {
16+
this.catalog = catalog;
17+
}
18+
19+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.salesmanager.shop.model.catalog.catalog;
2+
3+
public class PersistableCatalog extends CatalogEntity {
4+
5+
/**
6+
*
7+
*/
8+
private static final long serialVersionUID = 1L;
9+
10+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.salesmanager.shop.model.catalog.catalog;
2+
3+
import com.salesmanager.shop.model.catalog.NamedEntity;
4+
5+
public class PersistableCatalogEntry extends NamedEntity {
6+
7+
/**
8+
*
9+
*/
10+
private static final long serialVersionUID = 1L;
11+
private String productCode;
12+
private String categoryCode;
13+
public String getProductCode() {
14+
return productCode;
15+
}
16+
public void setProductCode(String productCode) {
17+
this.productCode = productCode;
18+
}
19+
public String getCategoryCode() {
20+
return categoryCode;
21+
}
22+
public void setCategoryCode(String categoryCode) {
23+
this.categoryCode = categoryCode;
24+
}
25+
26+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.salesmanager.shop.model.catalog.catalog;
2+
3+
import com.salesmanager.shop.model.catalog.NamedEntity;
4+
5+
public class ReadableCatalog extends NamedEntity {
6+
7+
/**
8+
*
9+
*/
10+
private static final long serialVersionUID = 1L;
11+
private String creationDate;
12+
public String getCreationDate() {
13+
return creationDate;
14+
}
15+
public void setCreationDate(String creationDate) {
16+
this.creationDate = creationDate;
17+
}
18+
19+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package com.salesmanager.shop.model.catalog.catalog;
2+
3+
import com.salesmanager.shop.model.catalog.category.ReadableCategory;
4+
import com.salesmanager.shop.model.catalog.product.ReadableProduct;
5+
6+
public class ReadableCatalogEntry extends CetalogEntryEntity {
7+
8+
/**
9+
*
10+
*/
11+
private static final long serialVersionUID = 1L;
12+
private String creationDate;
13+
private ReadableProduct product;
14+
private ReadableCategory category;
15+
public String getCreationDate() {
16+
return creationDate;
17+
}
18+
public void setCreationDate(String creationDate) {
19+
this.creationDate = creationDate;
20+
}
21+
public ReadableProduct getProduct() {
22+
return product;
23+
}
24+
public void setProduct(ReadableProduct product) {
25+
this.product = product;
26+
}
27+
public ReadableCategory getCategory() {
28+
return category;
29+
}
30+
public void setCategory(ReadableCategory category) {
31+
this.category = category;
32+
}
33+
34+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.salesmanager.shop.model.catalog.catalog;
2+
3+
import java.util.ArrayList;
4+
import java.util.List;
5+
6+
import com.salesmanager.shop.model.entity.ReadableList;
7+
8+
public class ReadableCatalogEntryList extends ReadableList {
9+
10+
/**
11+
*
12+
*/
13+
private static final long serialVersionUID = 1L;
14+
private List<ReadableCatalogEntry> catalogEntry = new ArrayList<ReadableCatalogEntry>();
15+
public List<ReadableCatalogEntry> getCatalogEntry() {
16+
return catalogEntry;
17+
}
18+
public void setCatalogEntry(List<ReadableCatalogEntry> catalogEntry) {
19+
this.catalogEntry = catalogEntry;
20+
}
21+
22+
}

0 commit comments

Comments
 (0)