Files
spend-sparrow/types/treasure_chest.go
Tim Wundenberg 7a691ec263
All checks were successful
Build Docker Image / Build-Docker-Image (push) Successful in 5m0s
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Successful in 5m25s
fix(treasurechest): make parentId actually null/nil instead of uuid.Nil
2025-05-19 19:56:06 +02:00

28 lines
720 B
Go

package types
import (
"time"
"github.com/google/uuid"
)
// The TreasureChest is a fictional account.
// The money it "holds" distributed across all accounts
//
// At the time of writing this, linking it to a specific account doesn't really make sense
// Imagne a TreasureChest for free time activities, where some money is spend in cash and some other with credit card
type TreasureChest struct {
Id uuid.UUID
ParentId *uuid.UUID `db:"parent_id"`
UserId uuid.UUID `db:"user_id"`
Name string
CurrentBalance int64 `db:"current_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"`
}