financialaccount

package
v0.0.0-...-984c388 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound           = exception.ResourceNotFound{Resource: "financial_account"}
	ErrInvalidAccountType = exception.InvalidParameter{
		Field:       "account_type",
		ValidValues: "CHECKING,SAVINGS",
	}
)

Functions

This section is empty.

Types

type AccountType

type AccountType uint8

func NewAccountType

func NewAccountType(v string) AccountType

func NewAccountTypeSafe

func NewAccountTypeSafe(v string) (AccountType, error)

func (AccountType) String

func (a AccountType) String() string

type CreateCommand

type CreateCommand struct {
	OwnerID string `json:"owner_id" validate:"required"`
	// contains filtered or unexported fields
}

type FinancialAccount

type FinancialAccount struct {
	ID           string
	User         user.User // req, FK -> users
	DisplayName  string    // req
	BankName     string
	AccountType  AccountType // enum: checking/savings/...
	Balance      float64
	CurrencyCode string
	customtype.Auditable
}

FinancialAccount storage for financial assets of a User backed and held by a financial institution.

type Repository

type Repository interface {
	storage.Repository[FinancialAccount]
}

type Service

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

func NewService

func NewService(r Repository) Service

func (Service) Create

func (s Service) Create(ctx context.Context, args any) error

func (Service) Delete

func (s Service) Delete(ctx context.Context, id string) error

func (Service) GetByID

func (s Service) GetByID(ctx context.Context, id string) (View, error)

func (Service) List

func (Service) Update

func (s Service) Update(ctx context.Context, args any) error

type UpdateCommand

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

type View

type View struct {
	ID           string     `json:"financial_account_id"`
	User         *user.View `json:"user"`
	DisplayName  string     `json:"display_name"`
	BankName     *string    `json:"bank_name"`
	AccountType  string     `json:"account_type"`
	Balance      float64    `json:"balance"`
	CurrencyCode string     `json:"currency_code"`
	customtype.Auditable
}

func NewView

func NewView(acc FinancialAccount) View

Jump to

Keyboard shortcuts

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