The GDO (Gestión Documental) module provides a centralized digital archive for cooperative staff records. It covers the full employee lifecycle—from onboarding with identity data and job title assignment, through document uploads (contracts, IDs, certificates), to organized retrieval via category-typed catalogs. All binary assets—profile photos and document files—are stored on AWS S3 with scoped paths and short-lived temporary URLs, ensuring access-controlled delivery without exposing permanent storage links.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/corpentunida-org/corpen/llms.txt
Use this file to discover all available pages before exploring further.
Sub-resources
All routes are grouped under the/archivo prefix with auth middleware. The following sub-resources make up the GDO module:
| Sub-resource | Route prefix | Model | Purpose |
|---|---|---|---|
| Employee records | GET /archivo/empleados | GdoEmpleado | Master registry: cedula, names, birth date, sex, address, EPS, contact info |
| Job titles | GET /archivo/cargos | GdoCargo | Positions with salary, shift, corporate contact, and PDF function manual |
| Organizational areas | GET /archivo/areas | GdoArea | Departments/units that cargos belong to |
| Document types | GET /archivo/gdotipodocumento | GdoTipoDocumento | Type catalog (e.g., contract, ID copy); protected from deletion if documents exist |
| Document categories | GET /archivo/categorias | GdoCategoriaDocumento | Groups that type sets belong to |
| Employee documents | GET /archivo/gdodocsempleados | GdoDocsEmpleados | Individual document files linked to an employee by cedula |
| Job functions | GET /archivo/funciones | GdoFuncion | Function descriptions that can be assigned to cargos |
Route Reference
User–Employee Integration
Each CorpenUser account can be linked to a GdoEmpleado record through the perfilEmpleado relationship. The join key is the nid (national ID / cedula) column that exists on both the users table and gdo_empleados. This allows a single login to surface the employee’s photo, job title, and personal details in the application UI.
The getFotoPerfilAttribute() accessor on the User model calls the named route archivo.empleado.verFoto with the employee’s ID. That controller method checks S3 for the stored path, and if found, issues a 302 redirect to a 20-minute temporary URL. If no photo exists, a default avatar (public/assets/media/avatars/blank.png) is served instead.
Profile photos are stored on the
s3 disk under the path pattern archivo/empleados/fotos/YYYY/MM/{timestamp}_{slug}.{ext}. Employee documents (contracts, certificates, etc.) follow the path archivo/empleados/documentos/{cedula}/{DOC_{timestamp}_{random}.{ext}}. When an employee is deleted, both the profile photo and all associated documents are removed from S3 before the database records are purged. Temporary view URLs expire after 15 minutes for documents and 20 minutes for photos.Onboarding a New Employee
Create a document type (if needed)
Before registering an employee, ensure the relevant document types exist. Navigate to
/archivo/gdotipodocumento/create and submit the form with a unique nombre and optionally a categoria_documento_id. Types linked to existing documents cannot be deleted, so plan your taxonomy in advance.Create the organizational area
If the employee’s department does not exist yet, open
/archivo/areas/create and register it. Areas are referenced by job titles (GdoCargo) via the GDO_area_id foreign key.Create the job title (cargo)
Go to
/archivo/cargos/create. Fill in nombre_cargo, salario_base, jornada, corporate contact fields (telefono_corporativo, correo_corporativo, gmail_corporativo), and select the area. Optionally upload a PDF function manual (mimes:pdf, max 5 MB); it is stored on S3 at archivo/cargos/manuales/MANUAL_{slug}_{timestamp}.pdf.Register the employee
Open After successful creation, the controller redirects to
/archivo/empleados and submit the registration form. Required fields are cedula (unique), nombre1, and apellido1. The cedula value is the permanent identifier used as the join key across the system.archivo.empleado.index?id={employee_id} to display the new employee’s detail panel automatically.Upload an employee document
From the employee detail panel, use the document upload form. The endpoint is The file is stored at
POST /archivo/empleados/storeDocumento. Attach the file (PDF, JPG, PNG, or DOCX; max 5 MB), select the tipo_documento_id, and set a fecha_subida.archivo/empleados/documentos/{cedula}/DOC_{timestamp}_{random}.{ext} on S3. A success JSON response is returned; errors are logged via Log::error() and a generic 500 response is sent to the client.View or download a document
To view a document inline, call
GET /archivo/empleados/verDocumento/{id}. This generates a temporary S3 URL with ResponseContentType: application/pdf and ResponseContentDisposition: inline, valid for 15 minutes.To force a download with a descriptive filename (e.g., contrato_juan-perez.pdf), call GET /archivo/empleados/downloadDocumento/{id}. The filename is built from {tipo_documento}_{nombre_completo}.Job Title CSV Export
TheGdoCargoController::exportCsv() method streams a UTF-8 BOM CSV (Excel-safe) with columns ID, CARGO, AREA, COLABORADOR, CEDULA, and ESTADO. The export respects the same search query parameter used by the index view, so the download always reflects the current filtered list.
Document Type Integrity Protection
GdoTipoDocumento::destroy() checks $tipoDocumento->documentos()->exists() before deletion. If any physical GdoDocsEmpleados records reference the type, the delete is rejected and the user is redirected with an error message. This prevents orphaned document records in the archive.