Documentation
¶
Index ¶
- type AccountHandlerImpl
- func (h *AccountHandlerImpl) CreateAccount(c fiber.Ctx) error
- func (h *AccountHandlerImpl) DeleteAccount(c fiber.Ctx) error
- func (h *AccountHandlerImpl) GetAccountById(c fiber.Ctx) error
- func (h *AccountHandlerImpl) GetAccounts(c fiber.Ctx) error
- func (h *AccountHandlerImpl) UpdateAccount(c fiber.Ctx) error
- type CreateAccountPayload
- type DeleteAccountByIdParams
- type GetAccountByIdParams
- type GetAccountsQuery
- type PostgresAccountStore
- func (s *PostgresAccountStore) CreateAccount(ctx context.Context, a *types.Account) (types.Account, error)
- func (s *PostgresAccountStore) DeleteAccount(ctx context.Context, userId, accountId int) (types.Account, error)
- func (s *PostgresAccountStore) GetAccountById(ctx context.Context, userId int, accountId int) (types.Account, error)
- func (s *PostgresAccountStore) GetAccountByName(ctx context.Context, name string, userId int) (types.Account, error)
- func (s *PostgresAccountStore) GetAccounts(ctx context.Context, userId int, options *types.GetAccountsStoreOptions) ([]types.Account, types.PaginationMetadata, error)
- func (s *PostgresAccountStore) UpdateAccount(ctx context.Context, account *types.Account) (types.Account, error)
- type UpdateAccountByIdParams
- type UpdateAccountPayload
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 (*PostgresAccountStore) DeleteAccount ¶
func (*PostgresAccountStore) GetAccountById ¶
func (*PostgresAccountStore) GetAccountByName ¶
func (*PostgresAccountStore) GetAccounts ¶
func (s *PostgresAccountStore) GetAccounts(ctx context.Context, userId int, options *types.GetAccountsStoreOptions) ([]types.Account, types.PaginationMetadata, error)
func (*PostgresAccountStore) UpdateAccount ¶
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
Source Files
¶
- handler.go
- handler_createaccount.go
- handler_deleteaccount.go
- handler_getaccountbyid.go
- handler_getaccounts.go
- handler_updateaccount.go
- schema_createaccount.go
- schema_deleteaccount.go
- schema_getaccountbyid.go
- schema_getaccounts.go
- schema_updateaccount.go
- store.go
- store_createaccount.go
- store_deleteaccount.go
- store_getaccountbyid.go
- store_getaccountbyname.go
- store_getaccounts.go
- store_updateaccount.go
Click to show internal directories.
Click to hide internal directories.