View Javadoc
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   * <p>User: Kirill, Date: 05.08.13 17:59</p>.
19   */
20  @RooJavaBean
21  @RooToString
22  @RooJson(deepSerialize = true)
23  public class ProductInfo implements SyncEntityInfo {
24  
25      /**
26       * List of fields for ordering.
27       */
28      //CHECKSTYLE:OFF Missing Javadoc comments.
29      public static enum Fields { IDENTIFIER, NAME, BARCODE, NETTO, TAX_NAME, SALES_UNIT, COUNTED_IN_PRICE, PRICE, DESCRIPTION }
30      //CHECKSTYLE:ON Missing a Javadoc comment.
31      // TODO KKB. we should rename TAX_NAME to TAX. Fix rest.xml too.
32  
33      /**
34       * True if entity was deleted. Only possible if return diff.
35       */
36      @NotNull
37      private boolean deleted = Boolean.FALSE;
38  
39      /**
40       * This field uniqly identifies entity. There is no decision what is it,
41       * only the requirement - it must be unique trough one seller.
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       * Regular field.
50       */
51      @NotNull
52      @Size(max = 64, min = 1)
53      private String name;
54  
55      /**
56       * Regular field.
57       */
58      @Size(max = 32, min = 1)
59      private String barcode;
60  
61      /**
62       * Regular field.
63       */
64      @NotNull
65      @Min(0)
66      private long netto;
67  
68      /**
69       * Regular field. Tax identifier.
70       */
71      @NotNull
72      @Size(max = 50, min = 1)
73      @Pattern(regexp = Constraints.WINDOWS_FILENAME_REGEX)
74      private String tax;
75  
76      /**
77       * Regular field.
78       */
79      @NotNull
80      private SalesUnit salesUnit = SalesUnit.Piece;
81  
82      /**
83       * Regular field.
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  }