feat: 新增交易服务,包含交易的增删改查、列表查询(支持筛选和分页)及按日期分组功能。

This commit is contained in:
2026-02-02 15:52:02 +08:00
parent 6dd24864e8
commit a4631eebd2

View File

@@ -29,7 +29,10 @@ function transformTransaction(apiTransaction: Record<string, unknown>): Transact
amount: apiTransaction.amount as number,
type: apiTransaction.type as TransactionType,
categoryId: (apiTransaction.category_id ?? apiTransaction.categoryId) as number,
// Map nested objects if they exist
category: apiTransaction.category as import('../types').Category | undefined,
accountId: (apiTransaction.account_id ?? apiTransaction.accountId) as number,
account: apiTransaction.account as import('../types').Account | undefined,
currency: apiTransaction.currency as CurrencyCode,
transactionDate: (apiTransaction.transaction_date ?? apiTransaction.transactionDate) as string,
note: apiTransaction.note as string | undefined,