turash/models/cost/cost.go
Damir Mukimov cdca1ea1a7
Reorganize funding programs and create application documents
- Reorganized funding program structure: moved standalone .md files into organized directories with PROGRAM_INFO.md and APPLICATION_SCOPE.md
- Created budget files for selected priority programs:
  * EIC Accelerator: budget_breakdown.csv and budget_justification.md (€1.815M)
  * ZIM: budget_breakdown.csv and budget_justification.md (€465k)
  * DBU: budget_breakdown.csv and budget_justification.md (€152.5k)
  * LIFE Programme: budget_breakdown.csv and budget_justification.md (€1.815M)
- Created team CV files for all selected programs (CV_Damir_Mukimov.md)
- Added application documents structure:
  * funding/applications/budget/ - Master budget files and templates
  * funding/applications/team_cvs/ - Master CV and team expertise summary
- Updated FUNDING_GAP_ANALYSIS.md to reflect completed documents
- Added APPLICATION_REQUIREMENTS_REPORT.md with detailed requirements
- Added PREPARATION_PRIORITY.md for application preparation workflow
2025-11-01 09:59:48 +01:00

63 lines
2.4 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package cost
import (
"github.com/damirmukimov/city_resource_graph/models/params"
"github.com/damirmukimov/city_resource_graph/models/team"
)
// 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)
Team team.TeamComposition `json:"team"` // Team composition breakdown
PersonnelCosts float64 `json:"personnel_costs"` // Total personnel costs (EUR/year)
}
// CalculateCosts computes all cost components for a given year.
func CalculateCosts(year int, p *params.Params) CostBreakdown {
cp := p.Costs
// Calculate team costs using team structure
salaries := team.DefaultSalaries()
personnelCosts, teamComposition := team.CalculateTeamCostsFromParams(year, p, salaries)
// Legacy calculation for backward compatibility
// Engineering costs = engineers × salary
engineers := cp.Engineers.GetYear(year)
engineering := float64(engineers) * cp.EngineerSalary
// Use team-based calculation if team structure is available
// Otherwise fall back to legacy calculation
if personnelCosts > 0 {
engineering = personnelCosts
}
// Infrastructure costs (from params)
infrastructure := cp.Infrastructure.GetYear(year)
// Marketing & sales costs (from params)
// Note: BD/Sales are now included in team costs, but we keep this
// for backward compatibility with existing params.yaml
marketingSales := cp.MarketingSales.GetYear(year)
// Operations costs (from params)
// Note: Operations staff are now included in team costs, but we keep this
// for backward compatibility with existing params.yaml
operations := cp.Operations.GetYear(year)
total := engineering + infrastructure + marketingSales + operations
return CostBreakdown{
Engineering: engineering,
Infrastructure: infrastructure,
MarketingSales: marketingSales,
Operations: operations,
Total: total,
Team: teamComposition,
PersonnelCosts: personnelCosts,
}
}