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.

Ferreandina NoSQL stores all data in MongoDB using a document model. Unlike relational databases, there are no auto-generated ObjectId keys — every document uses an integer _id as its primary key, managed by the application. Two collections use embedded arrays to denormalize related data for fast reads: a branches document embeds a subset of its assigned products and workers directly inside the branch document, while the canonical records for those entities live in their own top-level collections.
Embedded product and worker objects inside a branches document are denormalized copies kept for quick branch-level listing queries. They carry only the fields needed for display (typically _id, name, quantity, and image). The authoritative records — with full field sets — always live in the products and workers collections respectively.

Collection Schemas

The branches collection represents physical store locations. Each branch document embeds a trimmed-down list of its assigned products and workers so the UI can render a branch card in a single query.
_id
integer
required
Unique integer identifier for the branch.
name
string
required
Human-readable branch name, e.g. "ferreandina-manizales".
city
string
required
City where the branch is located.
direction
string
required
Street address of the branch.
is_main
boolean
required
Whether this is the main/flagship branch.
image
string
required
URL of the branch cover image.
products
array
Embedded array of product snapshots assigned to this branch.
workers
array
Embedded array of worker snapshots assigned to this branch.
Example document (from config/collections/branches.json):
{
  "_id": 1,
  "name": "ferreandina-manizales",
  "city": "manizales",
  "direction": "Cra 3 #23-12",
  "is_main": false,
  "image": "https://cdn.jsdelivr.net/gh/tutosrive/images-projects-srm-trg@main/others/ferreandina-nosql/branches/ferreandina-manizales.webp",
  "products": [
    {
      "_id": 1,
      "name": "hammer",
      "quantity": 10,
      "image": "https://cdn.jsdelivr.net/gh/tutosrive/images-projects-srm-trg@main/others/ferreandina-nosql/products/hammer.webp"
    },
    {
      "_id": 3,
      "name": "power_drill",
      "quantity": 4500,
      "image": "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcQabipjJj6zlLRVhlf8dq6SNxXqeyfGTFRu20wY_kaSZfhmzl1CzisyBZNKrUUW"
    }
  ],
  "workers": [
    {
      "_id": 1,
      "name": "Eduardo Sánchez",
      "image": "https://cdn.jsdelivr.net/gh/tutosrive/images-projects-srm-trg@main/others/ferreandina-nosql/workers/1.jpg"
    },
    {
      "_id": 2,
      "name": "Santiago Marin",
      "image": "https://cdn.jsdelivr.net/gh/tutosrive/images-projects-srm-trg@main/others/ferreandina-nosql/workers/2.jpg"
    }
  ]
}
The products collection is the catalogue of all hardware items sold across branches. Each product carries a denormalized supplier sub-document (with _id and name) so supplier info is available without a join.
_id
integer
required
Unique integer identifier for the product.
name
string
required
Machine-friendly product name, e.g. "hammer" or "copper_wire_12awg".
description
string
required
Human-readable product description.
price
double
required
Unit price in the store’s currency.
category_id
integer
required
Foreign key (integer) referencing a document in the categories collection.
quantity
integer
required
Global stock quantity (canonical value; branches may store a local copy).
unitary_weight
float
required
Weight of a single unit in kilograms.
sould_out_date
string | null
ISO date string when the product sold out, or null if currently in stock. Note: the field name contains a known typo from the source model (sould_out_date rather than sold_out_date).
supplier
object
required
Denormalized supplier snapshot.
image
string
required
Product image URL.
Example document (from config/collections/products.json):
{
  "_id": 1,
  "name": "hammer",
  "description": "Tools used for striking, driving nails, breaking materials and performing carpentry, construction and repair tasks",
  "price": 100,
  "category_id": 11,
  "quantity": 1000,
  "unitary_weight": 2.5,
  "sould_out_date": null,
  "supplier": { "_id": 1, "name": "Fierros La Central" },
  "image": "https://cdn.jsdelivr.net/gh/tutosrive/images-projects-srm-trg@main/others/ferreandina-nosql/products/hammer.webp"
}
The categories collection organises products into named groups. Products reference a category by its integer _id via the category_id field.
_id
integer
required
Unique integer identifier for the category.
name
string
required
Category name, e.g. "Hand Tools" or "Electrical".
description
string
required
Short description of what types of products belong to this category.
image
string
Optional category image URL.
Example document:
{
  "_id": 11,
  "name": "Hand Tools",
  "description": "Manual tools used for construction, repair, and carpentry tasks.",
  "image": "https://example.com/categories/hand-tools.webp"
}
The suppliers collection holds the companies and individuals that supply hardware products to Ferreandina. Supplier identity is denormalized into product documents (and supply records) for display convenience.
_id
integer
required
Unique integer identifier for the supplier.
name
string
required
Supplier company or individual name.
email
string
required
Contact email address for the supplier.
phone
string
required
Contact phone number for the supplier.
image
string
required
Supplier logo or avatar image URL.
Example document (from config/collections/suppliers.json):
{
  "_id": 1,
  "name": "Wright Ltd",
  "email": "michael86@petersen-freeman.com",
  "phone": "(633)358-1461",
  "image": "https://ui-avatars.com/api/?name=WrightLtd&background=random&color=cdf5f7&size=512"
}
The supplies collection records incoming stock deliveries. Each supply document references the supplying company via a denormalized suplier sub-document and lists the products delivered in an embedded products array.
_id
integer
required
Unique integer identifier for the supply record.
suplier
object
required
Denormalized snapshot of the delivering supplier. Note: the field is spelled suplier (one p) as defined in SupplieModel.java.
products
array
required
List of product documents included in this delivery. Each item mirrors the full ProductModel schema (see the products accordion above).
defective_quanity
integer
required
Number of defective units found in this delivery. Note: the field name contains a known typo from the source model (defective_quanity rather than defective_quantity).
entry_date
string
required
ISO date string recording when the delivery was received.
Example document:
{
  "_id": 1,
  "suplier": { "_id": 3, "name": "Fox, Hernandez and Hubbard" },
  "products": [
    {
      "_id": 1,
      "name": "hammer",
      "quantity": 200,
      "price": 100,
      "unitary_weight": 2.5,
      "sould_out_date": null,
      "category_id": 11,
      "supplier": { "_id": 3, "name": "Fox, Hernandez and Hubbard" },
      "image": "https://cdn.jsdelivr.net/gh/tutosrive/images-projects-srm-trg@main/others/ferreandina-nosql/products/hammer.webp"
    }
  ],
  "defective_quanity": 3,
  "entry_date": "2024-03-15"
}
The customers collection stores the buyers who purchase from Ferreandina branches. The model uses a @BsonProperty("NI") annotation to map the Java field ni to the MongoDB field name NI (national identification number).
_id
integer
required
Unique integer identifier for the customer.
NI
string
required
National identification number for the customer. Stored under the uppercase key NI in MongoDB (via @BsonProperty("NI") in CustomerModel.java).
alias
string
required
Display name or alias used for the customer.
category
string
required
Customer category or classification (e.g. wholesale, retail).
phone
string
required
Customer contact phone number.
Example document:
{
  "_id": 1,
  "NI": "1234567890",
  "alias": "El Constructor",
  "category": "wholesale",
  "phone": "310-555-0198"
}
The workers collection stores the employees who work across Ferreandina branches. A trimmed version of each worker document (only _id, name, and image) is embedded inside the corresponding branch document.
_id
integer
required
Unique integer identifier for the worker.
name
string
required
Worker’s full name.
image
string
required
Worker photo URL.
age
integer
required
Worker’s age in years.
speciality
string
required
Job speciality or role description (e.g. "electrician", "plumber").
weight
float
required
Worker’s body weight in kilograms (used for safety/equipment assignments).
email
string
required
Worker’s contact email address.
phone
string
required
Worker’s contact phone number.
salary
float
required
Worker’s monthly salary.
Example document:
{
  "_id": 1,
  "name": "Eduardo Sánchez",
  "image": "https://cdn.jsdelivr.net/gh/tutosrive/images-projects-srm-trg@main/others/ferreandina-nosql/workers/1.jpg",
  "age": 34,
  "speciality": "carpentry",
  "weight": 78.5,
  "email": "eduardo.sanchez@ferreandina.com",
  "phone": "300-123-4567",
  "salary": 1800000
}

Relationships

Ferreandina NoSQL uses a hybrid approach that mixes MongoDB-style denormalization with relational-style integer foreign keys. Reference by integer ID (category_idcategories._id) : Products carry a category_id field that is an integer matching _id in the categories collection. This is a classic foreign-key reference; the application must issue a second query (or use $lookup in an aggregation pipeline) to resolve the full category document. Denormalized supplier reference (supplier._id inside products) : Rather than referencing suppliers by ID alone, each product embeds a supplier sub-document with { "_id": ..., "name": ... }. This avoids a second round-trip when displaying product listings, but means supplier name changes must be propagated to all embedded copies. Embedded arrays in branches (products / workers) : Branch documents embed trimmed snapshots of their assigned products and workers. The embedded copies contain only the fields needed for display; full records remain in the products and workers collections. This pattern optimises branch-listing queries at the cost of write amplification whenever a product’s name, quantity, or image changes.

Build docs developers (and LLMs) love