-
Notifications
You must be signed in to change notification settings - Fork 8
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
FR: Register expenses for non-users #4
Comments
Hmm not so sure about that. What if someone is created as a "name only" member and later registers and wants to join as a regular member, ther'd have to be a way to merge them. A solution to taht would be to create personalized invite links, wich are used as "name only" for as long as nobody used them to join. But I feel like this is too complex right now. I'd like to focus on the core features first, since I don't have so much time. But I'd be happy to consider a different approach or even a PR. |
Ok, good points. Maybe you could proceed iteratively. Step 1) Introduce name-only members, which should be simple. Step 2) Allow an admin to transfer name-only transactions to a registered user which might be a little more complex. You know, avoid premature optimization, implement quick wins that are needed now and improve on it later. Step 1) would be very benefitial, even without step 2) I believe. At least in my groups of friends, we trust each other enough that a single person can track expenses but not all want to create yet another account with yet another service. Unfortunately I have no clue about Rust, so I cannot contribute myself, sorry. |
Creating name-only members is not that simple. The database has a table for users and the id of a user is the foreign key for the creditor / debtor of a transaction. Not sure how to handle name-only users right now... This has to be thought out well, so it doesn't lead to a ton of technical debt and problems in the future. |
In OOP-speak, you have a superclass: User and two subclasses: real user and name-only user. There are proven ways to design a DB schema for that, see e.g. here: https://stackoverflow.com/questions/3579079/how-can-you-represent-inheritance-in-a-database In your case, Single Table Inheritance should probably suffice. This should also be the easiest one to add. |
Yea, but I'll still have to change everything to use a member id instead of a user id. Since It's not a User with two subclasses, but a GroupMember with to subclasses (DummyMember and UserMember or something like that). |
But I like this approach, it gives even more flexibility:
|
Ok, I'm not sure where the difference is between member and user. But yeah, this would be the general idea. |
There is a |
Ah, so
Why? Would it not even be better if a name-only user can be used across groups? The actual person could also be in multiple groups so the name-only user should, too. And it would be much simpler to implement. Also if you want to convert them to "real" users at some point, this would be much easier. |
This would make things super complicated. And also has another problem: |
Ok, maybe you caught a case of analysis paralysis there? 😉 If I were you, I'd forget the corner cases right now. You have to decide on one way the feature works and it is ok to be opinionated about it. I would have a user with two types: normal and dummy. Both are in the same table and there is an enum column containing the type. When converting a dummy to a normal user, you just have to change the type and fill some other columns but there is no need to change any other table.
I would forget that. If it turns out, someone wants that, it can be implemented later. Avoid premature optimization.
The admin of the app is the only one who can convert dummys to normal users. Keep it simple. |
There is no admin...
This is an unfortunate approach in my opinion, as it always leads to a ton of technical debt and problems later on. |
Oh. Don't you have users who have more permissions than others? Some who can create/delete groups and some who can only participate?
Yes, that can happen and then the debt must be repaid by refactoring your code. But that is normal. Technical debt is not to be avoided at all cost, it must merely be managed and not allowed to accumulate too much. At least that is how it works best in my experience. Consider what happens if you try to anticipate every requirement beforehand and make lots of effort to fulfill them. And then it turns out, noone needs them in the end but some other things are needed you did not even think about. Then you will have to refactor anyway but you now had twice the effort. Anyway those are just some things I learned along the way, your mileage may vary. |
Nope, I'd like to keep it simple.
That's a fair point. I still want to implement this on the Member-level, tough, because I think, I'll be less work in the long run. Let's agree to disagree here :) |
Sure, absolutely! Didn't wanna push my view, sorry if it came across that way. Also, without a kind of admin user, your approach makes a lot more sense. |
You are right, that should be in a different issue, though. |
It seems like right now, everyone participating in a group must have an account and register their own expenses. But often, there is a single user in a group whom everyone tells what they paid and who keeps track of everything. It would be great if money-balancer would support that.
It would mean adding participants not as users but only as names. And when registering an expense, select one of those names.
The text was updated successfully, but these errors were encountered: