Machine
A Machine is a piece of physical equipment tracked within the OEE subsystem. Machines record downtime events and incident events, and contribute hours to jobs via the Job Time Tracking system. Machines operate within stations — they are time sources that act on jobs, not stages in a process flow.
Naming History
The entity was renamed from equipment to machines during the data model refactor. See Table Rename History for details.
Database Table: oee_machines
| Column | Type | Description |
|---|---|---|
id | UUID (PK) | Auto-generated |
site_id | UUID (FK) | References Site (oee_sites.id) — required |
organization_id | VARCHAR(50) | Org ownership |
center_type | machine_type_enum | Discriminator: 'equipment', 'station', or 'hybrid' |
code | VARCHAR(50) | Short identifier (e.g., “CNC-01”), unique per site |
name | VARCHAR(255) | Display name |
description | TEXT | Optional description |
machine_number | VARCHAR(50) | Equipment-specific serial/asset number |
ideal_cycle_time_seconds | DECIMAL(10,2) | Target cycle time per part |
target_rate / target_rate_unit | DECIMAL / enum | Target production rate |
target_oee_percent | DECIMAL(5,2) | Default 85.00 |
target_availability_percent | DECIMAL(5,2) | Default 90.00 |
target_performance_percent | DECIMAL(5,2) | Default 95.00 |
target_quality_percent | DECIMAL(5,2) | Default 99.50 |
is_concurrent_batch | BOOLEAN | Whether machine can run multiple batches simultaneously |
default_target_quantity | INTEGER | Default target parts per batch |
expected_batch_duration_hours | DECIMAL(10,2) | Expected run time |
expected_parts_per_batch | INTEGER | Expected output |
data_collection_start_date | TIMESTAMPTZ | When OEE data collection began |
is_archived | BOOLEAN | Soft-delete flag |
A machine’s direct parents are its Site (required, via site_id) and its stations (many-to-many, via a join table). A machine does not belong directly to a system — the hierarchy is System > Station > Machine, so a machine’s system membership is derived from its station(s).
Metrics Tracked
Machines track the following via Events (oee_machine_events):
- Availability — uptime vs. downtime, based on downtime events recorded against the machine
- Hours contributed to jobs — machine time entries linked to jobs, feeding into the cumulative Job Time Tracking model
- Downtime events — periods where the machine is down, categorized by reason codes. A single downtime event can affect multiple machines and/or stations simultaneously.
- Incident events — occurrences recorded against the machine (e.g., faults, alerts). A single incident can affect multiple machines and/or stations simultaneously.
OEE (Availability x Performance x Quality) is calculated at the job, station, and product level, not directly on the machine. Machines provide the time and event data that feeds into those calculations. See OEE Calculation Model for details.
Relationships
- Belongs to one Site (
site_id, required) — every machine has exactly one site - Belongs to zero or more stations (many-to-many via a join table) — a machine can exist at a site without being assigned to any station, or can operate across multiple stations
- Does not belong directly to a system — system membership is inherited through station(s). The hierarchy is System > Station > Machine.
- Has many downtime and incident events via Events (
oee_machine_events.machine_id) - Contributes time to jobs — machines are time sources, not job hosts. Jobs live at stations.
Codebase Paths
- Table definition:
database/sql_scripts/tables/oee_machines.sql - Frontend:
frontend/src/app/features/oee-dashboard/
Machine-Station Relationship
Machines relate to stations in two modes:
Collaborative: Machine as Part of a Station
A machine is one of several contributors to jobs at a station. The station is the container where people and machines work together, or where multiple machines operate in parallel. Each machine contributes its own hours to the job’s cumulative total alongside other machines and people at that station.
Dedicated: Machine IS the Station
The machine is the sole contributor to any job at its station. The station exists as a structural wrapper, but the machine and station are essentially 1:1. If a job is running at the station, the machine is running. No other machines or people contribute time — the machine is the default and only time source.
In both modes, machine-hours are cumulative and feed into the Job Time Tracking model. See Station Configuration for how stations are configured.