package de.effigenix.domain.masterdata.article;

import de.effigenix.domain.masterdata.productcategory.ProductCategoryId;
import de.effigenix.shared.common.RepositoryError;
import de.effigenix.shared.common.Result;

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

public interface ArticleRepository {

    Result<RepositoryError, Optional<Article>> findById(ArticleId id);

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

    Result<RepositoryError, List<Article>> findByCategory(ProductCategoryId categoryId);

    Result<RepositoryError, List<Article>> findByStatus(ArticleStatus status);

    Result<RepositoryError, Void> save(Article article);

    Result<RepositoryError, Void> delete(Article article);

    Result<RepositoryError, Boolean> existsByArticleNumber(ArticleNumber articleNumber);
}
