feat: extract into remaining packages
All checks were successful
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Successful in 1m19s

There has been a cyclic dependency.
transaction
	-> treasure_chest
	-> transaction_recurring
	-> transaction

This has been temporarily solved by moving the GenerateTransactions
function into the transaction package. In the future, this function has
to be rewritten to use a proper Service insteas of direct DB access or
replaced with a different system entirely.
This commit is contained in:
2025-12-31 22:24:21 +01:00
parent 6de8d8fb10
commit 1be46780bb
29 changed files with 230 additions and 251 deletions

View File

@@ -1,7 +1,9 @@
package account
import "spend-sparrow/internal/template/svg"
import "spend-sparrow/internal/types"
import (
"spend-sparrow/internal/core"
"spend-sparrow/internal/template/svg"
)
templ template(accounts []*Account) {
<div class="max-w-6xl mt-10 mx-auto">
@@ -82,9 +84,9 @@ templ accountItem(account *Account) {
<div class="text-xl flex justify-end gap-4">
<p class="mr-auto">{ account.Name }</p>
if account.CurrentBalance < 0 {
<p class="mr-20 text-red-700">{ types.FormatEuros(account.CurrentBalance) }</p>
<p class="mr-20 text-red-700">{ core.FormatEuros(account.CurrentBalance) }</p>
} else {
<p class="mr-20 text-green-700">{ types.FormatEuros(account.CurrentBalance) }</p>
<p class="mr-20 text-green-700">{ core.FormatEuros(account.CurrentBalance) }</p>
}
<a
href={ templ.URL("/transaction?account-id=" + account.Id.String()) }