summaryrefslogtreecommitdiff
path: root/backend/app/services/data_service.py
diff options
context:
space:
mode:
authorTyler Hoang <tyler@tylerhoang.xyz>2026-05-18 23:59:37 -0700
committerTyler Hoang <tyler@tylerhoang.xyz>2026-05-18 23:59:37 -0700
commit38f8664eccd7738855918fff0537335f7238a006 (patch)
treeac3b3cbbc742115482487c3ce6cd4394fa9fcd63 /backend/app/services/data_service.py
parent66cfb26ebd8fa44b24e37b4ffc796ab29dcbd704 (diff)
feat: add projection_years to DcfResult schema and service output
Add projection_years: int = 5 field to the DcfResult Pydantic schema and emit it from the data_service.get_valuation() function across all three dcf_out cases (unavailable, error, and successful). This enables frontend DCF sliders to know the default projection horizon. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'backend/app/services/data_service.py')
-rw-r--r--backend/app/services/data_service.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/backend/app/services/data_service.py b/backend/app/services/data_service.py
index f913ec5..9662227 100644
--- a/backend/app/services/data_service.py
+++ b/backend/app/services/data_service.py
@@ -505,9 +505,9 @@ def get_valuation(symbol: str) -> dict:
)
if not dcf_raw:
- dcf_out: dict = {"available": False, "wacc": 0.10, "terminal_growth": 0.03}
+ dcf_out: dict = {"available": False, "wacc": 0.10, "terminal_growth": 0.03, "projection_years": 5}
elif "error" in dcf_raw:
- dcf_out = {"available": True, "error": dcf_raw["error"], "wacc": 0.10, "terminal_growth": 0.03}
+ dcf_out = {"available": True, "error": dcf_raw["error"], "wacc": 0.10, "terminal_growth": 0.03, "projection_years": 5}
else:
dcf_out = {
"available": True,
@@ -523,6 +523,7 @@ def get_valuation(symbol: str) -> dict:
"base_fcf": dcf_raw.get("base_fcf"),
"wacc": 0.10,
"terminal_growth": 0.03,
+ "projection_years": 5,
}
common = dict(