package kr.co.hanwha.hifive.data.model;

import android.text.TextUtils;

import java.util.ArrayList;

/**
 * Created by sanghoonkwon on 2018. 1. 11..
 */

public class LoginData extends BaseData {
    /**
     * ex) 6
     */
    int member_id;
    /**
     * "iBPiEJr96PYRgmb2SFLvPg=="
     */
    String encryption_member_id;
    /**
     * ex) null
     */
    String profile_url;
    /**
     * ex) "201404397"
     */
    String login;
    /**
     * ex) "이승창"
     */
    String name;
    /**
     * ex) "차장"
     */
    String position;
    /**
     * ex) "인사팀"
     */
    String department;

    String company;

    String simple_login_yn;

    ArrayList<ProjectInfoData> listLeaderProjectsInfo;

    ArrayList<ProjectInfoData> listMyProjectsInfo;


    public int getMember_id() {
        return member_id;
    }

    public String getEncryption_member_id() {
        return TextUtils.isEmpty(encryption_member_id) ? "" : encryption_member_id;
    }

    public String getProfile_url() {
        return TextUtils.isEmpty(profile_url) ? "" : profile_url;
    }

    public String getLogin() {
        return TextUtils.isEmpty(login) ? "" : login;
    }

    public String getName() {
        return TextUtils.isEmpty(name) ? "" : name;
    }

    public String getPosition() {
        return TextUtils.isEmpty(position) ? "" : position;
    }

    public String getDepartment() {
        return TextUtils.isEmpty(department) ? "" : department;
    }

    public String getCompany() {
        return TextUtils.isEmpty(company) ? "" : company;
    }

    public boolean isSimpleLoginYn() {
        return ("Y".equalsIgnoreCase(simple_login_yn));
    }

    public boolean isProjectLeader() {
        return (listLeaderProjectsInfo != null && listLeaderProjectsInfo.size() > 0);
    }

    public ArrayList<ProjectInfoData> getListMyProjectsInfo() {
        return listMyProjectsInfo;
    }

    @Override
    public String toString() {
        return "LoginData{" +
                "member_id=" + member_id +
                ", encryption_member_id='" + encryption_member_id + '\'' +
                ", profile_url='" + profile_url + '\'' +
                ", login='" + login + '\'' +
                ", name='" + name + '\'' +
                ", position='" + position + '\'' +
                ", department='" + department + '\'' +
                ", company='" + company + '\'' +
                ", simple_login_yn='" + simple_login_yn + '\'' +
                ", listLeaderProjectsInfo=" + listLeaderProjectsInfo +
                ", listMyProjectsInfo=" + listMyProjectsInfo +
                '}';
    }
}
