package shop.alien.entity.store;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * <p>
 * 支付宝退款记录表
 * </p>
 *
 * @author system
 * @since 2025-01-XX
 */
@Data
@EqualsAndHashCode(callSuper = false)
@JsonInclude
@ApiModel(value = "StoreAliPayRefundLog对象", description = "支付宝退款记录表")
@TableName("store_ali_pay_refund_log")
public class StoreAliPayRefundLog extends Model<StoreAliPayRefundLog> {

    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "响应状态码：10000表示接口调用成功")
    @TableField("response_code")
    private String responseCode;

    @ApiModelProperty(value = "响应状态描述")
    @TableField("response_msg")
    private String responseMsg;

    @ApiModelProperty(value = "买家支付宝账号（邮箱形式，中间字符脱敏处理）")
    @TableField("buyer_logon_id")
    private String buyerLogonId;

    @ApiModelProperty(value = "资金变动标识：Y表示用户账户发生实际资金变动，N表示用户账户未发生实际资金变动")
    @TableField("fund_change")
    private String fundChange;

    @ApiModelProperty(value = "退款受理时间：支付宝系统处理该退款请求的时间")
    @TableField("gmt_refund_pay")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date gmtRefundPay;

    @ApiModelProperty(value = "商户订单号：商户系统生成的原交易订单唯一标识")
    @TableField("out_trade_no")
    private String outTradeNo;

    @ApiModelProperty(value = "退款渠道明细列表：记录本次退款涉及的资金渠道及对应金额（JSON格式）")
    @TableField("refund_detail_item_list")
    private String refundDetailItemList;

    @ApiModelProperty(value = "申请退款金额：商户发起的退款请求金额（单位：元）")
    @TableField("refund_fee")
    private String refundFee;

    @ApiModelProperty(value = "实际退回金额：最终成功退回给买家的金额（单位：元）")
    @TableField("send_back_fee")
    private String sendBackFee;

    @ApiModelProperty(value = "支付宝交易号：支付宝系统生成的原交易唯一标识")
    @TableField("trade_no")
    private String tradeNo;

    @ApiModelProperty(value = "买家开放ID：支付宝为买家分配的唯一标识")
    @TableField("buyer_open_id")
    private String buyerOpenId;

    @ApiModelProperty(value = "支付宝证书序列号：用于验证响应数据来源的真实性")
    @TableField("alipay_cert_sn")
    private String alipayCertSn;

    @ApiModelProperty(value = "响应签名：支付宝对响应数据的加密签名")
    @TableField("sign")
    private String sign;

    @ApiModelProperty(value = "退款原因：商户发起的退款原因")
    @TableField("refund_reason")
    private String refundReason;

    @ApiModelProperty(value = "部分退款编号：标识一次退款请求，部分退款时必传")
    @TableField("out_request_no")
    private String outRequestNo;

    @ApiModelProperty(value = "删除标记, 0:未删除, 1:已删除")
    @TableField("delete_flag")
    @TableLogic
    private Integer deleteFlag;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdTime;

    @ApiModelProperty(value = "创建人ID")
    @TableField("created_user_id")
    private Integer createdUserId;

    @ApiModelProperty(value = "修改时间")
    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updatedTime;

    @ApiModelProperty(value = "修改人ID")
    @TableField("updated_user_id")
    private Integer updatedUserId;
}

