20 lines
1.3 KiB
C#
20 lines
1.3 KiB
C#
using Imprink.Domain.Entities;
|
|
|
|
namespace Imprink.Domain.Repositories;
|
|
|
|
public interface ICategoryRepository
|
|
{
|
|
Task<Category?> GetByIdAsync(Guid id, CancellationToken cancellationToken = default);
|
|
Task<Category?> GetByIdWithSubCategoriesAsync(Guid id, CancellationToken cancellationToken = default);
|
|
Task<Category?> GetByIdWithProductsAsync(Guid id, CancellationToken cancellationToken = default);
|
|
Task<IEnumerable<Category>> GetAllAsync(CancellationToken cancellationToken = default);
|
|
Task<IEnumerable<Category>> GetActiveAsync(CancellationToken cancellationToken = default);
|
|
Task<IEnumerable<Category>> GetRootCategoriesAsync(CancellationToken cancellationToken = default);
|
|
Task<IEnumerable<Category>> GetSubCategoriesAsync(Guid parentCategoryId, CancellationToken cancellationToken = default);
|
|
Task<Category> AddAsync(Category category, CancellationToken cancellationToken = default);
|
|
Task<Category> UpdateAsync(Category category, CancellationToken cancellationToken = default);
|
|
Task DeleteAsync(Guid id, CancellationToken cancellationToken = default);
|
|
Task<bool> ExistsAsync(Guid id, CancellationToken cancellationToken = default);
|
|
Task<bool> HasSubCategoriesAsync(Guid categoryId, CancellationToken cancellationToken = default);
|
|
Task<bool> HasProductsAsync(Guid categoryId, CancellationToken cancellationToken = default);
|
|
} |