feat(portfolio): nest asset positions

This commit is contained in:
tiennm99 committed 2026-07-21 16:42:33 +07:00
1 parent 7711029f4c
commit 7083079b39
24 files changed
+830 -979

No files matched your search

+8 -6
View File
@@ -101,12 +101,14 @@ 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 and coin documents store `costBasis` by symbol. On
> every startup, enabled paper-trading modules verify that each positive holding
> has a valid basis; legacy holdings are initialized from current quotes before
> Telegram handlers are installed. The bot intentionally fails startup if a
> required quote or 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`; 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.
## 2. Coolify