package com.telephoners.krakyournet.ctf.repositories;

import com.telephoners.krakyournet.ctf.beans.Team;
import com.telephoners.krakyournet.ctf.beans.User;
import org.ektorp.CouchDbConnector;

import javax.inject.Singleton;

public class TeamsRepository extends Repository<Team>
{
    public TeamsRepository(Class<Team> type, CouchDbConnector connector)
    {
        super(type, connector);
    }

    public Team getTeamByUser(User user)
    {
        return null;
        /*
        return datastore.createQuery(Team.class).asList().stream()
                .filter(team -> team.getMembers().contains(user))
                .findFirst()
                .orElseThrow(TeamNotFoundException::new);*/
    }

    public Team getTeamByUserName(String username)
    {
        return null;
//        return getTeamByUser(usersRepository.getUserByName(username));
    }
}
