package com.arrebol.taxiservicios.model.core;

import com.arrebol.taxiservicios.model.admin.ClosingDay;
import com.arrebol.taxiservicios.model.catalog.Location;
import com.arrebol.taxiservicios.model.enums.UserStatusType;
import com.arrebol.taxiservicios.model.notification.StopNotification;
import com.arrebol.taxiservicios.model.stocktaking.ServiceOrderNotificationDeliveryTo;
import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;

/**
 *
 * @author Carlos Janitzio Zavala Lopez
 */
public class User implements Serializable {

    private static final long serialVersionUID = 5293919946950359645L;

    private String id;
    private Person person;
    private String userName;
    private String password;
    private boolean active;
    private boolean root;
    private UserStatusType userStatusType;
    private Location location;
    private String createdBy;
    private Date createdOn;
    private String lastUpdatedBy;
    private Date lastUpdatedOn;
    private Set userHasPermissions = new HashSet(0);
    private Set brandCreatedIds = new HashSet(0);
    private Set brandUpdatedIds = new HashSet(0);
    private Set productCreatedIds = new HashSet(0);
    private Set productUpdatedIds = new HashSet(0);
    private Set vehicleCreatedIds = new HashSet(0);
    private Set vehicleUpdatedIds = new HashSet(0);
    private Set colorCreatedIds = new HashSet(0);
    private Set colorUpdatedIds = new HashSet(0);
    private Set createdByTaxis = new HashSet(0);
    private Set lastUpdatedByTaxis = new HashSet(0);
    private Set createdByReferences = new HashSet(0);
    private Set lastUpdatedByReferences = new HashSet(0);
    private Set createdByDocuments = new HashSet(0);
    private Set lastUpdatedByDocuments = new HashSet(0);
    private Set createdByAddresses = new HashSet(0);
    private Set lastUpdatedByAddresses = new HashSet(0);
    private Set createdByContactNumbers = new HashSet(0);
    private Set lastUpdatedByContactNumbers = new HashSet(0);
    private Set createdByPersons = new HashSet(0);
    private Set lastUpdatedByPersons = new HashSet(0);
    private Set createdByServices = new HashSet(0);
    private Set lastUpdatedByServices = new HashSet(0);
    private Set createdBySales = new HashSet(0);
    private Set lastUpdatedBySales = new HashSet(0);
    private Set createdByContracts = new HashSet(0);
    private Set lastUpdatedByContracts = new HashSet(0);
    private Set createdByInvoices = new HashSet(0);
    private Set lastUpdatedByInvoices = new HashSet(0);
    private Set createdByInvoiceHasProducts = new HashSet(0);
    private Set lastUpdatedByInvoiceHasProducts = new HashSet(0);
    private Set createdByServiceOrders = new HashSet(0);
    private Set lastUpdatedByServiceOrders = new HashSet(0);
    private Set createdByServiceOrderHasProducts = new HashSet(0);
    private Set lastUpdatedByServiceOrderHasProducts = new HashSet(0);
    private Set createdByExpenses = new HashSet(0);
    private Set lastUpdatedByExpenses = new HashSet(0);
    private Set createdBySanctions = new HashSet(0);
    private Set lastUpdatedBySanctions = new HashSet(0);
    private Set createdByHolidays = new HashSet(0);
    private Set lastUpdatedByHolidays = new HashSet(0);
    private Set createdByToCollects = new HashSet(0);
    private Set lastUpdatedByToCollects = new HashSet(0);
    private Set<ServiceOrderNotificationDeliveryTo> serviceOrderNotificationDeliveryTos = new HashSet(0);
    private Set<StopNotification> stopNotifications = new HashSet(0);
    private Set createdByExpenseCompany = new HashSet(0);
    private Set lastUpdatedByExpenseCompany = new HashSet(0);
    private Set createdByStableGeneralBox = new HashSet(0);
    private Set lastUpdatedByStableGeneralBox = new HashSet(0);
    private Set createdByStableSmallBox = new HashSet(0);
    private Set lastUpdatedByStableSmallBox = new HashSet(0);
    private Set<ClosingDay> closingDays = new HashSet(0);
    private Set createdByClosingDay = new HashSet(0);
    private Set lastUpdatedByClosingDay = new HashSet(0);
    private Set createdByClosingDayDetails = new HashSet(0);
    private Set lastUpdatedByClosingDayDetails = new HashSet(0);
    private Set createdByFeeByDriver = new HashSet(0);
    private Set lastUpdatedByFeeByDriver = new HashSet(0);
    private Set createdByReleaseResource = new HashSet(0);
    private Set lastUpdatedByReleaseResource = new HashSet(0);

