package com.red.circle.mq.business.model.event.user;

import com.red.circle.tool.core.num.account.PrettyAccountEnum;
import java.io.Serial;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * @author pengliang on 2020/12/18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class AccountBeautifulNumberEvent implements Serializable {

  @Serial
  private static final long serialVersionUID = 1L;

  /**
   * 账号类型.
   */
  private AccountTypeEnum accountType;

  /**
   * 类型.
   */
  private PrettyAccountEnum prettyAccountType;

  /**
   * 账号.
   */
  private Long account;

  public static AccountBeautifulNumberEvent newRoomAccount(Long account, PrettyAccountEnum pretty) {
    return new AccountBeautifulNumberEvent()
        .setAccountType(AccountTypeEnum.ROOM_ACCOUNT)
        .setPrettyAccountType(pretty)
        .setAccount(account);
  }

  public static AccountBeautifulNumberEvent newUserAccount(Long account, PrettyAccountEnum pretty) {
    return new AccountBeautifulNumberEvent()
        .setAccountType(AccountTypeEnum.USER_ACCOUNT)
        .setPrettyAccountType(pretty)
        .setAccount(account);
  }

  public enum AccountTypeEnum {

    /**
     * 用户账号.
     */
    USER_ACCOUNT,

    /**
     * 房间账号.
     */
    ROOM_ACCOUNT
  }
}
