mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 13:19:39 +02:00
perf(transactions): add kind
to Transaction
model and remove expensive Transfer joins in aggregations (#2388)
* add kind to transaction model * Basic transfer creator * Fix method naming conflict * Creator form pattern * Remove stale methods * Tweak migration * Remove BaseQuery, write entire query in each class for clarity * Query optimizations * Remove unused exchange rate query lines * Remove temporary cache-warming strategy * Fix test * Update transaction search * Decouple transactions endpoint from IncomeStatement * Clean up transactions controller * Update cursor rules * Cleanup comments, logic in search * Fix totals logic on transactions view * Fix pagination * Optimize search totals query * Default to last 30 days on transactions page if no filters * Decouple transactions list from transfer details * Revert transfer route * Migration reset * Bundle update * Fix matching logic, tests * Remove unused code
This commit is contained in:
parent
7aca5a2277
commit
1aae00f586
49 changed files with 1749 additions and 705 deletions
|
@ -313,13 +313,13 @@ end
|
|||
accountable: Depository.new
|
||||
)
|
||||
|
||||
transfer = Transfer.from_accounts(
|
||||
from_account: from_account,
|
||||
to_account: to_account,
|
||||
transfer = Transfer::Creator.new(
|
||||
family: @family,
|
||||
source_account_id: from_account.id,
|
||||
destination_account_id: to_account.id,
|
||||
date: Date.current,
|
||||
amount: 100
|
||||
)
|
||||
transfer.save!
|
||||
).create
|
||||
|
||||
get api_v1_transaction_url(transfer.inflow_transaction), headers: api_headers(@api_key)
|
||||
assert_response :success
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue