Files
links/invest/urls.py
T
OpenClaw Sub-agent 8d05a11eb6 feat(invest): Add investment portfolio management feature
- Portfolio management (MOMO, IBKR personal, IBKR Yanhua)
- Stock holdings with transaction history (buy/sell)
- Weekly AI report generation
- Real-time price cache via Finnhub API
- Dashboard with tree view and performance charts
- REST API with AI-friendly batch update endpoint
- Management command for scheduled report generation

For大哥's personal investment advisor system.
2026-04-18 11:26:48 +10:00

31 lines
1.3 KiB
Python

from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import (
PortfolioViewSet, StockViewSet, TransactionViewSet,
ReportViewSet, QuotesView, AIUpdateView,
)
from . import template_views
router = DefaultRouter()
router.register(r'portfolios', PortfolioViewSet, basename='invest-portfolio')
router.register(r'stocks', StockViewSet, basename='invest-stock')
router.register(r'transactions', TransactionViewSet, basename='invest-transaction')
router.register(r'reports', ReportViewSet, basename='invest-report')
# API URL patterns (mounted at /api/invest/ in core/urls.py)
api_urlpatterns = [
path('', include(router.urls)),
path('quotes/', QuotesView.as_view(), name='invest-quotes'),
path('ai-update/', AIUpdateView.as_view(), name='invest-ai-update'),
]
# Template URL patterns (mounted at /invest/ in core/urls.py)
urlpatterns = [
path('', template_views.dashboard, name='invest-dashboard'),
path('portfolios/<int:pk>/', template_views.portfolio_detail, name='invest-portfolio-detail'),
path('portfolios/<int:pk>/transactions/', template_views.portfolio_transactions, name='invest-portfolio-transactions'),
path('reports/', template_views.reports_list, name='invest-reports'),
path('reports/<int:pk>/', template_views.report_detail, name='invest-report-detail'),
]