Key Capabilities
Quality Samples
Record parametric measurements per process with automatic pass/fail validation against specifications.
Batch Management
Generate unique batch codes (lotes) for every production run with state tracking and closure controls.
Traceability
Track material consumption from upstream batches to downstream processes with complete lineage.
Compliance Enforcement
Block production until quality is validated; automatic rejection handling and supervisor escalation.
Quality-First Workflow
PROD-SYS enforces quality validation before production recording:Execution Sequence
- Open Shift: Supervisor opens bitácora de turno
- Quality Sampling: Operators record quality samples (muestras) for each process
- Validation Gate: System validates samples against process contract requirements
- Production Recording: Only after quality validation can production quantities be recorded
- Shift Closure: Supervisor closes bitácora with automatic quality review
bitacora.service.js:167):
Quality Samples (Muestras)
Recording Samples
UI Flow:- Navigate to active bitácora → Select process
- Click Add Quality Sample
- Enter sample data:
- Parametro: e.g., “Espesor”, “Gramaje”, “Tracción”
- Valor: Measured value (numeric)
- Valor Nominal: Target/specification value
- Resultado: Pass/fail determination
- System validates parameter against process contract
- Sample saved and contributes to quality gate
muestras):
backend/domains/quality/muestra.repository.js
Process-Specific Validation
Each process contract defines valid parameters and ranges. Example fromExtrusorPPContract.js:
bitacora.service.js:427):
Rejection Handling
When a sample hasresultado = 'Rechazo' or 'No cumple':
- Automatic Escalation: Bitácora state changes to
REVISIONon closure - Observaciones Required: Operator must provide detailed explanation
- Supervisor Review: Supervisor must review and approve closure
- Audit Trail: All rejections logged in audit system
bitacora.service.js:148):
backend/domains/production/bitacora.service.js:148-165
Batch Management (Lotes)
Batch Generation
PROD-SYS automatically generates batch codes (lotes) for every production run: Generation Rules:- Format:
{codigo_orden}-{correlativo}- Example:
4567890-001(first batch of order 4567890) - Example:
2345678-012(twelfth batch of order 2345678)
- Example:
- One batch per bitácora + orden combination
- Correlativo auto-increments per order
lote.service.js:21):
lotes):
backend/domains/quality/lote.repository.js
Batch State Management
Batches progress through states:| State | Description | Allowed Transitions |
|---|---|---|
| activo | Available for consumption by downstream processes | → pausado, → cerrado |
| pausado | Temporarily unavailable (quality hold, quarantine) | → activo, → cerrado |
| cerrado | Final state, no further changes allowed | (terminal) |
lote.service.js:110):
lote_historial_estado):
backend/domains/quality/lote.service.js:97
Traceability
Upstream Consumption Tracking
Downstream processes consume batches from upstream processes. Example: Telar (weaving) consumes batches from ExtrusorPP (extrusion). Consumption Flow:- Operator selects process (e.g., Telar) in bitácora
- System displays available batches (estado = ‘activo’ or ‘pausado’)
- Operator selects which batches are being consumed
- System records consumption linkage
telar_consumo_lote):
lote.service.js:71):
- Closed batches (
estado = 'cerrado') cannot be consumed - Consumption records are mutable (operator can change batch selection)
- Each
registro_trabajocan consume multiple batches
backend/domains/quality/lote.service.js:71
Traceability Query
The system provides complete traceability for any batch: API Endpoint:GET /api/quality/lotes/:id/trazabilidad
Response Structure:
lote.service.js:162):
backend/domains/quality/lote.service.js:162
Integration with Production
Quality Gate Enforcement
The bitácora service enforces quality-first logic: Process State Machine (frombitacora.service.js:180):
- UI disables “Add Production” button when
accionesPermitidasdoes not include'REGISTRAR_PRODUCCION' - Display
bloqueosmessages as alert banners - Only enable production recording after quality validation
Batch-Linked Samples
Samples can be linked to specific batches vialote_id foreign key:
Use Cases:
- Finished goods testing: Sample final product from a specific batch
- Quarantine decisions: Sample triggers batch pause
- Certificate generation: Export batch quality data for compliance docs
backend/domains/quality/muestra.repository.js:6
Quality Analytics
Rejection Rate by Process
Query Pattern:Batch Closure Rate
Query Pattern:Traceability Coverage
Query Pattern (batches with downstream consumption):Compliance & Auditing
Audit Trail
All quality actions are logged viaauditService:
Logged Events:
- Sample creation/modification
- Batch state changes
- Rejection occurrences
- Traceability linkages
audit.service.js):
lote.service.js:143):
Quality Hold Process
Standard Operating Procedure:- Detection: Quality sample fails specification
- Automatic Block: Bitácora state →
REVISION - Batch Pause: Operator pauses related batch with reason
- Investigation: Supervisor reviews root cause
- Resolution:
- Release: Batch reactivated with approval comment
- Scrap: Batch closed with scrap reason
lote.service.js:123):
Next Steps
Production Management
See how quality integrates with production order execution
Resource Tracking
Track raw material consumption alongside batch production
API Reference
Explore quality management API endpoints
Dashboard
View real-time quality metrics and rejection trends