View Javadoc
1   package com.srv4pos.server.api.category;
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 CategoryInfo implements SyncEntityInfo {
23  
24      /**
25       * List of fields for ordering.
26       */
27      //CHECKSTYLE:OFF Missing Javadoc comments.
28      public enum Fields {
29          IDENTIFIER, NAME, VAT
30      } // TODO KKB. we should remove VAT
31      //CHECKSTYLE:ON Missing Javadoc comments.
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      @Size(max = 50, min = 1)
44      @Pattern(regexp = Constraints.WINDOWS_FILENAME_REGEX)
45      private String identifier;
46  
47      /**
48       * Regular field.
49       */
50      @NotNull(groups = IdentifierValidationGroup.class)
51      @Size(max = 64, min = 1)
52      private String name;
53  
54      private Integer version;
55  
56      private Integer color;
57  
58      @JournalDate
59      private Date modified;
60  }