Product Family
A Product Family is a logical grouping of related products at a Site. Product families serve as the top level of the Product Hierarchy and can define default standard hours, target scrap rates, and unit costs that apply to all products in the family.
Database Table: ops_product_families
| Column | Type | Description |
|---|---|---|
id | UUID (PK) | Auto-generated |
site_id | UUID (FK) | References Site (oee_sites.id) |
family_code | VARCHAR(50) | Short identifier, unique per site |
family_name | VARCHAR(255) | Display name |
description | TEXT | Optional description |
standard_hours | NUMERIC | Default standard hours for products in this family |
default_quantity | INTEGER | Default target quantity when posting a job |
target_scrap_rate | NUMERIC | Expected scrap rate for this product type |
unit_cost | NUMERIC | Cost per unit |
sort_order | INTEGER | Display ordering |
Unique constraint: (site_id, family_code)
Standard Hours Fallback
When calculating efficiency, the system uses this priority:
ops_products.standard_hours(product-level)ops_product_families.standard_hours(family-level fallback)0(if neither is set)
Relationships
- Belongs to a Site (
oee_sites) - Has many Products (
ops_products.family_id) - Referenced by jobs (
ops_jobs.product_family_id) - Has per-station specs via
ops_station_product_standards
Changes in PR #2783
- Delete behavior changed: Hard-delete replaced soft-delete (archive/restore pattern was removed)
archive_ops_product_family()andunarchive_ops_product_family()were replaced bydelete_ops_product_family()get_product_family_by_idendpoint was removed (no longer needed)
Codebase Paths
- Table:
database/sql_scripts/tables/ops_product_families.sql - Functions:
database/sql_scripts/functions/ops/ops_product_family_functions.sql - Backend:
backend/endpoints/ops.ts
Target OEE Per Station
Product Families define target OEE per station:
- Each product family can have a different target efficiency at each Station
- Targets are stored in Station Product Standards (
ops_station_product_standards) - When a station allows concurrent jobs, the target OEE calculation adjusts for shared capacity
- OEE is trackable per product family across all jobs for products in that family
See Efficiency Calculation for how target OEE interacts with efficiency calculations.