package com.jeesharp.business.modules.food.service;

import com.jeesharp.business.modules.food.entity.FoodMealMenuItemSpec;
import com.jeesharp.business.modules.food.entity.FoodMealOrderItem;
import com.jeesharp.business.modules.food.vo.FoodMealMenuItemSpecQueryVO;
import com.jeesharp.framework.mybatis.core.service.BaseInterface;

import java.util.Collection;
import java.util.List;
import java.util.Map;

public interface FoodMealMenuItemSpecService extends BaseInterface<FoodMealMenuItemSpec, FoodMealMenuItemSpecQueryVO> {

    List<FoodMealMenuItemSpec> listByMenuItemId(String menuItemId);

    List<FoodMealMenuItemSpec> listByMenuItemIds(Collection<String> menuItemIds);

    List<FoodMealMenuItemSpec> listByIds(Collection<String> ids, boolean forUpdate);

    int increaseSoldQuantity(String id, Integer quantity, String tenantCode);

    int decreaseSoldQuantity(String id, Integer quantity, String tenantCode);

    void increaseSoldQuantity(Map<String, Integer> quantityMap, String tenantCode);

    void releaseSoldQuantity(Collection<FoodMealOrderItem> items, String tenantCode);

    void deleteByMenuId(String menuId);

    void deleteByMenuItemId(String menuItemId);
}
