using Hotline.Share.Dtos.CallCenter;
using static Hotline.CallCenter.Ivrs.IvrDomainService;

namespace Hotline.CallCenter.Ivrs
{
    public interface IIvrDomainService
    {
        /// <summary>
        /// 语音播放结束
        /// </summary>
        /// <param name="menuId"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task<IvrAnswer?> GetVoiceEndAnswerAsync(string menuId, CancellationToken cancellationToken = default);

        /// <summary>
        /// 获得按键输入
        /// </summary>
        /// <param name="menuId"></param>
        /// <param name="input"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task<IvrAnswer?> GetDtmfAnswerAsync(string menuId, string input, CancellationToken cancellationToken = default);

        /// <summary>
        /// 新增IVR
        /// </summary>
        /// <param name="ivr"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task<string> AddIvrAsync(Ivr ivr, CancellationToken cancellationToken = default);

        /// <summary>
        /// 更新IVR
        /// </summary>
        /// <param name="ivr"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task UpdateIvrAsync(Ivr ivr, CancellationToken cancellationToken = default);

        /// <summary>
        /// 构建IVR关系
        /// </summary>
        /// <param name="dto"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task StructureIvrAsync(StructureIvrDto dto, CancellationToken cancellationToken);

        /// <summary>
        /// 删除IVR关系（并非删除IVR）
        /// </summary>
        /// <param name="ivrId"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task DeStructureIvrAsync(string ivrId, CancellationToken cancellationToken);

        /// <summary>
        /// 替换某个IVR分组下的起始IVR(根节点)
        /// </summary>
        /// <param name="ivrId"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task ReplaceRootAsync(string ivrId, CancellationToken cancellationToken);

        #region IVR流程处理

        CorrectIvr GetCorrectIvr(string to, bool isEvaluate = false);

        #endregion
    }
}
