1 package com.srv4pos.server.api.product;
2
3 import com.srv4pos.server.api.infrastructure.Constraints;
4 import com.srv4pos.server.api.infrastructure.SyncEntityInfo;
5 import com.srv4pos.server.api.infrastructure.journal.JournalDate;
6 import com.srv4pos.server.api.validationGroups.IdentifierValidationGroup;
7 import org.springframework.roo.addon.javabean.RooJavaBean;
8 import org.springframework.roo.addon.json.RooJson;
9 import org.springframework.roo.addon.tostring.RooToString;
10
11 import javax.validation.constraints.Min;
12 import javax.validation.constraints.NotNull;
13 import javax.validation.constraints.Pattern;
14 import javax.validation.constraints.Size;
15 import java.util.Date;
16
17
18
19
20 @RooJavaBean
21 @RooToString
22 @RooJson(deepSerialize = true)
23 public class ProductInfo implements SyncEntityInfo {
24
25
26
27
28
29 public static enum Fields { IDENTIFIER, NAME, BARCODE, NETTO, TAX_NAME, SALES_UNIT, COUNTED_IN_PRICE, PRICE, DESCRIPTION }
30
31
32
33
34
35
36 @NotNull
37 private boolean deleted = Boolean.FALSE;
38
39
40
41
42
43 @NotNull(groups = IdentifierValidationGroup.class)
44 @Size(max = 50, min = 1)
45 @Pattern(regexp = Constraints.WINDOWS_FILENAME_REGEX)
46 private String identifier;
47
48
49
50
51 @NotNull
52 @Size(max = 32, min = 1)
53 private String name;
54
55
56
57
58 @NotNull
59 @Size(max = 32, min = 1)
60 private String barcode;
61
62
63
64
65 @NotNull
66 @Min(0)
67 private long netto;
68
69
70
71
72 @NotNull
73 @Size(max = 50, min = 1)
74 @Pattern(regexp = Constraints.WINDOWS_FILENAME_REGEX)
75 private String tax;
76
77
78
79
80 @NotNull
81 private SalesUnit salesUnit = SalesUnit.Piece;
82
83
84
85
86 @NotNull
87 private boolean countedInPrice = Boolean.FALSE;
88
89 @Size(max = 1024)
90 private String description;
91
92 @Size(max = 65535)
93 private String custom;
94
95 private Integer version;
96
97 @JournalDate
98 private Date modified;
99 }