using IWS5.Core.Models.Request;
using IWS5.DatabaseAccess.IwsDataModels;

namespace IWS5.DatabaseAccess.Interfaces;

/// <summary>
/// Interface for document cabinet repository operations.
/// </summary>
public interface IDocumentCabinetRepository : IIWSRepository<AtdocumentCabinet>
{
    /// <summary>
    /// Gets the default document templates for the process.
    /// </summary>
    /// <returns>An array of default document templates.</returns>
    Task<AtdocumentCabinet[]> GetProcessDefaultDocumentTemplate();

    /// <summary>
    /// Gets the default document template for a specific process.
    /// </summary>
    /// <param name="processId">The ID of the process.</param>
    /// <returns>The default document template for the specified process.</returns>
    Task<AtdocumentCabinet> GetProcessDefaultDocumentTemplate(int processId);

    Task<AtdocumentCabinet> GetAllowedTemplateFields(string userName, int templateId);

    /// <summary>
    /// Gets a document template by its ID.
    /// </summary>
    /// <param name="templateId">The ID of the document template.</param>
    /// <returns>The document template with the specified ID.</returns>
    Task<AtdocumentCabinet> GetDocumentTemplateById(int templateId);
    Task<List<AtdocumentCabinet>> GetDocumentTemplatesByIds(Guid[] objectIds);
    
    /// <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 template.
    /// </summary>
    /// <param name="request">The request containing the details of the document template to update.</param>
    /// <returns>A task representing the asynchronous operation.</returns>
    Task UpdateDocumentTemplate(UpdateDocumentTemplateRequest request);
}