Versions in this module Expand all Collapse all v1 v1.0.0 Apr 20, 2024 Changes in this version + var ErrUnprocessableEntity = errors.New("unprocessable entity") + type Account struct + AccountType AccountType + CreatedAt time.Time + CustomerName string + DocumentNumber string + Email string + ID uuid.UUID + PasswordEncoded Password + PhoneNumber string + Status AccountStatus + UpdatedAt time.Time + Wallet Wallet + func NewAccount(t AccountType, name, doc, email, pass, phone string) Account + func (a *Account) Deposit(v Money) (*Transaction, error) + func (a *Account) Transfer(payee *Account, v Money) (*TransferOutput, error) + type AccountStatus string + const AccountStatusActive + const AccountStatusCanceled + type AccountType string + const Personal + const Seller + type Money int64 + const Cent + const MilReais + const Real + func (m Money) Absolute() Money + func (m Money) String() string + type Password string + func (p *Password) Compare(input string) error + func (p *Password) Ok() error + type ResumeAccount struct + AccountType AccountType + Email string + ID uuid.UUID + PasswordEncoded Password + Status AccountStatus + func (a *ResumeAccount) JsonRawMessage() json.RawMessage + func (a *ResumeAccount) ValidatePassword(pass string) error + type Transaction struct + AccountID uuid.UUID + Amount Money + CorrelatedID uuid.NullUUID + ID uuid.UUID + SnapshotID uuid.NullUUID + Timestamp time.Time + TransactionType TransactionType + type TransactionError struct + AccountID uuid.UUID + Amount Money + Message string + TransactionType TransactionType + func NewDepositError(msg string, accountID uuid.UUID, amount Money) *TransactionError + func NewTransferError(msg string, accountID uuid.UUID, amount Money) TransactionError + func (t TransactionError) Error() string + type TransactionType string + const Deposit + const Snapshot + const TransferPayee + const TransferPayer + type TransferOutput struct + CorrelatedID uuid.UUID + Payee *Transaction + Payer *Transaction + type Wallet []*Transaction + func (w *Wallet) Balance() Money + func (w *Wallet) Snapshot(accountID uuid.UUID) *Transaction