View Javadoc
1   package com.srv4pos.server.api.commodity;
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.NotNull;
12  import javax.validation.constraints.Pattern;
13  import javax.validation.constraints.Size;
14  import java.util.Date;
15  
16  /**
17   * <p>User: Kirill, Date: 05.08.13 17:59</p>.
18   */
19  @RooJavaBean
20  @RooToString
21  @RooJson(deepSerialize = true)
22  public class CommodityInfo implements SyncEntityInfo {
23  
24      /**
25       * List of fields for ordering.
26       */
27      //CHECKSTYLE:OFF Missing Javadoc comments.
28      public enum Fields { IDENTIFIER, PRODUCT_NAME, PRODUCT_BARCODE, PRODUCT_NETTO, CATEGORY_NAME, PRODUCT_SALES_UNIT, PRODUCT_COUNTED_IN_PRICE }
29      //CHECKSTYLE:ON Missing Javadoc comments.
30  
31      /**
32       * True if entity was deleted. Only possible if return diff
33       */
34      @NotNull
35      private boolean deleted = Boolean.FALSE;
36  
37      /**
38       * This field uniquely identifies entity. There is no decision what is it,
39       * only the requirement - it must be unique trough one seller
40       */
41      @NotNull(groups = IdentifierValidationGroup.class)
42      @Size(max = 50, min = 1)
43      @Pattern(regexp = Constraints.WINDOWS_FILENAME_REGEX)
44      private String identifier;
45  
46      /**
47       * Regular field. Product identifier
48       */
49      @NotNull
50      @Size(max = 50, min = 1)
51      @Pattern(regexp = Constraints.WINDOWS_FILENAME_REGEX)
52      private String product;
53  
54      /**
55       * Regular field. Category identifier
56       */
57      @NotNull
58      @Size(max = 50, min = 1)
59      @Pattern(regexp = Constraints.WINDOWS_FILENAME_REGEX)
60      private String category;
61  
62      /**
63       * Regular field. Commodity color
64       */
65      private Integer color;
66  
67      @Size(max = 65535)
68      private String custom;
69  
70      private Integer version;
71  
72      @JournalDate
73      private Date modified;
74  }