1 package com.srv4pos.server.api.activation; 2 3 import com.srv4pos.server.api.infrastructure.Info; 4 import org.springframework.roo.addon.javabean.RooJavaBean; 5 import org.springframework.roo.addon.json.RooJson; 6 import org.springframework.roo.addon.tostring.RooToString; 7 8 import javax.validation.Valid; 9 import javax.validation.constraints.NotNull; 10 import javax.validation.constraints.Size; 11 import java.util.Date; 12 import java.util.HashSet; 13 14 /** 15 * Represents server-side entity available. 16 * <p>User: Kirill, Date: 05.08.13 17:59</p> 17 */ 18 @RooJavaBean 19 @RooToString 20 @RooJson(deepSerialize = true) 21 public class ActivationInfo implements Info { 22 private Long id; 23 24 /** 25 * This field is set by activation server internal logic every time we do an action with the activation, 26 * so it's read-only field, any input will be ignored. 27 */ 28 @NotNull 29 private ActivationStatus status = ActivationStatus.ISSUED; 30 31 /** 32 * It's read-only field. 33 */ 34 private Date issued; 35 36 /** 37 * This field is set by customer when ordering. 38 */ 39 private ControlUnitLocation controlUnitLocation = ControlUnitLocation.REMOTE; 40 41 /** 42 * This field is set a) when customer makes an order and suggest the date he wish; b) when sales person approves an activation he is able to change it. 43 */ 44 private Date validFrom; 45 46 /** 47 * This field is set a) when customer makes an order and suggest the date he wish; b) when sales person approves an activation he is able to change it. 48 */ 49 private Date validTo; 50 51 /** 52 * This field is set when customer makes an order: 53 * <ul> 54 * <li>control unit is not required by the application, then this field is null</li> 55 * <li>If {@link ActivationDetailsInfo#controlUnitLocation} == {@link ControlUnitLocation#REMOTE}, then one of the connected control units will be 56 * selected automatically</li> 57 * <li>If {@link ActivationDetailsInfo#controlUnitLocation} == {@link ControlUnitLocation#DEVICE}, then 58 * <ul> 59 * <li>control unit will be selected by {@link com.srv4pos.server.api.activation.ActivationDetailsInfo#controlUnitSerialNumber}</li> 60 * <li>or null if customer wants to order a new one</li> 61 * </ul> 62 * </li> 63 * </ul>. 64 * This field can be changed by sales person when he activates an activation. 65 */ 66 @Size(max = 20, min = 1) 67 private String controlUnitSerial; 68 69 /** 70 * Where device (with control unit) is located. This information is sent to taxation authority 71 * This field is set when customer makes an order and {@link ActivationDetailsInfo#controlUnitLocation} == {@link ControlUnitLocation#DEVICE}. 72 * If this field is set and sales person makes an activation, he must check it's validity because it's content will be copied to controlUnit.geolocation 73 * and will be applied for all the sellers connected to this control unit. 74 */ 75 @Valid 76 private GeolocationInfo controlUnitGeolocation; 77 78 /** 79 * This field is set when customer to tell sales person his contact data. 80 */ 81 @Valid 82 private ContactInfo contact; 83 84 /** 85 * This field is set when customer makes an order to send a custom message to sales person. For instance "I've broken my device with already 86 * activated license. Please reactivate this new device for free". 87 */ 88 @Size(max = 1024) 89 private String comment; 90 91 /** 92 * Set of features, see {@link Feature} for more info. 93 */ 94 @NotNull 95 private java.util.Set<Feature> features = new HashSet<Feature>(); 96 97 private int apiVersion; 98 99 @Valid 100 private GeolocationInfo registrationLocation; 101 102 @Size(max = 256) 103 private String skvRegistration; 104 105 private Date skvRegistrationDate; 106 }