    public Location getLocation() {
        return location;
    }

    public void setLocation(Location location) {
        this.location = location;
    }

    public User() {
    }

    public User(String userName) {
        this.userName = userName;
    }

    public User(String id, boolean active) {
        this.id = id;
        this.active = active;
    }

    public User(Person person) {
        this.person = person;
    }

    /**
     *
     * @param id Identify number
     * @param userName Username
     */
    public User(String id, String userName) {
        this.id = id;
        this.userName = userName;
    }

    /**
     *
     * @param person
     * @param userName
     */
    public User(Person person, String userName) {
        this.person = person;
        this.userName = userName;
    }

    /**
     *
     * @param userName
     * @param person
     */
    public User(String userName, Person person) {
        this.userName = userName;
        this.person = person;
    }

    /**
     *
     * @param id
     * @param userName
     * @param root
     */
    public User(String id, String userName, boolean root) {
        this.id = id;
        this.userName = userName;
        this.root = root;
    }

    /**
     *
     * @param id
     * @param userName
     * @param person
     */
    public User(String id, String userName, Person person) {
        this.id = id;
        this.userName = userName;
        this.person = person;
    }

    /**
     *
     * @param id
     * @param userName
     * @param person
     * @param root
     */
    public User(String id, String userName, Person person, boolean root) {
        this.id = id;
        this.userName = userName;
        this.person = person;
        this.root = root;
    }

    /**
     *
     * @param id
     * @param userName
     * @param person
     * @param root
     * @param active
     */
    public User(String id, String userName, Person person, boolean root, boolean active) {
        this.id = id;
        this.userName = userName;
        this.person = person;
        this.root = root;
        this.active = active;
    }

    public User(String id, String userName, String password, boolean active, Person person) {
        this.id = id;
        this.userName = userName;
        this.password = password;
        this.active = active;
        this.person = person;
    }

    public User(String id, String userName, String password, boolean active, Person person, Boolean root) {
        this.id = id;
        this.userName = userName;
        this.password = password;
        this.active = active;
        this.person = person;
        this.root = root;
    }

    public User(String id, Person person, String userName) {
        this.id = id;
        this.person = person;
        this.userName = userName;
    }

    /**
     * Use for user creation functionality.
     *
     * @param id
     * @param userName
     * @param password
     * @param active
     * @param createdBy
     */
    public User(String id, String userName, String password, boolean active, String createdBy) {
        this.id = id;
        this.userName = userName;
        this.password = password;
        this.active = active;
        this.createdBy = createdBy;
    }
    
    /**
     * Use for user creation functionality.
     *
     * @param id
     * @param root
     * @param userName
     * @param password
     * @param active
     * @param createdBy
     * 
     */
    public User(String id,Boolean root ,String userName, String password, boolean active, String createdBy) {
        this.id = id;
        this.root = root;
        this.userName = userName;
        this.password = password;
        this.active = active;
        this.createdBy = createdBy;
    }

    public User(String id, Person person, String userName, String password, boolean active, boolean root, UserStatusType userStatusType, Location location, String createdBy, Date createdOn, String lastUpdatedBy, Date lastUpdatedOn) {
        this.id = id;
        this.person = person;
        this.userName = userName;
        this.password = password;
        this.active = active;
        this.root = root;
        this.userStatusType = userStatusType;
        this.location = location;
        this.createdBy = createdBy;
        this.createdOn = createdOn;
        this.lastUpdatedBy = lastUpdatedBy;
        this.lastUpdatedOn = lastUpdatedOn;
    }

    public String getId() {
        return id;
    }

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

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

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

