feat: archive entry type from review, prune stale trades on sync, manual delete
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1835,6 +1835,20 @@ def api_archive_trade_overlay(
|
||||
return {"ok": True, "overlay": out}
|
||||
|
||||
|
||||
@app.delete("/api/archive/trade/{exchange_key}/{trade_id}")
|
||||
def api_archive_trade_delete(exchange_key: str, trade_id: int):
|
||||
from hub_symbol_archive_lib import delete_trade_from_archive
|
||||
|
||||
ex_k = (exchange_key or "").strip().lower()
|
||||
if not ex_k:
|
||||
raise HTTPException(status_code=400, detail="缺少 exchange_key")
|
||||
init_archive_db()
|
||||
removed = delete_trade_from_archive(ex_k, int(trade_id))
|
||||
if not removed:
|
||||
raise HTTPException(status_code=404, detail="档案中无该笔交易")
|
||||
return {"ok": True, "exchange_key": ex_k, "trade_id": int(trade_id)}
|
||||
|
||||
|
||||
@app.post("/api/archive/sync")
|
||||
async def api_archive_sync():
|
||||
body = await _run_archive_sync_once()
|
||||
|
||||
Reference in New Issue
Block a user