package shop.alien.entity.store;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 购物车表
 *
 * @author system
 * @since 2025-01-XX
 */
@Data
@JsonInclude
@TableName("store_cart")
@ApiModel(value = "StoreCart对象", description = "购物车表")
public class StoreCart {

    @ApiModelProperty(value = "主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "桌号ID")
    @TableField("table_id")
    private Integer tableId;

    @ApiModelProperty(value = "门店ID")
    @TableField("store_id")
    private Integer storeId;

    @ApiModelProperty(value = "菜品ID")
    @TableField("cuisine_id")
    private Integer cuisineId;

    @ApiModelProperty(value = "菜品名称")
    @TableField("cuisine_name")
    private String cuisineName;

    @ApiModelProperty(value = "菜品图片")
    @TableField("cuisine_image")
    private String cuisineImage;

    @ApiModelProperty(value = "单价")
    @TableField("unit_price")
    private BigDecimal unitPrice;

    @ApiModelProperty(value = "数量")
    @TableField("quantity")
    private Integer quantity;

    @ApiModelProperty(value = "已下单数量（下单时锁定的数量，不允许减少或删除）")
    @TableField("locked_quantity")
    private Integer lockedQuantity;

    @ApiModelProperty(value = "小计金额")
    @TableField("subtotal_amount")
    private BigDecimal subtotalAmount;

    @ApiModelProperty(value = "添加该菜品的用户ID")
    @TableField("add_user_id")
    private Integer addUserId;

    @ApiModelProperty(value = "添加该菜品的用户手机号")
    @TableField("add_user_phone")
    private String addUserPhone;

    @ApiModelProperty(value = "备注")
    @TableField("remark")
    private String remark;

    @ApiModelProperty(value = "删除标记, 0:未删除, 1:已删除")
    @TableField("delete_flag")
    @TableLogic
    private Integer deleteFlag;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdTime;

    @ApiModelProperty(value = "创建人ID")
    @TableField("created_user_id")
    private Integer createdUserId;

    @ApiModelProperty(value = "修改时间")
    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updatedTime;

    @ApiModelProperty(value = "修改人ID")
    @TableField("updated_user_id")
    private Integer updatedUserId;
}
