feat(ledger): 引入 latestPrice 字段与历史成本追踪,实装 P&L 盈亏计算引擎

This commit is contained in:
2026-04-28 00:57:33 +08:00
parent 27c3b76bba
commit b9186d4699
6 changed files with 241 additions and 101 deletions
+1
View File
@@ -20,6 +20,7 @@ export const assets = pgTable("assets", {
symbol: varchar("symbol", { length: 20 }).notNull().unique(),
type: assetTypeEnum("type").notNull(),
baseCurrency: varchar("base_currency", { length: 10 }).notNull(),
latestPrice: numeric("latest_price", { precision: 36, scale: 18 }).default('0').notNull(),
createdAt: timestamp("created_at", { withTimezone: true, mode: "date" })
.defaultNow(),
});