Skip to content

Job.Estimated* is never written; cost-summary estimate is permanently zero #35

Description

@dhokanson-armoryworks

Summary

Job.EstimatedLaborCost / EstimatedMaterialCost / EstimatedHours (the Job.Estimated* family) are never written by any production code path. Only the dev seeder populates them. POST /api/v1/jobs/{id}/recalculate-costs returns 204 and changes nothing.

Consequence

GET /api/v1/jobs/{id}/cost-summary returns a permanently-zero estimate on every job created through the API or UI, so every plan-vs-actual variance the product shows is meaningless. A costing feature that reads these fields (the planned standard-costing work) will inherit the zero.

Where

  • forge.api/Features/Jobs/CreateJob.cs: no estimate computed at creation, even when the part has routing (Operation.EstimatedMs) and a current BOM.
  • recalculate-costs handler: no write to the Estimated* fields.
  • Sweep of EstimatedLaborCost =/EstimatedMaterialCost =/EstimatedHours = outside tests and seeders returns only a report projection (Reports/GetTimeByOperationReport.cs).

Suggested fix

Compute the estimate at job creation and in recalculate-costs: hours from Σ routing EstimatedMs × quantity, labour from the work-center rate, material from the current BOM revision × standard cost. If the fields are not meant to ship yet, hide cost-summary's estimate columns rather than returning zeros that look like data.

Found by the 2026-08-30 arsenal-as-client gap audit; adversarially verified.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    • Status
      Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions