package com.czg.account.service;

import com.czg.account.dto.table.ShopTableAddDTO;
import com.czg.account.dto.table.ShopTableBindDTO;
import com.czg.account.dto.table.ShopTableClearDTO;
import com.czg.account.dto.table.ShopTableDTO;
import com.czg.account.entity.ShopTable;
import com.czg.account.vo.ShopTableVO;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.service.IService;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;

import java.io.IOException;

/**
 * 台桌配置 服务层。
 *
 * @author zs
 * @since 2025-02-13
 */
public interface ShopTableService extends IService<ShopTable> {

    Boolean add(Long shopId, ShopTableAddDTO shopTableAddDTO);

    ShopTable getOneByTableCode(@NotNull Long shopId, @NotBlank String tableCode);

    String getTableAreaAndName(Long shopId, String tableCode, String tableName);

    void createQrCode(Long shopId, Integer num, HttpServletResponse response, HttpServletRequest request) throws IOException;

    Boolean bind(Long shopId, ShopTableBindDTO shopTableBindDTO);

    Boolean updateInfo(long shopId, ShopTableDTO shopTableDTO);

    /**
     * 更新台桌状态
     */
    Boolean updateStatus(long shopId, Long tableId, String tableCode, String status);

    Boolean clear(long shopId, ShopTableClearDTO shopTableClearDTO);

    Boolean expiredTable(long tableId);

    Page<ShopTableVO> pageInfo(Long shopId, Integer areaId, String tableCode, String status, String name, Boolean isBind);
}
