wallet

package
v0.0.0-...-ce024f6 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWalletHandler

func NewWalletHandler(walletRoute fiber.Router, walletService WalletService)

Types

type Balance

type Balance struct {
	ID        string    `gorm:"primaryKey" json:"-"`
	WalletID  string    `gorm:"not null" json:"-"`
	Currency  string    `gorm:"not null" json:"currency"`
	Amount    string    `gorm:"type:decimal(10,2); not null" json:"amount"`
	CreatedAt time.Time `json:"-"`
	UpdatedAt time.Time `json:"-"`
}

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func (*Handler) GetWallets

func (h *Handler) GetWallets(c *fiber.Ctx) error

type Repository

type Repository struct {
	// contains filtered or unexported fields
}

func NewWalletRepository

func NewWalletRepository(db *gorm.DB) *Repository

func (*Repository) FindAll

func (r *Repository) FindAll() (*[]Wallet, error)

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewWalletService

func NewWalletService(walletRepository WalletRepository) *Service

func (*Service) GetUserWallets

func (s *Service) GetUserWallets() (*[]Wallet, error)

type Wallet

type Wallet struct {
	ID        string    `gorm:"primaryKey" json:"id"`
	UserId    string    `gorm:"not null" json:"-"`
	Balances  []Balance `gorm:"foreignKey:WalletID" json:"balances"`
	CreatedAt time.Time `json:"-"`
	UpdatedAt time.Time `json:"-"`
}

type WalletRepository

type WalletRepository interface {
	FindAll() (*[]Wallet, error)
}

type WalletService

type WalletService interface {
	GetUserWallets() (*[]Wallet, error)
}

Jump to

Keyboard shortcuts

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