Skip to content

Commit 83a1fee

Browse files
committed
Refactor code and enhance maintainability.
1 parent 9c5a562 commit 83a1fee

4 files changed

Lines changed: 25 additions & 12 deletions

File tree

‎backend/app.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ def get_market_data(symbol: str) -> Any:
510510
"""Get market data for a symbol"""
511511
try:
512512
symbol = symbol.upper()
513-
timeframe = request.args.get("timeframe", "1d")
513+
request.args.get("timeframe", "1d")
514514
period = request.args.get("period", "30d")
515515

516516
if symbol in MOCK_MARKET_DATA:

‎docker-compose.yml‎

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ services:
1515
ports:
1616
- "${DB_PORT:-5432}:5432"
1717
healthcheck:
18-
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-quantumalpha_user} -d ${DB_NAME:-quantumalpha_db}"]
18+
test:
19+
[
20+
"CMD-SHELL",
21+
"pg_isready -U ${DB_USER:-quantumalpha_user} -d ${DB_NAME:-quantumalpha_db}",
22+
]
1923
interval: 10s
2024
timeout: 5s
2125
retries: 5
@@ -107,7 +111,7 @@ services:
107111
timeout: 10s
108112
retries: 3
109113
start_period: 15s
110-
command: ["python", "data_service/app.py"] # FIX: replaced exec(open()) with direct script path
114+
command: ["python", "data_service/app.py"] # FIX: replaced exec(open()) with direct script path
111115

112116
# ----------------------------------------------------------------
113117
# AI Engine Service
@@ -140,7 +144,7 @@ services:
140144
timeout: 10s
141145
retries: 3
142146
start_period: 15s
143-
command: ["python", "ai_engine/app.py"] # FIX: replaced exec(open()) with direct script path
147+
command: ["python", "ai_engine/app.py"] # FIX: replaced exec(open()) with direct script path
144148

145149
# ----------------------------------------------------------------
146150
# Risk Service
@@ -171,7 +175,7 @@ services:
171175
timeout: 10s
172176
retries: 3
173177
start_period: 15s
174-
command: ["python", "risk_service/app.py"] # FIX: replaced exec(open()) with direct script path
178+
command: ["python", "risk_service/app.py"] # FIX: replaced exec(open()) with direct script path
175179

176180
# ----------------------------------------------------------------
177181
# Execution Service
@@ -202,7 +206,7 @@ services:
202206
timeout: 10s
203207
retries: 3
204208
start_period: 15s
205-
command: ["python", "execution_service/app.py"] # FIX: replaced exec(open()) with direct script path
209+
command: ["python", "execution_service/app.py"] # FIX: replaced exec(open()) with direct script path
206210

207211
# ----------------------------------------------------------------
208212
# Web Frontend
@@ -223,7 +227,15 @@ services:
223227
- quantumalpha-network
224228
restart: unless-stopped
225229
healthcheck:
226-
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost/health"]
230+
test:
231+
[
232+
"CMD",
233+
"wget",
234+
"--quiet",
235+
"--tries=1",
236+
"--spider",
237+
"http://localhost/health",
238+
]
227239
interval: 30s
228240
timeout: 10s
229241
retries: 3
@@ -267,4 +279,4 @@ volumes:
267279

268280
networks:
269281
quantumalpha-network:
270-
driver: bridge
282+
driver: bridge

‎mobile-frontend/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,4 @@
105105
"@testing-library/jest-native/extend-expect"
106106
]
107107
}
108-
}
108+
}

‎mobile-frontend/src/services/api.js‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ api.interceptors.request.use(
3131
},
3232
(error) => {
3333
return Promise.reject(error);
34-
}
34+
},
3535
);
3636

3737
// Response interceptor for handling errors
@@ -75,7 +75,7 @@ api.interceptors.response.use(
7575
}
7676

7777
return Promise.reject(error);
78-
}
78+
},
7979
);
8080

8181
// Auth API
@@ -90,7 +90,8 @@ export const authAPI = {
9090
export const portfolioAPI = {
9191
getPortfolio: () => api.get("/portfolio"),
9292
getPositions: () => api.get("/portfolio/positions"),
93-
getHistory: (timeframe) => api.get(`/portfolio/history?timeframe=${timeframe}`),
93+
getHistory: (timeframe) =>
94+
api.get(`/portfolio/history?timeframe=${timeframe}`),
9495
};
9596

9697
// Market Data API

0 commit comments

Comments
 (0)