Documentation
¶
Index ¶
- Variables
- type AccountType
- type CreateCommand
- type FinancialAccount
- type Repository
- type Service
- func (s Service) Create(ctx context.Context, args any) error
- func (s Service) Delete(ctx context.Context, id string) error
- func (s Service) GetByID(ctx context.Context, id string) (View, error)
- func (s Service) List(ctx context.Context, cr storage.Criteria) ([]View, storage.PageToken, error)
- func (s Service) Update(ctx context.Context, args any) error
- type UpdateCommand
- type View
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
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
Click to show internal directories.
Click to hide internal directories.