package com.seer.teach.mall.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.seer.teach.common.config.mybatis.hanler.IntegerListTypeHandler;
import com.seer.teach.common.config.mybatis.hanler.StringListTypeHandler;
import com.seer.teach.common.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 交易售后主表
 * </p>
 *
 * @author Captain
 * @since 2025-06-21
 */
@Getter
@Setter
@TableName("mall_trade_after_sale")
@Schema(name = "TradeAfterSaleEntity对象", description = "交易售后主表")
public class TradeAfterSaleEntity extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 售后单号
     */
    @TableField("after_sale_sn")
    private String afterSaleSn;

    /**
     * 售后状态，参见 {@link com.seer.teach.common.enums.AfterSaleStatusEnum}
     */
    @TableField("`status`")
    private Integer status;

    /**
     * 用户ID
     */
    @TableField("user_id")
    private Integer userId;

    /**
     * 商家ID
     */
    @TableField("merchant_user_id")
    private Long merchantUserId;

    /**
     * 申请原因
     */
    @TableField("apply_reason")
    private String applyReason;

    /**
     * 申请描述
     */
    @TableField("apply_description")
    private String applyDescription;

    /**
     * 申请时间
     */
    @TableField("apply_time")
    private LocalDateTime applyTime;

    /**
     * 申请凭证图片URL
     */
    @TableField(value = "apply_pic_urls", typeHandler = StringListTypeHandler.class)
    private List<String> applyPicUrls;

    /**
     * 订单ID
     */
    @TableField("order_id")
    private Integer orderId;

    /**
     * 订单SN
     */
    @TableField("order_sn")
    private String orderSn;

    /**
     * 子订单SN
     */
    @TableField("child_order_sn")
    private String childOrderSn;

    /**
     * 子订单ID
     */
    @TableField("child_order_id")
    private Integer childOrderId;

    /**
     * 商品SPU名称
     */
    @TableField(value = "spu_name")
    private String spuName;

    /**
     * 商品SKU编号集合
     */
    @TableField(value = "sku_id")
    private Integer skuId;

    /**
     * 支付渠道编码
     */
    @TableField("pay_channel_code")
    private String payChannelCode;

    /**
     * 商品主图URL
     */
    @TableField("pic_url")
    private String picUrl;

    /**
     * 数量
     */
    @TableField("after_sale_count")
    private Integer afterSaleCount;

    /**
     * 审核时间
     */
    @TableField("audit_time")
    private LocalDateTime auditTime;

    /**
     * 审核人ID
     */
    @TableField("audit_user_id")
    private Integer auditUserId;

    /**
     * 审核意见
     */
    @Schema(description = "审核意见")
    private String auditReason;

    @Schema(description = "退款学豆")
    @TableField("refund_cny_price")
    private BigDecimal refundCoin;

    /**
     * 退款金额
     */
    @Schema(description = "退款金额")
    private BigDecimal refundPrice;

    @Schema(description = "支付退款单ID")
    @TableField("pay_refund_id")
    private Integer payRefundId;

    @Schema(description = "退款完成时间")
    @TableField("refund_time")
    private LocalDateTime refundTime;

    @Schema(description = "物流单ID")
    @TableField("logistics_id")
    private Integer logisticsId;

    @Schema(description = "物流单号")
    @TableField("logistics_no")
    private String logisticsNo;

    @Schema(description = "发货时间")
    @TableField("delivery_time")
    private LocalDateTime deliveryTime;

    @Schema(description = "收货时间")
    @TableField("receive_time")
    private LocalDateTime receiveTime;

    @Schema(description = "收货原因")
    @TableField("receive_reason")
    private String receiveReason;
}