Skip to main content

Get Implement

Retrieve agricultural implement information using different methods: by ID, available only, or with search filters.

Get by ID

Retrieve detailed information about a specific implement.

Endpoint

GET /api/implements/{id}

Path Parameters

id
integer
required
The unique identifier of the implement

Response

success
boolean
Indicates if the request was successful
data
object
The implement object (see schema below)

Examples

curl -X GET "http://localhost:4000/api/implements/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"
  }
}

Error Responses

Invalid ID (400)

{
  "success": false,
  "message": "ID de implemento inválido"
}

Not Found (404)

{
  "success": false,
  "message": "Implemento no encontrado"
}

Available Implements

Retrieve only implements with status: available, sorted by type and power requirement.

Endpoint

GET /api/implements/available

Query Parameters

limit
integer
default:"10"
Number of records per page
offset
integer
default:"0"
Number of records to skip
page
integer
default:"1"
Page number (alternative to offset)

Examples

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

Response Example (200 OK)

{
  "success": true,
  "data": [
    {
      "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": 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"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 10,
    "total": 12,
    "totalPages": 2
  }
}
Results are automatically sorted by implement_type and then by power_requirement_hp.

Search Implements

Search implements with advanced filters for type, soil compatibility, and power requirements.

Endpoint

GET /api/implements/search

Query Parameters

type
string
Filter by implement type (exact match, case-insensitive). Valid values:
  • plow
  • harrow
  • seeder
  • sprayer
  • harvester
  • cultivator
  • mower
  • trailer
  • other
soilType
string
Filter by compatible soil type (partial match, case-insensitive)Example values: Loam, Clay, Sandy, All
maxPower
number
Filter by maximum power requirement in HPReturns only implements requiring ≤ this power
General search across implement name and brand (partial match)
brand
string
Filter by exact brand name (case-insensitive)
limit
integer
default:"10"
Number of records per page
offset
integer
default:"0"
Number of records to skip
page
integer
default:"1"
Page number

Examples

Search by Type and Soil

curl -X GET "http://localhost:4000/api/implements/search?type=plow&soilType=Loam" \
  -H "Content-Type: application/json"

Search by Power Requirement

Find implements that require 60 HP or less:
curl -X GET "http://localhost:4000/api/implements/search?maxPower=60" \
  -H "Content-Type: application/json"
Search for seeders compatible with clay soil requiring max 50 HP:
curl -X GET "http://localhost:4000/api/implements/search?type=seeder&soilType=clay&maxPower=50"

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"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 10,
    "total": 1,
    "totalPages": 1
  },
  "filters": {
    "search": null,
    "brand": null,
    "type": "plow",
    "soilType": "Loam",
    "maxPower": 50
  }
}
The filters object in the response shows which filters were applied to the search.

Implement Types Reference

The following implement types are available in the system:
TypeDescriptionTypical Use
plowDisc or moldboard plowsPrimary soil tillage, breaking ground
harrowDisc or tine harrowsSecondary tillage, soil smoothing
seederSeed planting equipmentSowing seeds in rows or broadcast
sprayerPesticide/fertilizer sprayersApplying chemicals or nutrients
harvesterHarvesting equipmentCrop collection and processing
cultivatorSoil cultivation toolsWeed control, soil aeration
mowerMowing equipmentCutting grass, hay, or crop residue
trailerAgricultural trailersTransport of crops and materials
otherOther agricultural implementsMiscellaneous equipment

Soil Type Compatibility

Common soil type values:
  • Loam: Balanced mixture of sand, silt, and clay
  • Clay: Heavy, moisture-retaining soil
  • Sandy: Light, well-draining soil
  • Silty: Fine-textured, fertile soil
  • All: Compatible with all soil types
Soil type filtering uses partial matching, so searching for “clay” will also match “Heavy clay” or “Clay loam”.

Implementation Notes

Get by ID

  • Source: src/routes/implement.routes.js:273
  • Controller: src/controllers/implementController.js:47 - getImplementById
  • Model: src/models/Implement.js:12 - findById(id)
  • Public Access: No authentication required

Available Implements

  • Source: src/routes/implement.routes.js:133
  • Controller: src/controllers/implementController.js:139 - getAvailableImplements
  • Model: src/models/Implement.js:115 - getAvailable()
  • SQL: SELECT * FROM implement WHERE status = 'available' ORDER BY implement_type, power_requirement_hp

Search Implements

  • Source: src/routes/implement.routes.js:218
  • Controller: src/controllers/implementController.js:72 - searchImplements
  • Filtering: In-memory filtering after fetching all implements
  • Case-Insensitive: All text filters are case-insensitive

List All Implements

Get a paginated list of all implements

Create Implement

Add a new implement (Admin only)

Update Implement

Modify an existing implement (Admin only)

Delete Implement

Remove an implement (Admin only)

Build docs developers (and LLMs) love