using APT.Infrastructure.Core;
using APT.BaseData.Domain.ApiModel;
using APT.BaseData.Domain.Entities.FM;
using System;
using System.Collections.Generic;
using APT.Infrastructure.Api;
using APT.BaseData.Domain.Enums;

namespace APT.BaseData.Domain.IServices.FM
{
    /// <summary>
    /// 获取model 或者 modelDetail
    /// </summary>
    public partial interface IFMSyncLogDetailService : ICommonService
    {
        /// <summary>
        /// 获取日志单
        /// </summary>
        /// <param name="ORG_ID"></param>
        /// <param name="API_NAME"></param>
        /// <param name="SYNC_PARAM"></param>
        /// <param name="DATA_COUNT"></param>
        /// <returns></returns>
        T_FM_SYNC_LOG GetSyncLog(IDictionary<object, object?> Items, Guid? ORG_ID, string API_NAME, string SYNC_PARAM, SyncLogType? SyncLogType, int DATA_COUNT = 0);

        /// <summary>
        /// 获取日志明细
        /// </summary>
        /// <param name="SNC_LOG_ID"></param>
        /// <param name="ORG_ID"></param>
        /// <param name="Count"></param>
        /// <param name="REMARK"></param>
        /// <returns></returns>
        T_FM_SYNC_LOG_DETAIL GetSyncLogDetail(IDictionary<object, object?> Items, string TRACEIDENTIFIER, Guid? ORG_ID, int Count, string REMARK, SyncLogType? SyncLogType = null, Guid? SNC_LOG_ID = null);


        /// <summary>
        /// 插入跑批日志  可不写到事务中
        /// </summary>
        /// <param name="ORG_ID"></param>
        /// <param name="API_NAME"></param>
        /// <param name="SYNC_PARAM"></param>
        /// <param name="DATA_COUNT"></param>
        /// <returns></returns>
        bool InsertSyncLog(IDictionary<object, object?> Items, Guid? ORG_ID, string API_NAME, string SYNC_PARAM, SyncLogType? SyncLogType, int DATA_COUNT = 0);

        /// <summary>
        /// 插入跑批日志信息
        /// </summary>
        /// <param name="API_NAME"></param>
        /// <param name="TRACEIDENTIFIER"></param>
        /// <param name="LogID"></param>
        /// <param name="ORG_ID"></param>
        T_FM_SYNC_LOG InsertSyncLog(string API_NAME, string TRACEIDENTIFIER, Guid LogID, Guid? ORG_ID, string SYNC_PARAM);

        /// <summary>
        /// 插入信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        bool InsertSyncLog(T_FM_SYNC_LOG model);

        /// <summary>
        /// 插入跑批日志明细 可不写到事务中
        /// </summary>
        /// <param name="Items">固定值</param>
        /// <param name="ORG_ID"></param>
        /// <param name="Count">插入数据的数量</param>
        /// <param name="REMARK">跑批的自定义传参(filter.Parameter1)</param>
        /// <param name="SyncLogType">枚举类型 （可以是null）</param>
        /// <returns></returns>
        bool InsertSyncLogDetail(IDictionary<object, object?> Items, string TRACEIDENTIFIER, Guid? ORG_ID, int Count, string REMARK, SyncLogType? SyncLogType = null, Guid? SNC_LOG_ID = null);


        /// <summary>
        /// 插入 API 耗时
        /// </summary>
        /// <param name="API_NAME"></param>
        /// <param name="TRACEIDENTIFIER"></param>
        /// <param name="TRACEIDENTIFIERED"></param>
        /// <param name="ORG_ID"></param>
        /// <param name="START_TIME"></param>
        /// <param name="END_TIME"></param>
        /// <returns></returns>
        T_FM_SYNC_LOG InsertAPISyncLog(string API_NAME, string TRACEIDENTIFIER, string TRACEIDENTIFIERED, Guid? ORG_ID, DateTime START_TIME, DateTime END_TIME);
    }
}
