service

package
v0.0.0-...-e05d6db Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoanService

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

func NewLoanService

func NewLoanService(
	db *pgxpool.Pool,
	loanRepo *repository.LoanRepository,
	repaymentRepo *repository.RepaymentRepository,
) *LoanService

func (*LoanService) CheckIsDelinquent

func (l *LoanService) CheckIsDelinquent(ctx context.Context, loanID int64) (bool, int, helper.Errorx)

func (*LoanService) CreateLoan

func (l *LoanService) CreateLoan(ctx context.Context, req *domain.LoanRequest) (*domain.Loan, helper.Errorx)

func (*LoanService) GetLoanByCode

func (l *LoanService) GetLoanByCode(ctx context.Context, code string) (*domain.Loan, helper.Errorx)

func (*LoanService) GetLoanByID

func (l *LoanService) GetLoanByID(ctx context.Context, loanID int64) (*domain.Loan, helper.Errorx)

func (*LoanService) GetLoanByIDandUserID

func (l *LoanService) GetLoanByIDandUserID(ctx context.Context, loanID, userID int64) (*domain.Loan, helper.Errorx)

func (*LoanService) GetLoansByUserID

func (l *LoanService) GetLoansByUserID(ctx context.Context, userID int64) ([]*domain.Loan, helper.Errorx)

func (*LoanService) GetOutstandingBalance

func (l *LoanService) GetOutstandingBalance(ctx context.Context, loanID int64) (float64, helper.Errorx)

func (*LoanService) UpdateLoan

func (l *LoanService) UpdateLoan(ctx context.Context, loan *domain.Loan) helper.Errorx

type RepaymentService

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

func NewRepaymentService

func NewRepaymentService(
	loanService *LoanService,
	repaymentRepo *repository.RepaymentRepository,
) *RepaymentService

func (*RepaymentService) CreateRepayment

func (r *RepaymentService) CreateRepayment(ctx context.Context, repayment *domain.LoanRepayment) helper.Errorx

func (*RepaymentService) GetRepaymentByID

func (r *RepaymentService) GetRepaymentByID(ctx context.Context, repaymentID int64) (*domain.LoanRepayment, helper.Errorx)

func (*RepaymentService) GetRepaymentByIDAndLoanID

func (r *RepaymentService) GetRepaymentByIDAndLoanID(ctx context.Context, repaymentID, loanID int64) (*domain.LoanRepayment, helper.Errorx)

func (*RepaymentService) GetRepaymentsByLoanID

func (r *RepaymentService) GetRepaymentsByLoanID(ctx context.Context, loanID int64) ([]*domain.LoanRepayment, helper.Errorx)

func (*RepaymentService) MakePayment

func (*RepaymentService) PrintSchedule

func (r *RepaymentService) PrintSchedule(ctx context.Context, userID int64, loanID int64) ([]*domain.LoanRepayment, helper.Errorx)

type UserService

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

func NewUserService

func NewUserService(
	userRepo *repository.UserRepository,
) *UserService

func (*UserService) CreateUser

func (u *UserService) CreateUser(ctx context.Context, args *domain.UserRequest) (*domain.User, helper.Errorx)

func (*UserService) GetUserByID

func (u *UserService) GetUserByID(ctx context.Context, userID int64) (*domain.User, helper.Errorx)

func (*UserService) GetUserByUsernames

func (u *UserService) GetUserByUsernames(ctx context.Context, username ...string) ([]*domain.User, helper.Errorx)

func (*UserService) GetUsers

func (u *UserService) GetUsers(ctx context.Context, username ...string) ([]*domain.User, helper.Errorx)

Jump to

Keyboard shortcuts

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