fix: move implementation to "internal" package
Some checks failed
Build Docker Image / Build-Docker-Image (push) Has been cancelled

This commit is contained in:
2025-05-29 13:23:13 +02:00
parent 9bb0cc475d
commit 0c40680d76
72 changed files with 245 additions and 230 deletions

27
internal/types/account.go Normal file
View File

@@ -0,0 +1,27 @@
package types
import (
"time"
"github.com/google/uuid"
)
// The Account holds money.
type Account struct {
Id uuid.UUID `db:"id"`
UserId uuid.UUID `db:"user_id"`
// Custom Name of the account, e.g. "Bank", "Cash", "Credit Card"
Name string `db:"name"`
CurrentBalance int64 `db:"current_balance"`
LastTransaction *time.Time `db:"last_transaction"`
// The current precalculated value of:
// Account.Balance - [PiggyBank.Balance...]
OinkBalance int64 `db:"oink_balance"`
CreatedAt time.Time `db:"created_at"`
CreatedBy uuid.UUID `db:"created_by"`
UpdatedAt *time.Time `db:"updated_at"`
UpdatedBy *uuid.UUID `db:"updated_by"`
}