using MasaBlazorApp3.Pojo;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MasaBlazorApp3.DataAccess.Dao
{
    public interface IPlanDao
    {

        /// <summary>
        /// 获取所有套餐数据
        /// </summary>
        /// <returns></returns>
        Task<PageMultiData<Plan,DrugInfo>> GetAllPlanInfo();
        /// <summary>
        /// 根据套餐ID获取套餐数据
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        Task<Plan> GetPlanById(int Id);
        /// <summary>
        /// 新增套餐
        /// </summary>
        /// <param name="plan"></param>
        /// <returns></returns>
        Task<bool> InsertPlanInfo(Plan plan);
        /// <summary>
        /// 更新套餐
        /// </summary>
        /// <param name="plan"></param>
        /// <returns></returns>
        Task<bool> UpdatePlanInfo(Plan plan);
        /// <summary>
        /// 删除套餐
        /// </summary>
        /// <param name="planId"></param>
        /// <returns></returns>
        Task<bool> DeletePlanInfo(int planID);
        /// <summary>
        /// 向套餐添加药品
        /// </summary>
        /// <param name="details"></param>
        /// <returns></returns>
        Task<bool> AddPlanDetail(PlanDetails details);
        /// <summary>
        /// 修改套餐中的药品
        /// </summary>
        /// <param name="details"></param>
        /// <returns></returns>
        Task<bool> UpdatePlanDetail(PlanDetails details);
        //查询要删除的套餐下是否有绑定，且绑定有库存
        Task<bool> CheckPlanBind(int planId);
        //查询要删除的药品是否有绑定且库存大于0
        Task<bool> CheckPlanDetailBind(PlanDetails planDetail);
        /// <summary>
        /// 删除套餐中的药品
        /// </summary>
        /// <param name="details"></param>
        /// <returns></returns>
        Task<bool> DeletePlanDetail(PlanDetails planID);
        /// <summary>
        /// 根据套餐明细获取套餐
        /// </summary>
        /// <param name="details"></param>
        /// <returns></returns>
        bool CheckDrugById(PlanDetails details);
    }
}
