Topic: Recurring events (income/expenses)


I'm creating an app that lets a user input a recurring income or expense. I'm trying to figure out what the best way is to implement this, keeping both the backend and UX in mind.

One option is with a field like frequency_in_days, which is not ideal because months have different lengths
The other is just daily/weekly/bi-weekly/monthly for instance but also not ideal because users might have different needs

They will most likely also need to supply a starting date... for instance, if my wage gets transferred to my account on the 25th of each month, I don't want it added today and then once per month on the 2nd of that month...

Any tips / tricks are welcome :-)

Re: Recurring events (income/expenses)

One option is to use a non-relational database so you can store arbitrary settings.

Another is to simply have multiple boolean flags int he record for each setting as well as the date (e.g. daily, bi-monthly, bi-weekly, etc).

Re: Recurring events (income/expenses)

I used the Runt gem in a previous project. Worked great.

This also looks good, though I haven't used it. And it appears to be more actively maintained.

Either way, the basic idea is that you can marshal the recurrence object and store it in the db with the recurring object, an expense in your case.

This approach would provide your users with very flexible recurrence rules.