package com.czg.product.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import lombok.Data;

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

/**
 * 商品耗材绑定关系
 *
 * @author Tankaikai tankaikai@aliyun.com
 * @since 1.0 2025-02-20
 */
@Data
@Table("tb_prod_cons_relation")
public class ProdConsRelation implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 店铺id
     */
    @Id(keyType = KeyType.None)
    private Long shopId;
    /**
     * 商品id
     */
    @Id(keyType = KeyType.None)
    private Long productId;
    /**
     * 耗材id
     */
    @Id(keyType = KeyType.None)
    private Long consInfoId;
    /**
     * 单位消耗值
     */
    private BigDecimal surplusStock;
    /**
     * 创建时间
     */
    @Column(onInsertValue = "now()")
    private LocalDateTime createTime;
}