service

package
v0.0.0-...-045cb9c Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountService

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

func NewAccountService

func NewAccountService(accountRepo *repository.AccountRepository, userRepo *repository.UserRepository, feeRepo *repository.FeeRepository, mailService *utils.MailService) *AccountService

func (*AccountService) CreateAccount

func (s *AccountService) CreateAccount(ctx context.Context, userID string, currency domain.CurrencyCode, amount string) (*domain.Account, error)

func (*AccountService) DeleteAccount

func (s *AccountService) DeleteAccount(ctx context.Context, id string) error

func (*AccountService) Deposit

func (s *AccountService) Deposit(ctx context.Context, id string, amount string) (*domain.Account, error)

func (*AccountService) GetAccount

func (s *AccountService) GetAccount(ctx context.Context, id string) (*domain.Account, error)

func (*AccountService) GetAccounts

func (s *AccountService) GetAccounts(ctx context.Context, userID string, limit, offset int) ([]domain.Account, error)

func (*AccountService) UpdateAccount

func (s *AccountService) UpdateAccount(ctx context.Context, id string, currency domain.CurrencyCode, balance string) (*domain.Account, error)

func (*AccountService) Withdraw

func (s *AccountService) Withdraw(ctx context.Context, id string, amount string) (*domain.Account, error)

type AdminService

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

func NewAdminService

func NewAdminService(adminRepo *repository.AdminRepository, redisClient *redis.Client, mailService *utils.MailService) *AdminService

func (*AdminService) Login

func (s *AdminService) Login(ctx context.Context, email string) error

func (*AdminService) RefreshToken

func (s *AdminService) RefreshToken(ctx context.Context, tokenString string) (string, error)

func (*AdminService) SignUp

func (s *AdminService) SignUp(ctx context.Context, email string) (*domain.Admin, error)

func (*AdminService) VerifyAdmin

func (s *AdminService) VerifyAdmin(ctx context.Context, email, code string) (string, error)

type FeeService

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

func NewFeeService

func NewFeeService(feeRepo *repository.FeeRepository) *FeeService

func (*FeeService) CreateFee

func (s *FeeService) CreateFee(ctx context.Context, amount string, feeType domain.FeeType, currency domain.CurrencyCode) (*domain.Fee, error)

func (*FeeService) DeleteFee

func (s *FeeService) DeleteFee(ctx context.Context, id string) error

func (*FeeService) GetFees

func (s *FeeService) GetFees(ctx context.Context, limit, offset int) ([]domain.Fee, error)

func (*FeeService) UpdateFee

func (s *FeeService) UpdateFee(ctx context.Context, id, amount string, feeType domain.FeeType, currency domain.CurrencyCode) (*domain.Fee, error)

type TransactionService

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

func NewTransactionService

func NewTransactionService(transactionRepo *repository.TransactionRepository, accountRepo *repository.AccountRepository) *TransactionService

func (*TransactionService) GetTransactionByID

func (s *TransactionService) GetTransactionByID(ctx context.Context, id int64) (*domain.Transaction, error)

func (*TransactionService) GetTransactions

func (s *TransactionService) GetTransactions(ctx context.Context, limit, offset int) ([]domain.Transaction, error)

func (*TransactionService) Transfer

func (s *TransactionService) Transfer(ctx context.Context, fromAccountID, toAccountID string, amount, fee *utils.BigDecimal) error

type UserService

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

func NewUserService

func NewUserService(userRepo *repository.UserRepository) *UserService

func (*UserService) CreateUser

func (s *UserService) CreateUser(ctx context.Context, firstName, lastName, email string) (*domain.User, error)

func (*UserService) DeleteUser

func (s *UserService) DeleteUser(ctx context.Context, id string) error

func (*UserService) GetUserByEmail

func (s *UserService) GetUserByEmail(ctx context.Context, email string) (*domain.User, error)

func (*UserService) GetUserByID

func (s *UserService) GetUserByID(ctx context.Context, id string) (*domain.User, error)

func (*UserService) GetUserByIDWithAccounts

func (s *UserService) GetUserByIDWithAccounts(ctx context.Context, id string) (*domain.User, error)

func (*UserService) ListUsers

func (s *UserService) ListUsers(ctx context.Context, limit, offset int) ([]domain.User, error)

func (*UserService) UpdateUser

func (s *UserService) UpdateUser(ctx context.Context, id string, firstName, lastName, email string) (*domain.User, error)

Jump to

Keyboard shortcuts

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