Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Debit is a transaction which is subtracted. Debit = 1 // Credit is a transaction which is subtracted the next month. Credit = 2 // Income is a transaction which is summed. Income = 3 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Category ¶
type Category struct {
Name string
}
Category is the general class of a Transaction (eg: Health, Food).
type CreateTransactionUseCase ¶
type CreateTransactionUseCase struct {
// contains filtered or unexported fields
}
CreateTransactionUseCase implements the business logic to create a transaction.
func NewCreateTransactionUseCase ¶
func NewCreateTransactionUseCase(r Repository) *CreateTransactionUseCase
NewCreateTransactionUseCase initialize the use case.
func (*CreateTransactionUseCase) Create ¶
func (uc *CreateTransactionUseCase) Create(t Transaction) (Transaction, error)
Create a transaction.
type ListTransactionUseCase ¶
type ListTransactionUseCase struct {
// contains filtered or unexported fields
}
ListTransactionUseCase implements the business logic to find a transaction.
func NewListTransactionUseCase ¶
func NewListTransactionUseCase(r Repository) *ListTransactionUseCase
NewListTransactionUseCase initialize the use case.
func (*ListTransactionUseCase) List ¶
func (uc *ListTransactionUseCase) List() ([]Transaction, error)
List transaction(s).
type Repository ¶
type Repository interface { Create(Transaction) (Transaction, error) Find() ([]Transaction, error) }
Repository represents a client able to save and find a transaction.
type Transaction ¶
Transaction is money received or expended.
func (*Transaction) Validate ¶
func (t *Transaction) Validate() error
Validate whether a transaction has all it's required properties set.
Click to show internal directories.
Click to hide internal directories.