package com.microservices.zone.member.domain.vo;

import com.microservices.zone.member.domain.points.ZonePointsApply;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;

/**
 * 积分申请输入对象
 *
 * @author otto
 */
@Data
@ApiModel("积分申请输入对象")
public class ZonePointsApplyInputVo {
    @ApiModelProperty(value = "申请记录ID（驳回操作时必填）")
    private Long id;

    @ApiModelProperty(value = "用户ID", required = true)
    @NotNull
    private Long userId;

    @ApiModelProperty(value = "专区ID", required = true)
    @NotNull
    private Long zoneId;

    @ApiModelProperty(value = "组织ID", required = true)
    @NotNull
    private Long deptId;

    @ApiModelProperty(value = "申请类型（如：download下载/redeem兑换等）", required = true)
    @NotNull
    private String applyType;

    @ApiModelProperty(value = "事件ID（关联积分流水事件）")
    private String eventId;

    @ApiModelProperty(value = "申请积分数量")
    private Integer points;

    @ApiModelProperty(value = "手机号")
    private String phone;

    @ApiModelProperty(value = "真实姓名")
    private String realName;

    @ApiModelProperty(value = "描述")
    private String description;

    @ApiModelProperty(value = "回复/驳回内容")
    private String reply;

    @ApiModelProperty(value = "组织")
    private String organization;

    @ApiModelProperty(value = "微信号")
    private String wechat;

    @ApiModelProperty(value = "邮箱")
    private String email;

    public ZonePointsApply toZonePointsApply() {
        ZonePointsApply zonePointsApply = new ZonePointsApply();
        zonePointsApply.setUserId(userId);
        zonePointsApply.setZoneId(zoneId);
        zonePointsApply.setDeptId(deptId);
        zonePointsApply.setApplyType(applyType);
        zonePointsApply.setEventId(eventId);
        zonePointsApply.setPoints(points);
        zonePointsApply.setStatus("pending");
        zonePointsApply.setPhone(phone);
        zonePointsApply.setRealName(realName);
        zonePointsApply.setDescription(description);
        zonePointsApply.setOrganization(organization);
        zonePointsApply.setWechat(wechat);
        zonePointsApply.setEmail(email);
        return zonePointsApply;
    }
}