feat(ui): 實裝資產流水下鑽明細表格及行內 CRUD 操作
This commit is contained in:
@@ -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,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user