using Hotline.Share.Dtos.Settings;
using Hotline.Share.Enums.FlowEngine;
using Hotline.Share.Enums.Settings;

namespace Hotline.Settings.TimeLimits
{
    public interface ITimeLimitDomainService
    {

        /// <summary>
        /// 获取办理时限配置
        /// 2024-08-28 过期了,不再使用和维护;
        /// 请调用 <inheritdoc cref="IExpireTime.GetOrderTimeLimitConfig"/>IExpireTime.GetOrderTimeLimitConfig
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        [Obsolete("新的方法 -> IExpireTime.GetOrderTimeLimitConfig")]
        TimeConfig GetOrderTimeLimitConfig(string? code = null);

        /// <summary>
        /// 计算期满时间
        /// </summary>
        ExpiredTimeWithConfig CalcEndTime(DateTime beginTime, TimeConfig timeConfig, string busCode);

        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        Task<string> AddAsync(TimeLimit model, CancellationToken cancellationToken);

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="model"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task UpdateAsync(TimeLimit model, CancellationToken cancellationToken);


        /// <summary>
        /// 
        /// </summary>
        /// <param name="beginTime"></param>
        /// <param name="timeType"></param>
        /// <param name="timeValue"></param>
        /// <returns></returns>
        TimeResult CalcEndTime(DateTime beginTime, ETimeType timeType, int timeValue, int Percentage, int PercentageOne);

        /// <summary>
        /// 计算工作日
        /// 2024-08-28 过期了,不再使用和维护;
        /// 请调用 <inheritdoc cref="IExpireTime.CalcEndTime"/>IExpireTime.CalcEndTime
        /// </summary>
        /// <param name="beginTime"></param>
        /// <param name="busCode"></param>
        /// <param name="isCenter"></param>
        /// <returns></returns>
        [Obsolete("新的方法 -> IExpireTime.CalcEndTime")]
        ExpiredTimeWithConfig? CalcEndTime(DateTime beginTime, string busCode);

        /// <summary>
        /// 计算期满时间
        /// 2024-08-28 过期了,不再使用和维护;
        /// 请调用 <inheritdoc cref="IExpireTime.CalcExpiredTime"/>IExpireTime.CalcExpiredTime
        /// </summary>
        [Obsolete("新的方法 -> IExpireTime.CalcExpiredTime")]
        ExpiredTimeWithConfig CalcExpiredTime(DateTime beginTime, EFlowDirection flowDirection, string? acceptTypeCode);

        TimeResult CalcEndTime(DateTime beginTime, ETimeType timeType, int timeValue, string busCode);


        /// <summary>
        /// 计算工作时间天数
        /// 2024-08-28 过期了,不再使用和维护;
        /// 请调用 <inheritdoc cref="IExpireTime.CalcWorkTimeToDecimal"/>IExpireTime.CalcWorkTimeToDecimal
        /// </summary>
        /// <param name="beginTime"></param>
        /// <param name="endTime"></param>
        /// <param name="isCenter"></param>
        /// <returns></returns>
        [Obsolete("新的方法 -> IExpireTime.CalcWorkTimeToDecimal")]
        decimal CalcWorkTimeToDecimal(DateTime beginTime, DateTime endTime, bool isCenter);

        /// <summary>
        /// 计算工作时间分钟数（已改返回秒）
        /// </summary>
        /// <param name="beginTime"></param>
        /// <param name="endTime"></param>
        /// <returns></returns>
        int CalcWorkTime(DateTime beginTime, DateTime endTime, bool isCenter);

        /// <summary>
        /// 计算工作时间分钟数(已改返回秒)
        /// 2024-08-28 过期了,不再使用和维护;
        /// 请调用 <inheritdoc cref="IExpireTime.CalcWorkTimeEx"/>IExpireTime.CalcWorkTimeEx
        /// </summary>
        /// <param name="beginTime"></param>
        /// <param name="endTime"></param>
        /// <param name="isCenter"></param>
        /// <returns></returns>
        [Obsolete("新的方法 -> IExpireTime.CalcWorkTimeEx")]
        int CalcWorkTimeEx(DateTime beginTime, DateTime endTime, bool isCenter);

        /// <summary>
        /// 计算时间间隔
        /// </summary>
        /// <param name="beginTime"></param>
        /// <param name="endTime"></param>
        /// <param name="isCenter"></param>
        /// <returns></returns>
        string CalcTimeInterval(DateTime beginTime, DateTime endTime, bool isCenter);

        /// <summary>
        /// 计算工作时间小时
        /// 2024-08-28 过期了,不再使用和维护;
        /// 请调用 <inheritdoc cref="IExpireTime.CalcWorkTimeToHour"/>IExpireTime.CalcWorkTimeToHour
        /// </summary>
        /// <param name="beginTime"></param>
        /// <param name="endTime"></param>
        /// <param name="isCenter"></param>
        /// <returns></returns>
        [Obsolete("新的方法 -> IExpireTime.CalcWorkTimeToHour")]
        decimal CalcWorkTimeToHour(DateTime beginTime, DateTime endTime, bool isCenter);

        /// <summary>
        /// 判断是否工作日
        /// </summary>
        /// <param name="date"></param>
        /// <returns></returns>
        bool IsWorkDay(DateTime date);

        /// <summary>
        /// 获取工作日
        /// 2024-08-28 过期了,不再使用和维护;
        /// 请调用 <inheritdoc cref="IExpireTime.WorkDay"/>IExpireTime.WorkDay
        /// </summary>
        /// <param name="date"></param>
        /// <returns></returns>
        [Obsolete("新的方法 -> IExpireTime.WorkDay")]
        DateTime WorkDay(DateTime date);

        /// <summary>
        /// 倒推工作日
        /// 2024-08-28 过期了,不再使用和维护;
        /// 请调用 <inheritdoc cref="IExpireTime.CalcWorkTimeReduce"/>IExpireTime.CalcWorkTimeReduce
        /// </summary>
        /// <param name="date"></param>
        /// <returns></returns>
        [Obsolete("新的方法 -> IExpireTime.CalcWorkTimeReduce")]
        DateTime CalcWorkTimeReduce(DateTime date, int timeValue);


    }
}
