Manage custom expense types

Manage custom expense types

As a farmer I want to be able to add, use, and remove types of expenses that are useful for my particular operations so that I can accurately mirror and understand my operations financially

 

Screens

Mockups (see Finances tab, Manage custom expense types section)

 

Requirements

Must have

 

Nice to have

  • Spotlight for managing expense types on updated multi-select expense type view

  • Search bar for expense types

  • Filter for default / custom expense types

  • Edit custom expense type

  • Customize an icon for a custom expense type

  • Migration of all expense types of type “Other” to be custom expense types

    • Whomever takes this, if we get this far, please check with @David Trapp (Unlicensed) before completing.

 

Shouldn’t have

 

Other context

Closely follows the pattern for custom task types - check that functionality out first!


We’ve eschewed the term “categories” in favour of “types” throughout finances. Any time you see “categories”, it’s out of date and should be replaced. Logic for this:

  • Types is shorter than categories in most of our supported languages

  • farmExpenseType table already exists - reducing tech debt


Changes to the model are hopefully minimal in this epic (though this isn’t the case for https://lite-farm.atlassian.net/wiki/spaces/LITEFARM/pages/1339228177 - so take note of the structures for that upcoming epic). farmExpense and farmExpenseType tables already exist in the database.

  • For farmExpenseType, should use the existing convention around NULL or populated farm_id as to whether the type belongs to a specific farm or is universal


Discussion on Sep 22, 2023 -

Decision to retain “Miscellaneous” described here:https://lite-farm.atlassian.net/wiki/spaces/LITEFARM/pages/1361674242


For retired expense types:

These treatments are not in scope for this epic, but are helpful in framing future work in the https://lite-farm.atlassian.net/wiki/spaces/LITEFARM/pages/1333198854 module.


When creating a new expense type, we should …

  • Check if the exact name and farm_id exist in the database and if so, don’t POST a new one but just set delete = FALSE


Should we have a separate section for retired expense types where they can be “un-retired”?

Not initially. We’ll do a check a few months after releasing this feature to see if that is a use case we need to support.