package de.effigenix.domain.masterdata.productcategory;

import de.effigenix.shared.common.RepositoryError;
import de.effigenix.shared.common.Result;

import java.util.List;
import java.util.Optional;

public interface ProductCategoryRepository {

    Result<RepositoryError, Optional<ProductCategory>> findById(ProductCategoryId id);

    Result<RepositoryError, List<ProductCategory>> findAll();

    Result<RepositoryError, Void> save(ProductCategory category);

    Result<RepositoryError, Void> delete(ProductCategory category);

    Result<RepositoryError, Boolean> existsByName(CategoryName name);
}
