using Domain.Dtos.Sales;
using Domain.Generics;

namespace phronCare.UIBlazor.Services.Sales.SalesDocuments
{
    public interface ISalesDocumentService
    {
        Task<PagedResult<SalesDocumentSummaryDto>> SearchAsync(SalesDocumentSearchParams searchParams);
        Task<SalesDocumentDto?> GetByIdAsync(int id);
        Task<SalesDocumentDraftPreviewDto?> GetDraftPreviewAsync(int id);
        Task<SalesDocumentDraftPreviewDto> UpdateDraftReviewAsync(int id, SalesDocumentDraftReviewDto request);
        Task<SalesDocumentDraftPreviewDto> ValidateDraftAsync(int id);
        Task<SalesDocumentDto> CreateAsync(SalesDocumentCreateRequest request);
        Task<SalesDocumentDto> CreateFromDeliveryNotesAsync(SalesDocumentCreateFromDeliveryNotesRequest request);
        Task<SalesDocumentDto> CreateFromDeliveryNoteItemsAsync(SalesDocumentCreateFromDeliveryNoteItemsRequest request);
        Task<List<SalesDocumentDeliveryNoteItemCandidateDto>> GetDeliveryNoteItemCandidatesAsync(IReadOnlyCollection<int> deliveryNoteIds);
        Task<PagedResult<SalesDocumentDeliveryNoteCandidateDto>> SearchDeliveryNoteCandidatesAsync(
            int? customerId,
            string? customerText,
            string? deliveryNoteNumber,
            int? quoteId,
            DateTime? issueDateFrom,
            DateTime? issueDateTo,
            int page = 1,
            int pageSize = 50);
    }
}
