package de.effigenix.domain.masterdata.supplier;

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

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

public interface SupplierRepository {

    Result<RepositoryError, Optional<Supplier>> findById(SupplierId id);

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

    Result<RepositoryError, List<Supplier>> findByStatus(SupplierStatus status);

    Result<RepositoryError, Void> save(Supplier supplier);

    Result<RepositoryError, Void> delete(Supplier supplier);

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