    public boolean isActive() {
        return active;
    }

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

    public boolean isRoot() {
        return root;
    }

    public void setRoot(boolean root) {
        this.root = root;
    }

    public UserStatusType getUserStatusType() {
        return userStatusType;
    }

    public void setUserStatusType(UserStatusType userStatusType) {
        this.userStatusType = userStatusType;
    }

    public Person getPerson() {
        return person;
    }

    public void setPerson(Person person) {
        this.person = person;
    }

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public Date getCreatedOn() {
        return createdOn;
    }

    public void setCreatedOn(Date createdOn) {
        this.createdOn = createdOn;
    }

    public String getLastUpdatedBy() {
        return lastUpdatedBy;
    }

    public void setLastUpdatedBy(String lastUpdatedBy) {
        this.lastUpdatedBy = lastUpdatedBy;
    }

    public Date getLastUpdatedOn() {
        return lastUpdatedOn;
    }

    public void setLastUpdatedOn(Date lastUpdatedOn) {
        this.lastUpdatedOn = lastUpdatedOn;
    }

    public Set getUserHasPermissions() {
        return userHasPermissions;
    }

    public void setUserHasPermissions(Set userHasPermissions) {
        this.userHasPermissions = userHasPermissions;
    }

    public Set getBrandCreatedIds() {
        return brandCreatedIds;
    }

    public void setBrandCreatedIds(Set brandCreatedIds) {
        this.brandCreatedIds = brandCreatedIds;
    }

    public Set getBrandUpdatedIds() {
        return brandUpdatedIds;
    }

    public void setBrandUpdatedIds(Set brandUpdatedIds) {
        this.brandUpdatedIds = brandUpdatedIds;
    }

    public Set getProductCreatedIds() {
        return productCreatedIds;
    }

    public void setProductCreatedIds(Set productCreatedIds) {
        this.productCreatedIds = productCreatedIds;
    }

    public Set getProductUpdatedIds() {
        return productUpdatedIds;
    }

    public void setProductUpdatedIds(Set productUpdatedIds) {
        this.productUpdatedIds = productUpdatedIds;
    }

    public Set getVehicleCreatedIds() {
        return vehicleCreatedIds;
    }

    public void setVehicleCreatedIds(Set vehicleCreatedIds) {
        this.vehicleCreatedIds = vehicleCreatedIds;
    }

    public Set getVehicleUpdatedIds() {
        return vehicleUpdatedIds;
    }

    public void setVehicleUpdatedIds(Set vehicleUpdatedIds) {
        this.vehicleUpdatedIds = vehicleUpdatedIds;
    }

    public Set getColorCreatedIds() {
        return colorCreatedIds;
    }

    public void setColorCreatedIds(Set colorCreatedIds) {
        this.colorCreatedIds = colorCreatedIds;
    }

    public Set getColorUpdatedIds() {
        return colorUpdatedIds;
    }

    public void setColorUpdatedIds(Set colorUpdatedIds) {
        this.colorUpdatedIds = colorUpdatedIds;
    }

    public Set getCreatedByTaxis() {
        return createdByTaxis;
    }

    public void setCreatedByTaxis(Set createdByTaxis) {
        this.createdByTaxis = createdByTaxis;
    }

    public Set getLastUpdatedByTaxis() {
        return lastUpdatedByTaxis;
    }

    public void setLastUpdatedByTaxis(Set lastUpdatedByTaxis) {
        this.lastUpdatedByTaxis = lastUpdatedByTaxis;
    }

    public Set getCreatedByReferences() {
        return createdByReferences;
    }

    public void setCreatedByReferences(Set createdByReferences) {
        this.createdByReferences = createdByReferences;
    }

    public Set getLastUpdatedByReferences() {
        return lastUpdatedByReferences;
    }

    public void setLastUpdatedByReferences(Set lastUpdatedByReferences) {
        this.lastUpdatedByReferences = lastUpdatedByReferences;
    }

    public Set getCreatedByDocuments() {
        return createdByDocuments;
    }

    public void setCreatedByDocuments(Set createdByDocuments) {
        this.createdByDocuments = createdByDocuments;
    }

