Files
spend-sparrow/types/account.go
Tim Wundenberg 0792d8e01a
All checks were successful
Build Docker Image / Build-Docker-Image (push) Successful in 4m27s
feat: extract types to seperate files
2025-05-10 23:22:09 +02:00

28 lines
635 B
Go

package types
import (
"time"
"github.com/google/uuid"
)
// The Account holds money
type Account struct {
Id uuid.UUID
UserId uuid.UUID `db:"user_id"`
// Custom Name of the account, e.g. "Bank", "Cash", "Credit Card"
Name string
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"`
}