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 Customer resource stores information about individuals and companies that purchase products from Ferreandina. Rather than a traditional name/email schema, customer documents follow a Colombian-market pattern: each customer is identified by a NI (Número de Identificación, stored under the BSON key "NI"), a unique lowercase alias, a category indicating the customer type ("company" or "person"), and a phone number. There is no name or email field in this resource. The seed dataset ships with thousands of customer records. All CRUD operations are available at /api/customers.

Document Schema

_id
integer
required
Unique integer identifier for the customer.
NI
string
required
National Identification number (Número de Identificación). Stored in MongoDB under the key "NI" (uppercase). Mapped via @BsonProperty("NI") in the Java model.
alias
string
required
Unique lowercase slug alias for the customer (e.g., "oviedoplc", "rodríguez-cardona").
category
string
required
Customer type. Accepted values: "company" or "person".
phone
string
required
Contact phone number (format varies — includes local Colombian landline and mobile formats).

Endpoints

GET /api/customers

Returns an array of all customer documents.
curl http://localhost:7070/api/customers
[
  {
    "_id": 1,
    "NI": "9319166930",
    "alias": "oviedoplc",
    "category": "company",
    "phone": "313 194 71 05"
  },
  {
    "_id": 2,
    "NI": "0255361413",
    "alias": "rodríguez-cardona",
    "category": "company",
    "phone": "+57 316 300 74 26"
  }
]

GET /api/customers/{id}

Returns a single customer by its integer _id.
curl http://localhost:7070/api/customers/1
{
  "_id": 1,
  "NI": "9319166930",
  "alias": "oviedoplc",
  "category": "company",
  "phone": "313 194 71 05"
}

POST /api/customers

Creates a new customer document. Request Body
_id
integer
required
Unique integer ID for the new customer.
NI
string
required
National Identification number (must be unique).
alias
string
required
Unique lowercase alias for the customer.
category
string
required
Customer category: "company" or "person".
phone
string
required
Contact phone number.
curl -X POST http://localhost:7070/api/customers \
  -H "Content-Type: application/json" \
  -d '{
    "_id": 800,
    "NI": "1234567890",
    "alias": "constructora-norte",
    "category": "company",
    "phone": "+57 601 234 56 78"
  }'
{ "insertedId": 800 }

PATCH /api/customers/{id}

Partially updates a customer. Include only the fields to change. Request Body
NI
string
Updated national identification number.
alias
string
Updated alias.
category
string
Updated category ("company" or "person").
phone
string
Updated phone number.
curl -X PATCH http://localhost:7070/api/customers/1 \
  -H "Content-Type: application/json" \
  -d '{ "phone": "+57 313 999 00 11" }'
{ "modifiedCount": 1 }

DELETE /api/customers/{id}

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

Example Documents

[
  {
    "_id": 1,
    "NI": "9319166930",
    "alias": "oviedoplc",
    "category": "company",
    "phone": "313 194 71 05"
  },
  {
    "_id": 2,
    "NI": "0255361413",
    "alias": "rodríguez-cardona",
    "category": "company",
    "phone": "+57 316 300 74 26"
  },
  {
    "_id": 3,
    "NI": "7866674434",
    "alias": "rueda,barbosaandcano",
    "category": "company",
    "phone": "(+57)6097299619"
  }
]

Build docs developers (and LLMs) love