Integrate expense sharing and dues tracking into the app
Closed this issue · 5 comments
Currently, the app attempts to integrate Splitwise into the app. The integration is very minimal - it allows for a group to be created, and synced with the active RSVPs in an event. The amount then needs to be manually added to Splitwise and split between all the players. This sort of works, but payments are delayed because many players may not have Splitwise installed and may not get notifications for dues. Also, given that we are using the Splitwise API as the individual interacting with the app on the UI, there's not much more we can do in terms of querying balances, and querying dues for each person, etc.
The method of asking people to pay up and update their name in a WhatsApp message seems to work best in terms of how quickly people pay back. But, it can be quite spammy with long messages being sent back and forth over and over, during a day.
It may be useful to have this payment tracking directly within the app. The workflow could look something like this:
- Allow event creators/admins to add an expense for the event when creating the event or after the event
- The costs are automatically updated and shown to the players
- The admin can confirm that the RSVP list is updated after the event, and intimate people to pay. There could be a button to send out notifications to all the RSVP'd players of an event.
- The event page can let players settle up after they have paid the concerned person.
- The UI can make it easy to send out reminders of the notification, or copy the list of players yet to pay, to drop a message in WA.
The notifications will currently be Email notifications, but we could also implement Web Push notifications #33.
Also,
- The app can also keep track of all the dues for each player, and display warnings or reminders when they come back to the app to RSVP for another event.
- We could also restrict players from RSVP-ing if they have dues more than some minimum amount, and "nudge" people to settle up.
I think it still makes sense to use Splitwise to do the splitting of bills, etc., if only we can get the API to work reasonably.
There's no real "server side", even though Splitwise provides access tokens that don't expire. To list details for a particular group, the user needs to be a part of it, otherwise anyone can list any groups? We could have an "admin" user who creates all the groups for all the events, but it makes the group harder to use because this user would need to be excluded from all transactions. But, if we are able to do that properly, getting information about who owes how much in each app should be pretty easy to do.
- Events could be marked as paid events, and have rules for who can/can't RSVP on paid events. I don't know if we should let admins toggle the paid status, since that would lead to a lot of mess trying to manage the RSVPs.
- The dues can be fetched from Splitwise and updated every so often? Or can be updated (with a cache) each time an event page is opened.
- Notifications could be left to Splitwise. The app could do other things like just showing balance amount reminders and making it harder to RSVP for future events with dues, etc.
- Settling up from the event page would be 🤯
May be we could have one long running Splitwise group for Turf events, monthly events, where we update the costs. This would mean less clutter in terms of number of groups created. But, this would mean the expenses should be added from the RSVP app itself, instead of letting people directly use the Splitwise UI/App, because long running group could have people not participating in the current event.
Currently implemented workflow:
- Admins can create events marked as paid events (currently hidden from the UI, since we are in testing).
- Paid events don't yet create a Splitwise group automatically. There's an option in the UI to do so, as of now. But, this will be changed soon.
- Restrict RSVPs to paid events only to registered users with Splitwise accounts linked. Unregistered guests cannot RSVP, as of now, since managing them on Splitwise is not possible in a clear way.
- Players can RSVP like a normal event, once they link their Splitwise account with RSVP app, if their old dues if any are below a limit, say Rs. 500.
- Expenses for the event need to be directly added on Splitwise. Replicating the UI of Splitwise on our app seems like a wasteful effort, but it may be worth doing for the simplest case where the expense is split across all users.
- Also, note that all groups created via the RSVP app will have an extra user, with the name TIKS Ultimate, which is the account we use to manage these groups. This user needs to be in the group for the RSVP app to have permissions to look at the group and get data from it. So, anyone directly adding expenses on Splitwise should take care not to include this user in the expenses. This may be a good reason to let the RSVP app UI to directly add the simplest expense type where the cost is split among all players.
- When the expenses for an event have been added, currently the admin who added the expenses could inform on WhatsApp how much each person has to pay to whom - especially in the simplest case. In cases with more expenses users can check Splitwise. But, this is easy to change so that the expenses are shown in all future (paid or upaid) events to people.
- The app keep tracks of all the dues of all players, and checks if the dues of a player are below the limit to allow them to RSVP for future paid events.
- When a user is unable to RSVP to an event because they have dues above the limit, they can see in the UI how much they owe to each person (along with their UPI ID, if added on the RSVP profile page) and for which group/event they owe this amount.
TODO:
- Change Splitwise dues limit to an env var and set it to 500(?)
- Add manual steps to connect Splitwise for those worried about permissions. Also show link to remove permissions for app.
- Automatically create new Splitwise group for paid events on event creation. Or may be on the first RSVP.
- Prevent setting events with RSVPs as paid events, if not all users have splitwise_ids.
- Show dues even when below the threshold, on all event pages. Or on the profile page.
- Ensure current user is a Splitwise friend of API user. Just ensuring that user has a Splitwise id is not good enough.
- Add note on what paid events mean in the event creation UI.
- Add an icon to indicate paid events in the UI (event page and event list)
- Fix UPI link to work with WhatsApp Pay, Phone Pe, Google Pay, etc. (It works currently with BHIM app).
- Allow settling up from the UI, where we show the dues?
Closing this issue in favor of creating new smaller issues for specific feature requests.