package de.effigenix.domain.masterdata.customer;

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

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

public interface CustomerRepository {

    Result<RepositoryError, Optional<Customer>> findById(CustomerId id);

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

    Result<RepositoryError, List<Customer>> findByType(CustomerType type);

    Result<RepositoryError, List<Customer>> findByStatus(CustomerStatus status);

    Result<RepositoryError, Void> save(Customer customer);

    Result<RepositoryError, Void> delete(Customer customer);

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