Net worth calculation (#508)

* Add classification generated column to account

* Add basic net worth calculation

* Add net worth tests

* Fix lint errors
This commit is contained in:
Zach Gollwitzer
2024-03-04 08:31:22 -05:00
committed by GitHub
parent 19f15e9391
commit facd74f733
12 changed files with 156 additions and 40 deletions

View File

@@ -52,9 +52,9 @@ module ApplicationHelper
def trend_styles(trend)
bg_class, text_class, symbol, icon = case trend.direction
when "up"
trend.type == :liability ? [ "bg-red-500/5", "text-red-500", "+", "arrow-up" ] : [ "bg-green-500/5", "text-green-500", "+", "arrow-up" ]
trend.type == "liability" ? [ "bg-red-500/5", "text-red-500", "+", "arrow-up" ] : [ "bg-green-500/5", "text-green-500", "+", "arrow-up" ]
when "down"
trend.type == :liability ? [ "bg-green-500/5", "text-green-500", "-", "arrow-down" ] : [ "bg-red-500/5", "text-red-500", "-", "arrow-down" ]
trend.type == "liability" ? [ "bg-green-500/5", "text-green-500", "-", "arrow-down" ] : [ "bg-red-500/5", "text-red-500", "-", "arrow-down" ]
when "flat"
[ "bg-gray-500/5", "text-gray-500", "", "minus" ]
else