api for initial widgets

This commit is contained in:
Gabe Farrell 2023-04-10 22:39:51 -04:00
parent 36f751a69f
commit 4aa8a2f822
14 changed files with 864 additions and 11 deletions

29
widgets/router.go Normal file
View file

@ -0,0 +1,29 @@
package widgets
import "github.com/go-chi/chi/v5"
func Router() *chi.Mux {
r := chi.NewRouter()
// balance widget
r.Get("/balance", GetBalance)
r.Post("/balance", SetBalance)
// transaction widget
r.Get("/transactions/recent", GetRecentTransactions)
r.Post("/transactions", NewTransaction)
r.Post("/transactions/recurring", NewRecurring)
// budget widget
r.Get("/budget", GetBudget)
r.Post("/budget", SetBudget)
r.Post("/budget/categories", SetCategoryBudget)
// expenses
r.Get("/expenses/month", GetMonthExpenses)
// income
r.Get("/income/month", GetMonthIncome)
return r
}