Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to "merge" transactions #285

Open
letehaha opened this issue Jan 21, 2024 · 0 comments
Open

Ability to "merge" transactions #285

letehaha opened this issue Jan 21, 2024 · 0 comments
Assignees
Labels
priority-4-lowest question Further information is requested repo: backend Related to back-end repo: frontend Related to front-end type::enhancement New feature or request type::epic Epic. Big issue which containes sub-issues UX improvement Something that improves the overall UX

Comments

@letehaha
Copy link
Owner

letehaha commented Jan 21, 2024

Implementation detail

Once the user decides to merge transactions A,B,C we need to do the following things:

  1. Validate that they have the same flow – we cannot merge income with expense, only same-type. Or not? If not, then we can implement a "refund" functionality when income overrides expense so that stats are not affected. But that might heavily degrade SQL query performance.

  2. Generate a unique mergeId and add it to the Transaction model (need to update DB structure).

  3. Do the actual merge. Create a new "merge" transaction or just keep them as is, and when API returns transactions list, also include all transactions with the same mergeId, so it can be merged. Or merge it on the API side and simply return a synthetic transaction? Might be bad from API design and DX experience since it adds business logic to the response.

The possible flow:
When merging, "archive" all related transactions, add them mergeId to be able to find all related txs, and create a brand-new transaction that will represent the result of the merge. That way we don't need to store olds values in some new way. Also it will be super easy to edit the list of transactions used in merge. That means we can still implement the "refund" functionality. Merging might be possible between different accounts, but then to which account a new transaction should be added?

@letehaha letehaha added type::enhancement New feature or request question Further information is requested repo: frontend Related to front-end repo: backend Related to back-end priority-2-medium Medium priority UX improvement Something that improves the overall UX labels Jan 21, 2024
@letehaha letehaha self-assigned this Jan 21, 2024
@letehaha letehaha added the type::epic Epic. Big issue which containes sub-issues label Jan 21, 2024
@letehaha letehaha added priority-4-lowest and removed priority-2-medium Medium priority labels Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-4-lowest question Further information is requested repo: backend Related to back-end repo: frontend Related to front-end type::enhancement New feature or request type::epic Epic. Big issue which containes sub-issues UX improvement Something that improves the overall UX
Projects
None yet
Development

No branches or pull requests

1 participant