package com.red.circle.wallet.infra.database.mongo.entity.bank;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.red.circle.wallet.infra.database.mongo.dto.UserBankWithdrawMoneyApprovalProcess;
import com.red.circle.wallet.infra.database.mongo.dto.UserBankWithdrawMoneyResult;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

/**
 * 用户银行卡提现申请.
 *
 * @author pengliang on 2023/2/15
 */
@Data
@Accessors(chain = true)
@Document("user_bank_withdraw_money_apply")
public class UserBankWithdrawMoneyApply implements Serializable {

  @Serial
  private static final long serialVersionUID = 1L;

  /**
   * 记录id.
   */
  @Id
  @JsonSerialize(using = ToStringSerializer.class)
  private Long id;

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

  /**
   * 银行卡id.
   */
  private Long bankCardId;

  /**
   * 银行卡类型.
   */
  private String bankCardType;

  /**
   * + 接收方式 com.sugartime.app.mongo.user.dto.WithdrawMethod;
   */
  private String acceptMethod;

  /**
   * 提交用户id.
   */
  @JsonSerialize(using = ToStringSerializer.class)
  private Long submitUserId;

  /**
   * 提交金额.
   */
  private BigDecimal amount;

  /**
   * 金额类型：MONEY(美金政策)、SALARY_DIAMOND(工资钻石政策)
   */
  @Field("amountType")
  private String amountType;

  /**
   * 提现手续费比例.
   */
  private Long serviceCharge;

  /**
   * 实际提现金额.
   */
  private BigDecimal actualAmount;

  /**
   * 审核流程.
   */
  private List<UserBankWithdrawMoneyApprovalProcess> approvalProcesses;

  /**
   * WithdrawMoneyApprovalProcessStatus SUBMIT:提交状态,PASS:审核通过，NOT_PASS:审核不通过; 最新审核状态.
   */
  private String latestApprovalStatus;

  /**
   * 结算结果;
   */
  private UserBankWithdrawMoneyResult settlementResult;

  /**
   * 创建时间.
   */
  private Timestamp createTime;

  /**
   * 修改时间.
   */
  private Timestamp updateTime;

  /**
   * 创建用户.
   */
  private Long createUser;

  /**
   * 修改用户.
   */
  private Long updateUser;

  /**
   * 创建用户来源：0 app、1 后台.
   */
  private Integer createUserOrigin;

  /**
   * 创建用户来源：0 app、1 后台.
   */
  private Integer updateUserOrigin;

}
