Overview
The Direct Cost (CostosDirecto) model tracks all direct expenses associated with producing a specific batch. Each cost record captures a specific expense concept, amount, and optional notes.TypeScript Definition
Fields
Unique identifier for the cost record. Auto-generated UUID.Database: Primary key, UUID format
Cost concept or category.Enum Values:
insumos_basicos- Basic supplies (salt, packaging, labels, etc.)leche_cruda- Raw milkcuajo_y_fermentos- Rennet and starter culturesrefrigeracion- Refrigeration and energy costs
Cost amount in the specified currency.Type: Decimal(13,2) - up to 13 digits with 2 decimal placesFormat: Stored as decimal, no currency symbolExample: 15000.00, 2500.50, 850.25Note: Currency type should be tracked at the establishment or system level
Optional notes or details about the cost.Default: Empty string ("")Nullable: Can be null or emptyUsage: Provides context for the expense (quantities, rates, suppliers, etc.)Examples:
- “500 litros a $30/litro”
- “Cuajo líquido - Proveedor XYZ”
- “Consumo eléctrico cámara de frío - 48 horas”
Timestamp when the cost record was created.Default: Current timestampFormat: ISO 8601 datetime stringUsage: Tracks when expenses were recorded
Foreign key reference to the production batch this cost applies to.Database: Foreign key to LoteProduccion(idLote)Relation: Many-to-One with ProductionBatch
Relationships
Example Response
Example: Complete Cost Breakdown for a Batch
Example: Minimal Response
Cost Concepts Explained
Raw Milk (leche_cruda)
The primary raw material for all dairy production. Common Details to Track:- Volume purchased (liters)
- Price per liter
- Supplier information
- Milk quality metrics (fat %, protein %)
- Delivery date
- “500 litros a $30/litro - Proveedor La Pampa”
- “750L @ $28/L - Calidad Premium (3.5% grasa)“
Rennet and Cultures (cuajo_y_fermentos)
Essential ingredients for cheese production. Includes:- Rennet (animal, vegetable, or microbial)
- Starter cultures (mesophilic, thermophilic)
- Mold cultures (for specialty cheeses)
- Enzymes and coagulants
- “Cuajo líquido 200ml - CHR Hansen”
- “Fermento mesófilo 50g + cuajo microbiano”
- “Cultivo Penicillium roqueforti para queso azul”
Basic Supplies (insumos_basicos)
Miscellaneous supplies and materials needed for production. Includes:- Salt and brine solutions
- Calcium chloride
- Citric acid
- Packaging materials
- Labels and stickers
- Cleaning and sanitizing agents
- Small tools and consumables
- “Sal gruesa 25kg + cloruro de calcio 2kg”
- “Envases plásticos x200 + etiquetas impresas”
- “Material de empaque y sanitizantes”
Refrigeration (refrigeracion)
Energy costs for cooling and storage. Includes:- Electricity for cooling chambers
- Freezer operation costs
- Refrigerated storage during maturation
- Cold chain maintenance
- Metered electricity usage
- Estimated based on hours of operation
- Pro-rated from monthly utility bills
- “Cámara de frío 48 horas - 120 kWh @ $7/kWh”
- “Refrigeración durante maduración - 7 días”
- “Consumo eléctrico estimado - marzo 2024”
Usage Notes
Cost Tracking Workflow
- Production batch is created
- As expenses occur, cost records are added
- Each cost is categorized by concept
- Observations document details for audit trail
- Total batch costs calculated by summing all records
- Per-unit cost derived from total costs and quantity
Profitability Analysis
Total Direct CostsMulti-Currency Considerations
While the schema includes aMoneda enum (USD, EUR, ARS), the current cost model doesn’t explicitly store currency. Consider:
- Standardizing all costs to a single currency
- Adding a currency field if multi-currency support is needed
- Converting historical costs when analyzing across time periods
- Accounting for exchange rate fluctuations
Best Practices
Recording Costs:- Add costs as they occur during production
- Include detailed observations for audit purposes
- Use consistent units and calculation methods
- Verify amounts before batch finalization
- Use
leche_crudaonly for raw milk purchases - Group similar supplies under
insumos_basicos - Separate
cuajo_y_fermentosfor cheese-specific analysis - Track
refrigeracionseparately to identify energy efficiency opportunities
- Compare costs across batches of the same product
- Track cost trends over time
- Identify cost reduction opportunities by concept
- Calculate cost per unit for pricing decisions
- Monitor raw milk prices for budget forecasting
- Always include meaningful observations
- Document supplier information when relevant
- Record quantities and unit prices for raw materials
- Note any unusual expenses or one-time costs
- Maintain consistency in how costs are categorized
