5454router = APIRouter (prefix = "/v1/graphs" , tags = ["Graphs" ])
5555
5656# Surfaced to prospects at graph-creation time, so these describe only what is
57- # built. Both are read twice below — the schema-loading path and its fallback —
58- # and single-sourcing them here is what keeps the two copies from diverging.
57+ # built. All three are read twice below — the schema-loading path and its
58+ # fallback — and single-sourcing them here is what keeps the copies from
59+ # diverging.
60+ _DISPLAY_NAMES = {
61+ "roboledger" : "RoboLedger - Accounting & Financial Reporting" ,
62+ "roboinvestor" : "RoboInvestor - Investment Management" ,
63+ }
64+
5965_ROBOLEDGER_DESCRIPTION = (
6066 "Complete accounting system with XBRL reporting and GL transactions. "
6167 "Context-aware: SEC repositories get reporting-only tables, "
@@ -538,12 +544,6 @@ async def get_available_extensions(
538544 f"Extension { ext_info ['name' ]} : available={ ext_info .get ('available' , False )} "
539545 )
540546 if ext_info ["available" ]:
541- # Get display names for extensions
542- display_names = {
543- "roboledger" : "RoboLedger - Accounting & Financial Reporting" ,
544- "roboinvestor" : "RoboInvestor - Investment Management" ,
545- }
546-
547547 # Try to get actual node/relationship counts
548548 try :
549549 from robosystems .schemas .loader import (
@@ -577,7 +577,7 @@ async def get_available_extensions(
577577 available_extensions .append (
578578 {
579579 "name" : ext_info ["name" ],
580- "display_name" : display_names .get (
580+ "display_name" : _DISPLAY_NAMES .get (
581581 ext_info ["name" ], ext_info ["name" ].title ()
582582 ),
583583 "description" : description , # Use the correctly set description
@@ -589,7 +589,10 @@ async def get_available_extensions(
589589 # Convert dictionaries to AvailableExtension objects
590590 extension_objects = [
591591 AvailableExtension (
592- name = str (ext ["name" ]), description = str (ext ["description" ]), enabled = False
592+ name = str (ext ["name" ]),
593+ display_name = str (ext ["display_name" ]),
594+ description = str (ext ["description" ]),
595+ enabled = False ,
593596 )
594597 for ext in available_extensions
595598 ]
@@ -605,11 +608,13 @@ async def get_available_extensions(
605608 extensions = [
606609 AvailableExtension (
607610 name = "roboledger" ,
611+ display_name = _DISPLAY_NAMES ["roboledger" ],
608612 description = _ROBOLEDGER_DESCRIPTION ,
609613 enabled = False ,
610614 ),
611615 AvailableExtension (
612616 name = "roboinvestor" ,
617+ display_name = _DISPLAY_NAMES ["roboinvestor" ],
613618 description = _ROBOINVESTOR_DESCRIPTION ,
614619 enabled = False ,
615620 ),
0 commit comments