package com.ruoyi.ss.order.service;

import com.ruoyi.common.core.domain.ValidateResult;
import com.ruoyi.common.core.domain.entity.User;
import com.ruoyi.ss.order.domain.Order;
import com.ruoyi.ss.order.domain.OrderBO;
import com.ruoyi.ss.order.domain.OrderQuery;
import com.ruoyi.ss.order.domain.OrderVO;

import java.util.Date;
import java.util.List;

public interface IOrderValidator {

    /**
     * 创建订单前校验
     *
     * @param bo
     * @return
     */
    ValidateResult preAddOrder(OrderBO bo);

    /**
     * 开门前校验
     *
     * @param roomId
     * @param orderNo
     * @return
     */
    ValidateResult preOpenDoor(Long roomId, String orderNo);

    /**
     * 创建订单后校验
     *
     * @param order
     * @return
     */
    ValidateResult afterAddOrder(Order order);

    /**
     * 更换包间校验
     */
    void validateChangeRoom(OrderQuery orderQuery);

    /**
     * 分账比例100%校验
     */
    void checkDividendProportions(List<User> dividendUsers);

    /**
     * 进行中的订单校验
     */
    boolean getInProgressOrder(Long roomId);

    /**
     * 进行中的订单校验
     */
    boolean getInProgressOrderByIds(List<Long> roomIds);

    /**
     * 时间段内是否有预定单
     */
    int isReserved(Long roomId, Date reserveStartTime, Date reserveEndTime);
}
