Skip to main content
The user model defines authentication and account management data structures. Interfaces are exported from projects/shared/src/models/auth.model.ts and projects/shared/src/lib/users.service.ts.

Source

auth.model.ts

export type UserRole = 'ADMIN' | 'MESA' | 'AREA' | 'USUARIO';

export interface AuthUser {
  id: string;
  email: string;
  nombre: string;
  rol: UserRole;
  area?: string | null;
}

export interface LoginPayload {
  email: string;
  password: string;
}

export interface LoginResponse {
  access_token: string;
  token_type: string;
  user: AuthUser;
}

users.service.ts interfaces

export type UserRole = 'ADMIN' | 'MESA' | 'AREA' | 'USUARIO';

export interface UserDto {
  id: string;
  email: string;
  nombre: string;
  rol: UserRole;
  area?: string | null;
  telefono?: string | null;
  is_active: boolean;
}

export interface UserCreatePayload {
  email: string;
  nombre: string;
  password: string;
  rol: UserRole;
  area?: string | null;
  telefono?: string | null;
}

export interface UserUpdatePayload {
  email?: string;
  nombre?: string;
  password?: string;
  rol?: UserRole;
  area?: string | null;
  telefono?: string | null;
  is_active?: boolean;
}

UserRole type

All user accounts are assigned one of the following roles. The role controls what actions and views the user can access.
ValueDescription
ADMINFull administrative access. Can manage users, tickets, configuration, and reports.
MESAHelp desk agent. Can view and update all tickets in the queue.
AREAArea specialist. Typically scoped to tickets assigned to their department area.
USUARIOEnd user / requester. Can submit tickets and query their own ticket status via the public portal.
export type UserRole = 'ADMIN' | 'MESA' | 'AREA' | 'USUARIO';

AuthUser interface

The authenticated user object embedded in the login response and available throughout the session.
id
string
required
UUID that uniquely identifies the user account.
email
string
required
Email address used to log in.
nombre
string
required
Display name of the user.
rol
UserRole
required
Role assigned to the user. Controls access permissions throughout the application.
area
string | null
Department area associated with the user. Relevant for users with the AREA role.

LoginPayload interface

Send this payload to the login endpoint to authenticate a user.
email
string
required
The user’s registered email address.
password
string
required
The user’s password.

LoginResponse interface

Returned by the authentication endpoint on a successful login.
access_token
string
required
Bearer token to include in the Authorization header for subsequent authenticated requests.
token_type
string
required
Token scheme. Always bearer.
user
AuthUser
required
The authenticated user’s profile data.

UserDto interface

The full user object returned from the user management API. Use this when listing or displaying user accounts.
id
string
required
UUID that uniquely identifies the user.
email
string
required
User’s email address.
nombre
string
required
User’s display name.
rol
UserRole
required
Assigned role.
area
string | null
Associated department area.
telefono
string | null
User’s phone number.
is_active
boolean
required
Whether the account is currently active. Inactive accounts cannot log in.

UserCreatePayload interface

Use this payload when creating a new user account via the admin API.
email
string
required
Email address for the new account. Must be unique.
nombre
string
required
Display name for the new user.
password
string
required
Initial password for the account.
rol
UserRole
required
Role to assign to the new user.
area
string | null
Department area to associate with the user. Required for users with the AREA role.
telefono
string | null
Phone number for the user.

UserUpdatePayload interface

Use this payload to update an existing user account. All fields are optional — only include the fields you want to change.
You must be authenticated as an ADMIN to update other user accounts.
email
string
New email address for the account.
nombre
string
Updated display name.
password
string
New password for the account.
rol
UserRole
Updated role assignment.
area
string | null
Updated department area association.
telefono
string | null
Updated phone number.
is_active
boolean
Set to false to deactivate the account without deleting it.

Build docs developers (and LLMs) love