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

namespace IWS5.DatabaseAccess.Interfaces;

public interface IWorkItemReferenceRepository : IIWSRepository<AtworkItemReference>
{
    Task<List<AtworkItemReference>> GetInboxWorkItems(BaseRequest baseRequest);
    Task<List<AtworkItemReference>> GetAllowedWorkItems(WorkItemByQueueRequest listWorkItemsByQueueRequest);
    Task<AtworkItemReference> CreateWorkItemAsync(CreateWorkItemRequest createWorkItemRequest, string userName);
    Task<AtworkItemReference> CloneWorkItemAsync(CloneWorkItemRequest cloneWorkItemRequest, string userName, AtworkItemReference originalWorkItemReference);
    Task<string> UnlockWorkItem(int workItemReferenceId);
    Task<string> LockWorkItem(int workItemId, string userName);
    Task<AtworkItemReference> ForwardWorkItemAsync(ForwardWorkItemRequest forwardWorkItemRequest, string userName);
    Task<AtworkItemReference?> ForwardWorkItemAsync(ForwardWorkItemServerRequest forwardWorkItemRequest);
    Task<List<AtworkItemReference>> ForwardWorkItemListAsync(List<AtworkItemReference> atworkItems, string action, string userName);
    Task<bool> IsLockedForUserByWorkItemId(int workItemReferenceId, string userName);
    Task<bool> IsLockedForUserByWorkItemReferenceId(int workItemReferenceId, string userName);
    Task<bool> UpdateEventId(int workItemId, ATEventType eventType, int processId);
    Task<bool> UpdateEventId(int workItemId, int eventId);
    Task<int> DeleteWorkItemsAsync(IEnumerable<int> workItemIds, CancellationToken ct = default);
}