using ERPCore.Common.Http;
using ERPCore.Domain.Enums;
using ERPCore.Dtos.Common;
using ERPCore.Dtos.Items;

namespace ERPCore.Services.Interfaces;

/// <summary>
/// Item master business logic (docs/11-BACKEND-PHASE1.md §2.1–2.2). Returns DTOs;
/// entities never cross this boundary (00-CORE §4).
/// </summary>
public interface IItemService
{
    Task<PagedResponse<ItemListItemDto>> ListAsync(
        PageQuery query, EntityStatus? status, int? categoryId, int? subCategoryId, int? brandId,
        TrackingMode? trackingMode, CancellationToken ct = default);

    Task<ETagged<ItemDetailDto>?> GetAsync(int itemId, CancellationToken ct = default);

    Task<ETagged<ItemDetailDto>> CreateAsync(CreateItemRequest request, CancellationToken ct = default);

    Task<ETagged<ItemDetailDto>> UpdateAsync(int itemId, UpdateItemRequest request, uint expectedRowVersion, CancellationToken ct = default);

    Task SetStatusAsync(int itemId, EntityStatus status, CancellationToken ct = default);

    Task<ItemReorderSettingsDto> UpdateReorderAsync(int itemId, UpdateReorderRequest request, CancellationToken ct = default);
}
