Production Hierarchy
The system uses a two-level production hierarchy:Cadenas (Production Chains)
Top-level grouping representing major production areas or product families
Production Chains (Cadenas)
Chains group multiple production lines by product type or manufacturing process.TypeScript Interface
types.ts
Database Schema
schema.sql
Sample Chains
Cadena 1
Producción arneses motorManufactures wire harnesses for automotive engines
- 3 fixed lines (A1, A2)
- 1 flexible line (A3)
Cadena 2
Conectores y terminalesProduces electrical connectors and terminals
- 2 fixed lines (B1, B2)
Cadena 3
Ensambles especialesSpecialized assemblies and custom components
- 1 flexible line (C1)
- 1 fixed line (C2)
Cadena 4
Soldadura y acabadoWelding and finishing operations
- 1 fixed line (D1)
Example Data
seed.ts
Production Lines (Líneas)
Lines are the actual manufacturing workstations within each chain.TypeScript Interface
types.ts
Database Schema
schema.sql
The
cadena_id foreign key ensures referential integrity. Deleting a chain will cascade delete all its associated lines.Line Types
Fija (Fixed Line)
Fija (Fixed Line)
Fixed production lines manufacture a specific product or product family:
- Dedicated equipment and tooling
- Consistent process flow
- Standard staffing requirements
- Most common in high-volume production
Flexible (Flexible Line)
Flexible (Flexible Line)
Flexible production lines can manufacture multiple products:
- Modular equipment configuration
- Quick changeover capability
- Variable staffing based on product
- Used for mixed-model production
Sample Lines by Chain
seed.ts
Scrap Record Integration
When operators register scrap, they select both chain and line:Scrap Record Fields
types.ts
The system maintains both text fields (
CADENA, LINEA) and ID references (CADENA_ID, LINEA_ID) for backward compatibility with existing data.Database Schema
schema.sql
Managing Production Lines
Adding a New Chain
Create Chain
Click + Agregar and enter:
- Nombre: Chain name (e.g., “Cadena 5”)
- Descripción: Purpose or product family
Adding a New Line
Note: The Lines catalog is currently hidden in the UI (
Catalogs.tsx:104) but can be managed via API or database.Reporting by Chain and Line
The production hierarchy enables powerful reporting capabilities:By Chain Report
Drill-Down Capability
Reports allow drilling down from chain → line → area:Supervisor Assignment
Lines can be assigned to supervisors for accountability:Linking Supervisor to Line
Use Cases
Scrap Accountability
Track which supervisor is responsible for scrap generated on each line
Filtered Reports
Supervisors can view reports filtered to only their assigned lines
Performance Metrics
Calculate scrap rates per supervisor for performance reviews
Alert Routing
Send scrap alerts to the line supervisor when tolerances are exceeded
Best Practices
Naming Conventions
Chain Naming
Chain Naming
Use descriptive names that reflect the product family:
- ✅ “Cadena 1 - Arneses Motor”
- ✅ “Cadena 2 - Conectores”
- ❌ “Línea Principal” (too generic)
- ❌ “Producción A” (unclear)
Line Naming
Line Naming
Use alphanumeric codes that reference the parent chain:
- ✅ “Línea A1” (A = Cadena 1, 1 = first line)
- ✅ “Línea B2” (B = Cadena 2, 2 = second line)
- ❌ “Línea 1” (doesn’t indicate chain)
- ❌ “Producción 001” (unclear hierarchy)
Hierarchy Design
Balance Line Count
Aim for 2-5 lines per chain. Too few suggests chains are too granular; too many suggests they’re too broad
Consider Flexibility
Designate lines as “Flexible” if they produce multiple products to ensure accurate scrap attribution
Tolerance Configuration
Production chains and lines can have specific scrap tolerance limits:Chain-Level Tolerances
types.ts
Example Configuration
seed.ts
API Reference
Chains Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/catalogs/cadenas | List all chains |
| POST | /api/catalogs/cadenas | Create new chain |
| PUT | /api/catalogs/cadenas/:id | Update chain |
| DELETE | /api/catalogs/cadenas/:id | Deactivate chain |
Lines Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/catalogs/lineas | List all lines |
| GET | /api/catalogs/lineas?cadena_id=1 | List lines for specific chain |
| POST | /api/catalogs/lineas | Create new line |
| PUT | /api/catalogs/lineas/:id | Update line |
| DELETE | /api/catalogs/lineas/:id | Deactivate line |
All endpoints require authentication and the manage_catalogs permission.