service

package
v0.0.0-...-a64a35a Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthService

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

func NewAuthService

func NewAuthService(repo repository.Repository) *AuthService

func (*AuthService) Attempt

func (a *AuthService) Attempt(input *dto.LoginRequestBody) (*models.User, error)

func (*AuthService) ForgotPass

func (*AuthService) ResetPass

type Authorization

type Authorization interface {
	Attempt(input *dto.LoginRequestBody) (*models.User, error)
	ForgotPass(input *dto.ForgotPasswordRequestBody) (*models.PasswordReset, error)
	ResetPass(input *dto.ResetPasswordRequestBody) (*models.PasswordReset, error)
}

type JWT

type JWT interface {
	GenerateToken(userID string) (string, error)
	ValidateToken(token string) (*jwt.Token, error)
	SendVerificationToken(user *models.User) error
	VerifyUser(token string) (*models.User, *models.Wallet, error)
}

type JWTService

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

func NewJWTService

func NewJWTService(repo repository.Repository) *JWTService

func (*JWTService) GenerateToken

func (j *JWTService) GenerateToken(userID string) (string, error)

func (*JWTService) SendVerificationToken

func (j *JWTService) SendVerificationToken(user *models.User) error

func (*JWTService) ValidateToken

func (j *JWTService) ValidateToken(token string) (*jwt.Token, error)

func (*JWTService) VerifyUser

func (j *JWTService) VerifyUser(token string) (*models.User, *models.Wallet, error)

type Service

type Service struct {
	Authorization
	JWT
	User
	Wallet
	Transaction
}

func NewService

func NewService(repo *repository.Repository) *Service

type Transaction

type Transaction interface {
	GetTransactions(userID string, query *dto.TransactionRequestQuery) ([]*models.Transaction, error)
	TopUp(input *dto.TopUpRequestBody) (*models.Transaction, error)
	Transfer(input *dto.TransferRequestBody) (*models.Transaction, error)
	CountTransaction(userID string) (int64, error)
}

type TransactionService

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

func NewTransactionService

func NewTransactionService(repo repository.Repository) *TransactionService

func (*TransactionService) CountTransaction

func (t *TransactionService) CountTransaction(userID string) (int64, error)

func (*TransactionService) GetTransactions

func (t *TransactionService) GetTransactions(userID string, query *dto.TransactionRequestQuery) ([]*models.Transaction, error)

func (*TransactionService) TopUp

func (*TransactionService) Transfer

type User

type User interface {
	GetUser(input *dto.UserRequestParams) (*models.User, error)
	CreateUser(input *dto.RegisterRequestBody) (*models.User, error)
}

type UserService

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

func NewUserService

func NewUserService(repo repository.Repository) *UserService

func (*UserService) CreateUser

func (u *UserService) CreateUser(input *dto.RegisterRequestBody) (*models.User, error)

func (*UserService) GetUser

func (u *UserService) GetUser(input *dto.UserRequestParams) (*models.User, error)

type Wallet

type Wallet interface {
	GetWalletByUserId(input *dto.WalletRequestBody) (*models.Wallet, error)
	CreateWallet(input *dto.WalletRequestBody) (*models.Wallet, error)
	GetWalletByNumber(number string) (*models.Wallet, error)
}

type WalletService

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

func NewWalletService

func NewWalletService(repo repository.Repository) *WalletService

func (*WalletService) CreateWallet

func (w *WalletService) CreateWallet(input *dto.WalletRequestBody) (*models.Wallet, error)

func (*WalletService) GetWalletByNumber

func (w *WalletService) GetWalletByNumber(number string) (*models.Wallet, error)

func (*WalletService) GetWalletByUserId

func (w *WalletService) GetWalletByUserId(input *dto.WalletRequestBody) (*models.Wallet, error)

Jump to

Keyboard shortcuts

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