package com.red.circle.other.app.dto.clientobject.family;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.red.circle.framework.dto.ClientObject;
import java.io.Serial;
import java.math.BigDecimal;
import java.util.List;

import com.red.circle.other.inner.model.dto.famliy.FamilyMemberInfoDTO;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 家族基本信息.
 * </p>
 *
 * @author pengshigang
 * @since 2021-07-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class FamilyBaseInfoCO extends ClientObject {

  @Serial
  private static final long serialVersionUID = 1L;

  /**
   * 家族id.
   */
  @JsonSerialize(using = ToStringSerializer.class)
  private Long familyId;

  /**
   * 家族账号.
   */
  private String familyAccount;

  /**
   * 家族头像.
   */
  private String familyAvatar;

  /**
   * 家族名称.
   */
  private String familyName;

  /**
   * 家族介绍.
   */
  private String familyIntro;

  /**
   * 家族公告.
   */
  private String familyNotice;

  /**
   * 家族长信息
   */
  private FamilyAdminInfo familyAdmin;

  /**
   * 家族当前经验值
   */
  @JsonSerialize(using = ToStringSerializer.class)
  private Long currentExp;

  /**
   * 家族当前成员数.
   */
  private Integer currentMember;

  /**
   * 家族等级.
   */
  private Integer familyLevel;

  /**
   * 等级经验值
   */
  @JsonSerialize(using = ToStringSerializer.class)
  private Long levelExp;

  /**
   * 头像框.
   */
  private String avatarFrameCover;

  /**
   * 头像框效果.
   */
  private String avatarFrameSvg;

  /**
   * 徽章.
   */
  private String badgeCover;

  /**
   * 徽章效果.
   */
  private String badgeSvg;

  /**
   * 最大成员数.
   */
  private Integer maxMember;

  /**
   * 等级背景图.
   */
  private String levelBackgroundPicture;

  /**
   * 家族宝箱信息.
   */
  private FamilyBoxInfo boxInfo;

  /**
   * 成员列表.
   */
  private FamilyMemberList memberList;

  /**
   * 我的家族权限
   */
  private String myFamilyRole;

    /**
     * 待加入
     */
  private Boolean joinWaiting;

  /**
   * 家族群聊付费解锁金额.
   */
  private BigDecimal amount;

  @Data
  public static class FamilyAdminInfo {

      @JsonSerialize(using = ToStringSerializer.class)
      private Long userId;

      private String account;

      private String specialAccount;

      private String userAvatar;

      private String userNickName;

  }

  @Data
  public static class FamilyBoxInfo {

      /**
       * 当日投入人数.
       */
      private Integer contributeCount;

      /**
       * 当前用户是否已投入.
       */
      private Boolean userContributed;

      /**
       * 宝箱列表.
       */
      private List<FamilyBoxChestCO> chests;

  }

  @Data
  public static class FamilyMemberList {

      /**
       * 主播列表.
       */
      private List<SimpleMemberInfo> hosts;

      /**
       * 支持者列表.
       */
      private List<SimpleMemberInfo> supporters;

  }

  @Data
  public static class SimpleMemberInfo {

      /**
       * 用户ID.
       */
      @JsonSerialize(using = ToStringSerializer.class)
      private Long userId;

      /**
       * 用户头像.
       */
      private String userAvatar;

  }

}
