Product

ops product glossary

A Product is a specific item that can be produced at stations. Products belong to a Product Family and carry a standard_hours value used for efficiency calculations.

Database Table: ops_products

ColumnTypeDescription
idUUID (PK)Auto-generated
family_idUUID (FK)References Product Family (ops_product_families.id)
product_codeVARCHAR(50)Short identifier, unique within family
product_nameVARCHAR(255)Display name
standard_hoursDECIMAL(10,2)Expected labor hours to produce one unit
descriptionTEXTOptional description
is_activeBOOLEANWhether product is currently available
sort_orderINTEGERDisplay ordering

Unique constraint: (family_id, product_code) — each product code is unique within its family.

Standard Hours

The standard_hours field is critical for efficiency calculations:

  • Efficiency = Standard Hours / Actual Hours x 100%
  • When calculating efficiency, the system checks ops_products.standard_hours first, then falls back to ops_product_families.standard_hours
  • See Efficiency Calculation for details

Relationships

CRUD Operations

Managed via the OEE Settings modal (gear icon on the OEE dashboard):

OperationEndpointSQL Function
ListGET /api/v1/ops/productsget_ops_products()
CreatePOST /api/v1/ops/productcreate_ops_product()
UpdatePUT /api/v1/ops/product/:productIdupdate_ops_product()
DeleteDELETE /api/v1/ops/product/:productIddelete_ops_product()

Codebase Paths

  • Table: database/sql_scripts/tables/ops_products.sql
  • Functions: database/sql_scripts/functions/ops/ops_product_functions.sql
  • Backend: backend/endpoints/ops.ts (handlers: handleGetProducts, handleCreateProduct, handleUpdateProduct, handleDeleteProduct)

Dollar Amount and Cost Tracking

Products carry a dollar amount (unit price/sale value):

  • Revenue = units produced x product dollar amount
  • Combined with machine-hours and person-hours from Job Time Tracking, enables profitability analysis
  • OEE is trackable per product across all jobs for that product
  • See Cost Tracking for the full revenue/cost model

The dollar_amount field on ops_products stores the per-unit sale value. Family-level cost is stored as unit_cost on ops_product_families.

See Also