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.util.Date;

/**
 * 订单锁定记录表
 *
 * @author system
 * @since 2025-01-XX
 */
@Data
@JsonInclude
@TableName("store_order_lock")
@ApiModel(value = "StoreOrderLock对象", description = "订单锁定记录表")
public class StoreOrderLock {

    @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("order_id")
    private Integer orderId;

    @ApiModelProperty(value = "锁定类型(1:下单锁定, 2:结算锁定)")
    @TableField("lock_type")
    private Integer lockType;

    @ApiModelProperty(value = "锁定用户ID")
    @TableField("lock_user_id")
    private Integer lockUserId;

    @ApiModelProperty(value = "锁定用户手机号")
    @TableField("lock_user_phone")
    private String lockUserPhone;

    @ApiModelProperty(value = "锁定过期时间")
    @TableField("lock_expire_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date lockExpireTime;

    @ApiModelProperty(value = "锁定状态(0:已释放, 1:锁定中)")
    @TableField("lock_status")
    private Integer lockStatus;

    @ApiModelProperty(value = "释放时间")
    @TableField("release_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date releaseTime;

    @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 = "修改时间")
    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updatedTime;
}
