package org.academiadecodigo.enuminatti.cadetregistry.services;

import org.academiadecodigo.enuminatti.cadetregistry.models.User;

/**
 * MIT License
 * (c) 2017 Ricardo Constantino
 */

public interface UserService {
    /**
     * @param user to try to login
     * @param password corresponding to that user
     * @return true if authentication was successful
     */
    boolean authenticate(String user, String password);

    /**
     * @param newUser to add to registry
     */
    void addUser(User newUser);

    /**
     * @param user to look for
     * @return the User instance corresponding to the username asked
     */
    User findByName(String user);

    /**
     * @return the number of users registered
     */
    int count();

    String getErrorStatus();
}
