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 = 64, min = 1)
53 private String name;
54
55
56
57
58 @Size(max = 32, min = 1)
59 private String barcode;
60
61
62
63
64 @NotNull
65 @Min(0)
66 private long netto;
67
68
69
70
71 @NotNull
72 @Size(max = 50, min = 1)
73 @Pattern(regexp = Constraints.WINDOWS_FILENAME_REGEX)
74 private String tax;
75
76
77
78
79 @NotNull
80 private SalesUnit salesUnit = SalesUnit.Piece;
81
82
83
84
85 @NotNull
86 private boolean countedInPrice = Boolean.FALSE;
87
88 @Size(max = 1024)
89 private String description;
90
91 @Size(max = 65535)
92 private String custom;
93
94 private Integer version;
95
96 @JournalDate
97 private Date modified;
98 }