mutual-fund / USEME.MD
lucifer7210's picture
Upload 3 files
a7ae94c verified
Here are sample inputs for the key POST endpoints in the FastAPI backend:
### 1. POST `/api/v1/funds/sip-calculate`
**Request Body:**
```json
{
"monthly_amount": 10000,
"annual_return": 12.0,
"years": 10
}
```
### 2. POST `/api/v1/funds/required-sip`
**Request Body:**
```json
{
"target_amount": 5000000,
"years": 15,
"expected_return": 12.0
}
```
### 3. POST `/api/v1/funds/analyze`
**Request Body:**
```json
{
"fund_names": ["HDFC Top 100 Fund", "SBI Bluechip Fund"],
"investment_amount": 100000,
"start_date": "2023-01-01T00:00:00",
"end_date": "2024-01-01T00:00:00"
}
```
### 4. POST `/api/v1/portfolio/metrics`
**Request Body:**
```json
{
"holdings": {
"HDFC Top 100 Fund": {
"scheme_code": "120503",
"category": "Large Cap Equity",
"fund_house": "HDFC Mutual Fund",
"invested_amount": 50000,
"current_value": 58000,
"units": 500,
"current_nav": 116.0,
"investment_type": "SIP (Monthly)",
"nav_data": []
},
"SBI Small Cap Fund": {
"scheme_code": "122639",
"category": "Small Cap Equity",
"fund_house": "SBI Mutual Fund",
"invested_amount": 30000,
"current_value": 35000,
"units": 300,
"current_nav": 116.67,
"investment_type": "SIP (Monthly)",
"nav_data": []
}
}
}
```
### 5. POST `/api/v1/goals/dashboard`
**Request Body:**
```json
{
"goals": [
{
"name": "Child's Education",
"amount": 2000000,
"inflation_adjusted_amount": 4781564.0,
"years": 15,
"priority": "High",
"required_sip": 10000,
"expected_inflation": 6.0,
"id": 0
},
{
"name": "Retirement",
"amount": 5000000,
"inflation_adjusted_amount": 11953910.0,
"years": 25,
"priority": "Critical",
"required_sip": 15000,
"expected_inflation": 6.0,
"id": 1
}
],
"monthly_savings": 80000
}
```
### 6. POST `/api/v1/goals/inflation-adjusted`
**Request Body:**
```json
{
"target_amount": 1000000,
"years": 10,
"expected_inflation": 6.0
}
```
### 7. POST `/api/v1/ai/analyze`
**Request Body:**
```json
{
"client_profile": {
"age": 35,
"monthly_income": 50000,
"risk_tolerance": "Moderate",
"investment_experience": "Intermediate",
"tax_bracket": "20%",
"monthly_savings": 15000
},
"portfolio_data": {
"holdings": ["HDFC Top 100 Fund", "SBI Small Cap Fund"],
"categories": ["Large Cap Equity", "Small Cap Equity"],
"total_value": 93000,
"total_invested": 80000,
"total_gains": 13000,
"category_allocation": {
"Large Cap Equity": 62.37,
"Small Cap Equity": 37.63
}
},
"goals_data": {
"goals": ["Child's Education", "Retirement"],
"goal_details": [
{
"name": "Child's Education",
"amount": 2000000,
"inflation_adjusted_amount": 4781564.0,
"years": 15,
"priority": "High",
"required_sip": 10000,
"expected_inflation": 6.0,
"id": 0
},
{
"name": "Retirement",
"amount": 5000000,
"inflation_adjusted_amount": 11953910.0,
"years": 25,
"priority": "Critical",
"required_sip": 15000,
"expected_inflation": 6.0,
"id": 1
}
],
"total_required_sip": 25000,
"timeline_range": "15-25 years",
"priority_goals": [
{
"name": "Retirement",
"amount": 5000000,
"inflation_adjusted_amount": 11953910.0,
"years": 25,
"priority": "Critical",
"required_sip": 15000,
"expected_inflation": 6.0,
"id": 1
}
]
},
"analysis_focus": ["Fund Selection", "Risk Assessment", "Goal Alignment"],
"market_conditions": "Neutral",
"investment_horizon": "Medium Term (3-7 years)"
}
```
### 8. POST `/api/v1/ai/fund-selection`
**Request Body:**
```json
{
"client_profile": {
"age": 35,
"monthly_income": 50000,
"risk_tolerance": "Moderate",
"investment_experience": "Intermediate",
"tax_bracket": "20%",
"monthly_savings": 15000
},
"goals_data": {
"goals": ["Child's Education", "Retirement"],
"goal_details": [
{
"name": "Child's Education",
"amount": 2000000,
"inflation_adjusted_amount": 4781564.0,
"years": 15,
"priority": "High",
"required_sip": 10000,
"expected_inflation": 6.0,
"id": 0
},
{
"name": "Retirement",
"amount": 5000000,
"inflation_adjusted_amount": 11953910.0,
"years": 25,
"priority": "Critical",
"required_sip": 15000,
"expected_inflation": 6.0,
"id": 1
}
],
"total_required_sip": 25000,
"timeline_range": "15-25 years",
"priority_goals": [
{
"name": "Retirement",
"amount": 5000000,
"inflation_adjusted_amount": 11953910.0,
"years": 25,
"priority": "Critical",
"required_sip": 15000,
"expected_inflation": 6.0,
"id": 1
}
]
},
"market_conditions": "Neutral",
"investment_horizon": "Medium Term (3-7 years)"
}
```
### 9. POST `/api/v1/ai/risk-assessment`
**Request Body:**
```json
{
"client_profile": {
"age": 35,
"monthly_income": 50000,
"risk_tolerance": "Moderate",
"investment_experience": "Intermediate",
"tax_bracket": "20%",
"monthly_savings": 15000
},
"portfolio_data": {
"holdings": ["HDFC Top 100 Fund", "SBI Small Cap Fund"],
"categories": ["Large Cap Equity", "Small Cap Equity"],
"total_value": 93000,
"total_invested": 80000,
"total_gains": 13000,
"category_allocation": {
"Large Cap Equity": 62.37,
"Small Cap Equity": 37.63
}
},
"market_conditions": "Neutral"
}
```
### 10. POST `/api/v1/ai/goal-planning`
**Request Body:**
```json
{
"client_profile": {
"age": 35,
"monthly_income": 50000,
"risk_tolerance": "Moderate",
"investment_experience": "Intermediate",
"tax_bracket": "20%",
"monthly_savings": 15000
},
"goals_data": {
"goals": ["Child's Education", "Retirement"],
"goal_details": [
{
"name": "Child's Education",
"amount": 2000000,
"inflation_adjusted_amount": 4781564.0,
"years": 15,
"priority": "High",
"required_sip": 10000,
"expected_inflation": 6.0,
"id": 0
},
{
"name": "Retirement",
"amount": 5000000,
"inflation_adjusted_amount": 11953910.0,
"years": 25,
"priority": "Critical",
"required_sip": 15000,
"expected_inflation": 6.0,
"id": 1
}
],
"total_required_sip": 25000,
"timeline_range": "15-25 years",
"priority_goals": [
{
"name": "Retirement",
"amount": 5000000,
"inflation_adjusted_amount": 11953910.0,
"years": 25,
"priority": "Critical",
"required_sip": 15000,
"expected_inflation": 6.0,
"id": 1
}
]
},
"investment_horizon": "Medium Term (3-7 years)"
}
```
### 11. POST `/api/v1/portfolio/rebalance`
**Request Body:**
```json
{
"holdings": {
"HDFC Top 100 Fund": {
"scheme_code": "120503",
"category": "Large Cap Equity",
"fund_house": "HDFC Mutual Fund",
"invested_amount": 50000,
"current_value": 58000,
"units": 500,
"current_nav": 116.0,
"investment_type": "SIP (Monthly)",
"nav_data": []
},
"SBI Small Cap Fund": {
"scheme_code": "122639",
"category": "Small Cap Equity",
"fund_house": "SBI Mutual Fund",
"invested_amount": 30000,
"current_value": 35000,
"units": 300,
"current_nav": 116.67,
"investment_type": "SIP (Monthly)",
"nav_data": []
}
}
}
```
### 12. POST `/api/v1/portfolio/performance`
**Request Body:**
```json
{
"holdings": {
"HDFC Top 100 Fund": {
"scheme_code": "120503",
"category": "Large Cap Equity",
"fund_house": "HDFC Mutual Fund",
"invested_amount": 50000,
"current_value": 58000,
"units": 500,
"current_nav": 116.0,
"investment_type": "SIP (Monthly)",
"nav_data": []
},
"SBI Small Cap Fund": {
"scheme_code": "122639",
"category": "Small Cap Equity",
"fund_house": "SBI Mutual Fund",
"invested_amount": 30000,
"current_value": 35000,
"units": 300,
"current_nav": 116.67,
"investment_type": "SIP (Monthly)",
"nav_data": []
}
}
}
```
These sample inputs cover all the major POST endpoints in the FastAPI backend. Each request includes realistic data that matches the expected Pydantic models for each endpoint. You can use these samples to test the API endpoints directly or integrate them with your Streamlit frontend.