feat(ui): 實裝資產流水下鑽明細表格及行內 CRUD 操作

This commit is contained in:
2026-04-29 00:21:16 +08:00
parent 1c6c36b147
commit 574d27968d
4 changed files with 394 additions and 60 deletions
+6
View File
@@ -41,9 +41,11 @@ interface Position {
}
interface TransactionRecord {
id: string;
txType: string;
quantity: string;
price: string;
fee: string;
txCurrency: string;
executedAt: Date | null;
}
@@ -137,9 +139,11 @@ function getTodayInShanghai(): Date {
export async function getPortfolioPositions(): Promise<Position[]> {
const allTransactions = await db
.select({
id: transactions.id,
txType: transactions.txType,
quantity: transactions.quantity,
price: transactions.price,
fee: transactions.fee,
exchangeRate: transactions.exchangeRate,
txCurrency: transactions.txCurrency,
assetId: transactions.assetId,
@@ -279,9 +283,11 @@ export async function getPortfolioPositions(): Promise<Position[]> {
}
holding.transactions.push({
id: tx.id,
txType: tx.txType,
quantity: tx.quantity,
price: tx.price,
fee: tx.fee,
txCurrency: tx.txCurrency,
executedAt: tx.executedAt,
});