feat(portfolio): nest asset positions

This commit is contained in:
2026-07-21 16:42:33 +07:00
parent 1c6e0ad8a0
commit 6fe91f0e4e
24 changed files with 830 additions and 979 deletions
+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