Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/tutosrive/ferreandina-nosql/llms.txt

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

The Worker resource represents a Ferreandina store employee. Each worker document stores personal details (name, age, weight, email, phone), a job speciality (e.g., "stock clerk", "store manager", "electrical specialist"), a salary, and a profile image URL. Workers are associated with a branch — when a worker is assigned to a branch, a lightweight summary (_id, name, image) is embedded inside that branch document’s workers array. All CRUD operations are available at /api/workers.

Document Schema

_id
integer
required
Unique integer identifier for the worker.
name
string
required
Full name of the worker (e.g., "Beau Jackson", "Eduardo Sánchez").
image
string
required
URL of the worker’s profile photo.
age
integer
required
Age of the worker in years.
speciality
string
required
Job role or specialisation (e.g., "stock clerk", "plumbing specialist", "store manager", "electrical specialist").
weight
number
required
Body weight of the worker in kilograms (float).
email
string
required
Work email address.
phone
string
required
Contact phone number.
salary
number
required
Monthly salary (float, in local currency).

Endpoints

GET /api/workers

Returns an array of all worker documents.
curl http://localhost:7070/api/workers
[
  {
    "_id": 1,
    "name": "Beau Jackson",
    "image": "https://randomuser.me/api/portraits/men/75.jpg",
    "age": 40,
    "speciality": "stock clerk",
    "weight": 65,
    "email": "beau.jackson@example.com",
    "phone": "(134)-254-6034",
    "salary": 6284217
  }
]

GET /api/workers/{id}

Returns a single worker by their integer _id.
curl http://localhost:7070/api/workers/1
{
  "_id": 1,
  "name": "Beau Jackson",
  "image": "https://randomuser.me/api/portraits/men/75.jpg",
  "age": 40,
  "speciality": "stock clerk",
  "weight": 65,
  "email": "beau.jackson@example.com",
  "phone": "(134)-254-6034",
  "salary": 6284217
}

POST /api/workers

Creates a new worker document. Request Body
_id
integer
required
Unique integer ID for the new worker.
name
string
required
Full name of the worker.
image
string
URL of the worker’s profile photo.
age
integer
required
Age of the worker.
speciality
string
required
Job role or specialisation.
weight
number
required
Body weight in kg (float).
email
string
required
Work email address.
phone
string
required
Contact phone number.
salary
number
required
Monthly salary (float).
curl -X POST http://localhost:7070/api/workers \
  -H "Content-Type: application/json" \
  -d '{
    "_id": 310,
    "name": "Laura Gómez",
    "image": "https://randomuser.me/api/portraits/women/33.jpg",
    "age": 29,
    "speciality": "cashier",
    "weight": 58.0,
    "email": "laura.gomez@ferreandina.com",
    "phone": "+57 312 000 11 22",
    "salary": 2800000
  }'
{ "insertedId": 310 }

PATCH /api/workers/{id}

Partially updates a worker record. Include only the fields to change. Request Body
name
string
Updated name.
image
string
Updated profile image URL.
age
integer
Updated age.
speciality
string
Updated job role.
weight
number
Updated weight.
email
string
Updated email.
phone
string
Updated phone.
salary
number
Updated salary.
curl -X PATCH http://localhost:7070/api/workers/1 \
  -H "Content-Type: application/json" \
  -d '{ "salary": 6500000, "speciality": "inventory supervisor" }'
{ "modifiedCount": 1 }

DELETE /api/workers/{id}

Deletes the worker with the given integer _id.
curl -X DELETE http://localhost:7070/api/workers/1
{ "deletedCount": 1 }

Example Documents

[
  {
    "_id": 1,
    "name": "Beau Jackson",
    "image": "https://randomuser.me/api/portraits/men/75.jpg",
    "age": 40,
    "speciality": "stock clerk",
    "weight": 65,
    "email": "beau.jackson@example.com",
    "phone": "(134)-254-6034",
    "salary": 6284217
  },
  {
    "_id": 2,
    "name": "Elizabeth Ginnish",
    "image": "https://randomuser.me/api/portraits/women/79.jpg",
    "age": 40,
    "speciality": "warehouse worker",
    "weight": 104,
    "email": "elizabeth.ginnish@example.com",
    "phone": "Z13 N23-4086",
    "salary": 6793601
  },
  {
    "_id": 3,
    "name": "Inés Santos",
    "image": "https://randomuser.me/api/portraits/women/56.jpg",
    "age": 69,
    "speciality": "customer service representative",
    "weight": 70,
    "email": "ines.santos@example.com",
    "phone": "989-200-418",
    "salary": 2971891
  }
]
The seed dataset includes a wide range of specialities found across Ferreandina branches:
SpecialityExample worker ID
stock clerk1
warehouse worker2
customer service representative3
paint specialist4
accountant7
forklift operator8
inventory supervisor9
store manager45
electrical specialist54
plumbing specialist21
power tools specialist17
locksmithing specialist47

Build docs developers (and LLMs) love