package eu.eudat.models.data.userinfo;

import eu.eudat.data.entities.*;
import eu.eudat.data.entities.UserInfo;
import eu.eudat.models.DataModel;
import eu.eudat.models.data.dmp.DataManagementPlan;

import java.util.Date;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;

/**
 * Created by ikalyvas on 8/24/2018.
 */
public class UserProfile implements DataModel<eu.eudat.data.entities.UserInfo, UserProfile> {

    private UUID id;
    private String email;
    private Short usertype;
    private String name;
    private Date lastloggedin;
    private String additionalinfo;
    private List<DataManagementPlan> associatedDmps;

    public UUID getId() {
        return id;
    }

    public void setId(UUID id) {
        this.id = id;
    }

    public String getEmail() {
        return email;
    }

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

    public Short getUsertype() {
        return usertype;
    }

    public void setUsertype(Short usertype) {
        this.usertype = usertype;
    }

    public String getName() {
        return name;
    }

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

    public Date getLastloggedin() {
        return lastloggedin;
    }

    public void setLastloggedin(Date lastloggedin) {
        this.lastloggedin = lastloggedin;
    }

    public String getAdditionalinfo() {
        return additionalinfo;
    }

    public void setAdditionalinfo(String additionalinfo) {
        this.additionalinfo = additionalinfo;
    }

    public List<DataManagementPlan> getAssociatedDmps() {
        return associatedDmps;
    }

    public void setAssociatedDmps(List<DataManagementPlan> associatedDmps) {
        this.associatedDmps = associatedDmps;
    }

    @Override
    public UserProfile fromDataModel(UserInfo entity) {
        this.id = entity.getId();
        this.email = entity.getEmail();
        this.usertype = entity.getUsertype();
        this.name = entity.getName();
        this.lastloggedin = entity.getLastloggedin();
        this.additionalinfo = entity.getAdditionalinfo();
        return this;
    }

    @Override
    public UserInfo toDataModel() throws Exception {
        return null;
    }

    @Override
    public String getHint() {
        return null;
    }
}
