package de.effigenix.domain.usermanagement;

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

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

/**
 * Repository interface for Role entity.
 * Roles are reference data - typically loaded from seed data.
 */
public interface RoleRepository {

    Result<RepositoryError, Optional<Role>> findById(RoleId id);

    Result<RepositoryError, Optional<Role>> findByName(RoleName name);

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

    Result<RepositoryError, Void> save(Role role);

    Result<RepositoryError, Void> delete(Role role);

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