turash/concept/schemas/economic_calculation.json
Damir Mukimov 4a2fda96cd
Initial commit: Repository setup with .gitignore, golangci-lint v2.6.0, and code quality checks
- Initialize git repository
- Add comprehensive .gitignore for Go projects
- Install golangci-lint v2.6.0 (latest v2) globally
- Configure .golangci.yml with appropriate linters and formatters
- Fix all formatting issues (gofmt)
- Fix all errcheck issues (unchecked errors)
- Adjust complexity threshold for validation functions
- All checks passing: build, test, vet, lint
2025-11-01 07:36:22 +01:00

97 lines
2.8 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://cityresourcegraph.com/schemas/economic_calculation.json",
"title": "Economic Calculation Request/Response",
"description": "Schema for economic viability calculations",
"type": "object",
"properties": {
"match_id": {
"type": "string",
"format": "uuid",
"description": "Match identifier"
},
"source_resource": {
"$ref": "https://cityresourcegraph.com/schemas/resource_flow.json"
},
"target_resource": {
"$ref": "https://cityresourcegraph.com/schemas/resource_flow.json"
},
"calculations": {
"type": "object",
"properties": {
"annual_savings": {
"type": "number",
"description": "Annual cost savings (€)"
},
"payback_period_years": {
"type": "number",
"minimum": 0,
"description": "Investment payback period"
},
"npv_10_years": {
"type": "number",
"description": "Net present value over 10 years (€)"
},
"irr_percent": {
"type": "number",
"minimum": 0,
"description": "Internal rate of return (%)"
},
"transportation_costs": {
"type": "object",
"properties": {
"annual_cost": {"type": "number"},
"distance_km": {"type": "number"},
"method": {"type": "string"}
}
},
"co2_reduction_tonnes": {
"type": "number",
"minimum": 0,
"description": "Annual CO2 emissions reduction"
},
"implementation_complexity": {
"type": "string",
"enum": ["low", "medium", "high"],
"description": "Technical implementation complexity"
},
"regulatory_requirements": {
"type": "array",
"items": {
"type": "string"
},
"description": "Required permits and approvals"
}
},
"required": ["annual_savings", "payback_period_years"]
},
"assumptions": {
"type": "object",
"properties": {
"discount_rate": {
"type": "number",
"default": 0.08,
"description": "Discount rate for NPV calculations"
},
"operating_hours_year": {
"type": "integer",
"default": 8000,
"description": "Annual operating hours"
},
"maintenance_cost_factor": {
"type": "number",
"default": 0.05,
"description": "Annual maintenance as % of capital cost"
},
"energy_cost_inflation": {
"type": "number",
"default": 0.02,
"description": "Annual energy cost inflation rate"
}
}
}
},
"required": ["source_resource", "target_resource"],
"additionalProperties": false
}