refactor(portfolio): retire completed migrations

This commit is contained in:
2026-07-21 17:13:19 +07:00
parent 6fe91f0e4e
commit dbe0c9ca70
19 changed files with 205 additions and 1170 deletions
+5 -8
View File
@@ -101,14 +101,11 @@ Successful GIF replies include the result behind Telegram spoiler formatting.
> counts and creates indexes on startup. Deleted legacy command rows are
> retained with `deleted: true`; `/stats` queries filter those rows from visible
> results. A historical `system` collection may remain in MongoDB with completed
> migration records. Stock stores cash as `vnd`; coin stores cash as `usd`.
> Both embed positions as
> `assets.<symbol>.{quantity,base,dividendCheckedAt}`. On every startup, enabled
> paper-trading modules verify this shape and migrate the previous flat
> `assets`/`costBasis` documents before Telegram handlers are installed. The bot
> intentionally fails startup if validation or a migration write fails.
> Completed records remain in `system` as audit history, but do not suppress
> later invariant scans.
> migration records. Stock stores cash as `vnd` and embeds positions as
> `assets.<symbol>.{quantity,base,dividendCheckedAt}`. Coin stores cash as `usd`
> and embeds positions as `assets.<symbol>.{quantity,base}`. Completed migration
> records remain in `system` as audit history; the completed one-time migration
> code no longer runs at startup.
## 2. Coolify