package jnpf.model.warningnotice.req;
import lombok.Data;
import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Warning notice save request.
 */
@Data
public class WarningNoticeSaveReq implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * Id.如果有则更新，无则插入
     */
    private String id;

    /**
     * 如果是健康证、营业执照、卫生许可，则是类型，如果是自定义证照，则是id。可以传入tab接口返回的key
     */
    @NotNull(message = "证照类型不能为空")
    private String typeOrTemplateId;

    /**
     * Expiry reminder days.
     * STORE_CUSTOM_CERTIFICATE does not require this field.
     */
    private Integer expiryReminderDays;

    /**
     * Notice receiver config list.
     */
    @Valid
    private List<WarningNoticeUserConfigReq> noticeConfigList = new ArrayList<>();

    /**
     * Notice frequency days.
     */
    @NotNull(message = "通知频率不能为空")
    @Min(value = 0, message = "通知频率必须大于等于0")
    private Integer noticeFrequencyDays;
}
