package com.rj.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@EqualsAndHashCode(callSuper = false)
@TableName("lb_goods")
@Schema(description = "货品表")
@JsonIgnoreProperties(ignoreUnknown = true)
public class LbGoods implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.INPUT)
    @Schema(description = "商品ID（外部系统主键）")
    private Long id;

    @TableField("tenant_id")
    @Schema(description = "租户ID")
    private String tenantId;

    @TableField("old_id")
    @Schema(description = "旧商品ID（迁移/关联用）")
    private Long oldId;

    @TableField("user_id")
    @Schema(description = "所属用户ID")
    private Long userId;

    @TableField("title")
    @Schema(description = "商品标题")
    private String title;

    @TableField("image")
    @Schema(description = "商品图片路径")
    private String image;

    @TableField("price")
    @Schema(description = "单价")
    private BigDecimal price;

    @TableField("total_money")
    @Schema(description = "总金额")
    private BigDecimal totalMoney;

    @TableField("quantity")
    @Schema(description = "数量描述（如：≈6盒）")
    private String quantity;

    @TableField("seller_id")
    @Schema(description = "卖家用户ID")
    private Long sellerId;

    @TableField("is_show")
    @Schema(description = "是否展示：0否 1是")
    private Integer isShow;

    @TableField("status")
    @Schema(description = "状态")
    private Integer status;

    @TableField("created_at")
    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdAt;

    @TableField("updated_at")
    @Schema(description = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updatedAt;
}
