Skip to main content

Overview

The Resources API provides endpoints for updating equipment resources including sanitary facilities, treatment plants, and storage tanks. Resources can be tracked for availability, operational status, and project assignments.

Update Resource

Update Resource Equipment

POST
curl -X POST https://api.mantis.com/api/resources/update/ \
  -H "Content-Type: application/json" \
  -d '{
    "id": 1,
    "stst_status_equipment": "FUNCIONANDO",
    "stst_status_disponibility": "RENTADO",
    "stst_current_location": "Project Site A",
    "have_soap_dispenser": true,
    "have_paper_dispenser": true
  }'
Updates resource equipment fields including status, availability, location, and component checklist items.

Request Body

id
integer
required
ID of the resource to update
name
string
Equipment/Service name
code
string
Equipment/Service code (unique)
type_equipment
string
Equipment subtype. Valid options:
  • SERVIC - Service
  • LVMNOS - Handwashing station
  • BTSNHM - Men’s sanitary battery
  • BTSNMJ - Women’s sanitary battery
  • EST4UR - Quadruple urinal station
  • CMPRBN - Bathroom camper
  • PTRTAP - Potable water treatment plant
  • PTRTAR - Wastewater treatment plant
  • TNQAAC - Raw water storage tank
  • TNQAAR - Wastewater storage tank
stst_status_equipment
string
Equipment operational status:
  • FUNCIONANDO - Working
  • DAÑADO - Damaged
  • INCOMPLETO - Incomplete
  • EN REPARACION - Under repair
stst_status_disponibility
string
Equipment availability status:
  • DISPONIBLE - Available
  • RENTADO - Rented
stst_current_location
string
Current physical location of the equipment
stst_current_project_id
integer
ID of the project the equipment is currently assigned to
stst_commitment_date
string
Date when equipment was assigned (format: YYYY-MM-DD)
stst_release_date
string
Date when equipment will be released (format: YYYY-MM-DD)
stst_repair_reason
string
Reason for repair (required when status is “EN REPARACION”)

Equipment Specifications

brand
string
Equipment brand
model
string
Equipment model
serial_number
string
Serial number
date_purchase
string
Purchase date (format: YYYY-MM-DD)
height
integer
Height in centimeters
width
integer
Width in centimeters
depth
integer
Depth in centimeters
weight
integer
Weight in kilograms
capacity_gallons
number
Capacity in gallons

Component Checklist (Boolean Fields)

These fields track whether specific components are present. When updating checklist fields without explicitly setting stst_status_equipment, the status will automatically update to FUNCIONANDO if all applicable checklist items are true, or INCOMPLETO if any are false.

Sanitary Equipment Components

have_foot_pumps
boolean
Foot pedal pumps (for handwashing stations)
have_soap_dispenser
boolean
Soap dispenser
have_paper_dispenser
boolean
Paper dispenser
have_napkin_dispenser
boolean
Napkin dispenser
have_paper_towels
boolean
Paper towels
have_urinals
boolean
Urinals (for men’s sanitary batteries)
have_seat
boolean
Toilet seat
have_toilet_pump
boolean
Toilet pump
have_sink_pump
boolean
Sink pump
have_toilet_lid
boolean
Toilet lid/valve
have_bathroom_bases
boolean
Bathroom bases
have_ventilation_pipe
boolean
Ventilation pipe

Treatment Plant Components

have_blower_brand
boolean
Has blower
have_belt_brand
boolean
Has belt
have_blower_pulley
boolean
Has blower pulley
have_motor_pulley
boolean
Has motor pulley
have_electrical_panel
boolean
Has electrical panel
have_motor_guard
boolean
Has motor guard
have_relay_engine
boolean
Has engine relay
have_relay_blower
boolean
Has blower relay
have_engine
boolean
Has motor
have_engine_guard
boolean
Has motor guard

Potable Water Plant Components

have_uv_filter
boolean
Has UV filter
have_pump_filter
boolean
Has filtration pump
have_pump_dosing
boolean
Has dosing pump
have_pump_pressure
boolean
Has pressure pump
have_hidroneumatic_tank
boolean
Has hydropneumatic tank
have_sand_carbon_filter
boolean
Has sand and carbon filter

Treatment Plant Details

