NetSuite assembly build flow

Build request → BOM → cost rollup → HITL → consumption → assembly → spec sheet refresh → cost recalc · 10 phases

Assembly builds are how GFS turns components into Power Up / Right Start / brand-line SKUs. Each build resolves the current BOM, refreshes cost rollup (raw + packaging + labor + overhead + freight), runs a capacity check, gates on HITL if cost crosses threshold, consumes components, produces the assembly, refreshes the spec sheet if claims changed, and recalculates assembly_cost_rollup with drift_pct_vs_prior surfaced.

D1-mirrored from NS HITL above cost threshold spec sheet linkage REAL

Pipeline — 10 phases, left to right

idle
NS assembly build flow — build request → BOM resolution → cost rollup → capacity check → HITL → component consumption → build operation → assembly created → spec sheet refresh → cost recalc 01 / Request 02 / BOM 03 / Rollup 04 / Capacity 05 / HITL 06 / Consume 07 / Build 08 / Created 09 / Spec 10 / Recalc BUILD REQUEST — Operator, WO, or sales-driven request to produce N units of an assembly. Source can be manual, an open work order, or a customer order requiring assembled stock. TRIGGER manual: NS UI · production form wo_driven: parent workorder release so_driven: sales_order needs FG TABLES read: assemblies (master) STATUS: REAL build request assembly_id + qty source: manual/WO/SO FRONTEND · NS UI i BOM RESOLUTION — Pull current assembly_bom rows for assembly_id. Validate every line_key exists in items master, has a current cost, and has on-hand availability. ACTION resolve: assembly_bom WHERE assembly_id=? validate: line_key IN items scale: qty × bom_qty per line TABLES read: assembly_bom · items STATUS: REAL BOM resolution assembly_bom rows scale by qty DATABASE · D1 i COST ROLLUP — Refresh assembly_cost_rollup by summing raw component cost, packaging, labor estimate, overhead allocation, and freight per pillar 4 cost-surface logic. COMPONENTS raw_cost: sum(bom.qty × component.cost) packaging: from bom packaging lines labor: bom.labor_min × labor_rate overhead: pct allocation freight: per-location adder TABLES write: assembly_cost_rollup STATUS: REAL cost rollup raw + pkg + labor + overhead + freight vs prior drift BACKEND · cost_surface i CAPACITY CHECK — Confirm labor hours available and components in inventory. Block or queue if either fails. ACTION labor: timebill_capacity vs bom.labor_min × qty components: inventory_balance.quantityavailable per line TABLES read: inventory_balance · employees (capacity) STATUS components_check: REAL labor_capacity: STUB (manual judgement) capacity check labor + components block if short CAPACITY · STUB labor i HITL AUTHORIZATION — If rollup cost > threshold (default $5K) or drift_pct_vs_prior > 8%, proposed_action staged. Mike approves via /proposed-actions.html. THRESHOLD cost_abs: $5,000 drift_pct: 8% HITL action_type: 'assembly_build_authorize' surface: /proposed-actions.html TABLES write: proposed_actions STATUS: REAL · risk 3 HITL authorize cost > $5K drift > 8% Mike approves SECURITY · risk 3 i COMPONENT CONSUMPTION — Debit inventory_balance per BOM line for the build qty. NS posts assemblyunbuild reverse only if rollback; forward path posts inventoryadjustment or workorderissue child. ACTION decrement: inventory_balance per BOM line ns_record: linked workorderissue OR direct inventoryadjustment TABLES write: inventory_balance · transactions STATUS: REAL consumption debit inventory per BOM line DATABASE · -qty i BUILD OPERATION — Physical production of the assembly happens on the floor; system-side this is the NS 'build' transaction record that links consumption to creation. ACTION ns_record: assemblybuild (Build txn) link: parent_wo_id if WO-driven TABLES write: transactions (Build) STATUS: REAL build operation assemblybuild physical produce BACKEND · Build txn i ASSEMBLY CREATED — Credit inventory_balance for the assembly item at the production location. Assembly available for sales allocation. ACTION increment: inventory_balance (assembly_id, +qty) TABLES write: inventory_balance · assemblies STATUS: REAL assembly created credit FG qty available DATABASE · +qty i SPEC SHEET REFRESH — If claims, allergens, or pack format changed in the BOM since last spec render, regenerate via spec-sheet-pipeline workflow. Otherwise skip. TRIGGER diff: claims OR allergens OR pack_format changed WORKFLOW invoke: spec-sheet-pipeline endpoint: POST /api/specs/ingest TABLES write: spec_items (new spec_version) r2: specs/<item_code>/<version>.pdf STATUS: REAL · invoked when needed spec sheet refresh if claims changed spec-sheet-pipeline new spec_version CLOUD · linked workflow i COST RECALC — assembly_cost_rollup re-runs with the final actuals. drift_pct_vs_prior surfaced on the item entity page and admin-dashboard cost-surface tile. ACTION compute: assembly_cost_rollup with actuals surface: drift_pct_vs_prior TABLES write: assembly_cost_rollup (status=active) SURFACES /item/<code> · admin-dashboard cost tile STATUS: REAL cost recalc final actuals drift_pct surfaced cost tile updated BACKEND · cost-surface i drift feeds next build's rollup baseline LEGEND Frontend Database Backend Cloud / linked HITL Capacity

