account

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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountHandlerImpl

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

func NewAccountHandler

func NewAccountHandler(store types.AccountStore, logger *slog.Logger) *AccountHandlerImpl

func (*AccountHandlerImpl) CreateAccount

func (h *AccountHandlerImpl) CreateAccount(c fiber.Ctx) error

func (*AccountHandlerImpl) DeleteAccount

func (h *AccountHandlerImpl) DeleteAccount(c fiber.Ctx) error

func (*AccountHandlerImpl) GetAccountById

func (h *AccountHandlerImpl) GetAccountById(c fiber.Ctx) error

func (*AccountHandlerImpl) GetAccounts

func (h *AccountHandlerImpl) GetAccounts(c fiber.Ctx) error

func (*AccountHandlerImpl) UpdateAccount

func (h *AccountHandlerImpl) UpdateAccount(c fiber.Ctx) error

type CreateAccountPayload

type CreateAccountPayload struct {
	Name          string           `json:"name"`
	Description   string           `json:"description"`
	Tax_shelter   types.TaxShelter `json:"tax_shelter"`
	Institution   string           `json:"institution"`
	Is_deprecated bool             `json:"is_deprecated"`
}

func (CreateAccountPayload) Validate

func (p CreateAccountPayload) Validate() error

type DeleteAccountByIdParams

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

func (DeleteAccountByIdParams) Validate

func (p DeleteAccountByIdParams) Validate() error

type GetAccountByIdParams

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

func (GetAccountByIdParams) Validate

func (p GetAccountByIdParams) Validate() error

type GetAccountsQuery

type GetAccountsQuery struct {
	Ids           []int            `json:"ids"`
	Tax_shelter   types.TaxShelter `json:"tax_shelter"`
	Institution   string           `json:"institution"`
	Is_deprecated string           `json:"is_deprecated"`

	types.PaginationQuery
}

func (GetAccountsQuery) Validate

func (q GetAccountsQuery) Validate() error

type PostgresAccountStore

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

func NewPostgresAccountStore

func NewPostgresAccountStore(postgresDb *pgxpool.Pool, logger *slog.Logger) *PostgresAccountStore

func (*PostgresAccountStore) CreateAccount

func (s *PostgresAccountStore) CreateAccount(ctx context.Context, a *types.Account) (types.Account, error)

func (*PostgresAccountStore) DeleteAccount

func (s *PostgresAccountStore) DeleteAccount(ctx context.Context, userId, accountId int) (types.Account, error)

func (*PostgresAccountStore) GetAccountById

func (s *PostgresAccountStore) GetAccountById(ctx context.Context, userId int, accountId int) (types.Account, error)

func (*PostgresAccountStore) GetAccountByName

func (s *PostgresAccountStore) GetAccountByName(ctx context.Context, name string, userId int) (types.Account, error)

func (*PostgresAccountStore) GetAccounts

func (*PostgresAccountStore) UpdateAccount

func (s *PostgresAccountStore) UpdateAccount(ctx context.Context, account *types.Account) (types.Account, error)

type UpdateAccountByIdParams

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

func (UpdateAccountByIdParams) Validate

func (p UpdateAccountByIdParams) Validate() error

type UpdateAccountPayload

type UpdateAccountPayload struct {
	Name          string           `json:"name"`
	Description   string           `json:"description"`
	Tax_shelter   types.TaxShelter `json:"tax_shelter"`
	Institution   string           `json:"institution"`
	Is_deprecated bool             `json:"is_deprecated"`
}

func (UpdateAccountPayload) Validate

func (p UpdateAccountPayload) Validate() error

Jump to

Keyboard shortcuts

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