Files
spend-sparrow/internal/account/type.go
Tim Wundenberg f9a5a9e5f9
All checks were successful
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Successful in 1m17s
feat: extract account to domain package
2025-12-24 07:45:44 +01:00

27 lines
659 B
Go

package account
import (
"github.com/google/uuid"
"time"
)
// 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"`
}