package com.liquidnet.service.adam.dto.vo;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.liquidnet.service.adam.entity.AdamMemberPrice;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

@ApiModel(value = "AdamMemberPriceVo", description = "会员价格")
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class AdamMemberPriceVo implements Serializable {
    private static final long serialVersionUID = -8106910166417645208L;
    @ApiModelProperty(position = 1, value = "会员价格ID")
    private String memberPriceId;
    @ApiModelProperty(position = 2, value = "会员类型ID")
    private String memberId;
    @ApiModelProperty(position = 4, value = "价格包名称")
    private String name;
    @ApiModelProperty(position = 5, value = "原价")
    private BigDecimal price;
    @ApiModelProperty(position = 6, value = "折扣价:购买价格")
    private BigDecimal priceFixed;
    @ApiModelProperty(position = 7, value = "特价:首次、首年优惠价")
    private BigDecimal priceSpecial;
    @ApiModelProperty(position = 8, value = "有效天数")
    private Integer days;
    @ApiModelProperty(position = 9, value = "本价格包权益")
    private List<AdamMemberRightsVo> rightsVoList;

    private static final AdamMemberPriceVo obj = new AdamMemberPriceVo();

    public static AdamMemberPriceVo getNew() {
        try {
            return (AdamMemberPriceVo) obj.clone();
        } catch (CloneNotSupportedException e) {
            return new AdamMemberPriceVo();
        }
    }

    public AdamMemberPriceVo copy(AdamMemberPrice source) {
        if (null == source) return this;
        this.setMemberPriceId(source.getMemberPriceId());
        this.setMemberId(source.getMemberId());
        this.setName(source.getName());
        this.setPrice(source.getPrice());
        this.setPriceFixed(source.getPriceFixed());
        this.setPriceSpecial(source.getPriceSpecial());
        this.setDays(source.getDays());
        return this;
    }
}
