using Newtonsoft.Json.Linq;
using Sagitec.Rules.Core.Instance.Attributes;
using Sagitec.Rules.Core.Interface;
using Sagitec.Rules.Interface.Context;
using System;
using System.Collections;
using System.Collections.Generic;
namespace Sagitec.Interface
{
/// <summary>
/// Defines methods to generate correspondence and compare bookmarks.
/// </summary>
[TransientInstance]
public interface ICorrespondenceWrapper : ICoreInstance
{
/// <summary>
/// Initializes the execution context.
/// </summary>
/// <param name="aobjExecutionContext"> An object of the type IExecutionContext which needs to be initialized. </param>
void InitializeContext(IExecutionContext aobjExecutionContext);
/// <summary>
/// Generates the correspondence file along with the record in correspondence tracking table(sgs_cor_tracking).
/// </summary>
/// <param name="astrTemplateName">Name of the correspondence template that needs to be generated. </param>
/// <param name="aobjBase">An object containing the data that will be used to generate the correspondence. </param>
/// <param name="ahtbQueryBkmarks">An object containing the query bookmark values which is entered by the user, if any. The default value is null. </param>
/// <param name="adictParams">A collection of common parameters like form name, user id etc., that is passed from the web client. The default value is null. </param>
/// <param name="aintXTenantId"> MultiTenant Id, which is required only for MultiTenant applications, or -1 in case it is not MultiTenant. The default value is "-1". </param>
/// <returns>The name of the generated correspondence file. </returns>
string CreateCorrespondence(string astrTemplateName, IentBase aobjBase, Hashtable ahtbQueryBkmarks , Dictionary<string, object> adictParams, int aintXTenantId);
/// <summary>
/// Once the Correspondence is generated, it creates a record in the correspondence tracking table(sgs_cor_tracking).
/// </summary>
/// <param name="astrTemplateName">Name of the correspondence template that needs to be generated. </param>
/// <param name="aobjBase">An object containing the data that will be used to generate the correspondence. </param>
/// <param name="ahtbQueryBkmarks"> An object containing the query bookmark values which is entered by the user, if any. The default value is null. </param>
/// <param name="adictParams">A collection of common parameters like form name, user id etc., that is passed from the web client. The default value is null. </param>
/// <param name="aintXTenantId"> MultiTenant Id, which is required only for MultiTenant applications, or -1 in case, it is not Multitenant. The default value is "-1". </param>
/// <returns>The name of the correspondence file that will be generated. </returns>
string CreateCorrespondenceAsync(string astrTemplateName, IentBase aobjBase, Hashtable ahtbQueryBkmarks, Dictionary<string, object> adictParams, int aintXTenantId);
/// <summary>
/// Generates the correspondence file for the tracking id, in case of async generation.
/// This method can be called by communication engine.
/// </summary>
/// <param name="aintTrackingID">Id for which the correspondence file needs to be generated. </param>
/// <returns>The name of the generated correspondence file. </returns>
string CreateCommunicationForTrackingID(long aintTrackingID);
/// <summary>
/// Generates the correspondence file along with the record in correspondence tracking table(sgs_cor_tracking) using the JSON parameter .
/// </summary>
/// <param name="astrTemplate"> Name of the correspondence template that needs to be generated. </param>
/// <param name="adictBkmValues"> A JSON object containing the data that will be used to generate the correspondence. </param>
/// <param name="ahtbQueryBkmarks"> An object containing the query bookmark values which is entered by the user, if any. The default value is null. </param>
/// <param name="adictParams"> A collection of common parameters like form name, user id etc., that is passed from the web client. The default value is null. </param>
/// <param name="aintXTenantId"> MultiTenant Id, which is required only for MultiTenant applications, or -1 in case, it is not Multitenant. The default value is "-1". </param>
/// <returns>The name of the generated correspondence from the JSON parameter file. </returns>
string CreateCorrespondenceForJSON(string astrTemplate, JObject adictBkmValues, Hashtable ahtbQueryBkmarks, Dictionary<string, object> adictParams, int aintXTenantId);
/// <summary>
/// Only generates the record in correspondence tracking table(sgs_cor_tracking) using the JSON parameter.
/// </summary>
/// <param name="astrTemplate"> Name of the correspondence template that needs to be generated. </param>
/// <param name="adictBkmValues"> A JSON object containing the data that will be used to generate the correspondence. </param>
/// <param name="ahtbQueryBkmarks"> An object containing the query bookmark values which is entered by the user, if any. The default value is null. </param>
/// <param name="adictParams"> A collection of common parameters like form name, user id etc., that is passed from the web client. The default value is null. </param>
/// <param name="aintXTenantId"> MultiTenant Id, which is required only for MultiTenant applications, or -1 in case, it is not MultiTenant. The default value is "-1". </param>
/// <returns>The name of the generated correspondence file. </returns>
string CreateCorrespondenceForJSONAsync(string astrTemplate, JObject adictBkmValues, Hashtable ahtbQueryBkmarks, Dictionary<string, object> adictParams, int
aintXTenantId);
/// <summary>
/// Returns the tracking id for the generated correspondence file.
/// </summary>
/// <param name="astrGenereatedCorrTemplate"> Name of the generated correspondence file. </param>
/// <returns>Tracking id for the generated correspondence file. </returns>
long GetCorrTrackingID(string astrGenereatedCorrTemplate);
/// <summary>
/// Compares the bookmarks of the newly uploaded template file with the main correspondence template file.
/// </summary>
/// <param name="astrUploadedTemplateFilePath">Full path for the newly uploaded template file. </param>
/// <param name="astrOriginalTemplateFilePath"> Full path for the original template file. </param>
/// <returns>True if the bookmarks match; otherwise, false. </returns>
bool CompareBookmarks(string astrUploadedTemplateFilePath, string astrOriginalTemplateFilePath);
}
}
#Rules