    public Set getLastUpdatedByDocuments() {
        return lastUpdatedByDocuments;
    }

    public void setLastUpdatedByDocuments(Set lastUpdatedByDocuments) {
        this.lastUpdatedByDocuments = lastUpdatedByDocuments;
    }

    public Set getCreatedByAddresses() {
        return createdByAddresses;
    }

    public void setCreatedByAddresses(Set createdByAddresses) {
        this.createdByAddresses = createdByAddresses;
    }

    public Set getLastUpdatedByAddresses() {
        return lastUpdatedByAddresses;
    }

    public void setLastUpdatedByAddresses(Set lastUpdatedByAddresses) {
        this.lastUpdatedByAddresses = lastUpdatedByAddresses;
    }

    public Set getCreatedByContactNumbers() {
        return createdByContactNumbers;
    }

    public void setCreatedByContactNumbers(Set createdByContactNumbers) {
        this.createdByContactNumbers = createdByContactNumbers;
    }

    public Set getLastUpdatedByContactNumbers() {
        return lastUpdatedByContactNumbers;
    }

    public void setLastUpdatedByContactNumbers(Set lastUpdatedByContactNumbers) {
        this.lastUpdatedByContactNumbers = lastUpdatedByContactNumbers;
    }

    public Set getCreatedByPersons() {
        return createdByPersons;
    }

    public void setCreatedByPersons(Set createdByPersons) {
        this.createdByPersons = createdByPersons;
    }

    public Set getLastUpdatedByPersons() {
        return lastUpdatedByPersons;
    }

    public void setLastUpdatedByPersons(Set lastUpdatedByPersons) {
        this.lastUpdatedByPersons = lastUpdatedByPersons;
    }

    public Set getCreatedByServices() {
        return createdByServices;
    }

    public void setCreatedByServices(Set createdByServices) {
        this.createdByServices = createdByServices;
    }

    public Set getLastUpdatedByServices() {
        return lastUpdatedByServices;
    }

    public void setLastUpdatedByServices(Set lastUpdatedByServices) {
        this.lastUpdatedByServices = lastUpdatedByServices;
    }

    public Set getCreatedBySales() {
        return createdBySales;
    }

    public void setCreatedBySales(Set createdBySales) {
        this.createdBySales = createdBySales;
    }

    public Set getLastUpdatedBySales() {
        return lastUpdatedBySales;
    }

    public void setLastUpdatedBySales(Set lastUpdatedBySales) {
        this.lastUpdatedBySales = lastUpdatedBySales;
    }

    public Set getCreatedByContracts() {
        return createdByContracts;
    }

    public void setCreatedByContracts(Set createdByContracts) {
        this.createdByContracts = createdByContracts;
    }

    public Set getLastUpdatedByContracts() {
        return lastUpdatedByContracts;
    }

    public void setLastUpdatedByContracts(Set lastUpdatedByContracts) {
        this.lastUpdatedByContracts = lastUpdatedByContracts;
    }

    public Set getCreatedByInvoices() {
        return createdByInvoices;
    }

    public void setCreatedByInvoices(Set createdByInvoices) {
        this.createdByInvoices = createdByInvoices;
    }

    public Set getLastUpdatedByInvoices() {
        return lastUpdatedByInvoices;
    }

    public void setLastUpdatedByInvoices(Set lastUpdatedByInvoices) {
        this.lastUpdatedByInvoices = lastUpdatedByInvoices;
    }

    public Set getCreatedByInvoiceHasProducts() {
        return createdByInvoiceHasProducts;
    }

    public void setCreatedByInvoiceHasProducts(Set createdByInvoiceHasProducts) {
        this.createdByInvoiceHasProducts = createdByInvoiceHasProducts;
    }

    public Set getLastUpdatedByInvoiceHasProducts() {
        return lastUpdatedByInvoiceHasProducts;
    }

    public void setLastUpdatedByInvoiceHasProducts(Set lastUpdatedByInvoiceHasProducts) {
        this.lastUpdatedByInvoiceHasProducts = lastUpdatedByInvoiceHasProducts;
    }

