package com.telephoners.krakyournet.ctf.beans;

import org.ektorp.docref.DocumentReferences;
import org.ektorp.support.CouchDbDocument;

import java.security.Principal;

//todo: use CouchDbDocument
//todo: implement principal
public class User extends CouchDbDocument implements Principal
{
    private String name;
    private String password;
    private String email;
    private boolean admin = false;

    @DocumentReferences //todo: make sure it works
    private Team team;

    public User(String name, String password, String email, boolean admin, Team team)
    {
        this.name = name;
        this.password = password;
        this.email = email;
        this.admin = admin;
        this.team = team;
    }

    @Override
    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public String getPassword()
    {
        return password;
    }

    public void setPassword(String password)
    {
        this.password = password;
    }

    public String getEmail()
    {
        return email;
    }

    public void setEmail(String email)
    {
        this.email = email;
    }

    public boolean isAdmin()
    {
        return admin;
    }

    public void setAdmin(boolean admin)
    {
        this.admin = admin;
    }

    public Team getTeam()
    {
        return team;
    }

    public void setTeam(Team team)
    {
        this.team = team;
    }
}
