Skip to main content

List Implements

Retrieve all agricultural implements from the catalog with pagination and optional search filters. This is a public endpoint that does not require authentication.

Endpoint

GET /api/implements

Query Parameters

limit
integer
default:"10"
Number of records per page (pagination limit)
offset
integer
default:"0"
Number of records to skip (pagination offset)
page
integer
default:"1"
Page number (alternative to offset)
sort
string
Field to sort by (e.g., implement_type, brand, power_requirement_hp)
order
string
default:"asc"
Sort order: asc or desc

Response

Returns a paginated list of implements with metadata.

Response Schema

success
boolean
Indicates if the request was successful
data
array
Array of implement objects
pagination
object
Pagination metadata

Examples

curl -X GET "http://localhost:4000/api/implements?limit=10&page=1" \
  -H "Content-Type: application/json"

Response Example (200 OK)

{
  "success": true,
  "data": [
    {
      "implement_id": 1,
      "implement_name": "3-body disc plow",
      "brand": "Baldan",
      "power_requirement_hp": 50,
      "working_width_m": 0.9,
      "soil_type": "Loam",
      "working_depth_cm": 25,
      "weight_kg": 320,
      "implement_type": "plow",
      "status": "available",
      "registration_date": "2026-01-15T10:00:00.000Z"
    },
    {
      "implement_id": 2,
      "implement_name": "20-disc harrow",
      "brand": "Tatu",
      "power_requirement_hp": 35,
      "working_width_m": 1.8,
      "soil_type": "All",
      "working_depth_cm": 15,
      "weight_kg": 280,
      "implement_type": "harrow",
      "status": "available",
      "registration_date": "2026-01-20T14:30:00.000Z"
    },
    {
      "implement_id": 3,
      "implement_name": "5-row seeder",
      "brand": "Semeato",
      "power_requirement_hp": 40,
      "working_width_m": 1.5,
      "soil_type": "Loam",
      "working_depth_cm": 10,
      "weight_kg": 450,
      "implement_type": "seeder",
      "status": "available",
      "registration_date": "2026-02-01T09:00:00.000Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 10,
    "total": 15,
    "totalPages": 2
  }
}

Advanced Filtering

Get Available Implements Only

To retrieve only implements with status: available, use the /api/implements/available endpoint:
curl -X GET "http://localhost:4000/api/implements/available?limit=10"
See the Get Available Implements section for details.

Search with Filters

For advanced filtering by type, soil compatibility, and power requirements, use the /api/implements/search endpoint:
curl -X GET "http://localhost:4000/api/implements/search?type=plow&soilType=Loam&maxPower=60"
See Search Implements for more information.

Error Responses

Internal Server Error (500)

{
  "success": false,
  "message": "Error al obtener implementos"
}

Get Implement

Retrieve a specific implement by ID or search with filters

Create Implement

Add a new implement to the catalog (Admin only)

Update Implement

Modify an existing implement (Admin only)

Delete Implement

Remove an implement from the catalog (Admin only)
Implements are sorted by implement_type and brand by default. Use the sort and order parameters to customize sorting.

Implementation Notes

  • Source: src/routes/implement.routes.js:80 - Route definition
  • Controller: src/controllers/implementController.js:31 - getAllImplements function
  • Model: src/models/Implement.js:5 - Database query: SELECT * FROM implement ORDER BY implement_type, brand
  • Caching: This endpoint uses cache middleware with 24-hour TTL (86400 seconds)
  • Public Access: No authentication required

Build docs developers (and LLMs) love