Product Hierarchy

ops product hierarchy

The product data model follows a two-level hierarchy within each Site:

graph TD
    Site["Site (oee_sites)"] --> PF["Product Families (ops_product_families)"]
    PF --> P["Products (ops_products)"]
    P -.->|used by| Job["OPS Jobs (ops_jobs)"]
    P -->|oee_batch_details.product_id| Batch["Batches (oee_batch_details)"]
    P --> EPS["Equipment Product Standards (oee_product_equipment_config)"]

Level 1: Product Families

Product Families are simple grouping directories:

  • family_code + family_name — identification
  • description — optional description
  • sort_order — display ordering

Product families carry no production data. They exist purely to organize products.

Scope: Per-site. Each family code is unique within a site.

Level 2: Products

Products are specific items within a family and carry all production parameters:

  • product_code + product_name — identification
  • standard_hours NUMERIC(10,2) — target hours per unit, drives efficiency calculations
  • default_quantity INTEGER — default job size
  • target_scrap_rate NUMERIC(5,2) — acceptable scrap percentage
  • unit_value NUMERIC(12,2) — sale value per unit
  • is_active — can be deactivated without deletion

Scope: Per-family. Each product code is unique within its family.

Standard Hours

The standard_hours field on ops_products drives the Efficiency Calculation:

Efficiency = standard_hours / actual_hours x 100%

If standard_hours is NULL or 0, no efficiency calculation is possible for that product.

Per-Equipment And Per-Station Standard Hours

Products can also have per-equipment and per-station overrides for standard_hours via the oee_product_equipment_config table. Stations are represented by rows in oee_equipment with node_type = 'station', so station-specific standards use the same (product_id, equipment_id) relationship as machine-specific standards. See Equipment Product Standards for details.

Per-Station Standard Hours

Station-specific standard hours are equipment product standards where equipment_id points at the station row in oee_equipment. See Station Product Standards.

Relationship to Jobs

When posting a job, the operator selects a Product. The job stores product_id; the product’s standard_hours provides the fallback when no station-specific row exists, and default_quantity pre-fills the quantity field.

Product Detail Analytics

The /oee/products/:productId detail view summarizes product performance by Station. Its Station Metrics drill-down shows per-job Touch Time, dwell, standard hours, efficiency, and rework Touch Time.

Touch Time info icons expose the operator breakdown behind the value. The tooltip lists each operator and their contributed duration, split into first-pass touch and rework touch when the displayed value includes both. The rework Touch Time cell shows the same operator-duration breakdown for rework labor.

Management UI

Products and families are managed via the Product Families tab in the OEE Settings modal (gear icon on the OEE dashboard, /oee/stations). This is not a standalone navigation page — it lives inside the settings modal.

The tab uses a master-detail layout:

  • Left panel: List of product families for the selected site
  • Right panel: Family detail (name, code, description) at the top, with a list of products below
  • Products display as expandable cards with inline editing for all production fields

Relationship to Batches

Every batch requires a product. When an operator starts a batch via the Process Flow or production line UI:

  • The product dropdown lists active products for the site (required field)
  • The product’s default_quantity pre-fills the target_quantity field on the batch; the operator can override it
  • Product information (code and name) appears in:
    • ViewEvent modal opened from the Jobs page row click
    • Event Log table
    • Process Flow batch badges
    • Production Line equipment cards
    • CSV exports (product_name, product_code columns)

See Batches for the full batch lifecycle.

Codebase Paths

  • Product Families table: database/sql_scripts/tables/ops_product_families.sql
  • Products table: database/sql_scripts/tables/ops_products.sql
  • Station standards: database/sql_scripts/tables/oee_product_equipment_config.sql
  • Product functions: database/sql_scripts/functions/ops/ops_product_functions.sql
  • Family functions: database/sql_scripts/functions/ops/ops_product_family_functions.sql

See Also