    public Set getCreatedByServiceOrders() {
        return createdByServiceOrders;
    }

    public void setCreatedByServiceOrders(Set createdByServiceOrders) {
        this.createdByServiceOrders = createdByServiceOrders;
    }

    public Set getLastUpdatedByServiceOrders() {
        return lastUpdatedByServiceOrders;
    }

    public void setLastUpdatedByServiceOrders(Set lastUpdatedByServiceOrders) {
        this.lastUpdatedByServiceOrders = lastUpdatedByServiceOrders;
    }

    public Set getCreatedByServiceOrderHasProducts() {
        return createdByServiceOrderHasProducts;
    }

    public void setCreatedByServiceOrderHasProducts(Set createdByServiceOrderHasProducts) {
        this.createdByServiceOrderHasProducts = createdByServiceOrderHasProducts;
    }

    public Set getLastUpdatedByServiceOrderHasProducts() {
        return lastUpdatedByServiceOrderHasProducts;
    }

    public void setLastUpdatedByServiceOrderHasProducts(Set lastUpdatedByServiceOrderHasProducts) {
        this.lastUpdatedByServiceOrderHasProducts = lastUpdatedByServiceOrderHasProducts;
    }

    public Set getCreatedByExpenses() {
        return createdByExpenses;
    }

    public void setCreatedByExpenses(Set createdByExpenses) {
        this.createdByExpenses = createdByExpenses;
    }

    public Set getLastUpdatedByExpenses() {
        return lastUpdatedByExpenses;
    }

    public void setLastUpdatedByExpenses(Set lastUpdatedByExpenses) {
        this.lastUpdatedByExpenses = lastUpdatedByExpenses;
    }

    public Set getCreatedBySanctions() {
        return createdBySanctions;
    }

    public void setCreatedBySanctions(Set createdBySanctions) {
        this.createdBySanctions = createdBySanctions;
    }

    public Set getLastUpdatedBySanctions() {
        return lastUpdatedBySanctions;
    }

    public void setLastUpdatedBySanctions(Set lastUpdatedBySanctions) {
        this.lastUpdatedBySanctions = lastUpdatedBySanctions;
    }

    public Set getCreatedByHolidays() {
        return createdByHolidays;
    }

    public void setCreatedByHolidays(Set createdByHolidays) {
        this.createdByHolidays = createdByHolidays;
    }

    public Set getLastUpdatedByHolidays() {
        return lastUpdatedByHolidays;
    }

    public void setLastUpdatedByHolidays(Set lastUpdatedByHolidays) {
        this.lastUpdatedByHolidays = lastUpdatedByHolidays;
    }

    public Set getCreatedByToCollects() {
        return createdByToCollects;
    }

    public void setCreatedByToCollects(Set createdByToCollects) {
        this.createdByToCollects = createdByToCollects;
    }

    public Set getLastUpdatedByToCollects() {
        return lastUpdatedByToCollects;
    }

    public void setLastUpdatedByToCollects(Set lastUpdatedByToCollects) {
        this.lastUpdatedByToCollects = lastUpdatedByToCollects;
    }

    public Set<ServiceOrderNotificationDeliveryTo> getServiceOrderNotificationDeliveryTos() {
        return serviceOrderNotificationDeliveryTos;
    }

    public void setServiceOrderNotificationDeliveryTos(Set<ServiceOrderNotificationDeliveryTo> serviceOrderNotificationDeliveryTos) {
        this.serviceOrderNotificationDeliveryTos = serviceOrderNotificationDeliveryTos;
    }

    public Set<StopNotification> getStopNotifications() {
        return stopNotifications;
    }

    public void setStopNotifications(Set<StopNotification> stopNotifications) {
        this.stopNotifications = stopNotifications;
    }

    public Set getCreatedByExpenseCompany() {
        return createdByExpenseCompany;
    }

    public void setCreatedByExpenseCompany(Set createdByExpenseCompany) {
        this.createdByExpenseCompany = createdByExpenseCompany;
    }

    public Set getLastUpdatedByExpenseCompany() {
        return lastUpdatedByExpenseCompany;
    }

