package com.red.circle.other.inner.model.dto.material.props;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 贵族商店.
 * </p>
 *
 * @author pengliang
 * @since 2021-05-29
 */
@Deprecated
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class NobleVipStore implements Serializable {

  @Serial
  private static final long serialVersionUID = 1L;

  /**
   * 主键表示.
   */
  @JsonSerialize(using = ToStringSerializer.class)
  private Long id;

  /**
   * 归属平台.
   */
  private String sysOrigin;

  /**
   * 折扣率.
   */
  private Double discount;

  /**
   * 有效天数.
   */
  private String validDays;

  /**
   * 0.下架 1.上架.
   */
  private Boolean shelfStatus;

  /**
   * 道具资源.
   */
  private PropsResources propsResources;

  /**
   * 贵族能力.
   */
  private NobleVipAbility nobleVipAbility;

  /**
   * 头像框.
   */
  private PropsResources avatarFrame;

  /**
   * 座驾.
   */
  private PropsResources car;

  /**
   * 聊天气泡.
   */
  private PropsResources chatBubble;

  /**
   * 道具价格
   */
  private List<PropsPrice> propsPrices;

  /**
   * 计算价格.
   */
  public BigDecimal calculatePropsPrices(Integer days) {
    return PropsPrice.of(days, propsResources.getAmount()).getAmount();
  }

  /**
   * 计算折扣价格.
   */
  public BigDecimal calculatePropsPricesDiscount(Integer days, Double discount) {
    return PropsPrice.of(days, propsResources.getAmount(), BigDecimal.valueOf(discount))
        .getDiscountAmount();
  }

  /**
   * 获取资源id.
   */
  public Long getPropsResourceId() {
    return propsResources.getId();
  }

  public Integer getRoomMaxMember() {
    return nobleVipAbility.roomMaxMember();
  }

  public Integer getVipLevel() {
    return nobleVipAbility.vipLevel();
  }

  public BigDecimal getLoginRewardsAmount() {
    return nobleVipAbility.loginRewardsAmount();
  }

  public String getVipType() {
    return nobleVipAbility.vipType();
  }

  public Integer getAdminNumber() {
    return nobleVipAbility.adminNumber();
  }
}