engine_fases
string
Motor phases: 1, 2, or 3
blower_brand
string
Blower brand
blower_model
string
Blower model
engine_brand
string
Motor brand
engine_model
string
Motor model
belt_brand
string
Belt brand
belt_model
string
Belt model
belt_type
string
Belt type: A or B
electrical_panel_brand
string
Electrical panel brand
relay_engine
string
Engine relay brand
relay_blower
string
Blower relay brand
pump_filter
string
Filtration pump specification
pump_pressure
string
Pressure pump specification
pump_dosing
string
Dosing pump specification
uv_filter
string
UV filter specification
sand_carbon_filter
string
Sand and carbon filter specification
hidroneumatic_tank
string
Hydropneumatic tank specification

Response

success
boolean
Indicates if the operation was successful
message
string
Success or error message
data
object
id
integer
Resource ID
name
string
Equipment/Service name
code
string
Equipment/Service code
type_equipment
string
Equipment subtype code
is_active
boolean
Whether the resource is active
stst_status_equipment
string
Current operational status
created_at
string
Creation timestamp
updated_at
string
Last update timestamp
ignored_fields
array
List of field names that were sent but do not exist on the model (informational)
{
  "success": true,
  "message": "Equipo actualizado correctamente",
  "data": {
    "id": 1,
    "name": "Handwashing Station #5",
    "code": "LVMNOS-005",
    "type_equipment": "LVMNOS",
    "is_active": true,
    "stst_status_equipment": "FUNCIONANDO",
    "created_at": "2023-01-01T00:00:00Z",
    "updated_at": "2024-01-15T14:30:00Z"
  },
  "ignored_fields": null
}

ResourceItem Model

The ResourceItem model represents equipment and service resources with the following key characteristics:

Equipment Types

Resources are categorized by type with specific field sets for each:
  • SERVIC - Generic service (minimal fields)
  • LVMNOS - Handwashing stations with foot pumps and dispensers
  • BTSNHM - Men’s sanitary batteries with urinals
  • BTSNMJ - Women’s sanitary batteries
  • EST4UR - Quadruple urinal stations
  • CMPRBN - Bathroom campers
  • PTRTAP - Potable water treatment plants with filtration systems
  • PTRTAR - Wastewater treatment plants with aeration systems
  • TNQAAC - Raw water storage tanks
  • TNQAAR - Wastewater storage tanks

Status Values

Equipment Status (stst_status_equipment)

  • FUNCIONANDO - Equipment is working properly
  • DAÑADO - Equipment is damaged
  • INCOMPLETO - Equipment is incomplete (missing components)
  • EN REPARACION - Equipment is under repair

Availability Status (stst_status_disponibility)

  • DISPONIBLE - Available for assignment
  • RENTADO - Currently rented/assigned to a project

Availability Tracking

Resources track their assignment status with:
  • stst_current_location - Physical location
  • stst_current_project_id - Project assignment
  • stst_commitment_date - When assigned
  • stst_release_date - When available again

Automatic Status Updates

When updating checklist fields (fields starting with have_):
  • If all applicable checklist items are checked, status automatically becomes FUNCIONANDO
  • If any checklist items are unchecked, status automatically becomes INCOMPLETO
  • This behavior is skipped if you explicitly set stst_status_equipment in the request

Field Validation

  • Date fields accept format: YYYY-MM-DD
  • DateTime fields accept formats: YYYY-MM-DD HH:MM:SS, YYYY-MM-DDTHH:MM:SS, or YYYY-MM-DD
  • Unknown fields are ignored and listed in ignored_fields response
  • The id field is required for all update operations

Error Responses

{
  "success": false,
  "error": "El campo id es requerido"
}

Best Practices

  1. Checklist Management: When updating equipment components, update all relevant have_* fields together to ensure accurate status calculation.
  2. Status Override: If you need to manually set equipment status regardless of checklist state, explicitly include stst_status_equipment in your request.
  3. Date Formats: Always use YYYY-MM-DD format for dates to avoid validation errors.
  4. Field Validation: Check the ignored_fields array in responses to catch typos or invalid field names.
  5. Type-Specific Fields: Only send fields relevant to the equipment type. Fields not applicable to a type are safely ignored.
  6. Project Assignment: When assigning equipment to a project, update all availability fields together:
    • stst_status_disponibility = “RENTADO”
    • stst_current_project_id = project ID
    • stst_current_location = project location
    • stst_commitment_date = assignment date
    • stst_release_date = expected return date