Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/JuanDiego3030/Planta_Milenio/llms.txt

Use this file to discover all available pages before exploring further.

Planta Milenio provides 12 autocomplete endpoints used by its frontend forms to deliver real-time field suggestions as the user types. All 12 endpoints are GET-only, accept a single q query parameter containing the search string, and return a JSON array of matching results. All endpoints return at most 10 results per request. None of these endpoints perform a session or permission check — they are open to any request that reaches the Django application.

Shared Query Parameter

All autocomplete endpoints accept the following query parameter:
q
string
required
The search term. Transport and logistics endpoints filter using SQL Server LIKE matching (e.g. WHERE column LIKE '%q%'). Visitor/personnel endpoints use Django ORM icontains, which is case-insensitive on the local SQLite database. Passing an empty string returns an empty array for all endpoints except /autocomplete/destino/, which returns all destinations when q is empty.

Transport and Logistics Endpoints

These six endpoints query the external Ceres Romana SQL Server database and are used to populate fields on the raw-material intake and dispatch forms. All transport endpoints return an empty array when q is empty (except destino — see below).

GET /autocomplete/empresa/

Searches the empresa table by Empresa_Rif or Empresa_Nombre using LIKE. Both fields are matched independently, and any record where either field matches is returned.
curl 'http://localhost:8000/autocomplete/empresa/?q=agro'
[
  {"id": 3, "rif": "J-30000000-0", "nombre": "Agrotrack C.A."}
]
id
integer
Primary key of the empresa record.
rif
string
Tax identification number (RIF) of the company, e.g. J-12345678-9.
nombre
string
Registered company name.

GET /autocomplete/chuto/

Searches the Vehiculo table by Vehiculo_placa (tractor-unit licence plate) using LIKE.
curl 'http://localhost:8000/autocomplete/chuto/?q=ABC'
[
  {"id": 1, "placa": "ABC-123", "nombre": "Camión Ford"}
]
id
integer
Primary key of the Vehiculo record.
placa
string
Licence plate of the tractor unit (chuto).
nombre
string
Vehicle description or model name.

GET /autocomplete/tanque/

Searches the Vehiculo_Remolque table by Vehiculo_Remolque_Placa (tank trailer licence plate) using LIKE.
curl 'http://localhost:8000/autocomplete/tanque/?q=XYZ'
[
  {"placa": "XYZ-789", "nombre": "Tanque 1", "descripcion": ""}
]
placa
string
Licence plate of the tank trailer (tanque / remolque).
nombre
string
Short identifier or name for the trailer.
descripcion
string
Optional extended description; may be an empty string.

GET /autocomplete/destino/

Searches the Destino table by Destino_Nombre using LIKE. If q is empty, all destinations are returned rather than an empty array, making it suitable for populating an initial dropdown on page load.
curl 'http://localhost:8000/autocomplete/destino/?q=norte'
[
  {"id": 1, "nombre": "Planta Norte", "descripcion": ""}
]
id
integer
Primary key of the Destino record.
nombre
string
Destination name.
descripcion
string
Optional description; may be an empty string.
This is the only transport endpoint that returns results for an empty q. Sending GET /autocomplete/destino/?q= returns every destination in the table, ordered by Destino_Nombre.

GET /autocomplete/conductor/

Searches the conductor table by Conductor_Cedula (national ID number) using LIKE.
curl 'http://localhost:8000/autocomplete/conductor/?q=V-123'
[
  {
    "id": 1,
    "cedula": "V-12345678",
    "nombre": "Juan",
    "apellido": "Pérez",
    "descripcion": "",
    "telf": "0414-1234567"
  }
]
id
integer
Primary key of the conductor record.
cedula
string
Driver’s national ID number, e.g. V-12345678.
nombre
string
Driver’s first name.
apellido
string
Driver’s surname.
descripcion
string
Optional notes field; may be an empty string.
telf
string
Driver’s contact phone number. The field key is telf, not telefono.

GET /autocomplete/producto/

Searches the PRODUCTO table in Ceres Romana by Producto_Codigo or Producto_Nombre using SQL Server LIKE (case sensitivity depends on the database collation). Returns the top 10 matching products via SELECT TOP 10.
curl 'http://localhost:8000/autocomplete/producto/?q=maiz'
[
  {"id": 1, "codigo": "PROD-001", "nombre": "Maíz Blanco"}
]
id
integer
Primary key of the PRODUCTO record.
codigo
string
Internal product code, e.g. PROD-001.
nombre
string
Full product name.

Visitor and Personnel Endpoints

These six endpoints query the local SQLite database via the AccesoPersona model and are used to populate suggestion fields on the visitor-access control form. Each endpoint targets a single field on the model and returns a plain JSON array of matching string values (not objects). All six use icontains (case-insensitive) matching and return at most 10 distinct results. An empty q returns an empty array for all six endpoints.

GET /autocomplete/persona/nombre/

Searches AccesoPersona.nombre for matching first names.
curl 'http://localhost:8000/autocomplete/persona/nombre/?q=jua'
["Juan", "Juana"]

GET /autocomplete/persona/apellido/

Searches AccesoPersona.apellido for matching surnames.
curl 'http://localhost:8000/autocomplete/persona/apellido/?q=gar'
["García", "Garmendia"]

GET /autocomplete/persona/cedula/

Searches AccesoPersona.cedula for matching national ID numbers.
curl 'http://localhost:8000/autocomplete/persona/cedula/?q=V-12'
["V-12345678", "V-12987654"]

GET /autocomplete/persona/placa/

Searches AccesoPersona.placa_vehiculo for matching visitor vehicle plates.
curl 'http://localhost:8000/autocomplete/persona/placa/?q=ABC'
["ABC-123", "ABC-456"]

GET /autocomplete/persona/empresa/

Searches AccesoPersona.empresa for matching visitor company names. An empty q returns an empty array (the view applies an if q: guard before querying).
curl 'http://localhost:8000/autocomplete/persona/empresa/?q=corp'
["Corporación Delta", "Corpozulia"]

GET /autocomplete/persona/autorizado_por/

Searches AccesoPersona.autorizado_por for matching authoriser names or departments. Unlike the other persona endpoints, this endpoint queries even when q is empty — it applies no if q: guard — and returns up to 10 distinct non-empty values from the autorizado_por column.
curl 'http://localhost:8000/autocomplete/persona/autorizado_por/?q=ger'
["Gerencia", "Gerencia de Operaciones"]

Full curl Example

The following sequence shows a complete autocomplete flow querying two different endpoints:
# Query a transport/logistics autocomplete endpoint (no session required)
curl 'http://localhost:8000/autocomplete/empresa/?q=agro'
# Response:
# [{"id": 3, "rif": "J-30000000-0", "nombre": "Agrotrack C.A."}]

# Query a visitor/personnel autocomplete endpoint (no session required)
curl 'http://localhost:8000/autocomplete/persona/nombre/?q=jua'
# Response:
# ["Juan", "Juana"]

# Retrieve all destinations by passing an empty q
curl 'http://localhost:8000/autocomplete/destino/?q='
# Response: full list of all Destino records

Build docs developers (and LLMs) love