package com.kym.entity.miniapp;

import com.baomidou.mybatisplus.annotation.TableName;
import com.kym.entity.BaseEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * <p>
 * 退款日志
 * </p>
 *
 * @author skyline
 * @since 2023-09-11
 */
@Getter
@Setter
@TableName("t_refund_log")
@Accessors(chain = true)
public class RefundLog extends BaseEntity {

    public static final String STATUS_退款成功 = "SUCCESS";
    public static final String STATUS_退款关闭 = "CLOSED";
    public static final String STATUS_退款处理中 = "PROCESSING";
    public static final String STATUS_退款异常 = "ABNORMAL";
    public static final String STATUS_退款已申请 = "NEW";
    public static final String STATUS_挂起 = "SUSPENDED";

    private static final long serialVersionUID = 1L;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 微信支付退款单号
     */
    private String refundId;

    /**
     * 商户退款单号
     */
    private String outRefundNo;

    /**
     * 微信支付订单号
     */
    private String transactionId;

    /**
     * 商户订单号
     */
    private String outTradeNo;

    /**
     * 退款渠道
     */
    private String channel;

    /**
     * 退款入账账户
     */
    private String userReceivedAccount;

    /**
     * 退款成功时间
     */
    private LocalDateTime successTime;

    /**
     * 退款状态：SUCCESS：退款成功 CLOSED：退款关闭 PROCESSING：退款处理中 ABNORMAL：退款异常  NEW：已申请（自定义） SUSPENDED：挂起
     */
    private String status;

    /**
     * 资金账户：UNSETTLED : 未结算资金 AVAILABLE : 可用余额 UNAVAILABLE : 不可用余额 OPERATION : 运营户 BASIC : 基本账户（含可用余额和不可用余额）
     */
    private String fundsAccount;

    /**
     * 订单金额
     */
    private Integer total;

    /**
     * 退款金额
     */
    private Integer refund;

    /**
     * 不可退金额（分）
     */
    private Integer discountAmount;

    /**
     * 用户支付币种
     */
    private String currency;

    /**
     * 退款原因
     */
    private String reason;

    /**
     * 退款人id
     */
    private Long adminUserId;

    /**
     * 退款人
     */
    private String adminUsername;
}
