package com.microstar.tap3.login.api;

import java.util.List;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonIgnore;

public class LoginData
{

	// Data coming from client
	private String 						username;			// Can be empty if sending refreshToken
	private String 						password;			// Can be empty if sending refreshToken
	
	// Data going back to client
	private String 						userToken;
	private String 						userRole;
	private Map<String, String> 		accountPermissions;
	private String 						firstName;
	private String 						lastName;
	private String 						emailAddress;
	private String 						cellPhoneNumber;
	private String 						deskPhoneNumber;
	private String 						faxNumber;
	private List<BusinessUnit> 			businessUnits;
	private boolean 					active;
	private List<String>				permissions;				// "Permission1:Access|Permissionn2:Access"
	private Map<String, List<String>>	perCustomerPermissions;		// <"CustomerId", "Permission1:Access|Permission2:Access|etc">
	private String						userId;
	private String						rootCustomerId;				// For Customer logins only
	
	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public String getEmailAddress() {
		return emailAddress;
	}

	public void setEmailAddress(String emailAddress) {
		this.emailAddress = emailAddress;
	}

	public String getCellPhoneNumber() {
		return cellPhoneNumber;
	}

	public void setCellPhoneNumber(String cellPhoneNumber) {
		this.cellPhoneNumber = cellPhoneNumber;
	}

	public String getDeskPhoneNumber() {
		return deskPhoneNumber;
	}

	public void setDeskPhoneNumber(String deskPhoneNumber) {
		this.deskPhoneNumber = deskPhoneNumber;
	}

	public String getFaxNumber() {
		return faxNumber;
	}

	public void setFaxNumber(String faxNumber) {
		this.faxNumber = faxNumber;
	}

	public List<BusinessUnit> getBusinessUnits() {
		return businessUnits;
	}

	public void setBusinessUnits(List<BusinessUnit> businessUnits) {
		this.businessUnits = businessUnits;
	}

	public boolean isActive() {
		return active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}

	public LoginData()
	{
		// This is the Template for the object passed into and returned from this resource.
	}

	/**
	 * @return the username
	 */
	public String getUsername()
	{
		return username;
	}

	/**
	 * @param username the username to set
	 */
	public LoginData setUsername(String username)
	{
		this.username = username;
		return this;
	}

	/**
	 * @return the password
	 */
	public String getPassword()
	{
		return password;
	}

	/**
	 * @param password the password to set
	 */
	public LoginData setPassword(String password)
	{
		this.password = password;
		return this;
	}

	/**
	 * @return the userRole
	 */
	public String getUserRole()
	{
		return userRole;
	}

	/**
	 * @param userRole the userRole to set
	 */
	public LoginData setUserRole(String userRole)
	{
		this.userRole = userRole;
		return this;
	}

	/**
	 * @return the permissions
	 */
	public List<String> getPermissions()
	{
		return permissions;
	}

	/**
	 * @param permissions the permissions to set
	 */
	public LoginData setPermissions(List<String> permissions)
	{
		this.permissions = permissions;
		return this;
	}

	public String getUserToken() {
		return userToken;
	}

	public void setUserToken(String userToken) {
		this.userToken = userToken;
	}

	public Map<String, String> getAccountPermissions() {
		return accountPermissions;
	}

	public void setAccountPermissions(Map<String, String> accountPermissions) {
		this.accountPermissions = accountPermissions;
	}

	public Map<String, List<String>> getPerCustomerPermissions() {
		return perCustomerPermissions;
	}

	public void setPerCustomerPermissions(Map<String, List<String>> perCustomerPermissions) {
		this.perCustomerPermissions = perCustomerPermissions;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	@Override
	public String toString() {
		return "LoginData [username=" + username + ", userToken=" + userToken + ", userRole=" + userRole
				+ ", accountPermissions=" + accountPermissions + ", firstName=" + firstName + ", lastName=" + lastName
				+ ", emailAddress=" + emailAddress + ", cellPhoneNumber=" + cellPhoneNumber + ", deskPhoneNumber="
				+ deskPhoneNumber + ", faxNumber=" + faxNumber + ", businessUnits=" + businessUnits + ", active="
				+ active + ", permissions=" + permissions + ", perCustomerPermissions=" + perCustomerPermissions
				+ ", userId=" + userId + ", getFirstName()=" + getFirstName() + ", getLastName()=" + getLastName()
				+ ", getEmailAddress()=" + getEmailAddress() + ", getCellPhoneNumber()=" + getCellPhoneNumber()
				+ ", getDeskPhoneNumber()=" + getDeskPhoneNumber() + ", getFaxNumber()=" + getFaxNumber()
				+ ", getBusinessUnits()=" + getBusinessUnits() + ", isActive()=" + isActive() + ", getUsername()="
				+ getUsername() + ", getPassword()=" + getPassword() + ", getUserRole()=" + getUserRole()
				+ ", getPermissions()=" + getPermissions() + ", getUserToken()=" + getUserToken()
				+ ", getAccountPermissions()=" + getAccountPermissions() + ", getPerCustomerPermissions()="
				+ getPerCustomerPermissions() + ", getUserId()=" + getUserId() + ", getClass()=" + getClass()
				+ ", hashCode()=" + hashCode() + ", toString()=" + super.toString() + "]";
	}

	public String getRootCustomerId() {
		return rootCustomerId;
	}

	public void setRootCustomerId(String rootCustomerId) {
		this.rootCustomerId = rootCustomerId;
	}

}
