account

package
v0.0.0-...-20a34b2 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Id         string    `json:"id"`
	Name       string    `json:"name"`
	Cpf        string    `json:"cpf"`
	Secret     string    `json:"secret"`
	Balance    int       `json:"balance"`
	Created_at time.Time `json:"created_at"`
}

Account Entity

func NewAccount

func NewAccount(name string, cpf string, secret string, balance int) *Account

type Repository

type Repository interface {
	Store(*Account) error
	GetBalance(Account) (int, error)
	ExistsByCPF(*Account) (bool, error)
	UpdateBalance(*Account) error
	GetById(string) (Account, error)
	GetByCPF(string) (Account, error)
	ShowAll() ([]Account, error)
	GenerateID() string
	Transaction(driver.Tx) Repository
}

Manage the persistence related to account entity

type Service

type Service interface {
	CreateAccount(*Account) error
	UpdateBalance(Account) error
	GetAccount(string) (Account, error)
	ShowAccounts() ([]Account, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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