feat: add budgets
Some checks failed
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Failing after 1m11s

This commit is contained in:
2026-01-01 19:57:47 +01:00
parent d7dbca8242
commit 2b320986fd
9 changed files with 385 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ import (
"os/signal"
"spend-sparrow/internal/account"
"spend-sparrow/internal/authentication"
"spend-sparrow/internal/budget"
"spend-sparrow/internal/core"
"spend-sparrow/internal/dashboard"
"spend-sparrow/internal/handler"
@@ -109,6 +110,7 @@ func createHandlerWithServices(ctx context.Context, d *sqlx.DB, serverSettings *
var router = http.NewServeMux()
authDb := authentication.NewDbSqlite(d)
budgetDb := budget.NewDbSqlite(d)
randomService := core.NewRandom()
clockService := core.NewClock()
@@ -120,6 +122,7 @@ func createHandlerWithServices(ctx context.Context, d *sqlx.DB, serverSettings *
transactionService := transaction.NewService(d, randomService, clockService)
transactionRecurringService := transaction_recurring.NewService(d, randomService, clockService)
dashboardService := dashboard.NewService(d)
budgetService := budget.NewService(budgetDb, randomService, clockService)
render := core.NewRender()
indexHandler := handler.NewIndex(render, clockService)
@@ -129,6 +132,7 @@ func createHandlerWithServices(ctx context.Context, d *sqlx.DB, serverSettings *
treasureChestHandler := treasure_chest.NewHandler(treasureChestService, transactionRecurringService, render)
transactionHandler := transaction.NewHandler(transactionService, accountService, treasureChestService, render)
transactionRecurringHandler := transaction_recurring.NewHandler(transactionRecurringService, render)
budgetHandler := budget.NewHandler(budgetService, render)
go dailyTaskTimer(ctx, transactionService, authService)
@@ -139,6 +143,7 @@ func createHandlerWithServices(ctx context.Context, d *sqlx.DB, serverSettings *
authHandler.Handle(router)
transactionHandler.Handle(router)
transactionRecurringHandler.Handle(router)
budgetHandler.Handle(router)
// Serve static files (CSS, JS and images)
router.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("./static/"))))