Documentation ¶
Index ¶
- type LoanService
- func (l *LoanService) CheckIsDelinquent(ctx context.Context, loanID int64) (bool, int, helper.Errorx)
- func (l *LoanService) CreateLoan(ctx context.Context, req *domain.LoanRequest) (*domain.Loan, helper.Errorx)
- func (l *LoanService) GetLoanByCode(ctx context.Context, code string) (*domain.Loan, helper.Errorx)
- func (l *LoanService) GetLoanByID(ctx context.Context, loanID int64) (*domain.Loan, helper.Errorx)
- func (l *LoanService) GetLoanByIDandUserID(ctx context.Context, loanID, userID int64) (*domain.Loan, helper.Errorx)
- func (l *LoanService) GetLoansByUserID(ctx context.Context, userID int64) ([]*domain.Loan, helper.Errorx)
- func (l *LoanService) GetOutstandingBalance(ctx context.Context, loanID int64) (float64, helper.Errorx)
- func (l *LoanService) UpdateLoan(ctx context.Context, loan *domain.Loan) helper.Errorx
- type RepaymentService
- func (r *RepaymentService) CreateRepayment(ctx context.Context, repayment *domain.LoanRepayment) helper.Errorx
- func (r *RepaymentService) GetRepaymentByID(ctx context.Context, repaymentID int64) (*domain.LoanRepayment, helper.Errorx)
- func (r *RepaymentService) GetRepaymentByIDAndLoanID(ctx context.Context, repaymentID, loanID int64) (*domain.LoanRepayment, helper.Errorx)
- func (r *RepaymentService) GetRepaymentsByLoanID(ctx context.Context, loanID int64) ([]*domain.LoanRepayment, helper.Errorx)
- func (r *RepaymentService) MakePayment(ctx context.Context, req *domain.MakePaymentRequest) helper.Errorx
- func (r *RepaymentService) PrintSchedule(ctx context.Context, userID int64, loanID int64) ([]*domain.LoanRepayment, helper.Errorx)
- type UserService
- func (u *UserService) CreateUser(ctx context.Context, args *domain.UserRequest) (*domain.User, helper.Errorx)
- func (u *UserService) GetUserByID(ctx context.Context, userID int64) (*domain.User, helper.Errorx)
- func (u *UserService) GetUserByUsernames(ctx context.Context, username ...string) ([]*domain.User, helper.Errorx)
- func (u *UserService) GetUsers(ctx context.Context, username ...string) ([]*domain.User, helper.Errorx)
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 (*LoanService) CreateLoan ¶
func (l *LoanService) CreateLoan(ctx context.Context, req *domain.LoanRequest) (*domain.Loan, helper.Errorx)
func (*LoanService) GetLoanByCode ¶
func (*LoanService) GetLoanByID ¶
func (*LoanService) GetLoanByIDandUserID ¶
func (*LoanService) GetLoansByUserID ¶
func (*LoanService) GetOutstandingBalance ¶
func (*LoanService) UpdateLoan ¶
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 (r *RepaymentService) MakePayment(ctx context.Context, req *domain.MakePaymentRequest) helper.Errorx
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 (*UserService) GetUserByUsernames ¶
Click to show internal directories.
Click to hide internal directories.