Skip to content
This repository has been archived by the owner on Oct 31, 2021. It is now read-only.

Allow Transaction Modifications #46

Open
elliotcourant opened this issue Mar 16, 2021 · 0 comments
Open

Allow Transaction Modifications #46

elliotcourant opened this issue Mar 16, 2021 · 0 comments

Comments

@elliotcourant
Copy link
Member

Transactions should be able to be modified with a PUT request to /bank_accounts/{bankAccountId}/transactions/{transactionId}.

If a transaction is from a manual link, then the following fields can be modified along with all the fields from the plaid version.

  • Amount
  • OriginalCategories (maybe just make these two fields match or just omit one?)
  • Date
  • AuthorizedDate
  • OriginalName (Same logic with categories, do we want to maintain two fields for this for manual transactions?)
  • IsPending

If a transaction was not created with a manual link, and was imported via Plaid then only the following fields can be modified:

  • ExpenseId
  • Categories
  • Name
  • MerchantName

A transaction cannot change its bank account.

Behaviors for expenses:

  • When an expense is added to a transaction: Update the transaction's expenseId field, deduct the transaction's amount from the expense's current amount (do not go negative).
    • This has an inherent flaw: If a transaction is for $10, and then is spent from an expense with a current amount of $5, the expense's current amount becomes 0. In this moment the safe-to-spend is correct. But if the user were to remove the transaction from that expense; we would have no way of knowing that we should only return $5 of the $10 spent on the transaction to that expense. We would need to keep track of how much money was on the expense before a transaction was allocated to it in order to compensate for this.
  • When a transaction is removed from an expense: Set the transaction's expenseId field to nil, return the amount of money spent from the expense to the expense's current amount. (see note above).
  • When a transaction changes from expense A to B; combine the operations above as described.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request Transactions
Projects
No open projects
Development

No branches or pull requests

1 participant