    public void setLastUpdatedByExpenseCompany(Set lastUpdatedByExpenseCompany) {
        this.lastUpdatedByExpenseCompany = lastUpdatedByExpenseCompany;
    }

    public Set getCreatedByStableGeneralBox() {
        return createdByStableGeneralBox;
    }

    public void setCreatedByStableGeneralBox(Set createdByStableGeneralBox) {
        this.createdByStableGeneralBox = createdByStableGeneralBox;
    }

    public Set getLastUpdatedByStableGeneralBox() {
        return lastUpdatedByStableGeneralBox;
    }

    public void setLastUpdatedByStableGeneralBox(Set lastUpdatedByStableGeneralBox) {
        this.lastUpdatedByStableGeneralBox = lastUpdatedByStableGeneralBox;
    }

    public Set getCreatedByStableSmallBox() {
        return createdByStableSmallBox;
    }

    public void setCreatedByStableSmallBox(Set createdByStableSmallBox) {
        this.createdByStableSmallBox = createdByStableSmallBox;
    }

    public Set getLastUpdatedByStableSmallBox() {
        return lastUpdatedByStableSmallBox;
    }

    public void setLastUpdatedByStableSmallBox(Set lastUpdatedByStableSmallBox) {
        this.lastUpdatedByStableSmallBox = lastUpdatedByStableSmallBox;
    }

    public Set<ClosingDay> getClosingDays() {
        return closingDays;
    }

    public void setClosingDays(Set<ClosingDay> closingDays) {
        this.closingDays = closingDays;
    }

    public Set getCreatedByClosingDay() {
        return createdByClosingDay;
    }

    public void setCreatedByClosingDay(Set createdByClosingDay) {
        this.createdByClosingDay = createdByClosingDay;
    }

    public Set getLastUpdatedByClosingDay() {
        return lastUpdatedByClosingDay;
    }

    public void setLastUpdatedByClosingDay(Set lastUpdatedByClosingDay) {
        this.lastUpdatedByClosingDay = lastUpdatedByClosingDay;
    }

    public Set getCreatedByClosingDayDetails() {
        return createdByClosingDayDetails;
    }

    public void setCreatedByClosingDayDetails(Set createdByClosingDayDetails) {
        this.createdByClosingDayDetails = createdByClosingDayDetails;
    }

    public Set getLastUpdatedByClosingDayDetails() {
        return lastUpdatedByClosingDayDetails;
    }

    public void setLastUpdatedByClosingDayDetails(Set lastUpdatedByClosingDayDetails) {
        this.lastUpdatedByClosingDayDetails = lastUpdatedByClosingDayDetails;
    }

    public Set getCreatedByFeeByDriver() {
        return createdByFeeByDriver;
    }

    public void setCreatedByFeeByDriver(Set createdByFeeByDriver) {
        this.createdByFeeByDriver = createdByFeeByDriver;
    }

    public Set getLastUpdatedByFeeByDriver() {
        return lastUpdatedByFeeByDriver;
    }

    public void setLastUpdatedByFeeByDriver(Set lastUpdatedByFeeByDriver) {
        this.lastUpdatedByFeeByDriver = lastUpdatedByFeeByDriver;
    }

    public Set getCreatedByReleaseResource() {
        return createdByReleaseResource;
    }

    public void setCreatedByReleaseResource(Set createdByReleaseResource) {
        this.createdByReleaseResource = createdByReleaseResource;
    }

    public Set getLastUpdatedByReleaseResource() {
        return lastUpdatedByReleaseResource;
    }

    public void setLastUpdatedByReleaseResource(Set lastUpdatedByReleaseResource) {
        this.lastUpdatedByReleaseResource = lastUpdatedByReleaseResource;
    }

    @Override
    public String toString() {
        return "User{" + "person=" + person + ", userName=" + userName + '}';
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 67 * hash + Objects.hashCode(this.id);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final User other = (User) obj;
        if (!Objects.equals(this.id, other.id)) {
            return false;
        }
        return true;
    }

    public User(String id, String userName, Person person, boolean root, Location location) {
        this.id = id;
        this.person = person;
        this.userName = userName;
        this.root = root;
        this.location = location;
    }

}
