Documentation
¶
Index ¶
- type LoanRepository
- func (l *LoanRepository) CheckIsDelinquent(ctx context.Context, loanID int64) (bool, error)
- func (l *LoanRepository) CreateLoan(ctx context.Context, tx pgx.Tx, loan *domain.Loan) error
- func (l *LoanRepository) GetLoanByCode(ctx context.Context, code string) (*domain.Loan, error)
- func (l *LoanRepository) GetLoanByID(ctx context.Context, loanID int64) (*domain.Loan, error)
- func (l *LoanRepository) GetLoansByIDandUserID(ctx context.Context, loanID, userID int64) (*domain.Loan, error)
- func (l *LoanRepository) GetLoansByUserID(ctx context.Context, userID int64) ([]*domain.Loan, error)
- func (l *LoanRepository) GetOutstandingBalance(ctx context.Context, loanID int64) (float64, error)
- func (l *LoanRepository) UpdateLoan(ctx context.Context, loan *domain.Loan) error
- type RepaymentRepository
- func (r *RepaymentRepository) CreateRepayment(ctx context.Context, tx pgx.Tx, repayment *domain.LoanRepayment) error
- func (r *RepaymentRepository) GetLastRepaymentPaidByLoanID(ctx context.Context, loanID int64) (*domain.LoanRepayment, error)
- func (r *RepaymentRepository) GetRepaymentByID(ctx context.Context, repaymentID int64) (*domain.LoanRepayment, error)
- func (r *RepaymentRepository) GetRepaymentByIDAndLoanID(ctx context.Context, repaymentID, loanID int64) (*domain.LoanRepayment, error)
- func (r *RepaymentRepository) GetRepaymentsByLoanID(ctx context.Context, loanID int64) ([]*domain.LoanRepayment, error)
- func (r *RepaymentRepository) GetRepaymentsByLoanIDAndUserID(ctx context.Context, loanID, userID int64) ([]*domain.LoanRepayment, error)
- func (r *RepaymentRepository) GetRepaymentsByUserID(ctx context.Context, userID int64) ([]*domain.LoanRepayment, error)
- func (r *RepaymentRepository) MakePayment(ctx context.Context, req *domain.MakePaymentRequest) error
- type UserRepository
- func (u *UserRepository) CreateUser(ctx context.Context, user *domain.User) error
- func (u *UserRepository) GetUserByID(ctx context.Context, userID int64) (*domain.User, error)
- func (u *UserRepository) GetUserByUsernames(ctx context.Context, username ...string) ([]*domain.User, error)
- func (u *UserRepository) GetUsers(ctx context.Context) ([]*domain.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LoanRepository ¶
type LoanRepository struct {
// contains filtered or unexported fields
}
func NewLoanRepository ¶
func NewLoanRepository(db *pgxpool.Pool) *LoanRepository
func (*LoanRepository) CheckIsDelinquent ¶
func (*LoanRepository) CreateLoan ¶
func (*LoanRepository) GetLoanByCode ¶
func (*LoanRepository) GetLoanByID ¶
func (*LoanRepository) GetLoansByIDandUserID ¶
func (*LoanRepository) GetLoansByUserID ¶
func (*LoanRepository) GetOutstandingBalance ¶
func (*LoanRepository) UpdateLoan ¶
type RepaymentRepository ¶
type RepaymentRepository struct {
// contains filtered or unexported fields
}
func NewRepaymentRepository ¶
func NewRepaymentRepository(db *pgxpool.Pool) *RepaymentRepository
func (*RepaymentRepository) CreateRepayment ¶
func (r *RepaymentRepository) CreateRepayment(ctx context.Context, tx pgx.Tx, repayment *domain.LoanRepayment) error
func (*RepaymentRepository) GetLastRepaymentPaidByLoanID ¶
func (r *RepaymentRepository) GetLastRepaymentPaidByLoanID(ctx context.Context, loanID int64) (*domain.LoanRepayment, error)
func (*RepaymentRepository) GetRepaymentByID ¶
func (r *RepaymentRepository) GetRepaymentByID(ctx context.Context, repaymentID int64) (*domain.LoanRepayment, error)
func (*RepaymentRepository) GetRepaymentByIDAndLoanID ¶
func (r *RepaymentRepository) GetRepaymentByIDAndLoanID(ctx context.Context, repaymentID, loanID int64) (*domain.LoanRepayment, error)
func (*RepaymentRepository) GetRepaymentsByLoanID ¶
func (r *RepaymentRepository) GetRepaymentsByLoanID(ctx context.Context, loanID int64) ([]*domain.LoanRepayment, error)
func (*RepaymentRepository) GetRepaymentsByLoanIDAndUserID ¶
func (r *RepaymentRepository) GetRepaymentsByLoanIDAndUserID(ctx context.Context, loanID, userID int64) ([]*domain.LoanRepayment, error)
func (*RepaymentRepository) GetRepaymentsByUserID ¶
func (r *RepaymentRepository) GetRepaymentsByUserID(ctx context.Context, userID int64) ([]*domain.LoanRepayment, error)
func (*RepaymentRepository) MakePayment ¶
func (r *RepaymentRepository) MakePayment(ctx context.Context, req *domain.MakePaymentRequest) error
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
func NewUserRepository ¶
func NewUserRepository(db *pgxpool.Pool) *UserRepository
func (*UserRepository) CreateUser ¶
func (*UserRepository) GetUserByID ¶
func (*UserRepository) GetUserByUsernames ¶
Click to show internal directories.
Click to hide internal directories.