Documentation ¶
Index ¶
- Variables
- type Transfer
- type TransferRepositoryCreator
- type User
- func NewCommonUser(ID vo.Uuid, fullName vo.FullName, email vo.Email, password vo.Password, ...) User
- func NewMerchantUser(ID vo.Uuid, fullName vo.FullName, email vo.Email, password vo.Password, ...) User
- func NewUser(ID vo.Uuid, fullName vo.FullName, email vo.Email, password vo.Password, ...) (User, error)
- func (u User) CanTransfer() error
- func (u User) CreatedAt() time.Time
- func (u User) Deposit(money vo.Money)
- func (u User) Document() vo.Document
- func (u User) Email() vo.Email
- func (u User) FullName() vo.FullName
- func (u User) ID() vo.Uuid
- func (u User) Password() vo.Password
- func (u User) Roles() vo.Roles
- func (u User) TypeUser() vo.TypeUser
- func (u User) Wallet() *vo.Wallet
- func (u User) Withdraw(money vo.Money) error
- type UserRepositoryCreator
- type UserRepositoryFinder
- type UserRepositoryUpdater
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCreateTransfer = errors.New("error creating transfer") )
View Source
var ( ErrUserInsufficientBalance = errors.New("user does not have sufficient balance") ErrNotFoundUser = errors.New("not found user") ErrUpdateUserWallet = errors.New("error updating the value of the wallet") ErrCreateUser = errors.New("error creating user") ErrFindUserByID = errors.New("error fetching user by ID") )
Functions ¶
This section is empty.
Types ¶
type Transfer ¶
type Transfer struct {
// contains filtered or unexported fields
}
Transfer define the transfer entity
func NewTransfer ¶
func NewTransfer( ID vo.Uuid, payerID vo.Uuid, payeeID vo.Uuid, value vo.Money, createdAt time.Time, ) Transfer
NewTransfer creates new transfer
type TransferRepositoryCreator ¶
type TransferRepositoryCreator interface { Create(context.Context, Transfer) error WithTransaction(context.Context, func(context.Context) error) error }
TransferRepositoryCreator defines the operation of creating a transfer entity
type User ¶
type User struct {
// contains filtered or unexported fields
}
User defines the user entity
func NewCommonUser ¶
func NewCommonUser( ID vo.Uuid, fullName vo.FullName, email vo.Email, password vo.Password, document vo.Document, wallet *vo.Wallet, createdAt time.Time, ) User
NewCommonUser creates new common user
func NewMerchantUser ¶
func NewMerchantUser( ID vo.Uuid, fullName vo.FullName, email vo.Email, password vo.Password, document vo.Document, wallet *vo.Wallet, createdAt time.Time, ) User
NewMerchant creates new merchant user
func NewUser ¶
func NewUser( ID vo.Uuid, fullName vo.FullName, email vo.Email, password vo.Password, document vo.Document, wallet *vo.Wallet, typeUser vo.TypeUser, createdAt time.Time, ) (User, error)
NewUser is a factory for users
func (User) CanTransfer ¶
CanTransfer returns whether it is possible to transfer
type UserRepositoryCreator ¶
UserRepositoryCreator defines the operation of creating a transfer entity
type UserRepositoryFinder ¶
UserRepositoryFinder defines the search operation for a user entity
Click to show internal directories.
Click to hide internal directories.