type, externalSync, externalSource
Fields
type values
Only two row types exist today:
build_order_work_session and overhead_work_session row types (and the buildOrderId / overheadId / stageId foreign keys they used) have been removed server-side. buildOrderId, overheadId, and stageId remain in the response shape for backward compatibility but are always null. Order/stage/phase attribution for deliverable_work_session rows now goes exclusively through deliverableId — see the join example below.shiftWorkHours shape
HH:mm format. breaks is optional.
Example queries
Loading hours with Order / Stage / Phase attribution
Fordeliverable_work_session rows, the time is logged against a stage/phase/component node, and the only link to the build tree is deliverableId (buildOrderId and stageId are always null). To attribute each row to its Order, Stage and Phase, join the deliverable node and then chain further joins off it:
- a join’s condition may reference another join’s alias (not just the base table), so you can hop
timesheet → deliverable → orderin a single request; - declare the joins in dependency order — the join you reference (here
d) must come before the joins that depend on it (o,s).
o.name,o.identifier→ the Order (joined via the node’srootParentId)s.name→ the stage (joined via the node’sdata.stageId)d.computed.phase→ the Phase name (read straight off the joined node)
The
s join matches stage.id against data->>'stageId'; the engine casts both sides to uuid automatically. Phase/component nodes won’t have a linked stage, so s is null for those rows — read computed.phase for the phase regardless.attendance rows have no build-tree attribution — deliverableId, buildOrderId, overheadId, and stageId are all null for them.