package com.erp.report.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.Builder;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;

import java.time.LocalDateTime;

/**
 * 库存流水统计实体
 * 对应数据库表：stock_logs
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("stock_logs")
public class StockLogEntity {

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

    private String skuCode;
    
    private String skuName;
    
    private Long warehouseId;
    
    private String type; // inbound, outbound, adjust, lock, unlock
    
    private Integer changeQuantity;
    
    private Integer beforeQuantity;
    
    private Integer afterQuantity;
    
    private String referenceType; // order, purchase, adjustment
    
    private String referenceNo;
    
    private String operator;
    
    private String remark;

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

    @TableLogic
    private LocalDateTime deletedAt;
}
