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      @NotNull
59      @Size(max = 32, min = 1)
60      private String barcode;
61  
62      /**
63       * Regular field.
64       */
65      @NotNull
66      @Min(0)
67      private long netto;
68  
69      /**
70       * Regular field. Tax identifier.
71       */
72      @NotNull
73      @Size(max = 50, min = 1)
74      @Pattern(regexp = Constraints.WINDOWS_FILENAME_REGEX)
75      private String tax;
76  
77      /**
78       * Regular field.
79       */
80      @NotNull
81      private SalesUnit salesUnit = SalesUnit.Piece;
82  
83      /**
84       * Regular field.
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  }