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

Tracking payments by others, debts, budgeting #9

Closed
Sha-yol opened this issue Sep 14, 2024 · 16 comments
Closed

Tracking payments by others, debts, budgeting #9

Sha-yol opened this issue Sep 14, 2024 · 16 comments

Comments

@Sha-yol
Copy link
Contributor

Sha-yol commented Sep 14, 2024

The main selling point of Firefly (hence FF) for me was the budgeting (besides self hosting).
Budgeting doesn't work with Splitwise (hence SW) - if I pay 10 for groceries, but split it with my roommate, only my share - 5 - should come out of my groceries budget. However, if I want FF to actually match money moving out of my account, and match transactions to my bank statement - well, there will be a transaction of 10 to the grocery store, so FF should have a txn for 10.
Complication 1: I payed 10, but my actual assets should have decreased only by 5 - since my roommate now owes me 5 for the groceries.
Complication 2: my roommate is the one who bought groceries. Currently, if my roommate hasn't added the special comment, nothing will happen on my FF, and indeed no money moved out of my account. However, I have used up some of my groceries budget, and my total assets should have decreased by the same amount, since I owe my roommate my share.

I suggest resolving all of those in one fell swoop:

  1. Create another asset account to hold SW balance.
  2. If I payed 10 and my share is 5:
    1. create a split txn on FF: one part titled with the original SW description, the other part titled "splitwise loan" or something like that. Then, I can manually (or using FF rules) take my share from the relevant budget.
    2. create a deposit to SW balance account, either from my roommate's account or from generic "Splitwise" account
  3. If I payed 0 and my share is 5:
    1. Do not create a transaction from my real accounts, since no money moved.
    2. Create a withdrawal from the "SW balance" account. Can manually subtract it from relevant budget.
  4. Combo: I payed less than my share. Roommate was short on cash, they payed 7, I payed 3, my share was 5.
    1. Create withdrawal from account for 3.
    2. Create withdrawal from SW balance account for 2.

This would require a major overhaul of the transaction creation, and updating would require tracking several transactions on FF.
Thoughts on this proposed solution?

@adyanth
Copy link
Owner

adyanth commented Sep 14, 2024

Thanks for creating the issue, this is something I experience as well. For the problem 2, I just add a comment when I get a notification that someone split an expense with me.

1 is complicated as you note, causing multiple transactions to be handled, and also requiring to check settle up information to remove those (which might also vary since one friend might send it to a bank account vs another who might send it to a mobile wallet for example).

I like the idea of a splitwise balance (asset? loan?) account (this would need to be behind a feature switch, I would not assume others following that workflow) and what you propose.

PS: Also remember that you can add budget along with category if you so need from the text (without falling back to FF rules), it would be a simple code change to do that.

@Sha-yol
Copy link
Contributor Author

Sha-yol commented Sep 30, 2024

Alright, so I'll leave complication 2 as it is, and I'll solve it by adding a comment myself.

Re settle up information: I don't think settle up should complicate things - not sure how it's represented on SW, but a settlement is simply a transaction, no?

  • If we settle by me paying my friend: add a transfer txn from my account to the splitwise balance account on FF. Actual money has left my account, but my total assets haven't decreased, since I was paying off a debt.
  • The reverse happens if we settle by my friend paying me: a transfer from the splitwise balance account to my asset account. Actual money entered my account, but my total assets haven't changed.

Re adding budget with comment: does the current comment parsing support that? Or would that require a change to the parsing?

@adyanth
Copy link
Owner

adyanth commented Oct 1, 2024

What you describe is right, but which asset account would you select to move money to/from the SW balance account?

For budget, I meant mapping categories to budgets in the sync using a lookup config, since an expense category is unlikely to change budgets.

@Sha-yol
Copy link
Contributor Author

