package cost import ( "github.com/damirmukimov/city_resource_graph/models/params" ) // CostBreakdown represents all cost components for a given year. type CostBreakdown struct { Engineering float64 `json:"engineering"` // Engineering costs (EUR/year) Infrastructure float64 `json:"infrastructure"` // Infrastructure costs (EUR/year) MarketingSales float64 `json:"marketing_sales"` // Marketing & sales costs (EUR/year) Operations float64 `json:"operations"` // Operations costs (EUR/year) Total float64 `json:"total"` // Total costs (EUR/year) } // CalculateCosts computes all cost components for a given year. func CalculateCosts(year int, p *params.Params) CostBreakdown { cp := p.Costs // Engineering costs = engineers × salary engineers := cp.Engineers.GetYear(year) engineering := float64(engineers) * cp.EngineerSalary // Infrastructure costs (from params) infrastructure := cp.Infrastructure.GetYear(year) // Marketing & sales costs (from params) marketingSales := cp.MarketingSales.GetYear(year) // Operations costs (from params) operations := cp.Operations.GetYear(year) total := engineering + infrastructure + marketingSales + operations return CostBreakdown{ Engineering: engineering, Infrastructure: infrastructure, MarketingSales: marketingSales, Operations: operations, Total: total, } }