/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package cn.ysk.cashier.service.shop;

import cn.ysk.cashier.dto.shoptable.*;
import cn.ysk.cashier.pojo.order.TbCashierCart;
import cn.ysk.cashier.pojo.shop.TbShopTable;
import cn.ysk.cashier.dto.shop.TbShopTableDto;
import cn.ysk.cashier.dto.shop.TbShopTableQueryCriteria;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.data.domain.Pageable;
import java.util.Map;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;

/**
* @website https://eladmin.vip
* @description 服务接口
* @author lyf
* @date 2024-01-18
**/
public interface TbShopTableService {

    /**
    * 查询数据分页
    * @param criteria 条件
    * @param pageable 分页参数
    * @return Map<String,Object>
    */
    Map<String,Object> queryAll(TbShopTableQueryCriteria criteria, Pageable pageable);

    Map<String,Object> queryAllNoPage(TbShopTableQueryCriteria criteria);

    /**
    * 查询所有数据不分页
    * @param criteria 条件参数
    * @return List<TbShopTableDto>
    */
    List<TbShopTableDto> queryAll(TbShopTableQueryCriteria criteria);

    /**
     * 根据shopId查询台桌列表
     * @param shopId 店铺id
     * @return 台桌列表
     */
    List<TbShopTable> queryListByShopId(Integer shopId);

    /**
     * 根据ID查询
     * @param id ID
     * @return TbShopTableDto
     */
    TbShopTableDto findById(Integer id);


    void binding(TbShopTable resources);
    /**
     * 创建
     *
     * @param resources /
     * @return TbShopTableDto
     */
    TbShopTable create(TbShopTable resources);

    /**
    * 编辑
    * @param resources /
    */
    void update(TbShopTable resources);

    /**
    * 多选删除
    * @param ids /
    */
    void deleteAll(Integer[] ids);

    /**
    * 导出数据
    * @param all 待导出的数据
    * @param response /
    * @throws IOException /
    */
    void download(List<TbShopTableDto> all, HttpServletResponse response) throws IOException;

    TbCashierCart addCartForUser(AddCartDTO addCartDTO);

    void removeCart(RemoveCartDTO removeCartDTO);

    void clearCart(ClearCartDTO clearCartDTO);

    Page<TbCashierCart> getCart(Long tableId, Integer page, Integer size, Integer shopId, Integer vipUserId, String masterId);

    TbCashierCart updateCart(UpdateCartDTO updateCartDTO);

    void pack(PackCartDTO packCartDTO);

    Object createOrder(CreateOrderDTO createOrderDTO, boolean addMasterId, boolean isPrint);

    Object getMasterId(Integer shopId, Long tableId, Integer vipUserId);

    Object pending(PendingDTO pendingDTO);

    Object getCar(Integer shopId, String tableId);

    Object getPayType(Integer shopId);

    Object pay(PayDTO payDTO);

    Object deleteOrder(DeleteOrderDTO deleteOrderDTO);

    Object updateVip(UpdateVipDTO updateVipDTO);
}
