package org.example.petshopdesktop.models;

import org.example.petshopdesktop.auth.Role;

public class User {
    private final int userId;
    private final int employeeId;
    private final String username;
    private final String employeeFirstName;
    private final String employeeLastName;
    private final Role role;

    public User(int userId, int employeeId, String username, String employeeFirstName, String employeeLastName, Role role) {
        this.userId = userId;
        this.employeeId = employeeId;
        this.username = username;
        this.employeeFirstName = employeeFirstName;
        this.employeeLastName = employeeLastName;
        this.role = role;
    }

    public int getUserId() {
        return userId;
    }

    public int getEmployeeId() {
        return employeeId;
    }

    public String getUsername() {
        return username;
    }

    public String getEmployeeFirstName() {
        return employeeFirstName;
    }

    public String getEmployeeLastName() {
        return employeeLastName;
    }

    public String getEmployeeFullName() {
        String fn = employeeFirstName == null ? "" : employeeFirstName.trim();
        String ln = employeeLastName == null ? "" : employeeLastName.trim();
        String full = (fn + " " + ln).trim();
        return full.isBlank() ? username : full;
    }

    public Role getRole() {
        return role;
    }
}
