repository

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: 8 Imported by: 0

Documentation

Index

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 (l *LoanRepository) CheckIsDelinquent(ctx context.Context, loanID int64) (bool, error)

func (*LoanRepository) CreateLoan

func (l *LoanRepository) CreateLoan(ctx context.Context, tx pgx.Tx, loan *domain.Loan) error

func (*LoanRepository) GetLoanByCode

func (l *LoanRepository) GetLoanByCode(ctx context.Context, code string) (*domain.Loan, error)

func (*LoanRepository) GetLoanByID

func (l *LoanRepository) GetLoanByID(ctx context.Context, loanID int64) (*domain.Loan, error)

func (*LoanRepository) GetLoansByIDandUserID

func (l *LoanRepository) GetLoansByIDandUserID(ctx context.Context, loanID, userID int64) (*domain.Loan, error)

func (*LoanRepository) GetLoansByUserID

func (l *LoanRepository) GetLoansByUserID(ctx context.Context, userID int64) ([]*domain.Loan, error)

func (*LoanRepository) GetOutstandingBalance

func (l *LoanRepository) GetOutstandingBalance(ctx context.Context, loanID int64) (float64, error)

func (*LoanRepository) UpdateLoan

func (l *LoanRepository) UpdateLoan(ctx context.Context, loan *domain.Loan) error

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

type UserRepository

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

func NewUserRepository

func NewUserRepository(db *pgxpool.Pool) *UserRepository

func (*UserRepository) CreateUser

func (u *UserRepository) CreateUser(ctx context.Context, user *domain.User) error

func (*UserRepository) GetUserByID

func (u *UserRepository) GetUserByID(ctx context.Context, userID int64) (*domain.User, error)

func (*UserRepository) GetUserByUsernames

func (u *UserRepository) GetUserByUsernames(ctx context.Context, username ...string) ([]*domain.User, error)

func (*UserRepository) GetUsers

func (u *UserRepository) GetUsers(ctx context.Context) ([]*domain.User, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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