Commit f4bf55a
Ope Olatunji
fix: archive only closed positions, add filters/pagination/detail modal
Archive logic:
- Only archives trades for CLOSED positions (failed, rejected, cancelled, no_wallet)
- Filled trades for positions still held on-chain stay in Trade History
- Filled trades only move to archive when position is sold or market resolved
- Stops emptying the Trade History tab
Archive GET endpoint:
- Added pagination (page, pageSize params)
- Added filters (side, status, search)
- Returns totalPages for pagination UI
Archive display:
- Uses renderFilteredTable with search, filters (Side, Outcome, Status), sort by date
- Clicking a row opens the standard detail modal (same as live trading)
- Shows P&L and Cost columns
- Proper empty state message explaining when trades get archived1 parent 5cb450d commit f4bf55a
File tree
3 files changed
+51
-30
lines changed- src
- admin
- dashboard/pages
3 files changed
+51
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4286 | 4286 | | |
4287 | 4287 | | |
4288 | 4288 | | |
4289 | | - | |
| 4289 | + | |
4290 | 4290 | | |
4291 | 4291 | | |
4292 | 4292 | | |
4293 | 4293 | | |
4294 | 4294 | | |
4295 | | - | |
| 4295 | + | |
| 4296 | + | |
| 4297 | + | |
| 4298 | + | |
| 4299 | + | |
| 4300 | + | |
4296 | 4301 | | |
4297 | 4302 | | |
4298 | 4303 | | |
4299 | 4304 | | |
4300 | 4305 | | |
4301 | 4306 | | |
4302 | | - | |
| 4307 | + | |
4303 | 4308 | | |
4304 | | - | |
4305 | 4309 | | |
4306 | | - | |
4307 | | - | |
4308 | | - | |
| 4310 | + | |
| 4311 | + | |
| 4312 | + | |
| 4313 | + | |
| 4314 | + | |
| 4315 | + | |
| 4316 | + | |
| 4317 | + | |
| 4318 | + | |
| 4319 | + | |
4309 | 4320 | | |
4310 | | - | |
4311 | | - | |
| 4321 | + | |
4312 | 4322 | | |
4313 | 4323 | | |
4314 | 4324 | | |
| |||
4331 | 4341 | | |
4332 | 4342 | | |
4333 | 4343 | | |
4334 | | - | |
| 4344 | + | |
| 4345 | + | |
| 4346 | + | |
| 4347 | + | |
4335 | 4348 | | |
4336 | | - | |
4337 | | - | |
| 4349 | + | |
| 4350 | + | |
4338 | 4351 | | |
4339 | 4352 | | |
4340 | | - | |
| 4353 | + | |
4341 | 4354 | | |
4342 | 4355 | | |
4343 | 4356 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2024 | 2024 | | |
2025 | 2025 | | |
2026 | 2026 | | |
2027 | | - | |
2028 | | - | |
2029 | | - | |
2030 | | - | |
2031 | | - | |
2032 | | - | |
2033 | | - | |
2034 | | - | |
2035 | | - | |
2036 | | - | |
2037 | | - | |
2038 | | - | |
2039 | | - | |
2040 | | - | |
2041 | | - | |
2042 | | - | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
2043 | 2051 | | |
2044 | 2052 | | |
2045 | 2053 | | |
| |||
0 commit comments