package com.erp.skumatch.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@TableName("platform_sku")
public class PlatformSku {
    @TableId(type = IdType.AUTO)
    private Long id;
    private Long spuId;
    private Long shopId;
    private String platformCode;
    private String skuId;
    private String skuCode;
    private String skuName;
    private BigDecimal price;
    private Integer stock;
    private String status;
    private Long erpSkuId;
    private String erpSkuCode;
    private String erpSkuName;
    private String matchType;
    private LocalDateTime matchTime;
    private Long matchedRuleId;
    private String syncStatus;
    private LocalDateTime lastSyncAt;
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;
    
    public boolean isMatched() {
        return erpSkuId != null;
    }
}
