using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using ZhonTai.Admin.Core.Dto;
using NPP.SmartSchedue.Api.Contracts.Services.Time.Input;
using NPP.SmartSchedue.Api.Contracts.Services.Time.Output;

namespace NPP.SmartSchedue.Api.Contracts.Services.Time;

/// <summary>
/// 班次规则映射服务接口
/// </summary>
public interface IShiftRuleMappingService
{
    /// <summary>
    /// 查询
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    Task<ShiftRuleMappingGetOutput> GetAsync(long id);

    /// <summary>
    /// 查询分页
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task<PageOutput<ShiftRuleMappingGetPageOutput>> GetPageAsync(PageInput<ShiftRuleMappingGetPageInput> input);

    /// <summary>
    /// 添加
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task<long> AddAsync(ShiftRuleMappingAddInput input);

    /// <summary>
    /// 修改
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task UpdateAsync(ShiftRuleMappingUpdateInput input);

    /// <summary>
    /// 删除
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    Task DeleteAsync(long id);

    /// <summary>
    /// 软删除
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    Task SoftDeleteAsync(long id);

    /// <summary>
    /// 批量软删除
    /// </summary>
    /// <param name="ids"></param>
    /// <returns></returns>
    Task BatchSoftDeleteAsync(long[] ids);

    /// <summary>
    /// 根据班次查询映射的规则
    /// </summary>
    /// <param name="shiftId">班次ID</param>
    /// <returns>映射的规则列表</returns>
    Task<List<ShiftRuleMappingGetOutput>> GetRulesByShiftIdAsync(long shiftId);
    
    /// <summary>
    /// 班次增加规则
    /// </summary>
    /// <param name="shiftId">班次ID</param>
    /// <param name="ruleId">规则ID</param>
    /// <param name="input">映射配置</param>
    /// <returns>映射ID</returns>
    Task<long> AddRuleToShiftAsync(long shiftId, long ruleId, ShiftRuleMappingAddInput input);
    
    /// <summary>
    /// 班次修改规则
    /// </summary>
    /// <param name="mappingId">映射ID</param>
    /// <param name="input">修改信息</param>
    /// <returns>操作结果</returns>
    Task UpdateShiftRuleAsync(long mappingId, ShiftRuleMappingUpdateInput input);
    
    /// <summary>
    /// 班次删除规则
    /// </summary>
    /// <param name="shiftId">班次ID</param>
    /// <param name="ruleId">规则ID</param>
    /// <returns>操作结果</returns>
    Task RemoveRuleFromShiftAsync(long shiftId, long ruleId);
}