Key Capabilities
Personnel Registry
Maintain complete employee records with organizational roles, areas, contact info, and labor status.
Operational Roles
Assign specialized operational roles (Operario, Auxiliar, Ayudante) with temporal tracking.
Work Assignments
Assign personnel to specific processes, machines, and shifts (permanent or temporary).
Shift Groups
Organize workers into rotating shift groups (Grupo A, Grupo B) with automatic shift scheduling.
Personnel Registry (Personas)
Data Model
All employees are registered in thepersonas table:
Personnel Schema:
- Activo: Currently working
- Licencia: On leave (with absence dates and reason)
- Baja: Terminated
backend/domains/personal/personal.repository.js
Creating Personnel Records
UI Flow:- Navigate to Personnel → All Personnel
- Click Add Employee
- Enter employee details:
- Nombre / Apellido: Full name
- Código Interno: Employee badge number
- Área: Select department (e.g., “Producción”, “Calidad”)
- Email / Teléfono: Contact information
- Fecha de Ingreso: Hire date
- Rol Organizacional: Job title
- Save personnel record
POST /api/personnel/personal
Request Body:
personal.repository.js:35):
backend/domains/personal/personal.repository.js:35
User Accounts (Usuarios)
System Access
Personnel can be granted system access by creating a user account: User Schema:- Administrador: Full system access
- Supervisor: Manage operations, approve deviations
- Operario: Record production and quality data
- Auxiliar: Limited data entry
- Consulta: Read-only access
backend/domains/personal/personal.repository.js:115
Creating User Accounts
UI Flow:- Navigate to personnel detail page
- Click Create User Account
- Enter credentials:
- Username: Unique system username
- Password: Initial password (user must change on first login)
- Role: Select from dropdown
- System creates user account linked to persona
POST /api/personnel/personal/:id/usuario
Request Body:
personal.repository.js:115):
- Passwords are hashed using bcrypt before storage
- Initial passwords require change on first login (
must_change_password = 1) - Password reset creates audit trail via
motivo_cambio
backend/domains/personal/personal.repository.js:115
Operational Roles (Roles Operativos)
Role Assignment
Personnel are assigned operational roles that define their shop floor responsibilities: Operational Roles:- Operario: Primary machine operator
- Auxiliar: Assistant operator
- Ayudante: Helper/trainee
- Inspector: Quality inspector
- Preparador: Machine setup technician
persona_roles_operativos):
fecha_desde: Assignment start datefecha_hasta: Assignment end date (NULL for active assignments)- Historical assignments preserved for auditing
backend/domains/grupos/grupos.repository.js:85
Assigning Operational Roles
UI Flow:- Navigate to personnel detail page → Operational Role section
- Click Assign Role
- Select role from dropdown
- Enter assignment reason (e.g., “Promoción a operario”, “Capacitación completada”)
- System closes previous role assignment and creates new one
POST /api/personnel/personal/:id/rol-operativo
Request Body:
grupos.repository.js:85):
grupos.repository.js:74):
backend/domains/grupos/grupos.repository.js:85
Work Assignments (Asignaciones Operativas)
Process Assignments
Personnel are assigned to specific processes, machines, and shifts: Assignment Schema:- Permanent (
permanente = 1): Long-term assignment to a process/machine - Temporary (
permanente = 0): Short-term assignment with defined end date
backend/domains/personal/personal.repository.js:230
Creating Assignments
UI Flow:- Navigate to Operations → Assignments
- Click New Assignment
- Select:
- Employee: From active personnel list
- Process: From ProcessRegistry (1-9)
- Machine: Optional (leave blank for any machine in process)
- Shift: Día, Noche, or Ambos
- Permanent: Checkbox
- Save assignment
POST /api/personnel/personal/asignaciones
Request Body:
personal.repository.js:230):
backend/domains/personal/personal.repository.js:230
Assignment Validation
During bitácora closure, the system validates that all active processes have assigned personnel: Validation Logic (frombitacora.service.js:134):
backend/domains/production/bitacora.service.js:134
Shift Groups (Grupos)
Group Management
Personnel are organized into shift groups that rotate between day and night shifts: Group Schema:grupo_integrantes):
backend/domains/grupos/grupos.repository.js
Creating Groups
UI Flow:- Navigate to Personnel → Groups
- Click Create Group
- Enter group details:
- Nombre: e.g., “Grupo A”
- Tipo: Rotativo (default), Fijo Día, or Fijo Noche
- Turno Actual: Starting shift (Día or Noche)
- Save group
POST /api/grupos
Request Body:
grupos.repository.js:13):
backend/domains/grupos/grupos.repository.js:13
Adding Members
UI Flow:- Navigate to group detail page
- Click Add Member
- Select employee from dropdown
- Enter assignment reason
- System adds member to group
POST /api/grupos/:id/integrantes
Request Body:
grupos.repository.js:53):
backend/domains/grupos/grupos.repository.js:53
Shift Rotation
Groups rotate shifts automatically: Rotation Logic:- Rotativo groups swap shifts weekly (configurable)
- Fijo Día / Fijo Noche groups do not rotate
PATCH /api/grupos/:id/turno
Request Body:
grupos.repository.js:99):
backend/domains/grupos/grupos.repository.js:99
Absence Management
Recording Absences
When personnel are absent, their labor status is updated: Absence Flow:- Navigate to personnel detail page
- Click Record Absence
- Enter absence details:
- Tipo de Ausencia: Vacaciones, Enfermedad, Licencia, Permiso
- Fecha Desde / Fecha Hasta: Absence period
- Motivo: Detailed reason
- System updates
estado_laboral = 'Licencia'and records absence
historial_ausencias):
personal.repository.js:129):
backend/domains/personal/personal.repository.js:129
Returning from Absence
Flow:- Navigate to personnel detail page
- Click Return from Absence
- System updates
estado_laboral = 'Activo'and clears absence fields - Historical absence record preserved in
historial_ausencias
Integration with Planning
Personnel Planning
The weekly planning system (plan_detalle_personal) references personnel assignments:
Planning Schema:
- Supervisor creates weekly plan
- Assigns orders to processes/machines/shifts
- Assigns personnel to match order schedule
- System validates:
- Personnel have appropriate operational roles
- No double-booking (same person assigned to multiple processes in same shift)
- Availability (not on absence)
planning.repository.js:114):
backend/domains/production/planning.repository.js:114
Reporting & Analytics
Active Personnel Report
Query:Assignment Coverage Report
Query (processes without assigned personnel):Absence Trend Analysis
Query (absence rate by month):Next Steps
Production Management
See how personnel assignments enforce staffing requirements during shifts
Quality Control
Learn about inspector roles in quality validation
API Reference
Explore personnel management API endpoints
Dashboard
View personnel metrics and assignment coverage