{"openapi":"3.1.0","info":{"title":"POST /api/v1/cfo-projection/scenarios","version":"1.0.0","description":"Create scenario"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/cfo-projection/scenarios":{"post":{"tags":["cfo-projection"],"summary":"Create scenario","description":"Create a new projection scenario. Drivers are auto-seeded from trailing actuals when omitted.","operationId":"create_scenario_api_v1_cfo_projection_scenarios_post","parameters":[{"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"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScenarioCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScenarioResponse"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"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":{"CostClassification":{"type":"string","enum":["var","fix"],"title":"CostClassification","description":"Whether a cost line scales with revenue or is a flat run rate."},"FixedDriverValue":{"properties":{"base":{"type":"integer","title":"Base","description":"Base $/month in cents","default":0},"esc":{"type":"number","title":"Esc","description":"Annual escalation rate, e.g. 0.03 = 3%","default":0.0}},"type":"object","title":"FixedDriverValue"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"RevenueDriverValue":{"properties":{"growth":{"type":"number","title":"Growth","description":"MoM compound growth rate, e.g. 0.10 = 10%","default":0.0}},"type":"object","title":"RevenueDriverValue"},"ScenarioCreateRequest":{"properties":{"name":{"type":"string","maxLength":255,"title":"Name","default":"Default Projection"},"base_month":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Base Month","description":"Last month of actuals; defaults to most recent closed month"},"projection_months":{"type":"integer","maximum":60.0,"minimum":1.0,"title":"Projection Months","default":24},"revenue_drivers":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/RevenueDriverValue"},"type":"object"},{"type":"null"}],"title":"Revenue Drivers"},"cost_classifications":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/CostClassification"},"type":"object"},{"type":"null"}],"title":"Cost Classifications"},"variable_drivers":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/VariableDriverValue"},"type":"object"},{"type":"null"}],"title":"Variable Drivers"},"fixed_drivers":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/FixedDriverValue"},"type":"object"},{"type":"null"}],"title":"Fixed Drivers"},"monthly_overrides":{"anyOf":[{"additionalProperties":{"additionalProperties":{"type":"integer"},"type":"object"},"type":"object"},{"type":"null"}],"title":"Monthly Overrides","description":"Manual monthly overrides keyed by ledger_id then month index"},"tax_rate":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Tax Rate"},"interest_income_monthly":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Interest Income Monthly"},"interest_expense_monthly":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Interest Expense Monthly"}},"type":"object","title":"ScenarioCreateRequest","description":"Create a new projection scenario. Drivers are optional — the service\nwill seed defaults from trailing actuals when omitted."},"ScenarioResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"name":{"type":"string","title":"Name"},"is_active":{"type":"boolean","title":"Is Active"},"base_month":{"type":"string","format":"date","title":"Base Month"},"projection_months":{"type":"integer","title":"Projection Months"},"revenue_drivers":{"additionalProperties":{"$ref":"#/components/schemas/RevenueDriverValue"},"type":"object","title":"Revenue Drivers"},"cost_classifications":{"additionalProperties":{"type":"string"},"type":"object","title":"Cost Classifications"},"variable_drivers":{"additionalProperties":{"$ref":"#/components/schemas/VariableDriverValue"},"type":"object","title":"Variable Drivers"},"fixed_drivers":{"additionalProperties":{"$ref":"#/components/schemas/FixedDriverValue"},"type":"object","title":"Fixed Drivers"},"monthly_overrides":{"additionalProperties":{"additionalProperties":{"type":"integer"},"type":"object"},"type":"object","title":"Monthly Overrides"},"tax_rate":{"type":"number","title":"Tax Rate"},"interest_income_monthly":{"type":"integer","title":"Interest Income Monthly"},"interest_expense_monthly":{"type":"integer","title":"Interest Expense Monthly"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","business_id","name","is_active","base_month","projection_months","tax_rate","interest_income_monthly","interest_expense_monthly","created_at","updated_at"],"title":"ScenarioResponse","description":"Full scenario including all persisted drivers."},"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"},"VariableDriverValue":{"properties":{"pct_rev":{"type":"number","title":"Pct Rev","description":"Fraction of projected revenue, e.g. 0.085","default":0.0}},"type":"object","title":"VariableDriverValue"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}