Sha-yol commented Oct 7, 2024

  • re settlements: As of current implementation, the syncer skips payments and settlments. We can:
    1. Leave it as it is for the first iteration, and have users add those manually - they will be simpler to add, just a single FF transaction.
    2. Parse comments on those "expenses" using a simpler format, Firefly/account/category, where "account" is the partner of the SW balance account in the transfer.
    3. Use the default account defined in the .env file. Can be combined with option 2.
  • re budget: I actually have diffrent categories and budgets 😅 not sure if its a great idea, but since FF allows it, I wouldn't want to assume that no one else does that.

@adyanth
Copy link
Owner

adyanth commented Oct 7, 2024

I am good with leaving it as is and iterating on it.

Could you give an example of how a single category belongs in different budgets? FF allows it, but if it is not a major use case, it might be good for keeping the syncer simple, but if it is a good use case, then I agree, falling back to FF automation is not a bad idea.

@Sha-yol
Copy link
Contributor Author

Sha-yol commented Oct 8, 2024 via email

@adyanth
Copy link
Owner

adyanth commented Oct 9, 2024

I think that is accurate for using categories and budgets!

@Sha-yol
Copy link
Contributor Author

Sha-yol commented Oct 9, 2024 via email

@Sha-yol
Copy link
Contributor Author

Sha-yol commented Oct 13, 2024

Which is better for implementing the feature switch:
Dependency injection of the switch into processExpense
Or creating an abstract TransactionStrategy class and implementing two classes, one for each behavior? Could be an overkill, but is cleaner and would leave room for other strategies down the line.

@adyanth
Copy link
Owner

adyanth commented Oct 14, 2024

An abc (or a protocol) would be a good way to implement it as you suggest. Although I wouldn't not accept a PR with a boolean switch.

@Sha-yol
Copy link
Contributor Author

Sha-yol commented Nov 19, 2024

Ok. Now that the debt tracker is done, another question: I want to write the split-transaction feature, that splits getPaidShare into a split FF journal, with one txn of amount getOwedShare with the original description and another with of amount getNetBalance with a description like "Splitwise cover" or something. This will allow filing the getOwedShare txn under the appropriate budget.
Here's the question: should it be behind an independent feature switch? Does it make sense to want the split txn feature but not the debt tracker feature? I think it does, but raises the question of how to extend the strategy patten to take that into account. A SWBalanceAndSplitTransactionStrategy, calling the individual strategies? Could work for now since we have only 1 combination of two features, but not sustainable for future optional features.
What do you think?

@adyanth
Copy link
Owner

adyanth commented Nov 22, 2024

The split transaction feature would only work to split the single SW transaction into an owed and paid transaction right? In which case, I do not see what you could do with those transactions without debt tracking. Or maybe I'm mistaken?

@Sha-yol
Copy link
Contributor Author

Sha-yol commented Nov 22, 2024

  • The split txn feature would be for users who want to accurately track the actual txn amounts made out of their bank accounts, and also track which part of those txns is out of budget and which part is for coverning others.
  • The debt tracking feature is for users who want the net worth number be equal their real net worth, including money owed on SW transactions.

In theory, those two groups could be different, don't you think? In practice, it would make implementation much easier to assume they are the same :)

@adyanth
Copy link
Owner

adyanth commented Nov 22, 2024

Haha I see. I would leave that up to you; I don't have a preference either way.

There might be additional questions around the first case. What happens with the covering for others expenses if you do not have debt tracking?

@Sha-yol
Copy link
Contributor Author

Sha-yol commented Nov 22, 2024

Ok, now that I think of it, these features make sense separately only for transactions which I payed for, not for txns made by others.
If I want to budget transactions that others made, I must have the SW balance feature. Since my motivation for splitting the txns is to allow budgeting, it doesn't make conceptual sense to have split txns without SW balance.

To sum up: I'll continue to add the split txn funcionality behind the current feature switch, without adding another one.

@Sha-yol Sha-yol mentioned this issue Nov 23, 2024
@adyanth
Copy link
Owner

adyanth commented Dec 14, 2024

Closed by #25

@adyanth adyanth closed this as completed Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants