Skip to main content

Overview

The Establishment model represents individual dairy farm facilities in the Tambo360 platform. Each establishment is owned by a user and can manage multiple production batches.

TypeScript Definition

interface Establishment {
  idEstablecimiento: string;
  nombre: string;
  localidad: string;
  provincia: string;
  fechaCreacion: Date;
  idUsuario: string;
  usuario?: User;
  loteProducciones?: ProductionBatch[];
}

Fields

idEstablecimiento
string
required
Unique identifier for the establishment. Auto-generated UUID.Database: Primary key, UUID format
nombre
string
required
Name of the dairy farm establishment.Example: “La Esperanza”, “El Progreso”, “San José”
localidad
string
required
City or locality where the establishment is located.Example: “Rafaela”, “Villa María”, “Tandil”Usage: Used for geographical organization and reporting
provincia
string
required
Province or state where the establishment is located.Example: “Santa Fe”, “Córdoba”, “Buenos Aires”Usage: Regional analysis and reporting
fechaCreacion
datetime
required
Timestamp when the establishment was registered in the system.Default: Current timestampFormat: ISO 8601 datetime string
idUsuario
string
required
Foreign key reference to the owner user.Database: Foreign key to Usuario(idUsuario)Relation: Many-to-One with User

Relationships

Example Response

{
  "idEstablecimiento": "e1f2g3h4-5678-90ab-cdef-1234567890ab",
  "nombre": "La Esperanza",
  "localidad": "Rafaela",
  "provincia": "Santa Fe",
  "fechaCreacion": "2024-01-15T14:20:00.000Z",
  "idUsuario": "a7b8c9d0-1234-5678-90ab-cdef12345678",
  "usuario": {
    "idUsuario": "a7b8c9d0-1234-5678-90ab-cdef12345678",
    "correo": "[email protected]",
    "nombre": "Juan Pérez",
    "verificado": true
  },
  "loteProducciones": [
    {
      "idLote": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
      "numeroLote": 1001,
      "fechaProduccion": "2024-03-01T08:00:00.000Z",
      "cantidad": "250.50",
      "unidad": "kg",
      "estado": true
    }
  ]
}

Example: Minimal Response

{
  "idEstablecimiento": "e1f2g3h4-5678-90ab-cdef-1234567890ab",
  "nombre": "La Esperanza",
  "localidad": "Rafaela",
  "provincia": "Santa Fe",
  "fechaCreacion": "2024-01-15T14:20:00.000Z",
  "idUsuario": "a7b8c9d0-1234-5678-90ab-cdef12345678"
}

Usage Notes

Multi-Establishment Management

  • Users can own and manage multiple establishments
  • Each establishment operates independently with its own production batches
  • Useful for producers managing multiple farm locations

Geographical Organization

  • localidad and provincia enable regional reporting
  • Can be used for aggregating statistics by region
  • Supports multi-location farm management

Production Tracking

  • All production batches are linked to an establishment
  • Enables facility-specific performance metrics
  • Supports traceability requirements

Build docs developers (and LLMs) love