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

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

import javax.validation.constraints.NotNull;

/**
 * 积分账户更新对象
 *
 * @author otto
 */
@Data
@ApiModel("积分账户更新对象")
public class ZonePointsAccountUpdateVo {

    @ApiModelProperty(value = "积分账户ID", required = true)
    @NotNull
    private Long id;

    @ApiModelProperty(value = "累计积分")
    private int totalPoints;

    @ApiModelProperty(value = "累计获取积分")
    private int totalEarnedPoints;

    @ApiModelProperty(value = "累计消费积分")
    private int totalConsumedPoints;

    @ApiModelProperty(value = "可用积分")
    private int availablePoints;

    @ApiModelProperty(value = "冻结积分")
    private int frozenPoints;

    public ZonePointsAccount toZonePointsAccount() {
        ZonePointsAccount zonePointsAccount = new ZonePointsAccount();
        zonePointsAccount.setId(id);
        zonePointsAccount.setTotalPoints(totalPoints);
        zonePointsAccount.setTotalEarnedPoints(totalEarnedPoints);
        zonePointsAccount.setTotalConsumedPoints(totalConsumedPoints);
        zonePointsAccount.setAvailablePoints(availablePoints);
        zonePointsAccount.setFrozenPoints(frozenPoints);
        return zonePointsAccount;
    }
}