package com.erp.aftersale.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import lombok.Builder;
import com.fasterxml.jackson.annotation.JsonIgnore;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName("after_sale_items")
public class AfterSaleItem {

    @TableId(type = IdType.AUTO)
    private Long id;

    /** 售后单ID */
    private Long afterSaleId;

    /** 原订单明细ID */
    private Long orderItemId;

    /** 商品ID */
    private Long productId;

    /** 商品名称 */
    private String productName;

    /** SKU ID */
    private Long skuId;

    /** SKU编码 */
    private String skuCode;

    /** SKU规格描述 */
    private String skuSpecs;

    /** 商品图片 */
    private String imageUrl;

    /** 单价 */
    private BigDecimal unitPrice;

    /** 购买数量 */
    private Integer quantity;

    /** 申请售后数量 */
    private Integer applyQuantity;

    /** 审核通过数量 */
    private Integer approveQuantity;

    /** 实际退货数量 */
    private Integer returnQuantity;

    /** 小计金额 */
    private BigDecimal itemAmount;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;

    @TableLogic
    @JsonIgnore
    private Integer deleted;
}
