{"openapi":"3.1.0","info":{"title":"POST /api/v1/inventory/production/runs/{run_id}/complete","version":"1.0.0","description":"Complete production run"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/inventory/production/runs/{run_id}/complete":{"post":{"tags":["inventory:production"],"summary":"Complete production run","description":"Mark a run as completed.","operationId":"complete_run_api_v1_inventory_production_runs__run_id__complete_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunResponse"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"CostBreakdown":{"properties":{"materials_by_category":{"additionalProperties":{"type":"integer"},"type":"object","title":"Materials By Category","description":"Cost per category in cents."},"processing_steps_by_type":{"additionalProperties":{"type":"integer"},"type":"object","title":"Processing Steps By Type","description":"Cost per step_type in cents."},"material_line_items":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Material Line Items"},"step_line_items":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Step Line Items"},"total_cost":{"type":"integer","title":"Total Cost","default":0},"cost_per_unit":{"type":"integer","title":"Cost Per Unit","default":0},"sales_potential":{"type":"integer","title":"Sales Potential","default":0},"gross_profit":{"type":"integer","title":"Gross Profit","default":0},"gross_margin_pct":{"type":"number","title":"Gross Margin Pct","default":0.0},"total_weight":{"type":"number","title":"Total Weight","default":0.0},"total_weight_unit":{"type":"string","title":"Total Weight Unit","default":""}},"type":"object","title":"CostBreakdown","description":"Structured cost breakdown returned by the calculation engine."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"RunResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"recipe_id":{"type":"string","title":"Recipe Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"total_units":{"type":"integer","title":"Total Units"},"unit_sale_price":{"type":"integer","title":"Unit Sale Price"},"status":{"type":"string","title":"Status"},"cost_snapshot":{"anyOf":[{"$ref":"#/components/schemas/CostBreakdown"},{"type":"null"}]},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","business_id","recipe_id","total_units","unit_sale_price","status","created_at","updated_at"],"title":"RunResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}