Phase detail — 10 phases

01 Build request REAL

Manual entry, WO-driven, or sales-order-driven request to produce qty of an assembly.
Inputs
assembly_id · qty · source ∈ {manual, WO, SO}
Table read
assemblies

02 BOM resolution REAL

Pull assembly_bom rows, validate every line_key exists, scale qty.
Tables read
assembly_bom · items
Endpoint
GET /api/assemblies/{id}/bom

03 Cost rollup REAL

Pillar 4 cost-surface logic: raw + packaging + labor + overhead + freight. Returns drift_pct_vs_prior.
Table write
assembly_cost_rollup (status=active)
Code path
src/index.ts · cost-surface block

04 Capacity check labor STUB

Components check is real (inventory_balance). Labor capacity is currently manual judgement.
Tables read
inventory_balance · employees
STUB
no formal labor calendar table yet

05 HITL authorization risk 3

If cost > $5K or drift > 8% vs prior rollup, staged for Mike's review.
Thresholds
cost_abs > $5,000 · drift_pct > 8%
Surface
/proposed-actions.html
Table write
proposed_actions (action_type='assembly_build_authorize')

06 Component consumption REAL

Debit inventory_balance per BOM line.
NS record
workorderissue (if WO-linked) or inventoryadjustment
Table write
inventory_balance · transactions

07 Build operation REAL

NS posts the assemblybuild record linking consumption to creation.
NS record
assemblybuild
Table write
transactions (type='Build')

08 Assembly created REAL

Credit assembly to inventory at the production location.
Tables write
inventory_balance · assemblies

09 Spec sheet refresh REAL · linked

If allergens / claims / pack format changed since last spec, invokes the spec-sheet-pipeline workflow.
Workflow
spec-sheet-pipeline (R583)
Endpoint
POST /api/specs/ingest
Table write
spec_items · spec_versions
R2 path
specs/<item_code>/<version>.pdf

10 Cost recalc REAL

Final actuals roll up; drift_pct_vs_prior surfaced on the item entity page and cost-surface tile.
Table write
assembly_cost_rollup (status=active)
Surfaces
/item/<code> · admin-dashboard cost tile

Tables, endpoints, code paths

kindnamepurpose
D1 tableassembliesmaster record per assembly_id
D1 tableassembly_bomline_key, qty, uom, est cost per assembly
D1 tableassembly_cost_rollupraw + pkg + labor + overhead + freight · drift_pct_vs_prior
D1 tableinventory_balanceon-hand · available · reserved · per item × location
D1 tabletransactionsBuild, WkOrdIss rows
D1 tableproposed_actionsassembly_build_authorize rows above threshold
D1 tablespec_itemslinked spec row refreshed by step 9
NS recordassemblybuildsystem-of-record build transaction
NS recordinventoryadjustmentconsumption when no parent WO
EndpointPOST /api/assemblies/buildorchestrates the pipeline through HITL stage
EndpointGET /api/assemblies/{id}/bomresolves BOM + cost rollup
EndpointPOST /api/specs/ingestlinked spec workflow trigger
Workflowspec-sheet-pipelinestep 9 calls into this workflow
Code pathsrc/index.ts (cost-surface)cost rollup + drift_pct

Open gaps — honest punch list