Skip to main content

Overview

The Product model represents the different types of dairy products that can be manufactured at establishments. Products are categorized into cheeses and milk products.

TypeScript Definition

interface Product {
  idProducto: string;
  nombre: string;
  categoria: 'quesos' | 'leches';
  loteProducciones?: ProductionBatch[];
}

enum Categoria {
  quesos = 'quesos',
  leches = 'leches'
}

Fields

idProducto
string
required
Unique identifier for the product. Auto-generated UUID.Database: Primary key, UUID format
nombre
string
required
Name of the dairy product.Examples:
  • Cheeses: “Queso Mozzarella”, “Queso Parmesano”, “Queso Crema”
  • Milk: “Leche Pasteurizada”, “Leche Descremada”, “Crema de Leche”
categoria
enum
required
Category classification of the product.Enum Values:
  • quesos - Cheese products
  • leches - Milk and milk-based liquid products
Usage: Enables category-based filtering and reporting

Relationships

Example Response

{
  "idProducto": "p1q2r3s4-5678-90ab-cdef-1234567890ab",
  "nombre": "Queso Mozzarella",
  "categoria": "quesos",
  "loteProducciones": [
    {
      "idLote": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
      "numeroLote": 1001,
      "fechaProduccion": "2024-03-01T08:00:00.000Z",
      "cantidad": "250.50",
      "unidad": "kg",
      "estado": true
    },
    {
      "idLote": "b2c3d4e5-5678-90ab-cdef-1234567890ab",
      "numeroLote": 1015,
      "fechaProduccion": "2024-03-08T09:30:00.000Z",
      "cantidad": "300.00",
      "unidad": "kg",
      "estado": false
    }
  ]
}

Example: Minimal Response

{
  "idProducto": "p1q2r3s4-5678-90ab-cdef-1234567890ab",
  "nombre": "Queso Mozzarella",
  "categoria": "quesos"
}

Example: Product List by Category

Cheese Products

[
  {
    "idProducto": "p1q2r3s4-5678-90ab-cdef-1234567890ab",
    "nombre": "Queso Mozzarella",
    "categoria": "quesos"
  },
  {
    "idProducto": "p2q3r4s5-5678-90ab-cdef-1234567890ab",
    "nombre": "Queso Parmesano",
    "categoria": "quesos"
  },
  {
    "idProducto": "p3q4r5s6-5678-90ab-cdef-1234567890ab",
    "nombre": "Queso Crema",
    "categoria": "quesos"
  }
]

Milk Products

[
  {
    "idProducto": "p4q5r6s7-5678-90ab-cdef-1234567890ab",
    "nombre": "Leche Pasteurizada Entera",
    "categoria": "leches"
  },
  {
    "idProducto": "p5q6r7s8-5678-90ab-cdef-1234567890ab",
    "nombre": "Leche Descremada",
    "categoria": "leches"
  },
  {
    "idProducto": "p6q7r8s9-5678-90ab-cdef-1234567890ab",
    "nombre": "Crema de Leche",
    "categoria": "leches"
  }
]

Usage Notes

Product Categories

Quesos (Cheeses)
  • Hard cheeses: Parmesano, Reggianito
  • Semi-hard cheeses: Gouda, Cheddar
  • Soft cheeses: Mozzarella, Ricotta, Crema
  • Typically measured in kilograms (kg)
Leches (Milk Products)
  • Pasteurized milk (whole, semi-skimmed, skimmed)
  • Cream products
  • Yogurt and liquid dairy products
  • Typically measured in liters (litros)

Product Catalog Management

  • Products are global across all establishments
  • Each establishment can produce any product from the catalog
  • Product names should be descriptive and unique
  • Categories enable filtered views and reports

Production Analytics

  • loteProducciones relationship enables product-specific analytics
  • Track total production volume per product
  • Analyze cost trends over time for specific products
  • Compare performance across different products

Typical Workflow

  1. System administrator or user creates product definitions
  2. Products become available for production batch creation
  3. Establishments create batches linked to specific products
  4. Production history accumulates in loteProducciones

Build docs developers (and LLMs) love