Documentation Index
Fetch the complete documentation index at: https://mintlify.com/exon-reyes/integra-backend/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Integra’s organizational structure defines the hierarchical relationship between different organizational elements: departments, positions, units (work locations), and zones. This structure provides the foundation for employee assignment, attendance tracking, and reporting.Core Components
Departments (Departamentos)
Departments represent functional divisions within the organization.- Groups employees by functional area (Sales, HR, Operations, etc.)
- Every employee must belong to a department
- Used for reporting and organizational charts
Positions (Puestos)
Positions define job roles within the organization.- Defines employee job titles and roles
- Can be activated/deactivated with
activoflag - Every employee must have an assigned position
- Examples: “Manager”, “Supervisor”, “Operator”, “Administrator”
Units (Unidades)
Units represent physical work locations or branches where employees are assigned and attendance is tracked.clave: Short unique code for the unitnombre: Full unit namenombreCompleto: Auto-generated concatenation of clave and nombrelocalizacion: Physical location/addresszona: Geographic zone assignmentestado: State/province locationsupervisor: Employee responsible for the unitactivo: Active/inactive status
requiereCamara: Whether photo verification is requiredcodigoAutorizacionKiosco: Authorization code for kiosk setuprequiereCodigo: Whether access code is neededtiempoCompensacion: Compensation time for early/late punches
Units serve dual purposes: they are both organizational assignments for employees and physical locations for attendance registration through kiosks.
Zones (Zonas)
Zones group multiple units by geographic area.- Geographic grouping of units
- Regional reporting and management
- Territory assignment
- Can be activated/deactivated
Employee Relationships
Employees are connected to the organizational structure through multiple relationships:- Department: Required - defines functional area
- Position: Required - defines job role
- Unit: Optional - primary work location
- Zone: Optional - primary geographic zone (stored as ID)
- Manager (jefe): Optional - direct supervisor relationship
- Team (plantilla): Employees managed by this person
Hierarchical Relationships
Management Hierarchy
The system supports a management chain through thejefe relationship:
Location Hierarchy
Geographic organization flows from Zones to Units:API Endpoints
Department Management
Position Management
Unit Management
Zone Management
Organizational Catalogs
The system provides catalog endpoints for dropdown/selection lists:- Form dropdowns
- Employee assignment interfaces
- Quick lookups
Unit Supervision
Each unit can have an assigned supervisor:- Oversee unit operations
- Approve attendance modifications
- Manage unit employees
- Monitor unit performance
The supervisor must be an existing employee in the system. Circular references (employee supervising themselves) should be prevented at the application level.
Best Practices
Naming Conventions
- Departments: Use clear functional names (“Human Resources”, “Operations”)
- Positions: Use standard job titles (“Senior Developer”, “Sales Manager”)
- Units: Include location identifiers (“Warehouse-Dallas”, “Store-NYC-001”)
- Zones: Use geographic or regional names (“East Coast”, “Central Region”)
Data Integrity
- Before deleting departments/positions: Ensure no employees are assigned
- Unit deactivation: Use
activo = falseinstead of deletion - Zone changes: Consider impact on reporting when reassigning units
- Supervisor assignment: Validate supervisor works at or manages the unit
Performance Considerations
- Units use
@DynamicInsertand@DynamicUpdatefor efficient database operations - Lazy loading for relationships prevents unnecessary data fetching
nombreCompletois auto-generated at database level for consistency
Related Concepts
- Access Control - User roles and permissions
- Attendance System - How units relate to attendance
- Kiosk Mode - Unit-based attendance registration