using IWS5.Core.DTO;
using IWS5.Core.Models;
using IWS5.Core.Models.Request;
using System.Diagnostics;
using System.Text.RegularExpressions;

namespace IWS5.Core.Services;

/// <summary>
/// Interface for managing document templates.
/// </summary>
public interface IDocumentTemplateService
{
    /// <summary>
    /// Retrieves a list of document templates.
    /// </summary>
    /// <param name="request">The base request containing user information.</param>
    /// <returns>A response containing a read-only collection of document template list items.</returns>
    Task<Response<IReadOnlyCollection<DocumentTemplateListItemResponseDTO>>> ListDocumentTemplates(BaseRequest request);

    /// <summary>
    /// Retrieves a document limit templates by processId.
    /// </summary>
    /// <param name="request">The request containing the user information, process ID and group ID.</param>
    /// <returns>A response containing the list of document template data.</returns>
    Task<Response<List<DocumentTemplateLitimResponseDTO>>> GetLimitDocumentTemplatesDataById(GetDocumentLimitTemplatesRequest request);

    /// <summary>
    /// Retrieves a document template by its ID.
    /// </summary>
    /// <param name="request">The request containing the user information and template ID.</param>
    /// <returns>A response containing the document template data.</returns>
    Task<Response<DocumentTemplateResponseDTO>> GetDocumentTemplateDataById(GetDocumentTemplateRequest request);
    
    /// <summary>
    /// Retrieves a document template fields by it template ID.
    /// </summary>
    /// <param name="request">The request containing the user information and template ID.</param>
    /// <returns>A response containing the document template data.</returns>
    Task<Response<DocumentTemplateFieldListResponseDTO>> GetDocumentTemplateFieldsById(GetDocumentTemplateRequest request);

    /// <summary>
    /// Creates a new document template.
    /// </summary>
    /// <param name="request">The request containing the details of the document template to create.</param>
    /// <returns>A task representing the asynchronous operation.</returns>
    Task CreateDocumentTemplate(CreateDocumentTemplateRequest request);

    /// <summary>
    /// Updates an existing document cabinet.
    /// </summary>
    /// <param name="request">The request containing the details of the document cabinet to update.</param>
    /// <returns>A task representing the asynchronous operation.</returns>
    Task UpdateDocumentCabinet(UpdateDocumentTemplateRequest request);
}
