using Hotline.FlowEngine;
using Hotline.Users;

namespace Hotline.CallCenter.Tels
{
    /// <summary>
    /// 分机
    /// </summary>
    public interface ITelDomainService
    {
        /*
上线
下线
示忙
示闲
应答
保持通话
取消保持

转接
三方会议
抢接
呼出
挂断
评价
         */

        /// <summary>
        /// 查询所有分机
        /// </summary>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task<List<Tel>> QueryTelsAsync(CancellationToken cancellationToken);

        /// <summary>
        /// 查询所有分机组
        /// </summary>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task<List<TelGroup>> QueryTelGroupsAsync(CancellationToken cancellationToken);

        /// <summary>
        /// 分机休息审批流程开始
        /// </summary>
        Task TelRestFlowStartAsync(FlowAssignInfo assignInfo, string? telRestId, string workflowId, CancellationToken cancellationToken);

        /// <summary>
        /// 分机休息
        /// </summary>
        /// <param name="currentWork"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        //Task<string> RestAsync(Work currentWork, string reason, bool isApply, CancellationToken cancellationToken);

        /// <summary>
        /// 分机小休审批通过
        /// </summary>
        /// <param name="id"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task TelRestApplyPassAsync(string? id, CancellationToken cancellationToken);

        /// <summary>
        /// 分机小休审批通过（新）
        /// </summary>
        /// <param name="id"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task TelRestApplyPassNewAsync(string? id, CancellationToken cancellationToken);


        /// <summary>
        /// 分机结束休息（威尔信）
        /// </summary>
        /// <param name="telNo"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task<TelRest> UnRestWexAsync(string telNo, CancellationToken cancellationToken);


        /// <summary>
        /// 分机结束休息
        /// </summary>
        /// <param name="telId"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task<TelRest> UnRestAsync(string telId, CancellationToken cancellationToken);

        /// <summary>
        /// 保持通话
        /// </summary>
        /// <param name="telId"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task HoldAsync(string telId, string userId, string userName, string callId, CancellationToken cancellationToken);

        /// <summary>
        /// 恢复通话(解除hold状态)
        /// </summary>
        /// <param name="telId"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task UnHoldAsync(string telId, string userId, string callId, CancellationToken cancellationToken);

        /// <summary>
        /// 开启静音
        /// </summary>
        /// <param name="telId"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task MuteAsync(string telId, CancellationToken cancellationToken);

        /// <summary>
        /// 解除静音
        /// </summary>
        /// <param name="telId"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task UnMuteAsync(string telId, CancellationToken cancellationToken);

    }
}
