Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/JaiderT/CoffeePrice/llms.txt

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

The comprador role is designed for coffee buyers — cooperatives, processing mills, and independent traders — who want to advertise their purchase prices to Colombian coffee farmers in the Huila region. Unlike producers, buyer accounts go through an admin approval step before they can publish prices or appear on the public map. This ensures that only legitimate, verified buyers are visible to the farming community.
New buyer registrations cannot publish prices or appear on the map until an administrator has reviewed and approved the buyer profile. If your account is stuck in pendiente, check your email for a decision notification or contact the platform admin.

Registration and Approval Flow

1

Create a user account

Register at /register and select Comprador as your role. Your user estado is set to pendiente immediately after registration.
2

Verify your email

Enter the 6-digit code sent to your email to confirm your address. This step is required before you can proceed.
3

Complete your buyer profile

You are redirected to /completar-perfil. Fill in your company details (see Profile Fields below). Submitting this form calls POST /api/comprador and creates your buyer record with estadoRevision: "enRevision". An email notification is automatically sent to all active admins.
4

Wait for admin review

An admin reviews your profile. The estadoRevision moves from enRevision to either aprobado or rechazado. You receive an email with the decision.
5

Access your dashboard

Once approved, your user estado becomes activo and you can access /comprador/dashboard, publish prices, and appear on the buyer map.

Buyer Profile Fields

When completing your profile at /completar-perfil, you provide the following information:
FieldTypeRequiredDescription
nombreempresaStringLegal or trade name of your business (letters, spaces, . and & only)
tipoempresaStringBusiness type: independiente, or your applicable category
municipioStringOne of the 10 supported Huila municipalities (see list below)
direccionStringPhysical address of your buying point
telefonoStringContact phone number
horarioAperturaStringOpening time, e.g. "07:00"
horarioCierreStringClosing time, e.g. "17:00"
descripcionStringBrief description of your business
serviciosString[]List of services offered

Supported Municipalities

The platform covers the following municipalities in the department of Huila:
  • El Pital
  • Pitalito
  • Acevedo
  • La Argentina
  • Tarqui
  • Suaza
  • Palestina
  • Elías
  • Saladoblanco
  • Isnos

estadoRevision Lifecycle

The estadoRevision field on the buyer record tracks where the profile is in the approval workflow:
[Registration] → enRevision → aprobado
                            → rechazado
perfilIncompleto (profile not yet submitted)
estadoRevisionMeaning
perfilIncompletoBuyer account created but profile form not yet submitted
enRevisionProfile submitted, awaiting admin decision
aprobadoAdmin approved — buyer is visible on the map and can publish prices
rechazadoAdmin rejected — buyer cannot publish prices; a reason may be provided
When a buyer is rejected, the motivoRevision field stores the reason. If the buyer resubmits or the issue is resolved, the admin can update estadoRevision back to aprobado via PUT /api/comprador/:id.

What Approved Buyers Can Do

Once estadoRevision is aprobado and user estado is activo, buyers can:
  • Publish purchase prices — post the price they are currently offering per carga or per kg for specific coffee types.
  • Update or remove prices — keep their listed prices current throughout the trading day.
  • Appear on the regional map — their pin is shown on the public buyer map at /mapa with a general location.
  • Manage their company profile — update business details, schedule, and services via PUT /api/comprador/:id.
  • View their dashboard — access analytics and price management tools at /comprador/dashboard.

Publishing Prices

POST /api/precios — publish a purchase price for a specific coffee type.
{
  "tipocafe": "pergamino_seco",
  "preciocarga": 1100000,
  "preciokg": 16923,
  "unidad": "carga"
}
Supported coffee types (tipocafe):
ValueDescription
pergamino_secoDry parchment coffee
especialSpecialty coffee
organicoOrganic certified coffee
verdeGreen (unroasted) coffee
pasillaLower-grade sorted coffee
cacaoCacao (also traded on the platform)
limonLemon/citrus (complementary crop)
Prices are denominated in Colombian Pesos (COP).

Privacy Model

Contact details are deliberately restricted to protect buyer privacy and maintain fair competition:
InformationProducers & publicBuyer (own profile)Admin
Company name✅ Visible✅ Visible✅ Visible
Municipality (general area)✅ Visible✅ Visible✅ Visible
Exact address❌ Hidden✅ Visible✅ Visible
Phone number❌ Hidden✅ Visible✅ Visible
Business hours✅ Visible✅ Visible✅ Visible
estadoRevision❌ Hidden✅ Visible✅ Visible
The API response for unauthenticated users and producers uses sanitizarCompradorPublico(), which sets direccion: null, telefono: null, and contactoRestringido: true. Only the owner or an admin receives the full document.

Frontend Routes

RouteComponentDescription
/completar-perfilCompletarPerfilBuyer profile completion (post-registration)
/comprador/dashboardDashboardCompradorBuyer dashboard — price management and stats
/comprador/perfilPerfilCompradorEdit company profile and account settings
/mapaMapaCompradoresInteractive map of approved buyers

API Endpoints

EndpointMethodAuth requiredDescription
/api/compradorPOSTcompradorCreate buyer profile
/api/comprador/usuario/:usuarioIdGET✅ Owner or adminGet own buyer profile
/api/comprador/mapaGETPublicApproved buyers for the map
/api/comprador/:idGETOptionalPublic sanitised view of a buyer
/api/comprador/:idPUT✅ Owner or adminUpdate buyer profile
/api/preciosPOSTcomprador or adminPublish a purchase price
/api/precios/:idPUTcomprador or adminUpdate a published price
/api/precios/:idDELETEcomprador or adminRemove a published price

Build docs developers (and LLMs) love