holding

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2025 License: GPL-3.0 Imports: 16 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateHoldingPayload

type CreateHoldingPayload struct {
	Name              string              `json:"name"`
	Ticker            string              `json:"ticker,omitempty"`
	Asset_category    types.AssetCategory `json:"asset_category"`
	Expense_ratio_pct float32             `json:"expense_ratio_pct,omitempty"`
	Maturation_date   string              `json:"maturation_date,omitempty"`
	Interest_rate_pct float32             `json:"interest_rate_pct,omitempty"`
	Is_deprecated     bool                `json:"is_deprecated"`
}

func (CreateHoldingPayload) Validate

func (p CreateHoldingPayload) Validate() error

type DeleteHoldingParams

type DeleteHoldingParams struct {
	Id int `json:"id"`
}

func (DeleteHoldingParams) Validate

func (p DeleteHoldingParams) Validate() error

type GetHoldingByIdParams

type GetHoldingByIdParams struct {
	Id int `json:"id"`
}

func (GetHoldingByIdParams) Validate

func (p GetHoldingByIdParams) Validate() error

type GetHoldingsQuery

type GetHoldingsQuery struct {
	Ids                      []int               `json:"ids"`
	Ticker                   string              `json:"ticker"`
	Asset_category           types.AssetCategory `json:"asset_category"`
	Is_deprecated            string              `json:"is_deprecated"`
	Has_maturation_remaining string              `json:"has_maturation_remaining"`

	types.PaginationQuery
}

func (GetHoldingsQuery) Validate

func (q GetHoldingsQuery) Validate() error

type HoldingHandlerImpl

type HoldingHandlerImpl struct {
	// contains filtered or unexported fields
}

func NewHoldingHandler

func NewHoldingHandler(store types.HoldingStore, logger *slog.Logger) *HoldingHandlerImpl

func (*HoldingHandlerImpl) CreateHolding

func (h *HoldingHandlerImpl) CreateHolding(c fiber.Ctx) error

func (*HoldingHandlerImpl) DeleteHolding

func (h *HoldingHandlerImpl) DeleteHolding(c fiber.Ctx) error

func (*HoldingHandlerImpl) GetHoldingById

func (h *HoldingHandlerImpl) GetHoldingById(c fiber.Ctx) error

func (*HoldingHandlerImpl) GetHoldings

func (h *HoldingHandlerImpl) GetHoldings(c fiber.Ctx) error

func (*HoldingHandlerImpl) UpdateHolding

func (h *HoldingHandlerImpl) UpdateHolding(c fiber.Ctx) error

type PostgresHoldingStore

type PostgresHoldingStore struct {
	// contains filtered or unexported fields
}

func NewPostgresHoldingStore

func NewPostgresHoldingStore(db *pgxpool.Pool, logger *slog.Logger) *PostgresHoldingStore

func (*PostgresHoldingStore) CreateHolding

func (s *PostgresHoldingStore) CreateHolding(ctx context.Context, h *types.Holding) (types.Holding, error)

func (*PostgresHoldingStore) DeleteHolding

func (s *PostgresHoldingStore) DeleteHolding(ctx context.Context, userId, holdingId int) (types.Holding, error)

func (*PostgresHoldingStore) GetHoldingById

func (s *PostgresHoldingStore) GetHoldingById(ctx context.Context, userId, holdingId int) (types.Holding, error)

func (*PostgresHoldingStore) GetHoldingByName

func (s *PostgresHoldingStore) GetHoldingByName(ctx context.Context, name string, userId int) (types.Holding, error)

func (*PostgresHoldingStore) GetHoldingByTicker

func (s *PostgresHoldingStore) GetHoldingByTicker(ctx context.Context, ticker string, userId int) (types.Holding, error)

func (*PostgresHoldingStore) GetHoldings

func (*PostgresHoldingStore) UpdateHolding

func (s *PostgresHoldingStore) UpdateHolding(ctx context.Context, h *types.Holding) (types.Holding, error)

type UpdateHoldingParams

type UpdateHoldingParams struct {
	Id int `json:"id"`
}

func (UpdateHoldingParams) Validate

func (p UpdateHoldingParams) Validate() error

type UpdateHoldingPayload

type UpdateHoldingPayload struct {
	Name              string              `json:"name"`
	Ticker            string              `json:"ticker,omitempty"`
	Asset_category    types.AssetCategory `json:"asset_category"`
	Expense_ratio_pct float32             `json:"expense_ratio_pct,omitempty"`
	Maturation_date   string              `json:"maturation_date,omitempty"`
	Interest_rate_pct float32             `json:"interest_rate_pct,omitempty"`
	Is_deprecated     bool                `json:"is_deprecated"`
}

func (UpdateHoldingPayload) Validate

func (p UpdateHoldingPayload) Validate() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL