package com.jeeplus.hotelorder.room.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.jeeplus.core.domain.BaseEntity;
import com.jeeplus.core.query.Query;
import com.jeeplus.core.query.QueryType;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import java.util.Date;

/**
 * 酒店房间实体
 * @author jeeplus
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "hotel_room")
public class HotelRoom extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /** 房间号 */
    @NotBlank(message = "房间号不能为空")
    @Query(tableColumn = "room_no", type = QueryType.LIKE)
    private String roomNo;

    /** 房间类型ID */
    @Query(tableColumn = "room_type", type = QueryType.EQ)
    private String roomTypeId;

    /** 房间类型名称(非DB字段，查询用) */
    @TableField(exist = false)
    private String roomTypeName;

    /** 楼层 */
    @Query(tableColumn = "floor", type = QueryType.EQ)
    private Integer floor;

    /**
     * 房间状态: 0-正常, 1-暂停, 2-停用
     */
    @Query(tableColumn = "status", type = QueryType.EQ)
    private String status;

    /** 二维码完整URL */
    private String qrCodeUrl;

    /** 二维码图片存储路径 */
    private String qrCodeImage;

    /** 二维码签名值 */
    private String qrCodeSign;

    /** 房间短码（用于二维码URL） */
    private String roomShortCode;

    /** 二维码生成时间 */
    private Date qrGeneratedTime;

    /** 是否允许点餐: 1-允许, 0-不允许 */
    @TableField(exist = false)
    private Integer orderEnabled;
}
