generated

package
v0.0.0-...-79ac43c Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssignNonPostedParams

type AssignNonPostedParams struct {
	AssignTo          sql.NullInt32              `json:"assign_to"`
	TransactionSource NonPostedTransactionSource `json:"transaction_source"`
	AssignedBy        sql.NullString             `json:"assigned_by"`
	ID                uint32                     `json:"id"`
}

type Branch

type Branch struct {
	ID   uint32 `json:"id"`
	Name string `json:"name"`
}

type Client

type Client struct {
	ID            uint32         `json:"id"`
	FullName      string         `json:"full_name"`
	PhoneNumber   string         `json:"phone_number"`
	IDNumber      sql.NullString `json:"id_number"`
	Dob           sql.NullTime   `json:"dob"`
	Gender        ClientsGender  `json:"gender"`
	Active        bool           `json:"active"`
	BranchID      uint32         `json:"branch_id"`
	AssignedStaff uint32         `json:"assigned_staff"`
	Overpayment   float64        `json:"overpayment"`
	UpdatedBy     uint32         `json:"updated_by"`
	UpdatedAt     time.Time      `json:"updated_at"`
	CreatedBy     uint32         `json:"created_by"`
	CreatedAt     time.Time      `json:"created_at"`
}

type ClientOverpaymentTransaction

type ClientOverpaymentTransaction struct {
	ID          uint32        `json:"id"`
	ClientID    uint32        `json:"client_id"`
	PaymentID   sql.NullInt32 `json:"payment_id"`
	Amount      float64       `json:"amount"`
	Description string        `json:"description"`
	CreatedBy   string        `json:"created_by"`
	CreatedAt   time.Time     `json:"created_at"`
}

type ClientsGender

type ClientsGender string
const (
	ClientsGenderMALE   ClientsGender = "MALE"
	ClientsGenderFEMALE ClientsGender = "FEMALE"
)

func (*ClientsGender) Scan

func (e *ClientsGender) Scan(src interface{}) error

type CountBranchesByCategoryParams

type CountBranchesByCategoryParams struct {
	Column1 interface{} `json:"column_1"`
	Name    string      `json:"name"`
}

type CountClientLoansParams

type CountClientLoansParams struct {
	Column1   interface{} `json:"column_1"`
	FINDINSET string      `json:"FIND_IN_SET"`
	ClientID  uint32      `json:"client_id"`
}

type CountClientsByCategoryParams

type CountClientsByCategoryParams struct {
	Column1     interface{}  `json:"column_1"`
	FullName    string       `json:"full_name"`
	PhoneNumber string       `json:"phone_number"`
	Active      sql.NullBool `json:"active"`
}

type CountClientsNonPostedParams

type CountClientsNonPostedParams struct {
	AssignTo      sql.NullInt32  `json:"assign_to"`
	AccountNumber sql.NullString `json:"account_number"`
}

type CountExpectedPaymentsParams

type CountExpectedPaymentsParams struct {
	Column1    interface{} `json:"column_1"`
	FullName   string      `json:"full_name"`
	FullName_2 string      `json:"full_name_2"`
}

type CountLoansByCategoryParams

type CountLoansByCategoryParams struct {
	Column1 interface{} `json:"column_1"`
	Name    string      `json:"name"`
}

type CountLoansParams

type CountLoansParams struct {
	Column1    interface{} `json:"column_1"`
	FullName   string      `json:"full_name"`
	FullName_2 string      `json:"full_name_2"`
	Column4    interface{} `json:"column_4"`
	FINDINSET  string      `json:"FIND_IN_SET"`
}

type CountNonPostedByCategoryParams

type CountNonPostedByCategoryParams struct {
	Column1           interface{} `json:"column_1"`
	PayingName        string      `json:"paying_name"`
	AccountNumber     string      `json:"account_number"`
	TransactionNumber string      `json:"transaction_number"`
	Column5           interface{} `json:"column_5"`
	FINDINSET         string      `json:"FIND_IN_SET"`
	FromPaidDate      time.Time   `json:"from_paid_date"`
	ToPaidDate        time.Time   `json:"to_paid_date"`
}

type CountUnpaidInstallmentsDataParams

type CountUnpaidInstallmentsDataParams struct {
	Column1     interface{} `json:"column_1"`
	FullName    string      `json:"full_name"`
	PhoneNumber string      `json:"phone_number"`
}

type CountUsersByCategoryParams

type CountUsersByCategoryParams struct {
	Column1   interface{} `json:"column_1"`
	FullName  string      `json:"full_name"`
	Email     string      `json:"email"`
	Column4   interface{} `json:"column_4"`
	FINDINSET string      `json:"FIND_IN_SET"`
}

type CreateClientOverpaymentTransactionParams

type CreateClientOverpaymentTransactionParams struct {
	ClientID    uint32        `json:"client_id"`
	PaymentID   sql.NullInt32 `json:"payment_id"`
	Amount      float64       `json:"amount"`
	Description string        `json:"description"`
	CreatedBy   string        `json:"created_by"`
}

type CreateClientParams

type CreateClientParams struct {
	FullName      string         `json:"full_name"`
	PhoneNumber   string         `json:"phone_number"`
	IDNumber      sql.NullString `json:"id_number"`
	Dob           sql.NullTime   `json:"dob"`
	Gender        ClientsGender  `json:"gender"`
	BranchID      uint32         `json:"branch_id"`
	AssignedStaff uint32         `json:"assigned_staff"`
	UpdatedBy     uint32         `json:"updated_by"`
	CreatedBy     uint32         `json:"created_by"`
}

type CreateInstallmentParams

type CreateInstallmentParams struct {
	LoanID            uint32    `json:"loan_id"`
	InstallmentNumber uint32    `json:"installment_number"`
	AmountDue         float64   `json:"amount_due"`
	RemainingAmount   float64   `json:"remaining_amount"`
	DueDate           time.Time `json:"due_date"`
}

type CreateLoanParams

type CreateLoanParams struct {
	ProductID          uint32         `json:"product_id"`
	ClientID           uint32         `json:"client_id"`
	LoanOfficer        uint32         `json:"loan_officer"`
	LoanPurpose        sql.NullString `json:"loan_purpose"`
	DueDate            sql.NullTime   `json:"due_date"`
	ApprovedBy         uint32         `json:"approved_by"`
	DisbursedOn        sql.NullTime   `json:"disbursed_on"`
	DisbursedBy        sql.NullInt32  `json:"disbursed_by"`
	TotalInstallments  uint32         `json:"total_installments"`
	InstallmentsPeriod uint32         `json:"installments_period"`
	Status             LoansStatus    `json:"status"`
	ProcessingFee      float64        `json:"processing_fee"`
	FeePaid            bool           `json:"fee_paid"`
	CreatedBy          uint32         `json:"created_by"`
}

type CreateNonPostedParams

type CreateNonPostedParams struct {
	TransactionSource NonPostedTransactionSource `json:"transaction_source"`
	TransactionNumber string                     `json:"transaction_number"`
	AccountNumber     string                     `json:"account_number"`
	PhoneNumber       string                     `json:"phone_number"`
	PayingName        string                     `json:"paying_name"`
	Amount            float64                    `json:"amount"`
	PaidDate          time.Time                  `json:"paid_date"`
	AssignTo          sql.NullInt32              `json:"assign_to"`
	AssignedBy        string                     `json:"assigned_by"`
}

type CreatePaymentAllocationParams

type CreatePaymentAllocationParams struct {
	NonPostedID   uint32        `json:"non_posted_id"`
	LoanID        sql.NullInt32 `json:"loan_id"`
	InstallmentID sql.NullInt32 `json:"installment_id"`
	Amount        float64       `json:"amount"`
	Description   string        `json:"description"`
}

type CreateProductParams

type CreateProductParams struct {
	BranchID       uint32  `json:"branch_id"`
	LoanAmount     float64 `json:"loan_amount"`
	RepayAmount    float64 `json:"repay_amount"`
	InterestAmount float64 `json:"interest_amount"`
	UpdatedBy      uint32  `json:"updated_by"`
}

type CreateUserParams

type CreateUserParams struct {
	FullName     string    `json:"full_name"`
	PhoneNumber  string    `json:"phone_number"`
	Email        string    `json:"email"`
	Password     string    `json:"password"`
	RefreshToken string    `json:"refresh_token"`
	Role         UsersRole `json:"role"`
	BranchID     uint32    `json:"branch_id"`
	UpdatedAt    time.Time `json:"updated_at"`
	UpdatedBy    uint32    `json:"updated_by"`
	CreatedBy    uint32    `json:"created_by"`
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type DashBoardDataHelperRow

type DashBoardDataHelperRow struct {
	TotalClients          int64       `json:"total_clients"`
	ActiveClients         int64       `json:"active_clients"`
	TotalLoans            int64       `json:"total_loans"`
	ActiveLoans           int64       `json:"active_loans"`
	InactiveLoans         int64       `json:"inactive_loans"`
	TotalLoanAmount       interface{} `json:"total_loan_amount"`
	TotalLoanDisbursed    interface{} `json:"total_loan_disbursed"`
	TotalLoanPaid         interface{} `json:"total_loan_paid"`
	TotalPaymentsReceived interface{} `json:"total_payments_received"`
	TotalNonPosted        interface{} `json:"total_non_posted"`
}

type DashBoardInactiveLoansRow

type DashBoardInactiveLoansRow struct {
	ID             uint32    `json:"id"`
	LoanAmount     float64   `json:"loan_amount"`
	ClientName     string    `json:"client_name"`
	ApprovedByName string    `json:"approved_by_name"`
	RepayAmount    float64   `json:"repay_amount"`
	ClientID       uint32    `json:"client_id"`
	LoanOfficer    uint32    `json:"loan_officer"`
	ApprovedBy     uint32    `json:"approved_by"`
	CreatedAt      time.Time `json:"created_at"`
}

type DashBoardRecentsPaymentsRow

type DashBoardRecentsPaymentsRow struct {
	ID         uint32    `json:"id"`
	PayingName string    `json:"paying_name"`
	Amount     float64   `json:"amount"`
	PaidDate   time.Time `json:"paid_date"`
}

type DeductClientOverpaymentParams

type DeductClientOverpaymentParams struct {
	Overpayment float64 `json:"overpayment"`
	ID          uint32  `json:"id"`
}

type DeletePaymentAllocationsByNonPostedIdParams

type DeletePaymentAllocationsByNonPostedIdParams struct {
	DeletedDescription sql.NullString `json:"deleted_description"`
	NonPostedID        uint32         `json:"non_posted_id"`
}

type DisburseLoanParams

type DisburseLoanParams struct {
	DisbursedOn sql.NullTime    `json:"disbursed_on"`
	DisbursedBy sql.NullInt32   `json:"disbursed_by"`
	Status      NullLoansStatus `json:"status"`
	DueDate     sql.NullTime    `json:"due_date"`
	FeePaid     sql.NullBool    `json:"fee_paid"`
	ID          uint32          `json:"id"`
}

type GetActiveLoanDetailsRow

type GetActiveLoanDetailsRow struct {
	ID          uint32       `json:"id"`
	LoanAmount  float64      `json:"loan_amount"`
	RepayAmount float64      `json:"repay_amount"`
	DisbursedOn sql.NullTime `json:"disbursed_on"`
	DueDate     sql.NullTime `json:"due_date"`
	PaidAmount  float64      `json:"paid_amount"`
}

type GetBranchReportDataParams

type GetBranchReportDataParams struct {
	StartDate sql.NullTime `json:"start_date"`
	EndDate   sql.NullTime `json:"end_date"`
}

type GetBranchReportDataRow

type GetBranchReportDataRow struct {
	BranchName             string      `json:"branch_name"`
	TotalClients           int64       `json:"total_clients"`
	TotalUsers             int64       `json:"total_users"`
	TotalLoansIssued       int64       `json:"total_loans_issued"`
	TotalDisbursedAmount   interface{} `json:"total_disbursed_amount"`
	TotalCollectedAmount   interface{} `json:"total_collected_amount"`
	TotalOutstandingAmount interface{} `json:"total_outstanding_amount"`
	DefaultRate            interface{} `json:"default_rate"`
}

type GetClientActiveLoanParams

type GetClientActiveLoanParams struct {
	ClientID uint32      `json:"client_id"`
	Status   LoansStatus `json:"status"`
}

type GetClientAdminsReportDataParams

type GetClientAdminsReportDataParams struct {
	StartDate time.Time `json:"start_date"`
	EndDate   time.Time `json:"end_date"`
}

type GetClientAdminsReportDataRow

type GetClientAdminsReportDataRow struct {
	Name           string         `json:"name"`
	BranchName     sql.NullString `json:"branch_name"`
	TotalLoanGiven int64          `json:"total_loan_given"`
	DefaultedLoans int64          `json:"defaulted_loans"`
	ActiveLoans    int64          `json:"active_loans"`
	CompletedLoans int64          `json:"completed_loans"`
	InactiveLoans  int64          `json:"inactive_loans"`
	Overpayment    float64        `json:"overpayment"`
	PhoneNumber    string         `json:"phone_number"`
	TotalPaid      interface{}    `json:"total_paid"`
	TotalDisbursed interface{}    `json:"total_disbursed"`
	TotalOwed      interface{}    `json:"total_owed"`
	RateScore      interface{}    `json:"rate_score"`
	DefaultRate    interface{}    `json:"default_rate"`
}

type GetClientClientsReportDataParams

type GetClientClientsReportDataParams struct {
	StartDate time.Time `json:"start_date"`
	EndDate   time.Time `json:"end_date"`
	ID        uint32    `json:"id"`
}

type GetClientClientsReportDataRow

type GetClientClientsReportDataRow struct {
	Name          string         `json:"name"`
	PhoneNumber   string         `json:"phone_number"`
	IDNumber      sql.NullString `json:"id_number"`
	Dob           sql.NullTime   `json:"dob"`
	BranchName    sql.NullString `json:"branch_name"`
	AssignedStaff sql.NullString `json:"assigned_staff"`
	Active        bool           `json:"active"`
	Loans         interface{}    `json:"loans"`
	Payments      interface{}    `json:"payments"`
}

type GetClientFullDataRow

type GetClientFullDataRow struct {
	ClientID          uint32         `json:"client_id"`
	ClientName        string         `json:"client_name"`
	ClientPhone       string         `json:"client_phone"`
	IDNumber          sql.NullString `json:"id_number"`
	Dob               sql.NullTime   `json:"dob"`
	Gender            ClientsGender  `json:"gender"`
	Active            bool           `json:"active"`
	Overpayment       float64        `json:"overpayment"`
	BranchName        string         `json:"branch_name"`
	ClientCreatedAt   time.Time      `json:"client_created_at"`
	AssignedUserID    uint32         `json:"assigned_user_id"`
	AssignedUserName  string         `json:"assigned_user_name"`
	AssignedUserPhone string         `json:"assigned_user_phone"`
	AssignedUserEmail string         `json:"assigned_user_email"`
	AssignedUserRole  UsersRole      `json:"assigned_user_role"`
	CreatedByID       uint32         `json:"created_by_id"`
	CreatedByName     string         `json:"created_by_name"`
	CreatedByPhone    string         `json:"created_by_phone"`
	CreatedByEmail    string         `json:"created_by_email"`
	CreatedByRole     UsersRole      `json:"created_by_role"`
}

type GetClientLoansParams

type GetClientLoansParams struct {
	Column1   interface{} `json:"column_1"`
	FINDINSET string      `json:"FIND_IN_SET"`
	ClientID  uint32      `json:"client_id"`
	Limit     int32       `json:"limit"`
	Offset    int32       `json:"offset"`
}

type GetClientLoansRow

type GetClientLoansRow struct {
	ID                 uint32         `json:"id"`
	ProductID          uint32         `json:"product_id"`
	ClientID           uint32         `json:"client_id"`
	LoanOfficer        uint32         `json:"loan_officer"`
	LoanPurpose        sql.NullString `json:"loan_purpose"`
	DueDate            sql.NullTime   `json:"due_date"`
	ApprovedBy         uint32         `json:"approved_by"`
	DisbursedOn        sql.NullTime   `json:"disbursed_on"`
	DisbursedBy        sql.NullInt32  `json:"disbursed_by"`
	TotalInstallments  uint32         `json:"total_installments"`
	InstallmentsPeriod uint32         `json:"installments_period"`
	Status             LoansStatus    `json:"status"`
	ProcessingFee      float64        `json:"processing_fee"`
	PaidAmount         float64        `json:"paid_amount"`
	UpdatedBy          sql.NullInt32  `json:"updated_by"`
	CreatedBy          uint32         `json:"created_by"`
	CreatedAt          time.Time      `json:"created_at"`
	FeePaid            bool           `json:"fee_paid"`
	ProductBranchID    uint32         `json:"product_branch_id"`
	ProductBranchName  string         `json:"product_branch_name"`
	LoanAmount         float64        `json:"loan_amount"`
	RepayAmount        float64        `json:"repay_amount"`
	InterestAmount     float64        `json:"interest_amount"`
	ClientName         string         `json:"client_name"`
	ClientPhone        string         `json:"client_phone"`
	ClientActive       bool           `json:"client_active"`
	ClientBranchID     uint32         `json:"client_branch_id"`
	ClientBranchName   string         `json:"client_branch_name"`
	LoanOfficerName    string         `json:"loan_officer_name"`
	LoanOfficerEmail   string         `json:"loan_officer_email"`
	LoanOfficerPhone   string         `json:"loan_officer_phone"`
	ApprovedByName     string         `json:"approved_by_name"`
	ApprovedByEmail    string         `json:"approved_by_email"`
	ApprovedByPhone    string         `json:"approved_by_phone"`
	DisbursedByName    sql.NullString `json:"disbursed_by_name"`
	DisbursedByEmail   sql.NullString `json:"disbursed_by_email"`
	DisbursedByPhone   sql.NullString `json:"disbursed_by_phone"`
	UpdatedByName      sql.NullString `json:"updated_by_name"`
	UpdatedByEmail     sql.NullString `json:"updated_by_email"`
	UpdatedByPhone     sql.NullString `json:"updated_by_phone"`
	CreatedByName      sql.NullString `json:"created_by_name"`
	CreatedByEmail     sql.NullString `json:"created_by_email"`
	CreatedByPhone     sql.NullString `json:"created_by_phone"`
}

type GetClientWithBranchNameRow

type GetClientWithBranchNameRow struct {
	ID            uint32         `json:"id"`
	FullName      string         `json:"full_name"`
	PhoneNumber   string         `json:"phone_number"`
	IDNumber      sql.NullString `json:"id_number"`
	Dob           sql.NullTime   `json:"dob"`
	Gender        ClientsGender  `json:"gender"`
	Active        bool           `json:"active"`
	BranchID      uint32         `json:"branch_id"`
	AssignedStaff uint32         `json:"assigned_staff"`
	Overpayment   float64        `json:"overpayment"`
	UpdatedBy     uint32         `json:"updated_by"`
	UpdatedAt     time.Time      `json:"updated_at"`
	CreatedBy     uint32         `json:"created_by"`
	CreatedAt     time.Time      `json:"created_at"`
	BranchName    string         `json:"branch_name"`
}

type GetClientsNonPostedParams

type GetClientsNonPostedParams struct {
	AssignTo      sql.NullInt32  `json:"assign_to"`
	AccountNumber sql.NullString `json:"account_number"`
	Limit         int32          `json:"limit"`
	Offset        int32          `json:"offset"`
}

type GetClientsNonPostedRow

type GetClientsNonPostedRow struct {
	ID                uint32                     `json:"id"`
	TransactionSource NonPostedTransactionSource `json:"transaction_source"`
	TransactionNumber string                     `json:"transaction_number"`
	AccountNumber     string                     `json:"account_number"`
	PhoneNumber       string                     `json:"phone_number"`
	PayingName        string                     `json:"paying_name"`
	Amount            float64                    `json:"amount"`
	PaidDate          time.Time                  `json:"paid_date"`
	AssignTo          sql.NullInt32              `json:"assign_to"`
	AssignedBy        string                     `json:"assigned_by"`
}

type GetLoanDetailsRow

type GetLoanDetailsRow struct {
	ID          uint32       `json:"id"`
	ClientID    uint32       `json:"client_id"`
	LoanAmount  float64      `json:"loan_amount"`
	RepayAmount float64      `json:"repay_amount"`
	DisbursedOn sql.NullTime `json:"disbursed_on"`
	DueDate     sql.NullTime `json:"due_date"`
	PaidAmount  float64      `json:"paid_amount"`
	Status      LoansStatus  `json:"status"`
}

type GetLoanEventsRow

type GetLoanEventsRow struct {
	LoanID        uint32       `json:"loan_id"`
	DisbursedDate sql.NullTime `json:"disbursed_date"`
	DueDate       string       `json:"due_date"`
	ClientName    string       `json:"client_name"`
	LoanAmount    float64      `json:"loan_amount"`
	PaymentDue    string       `json:"payment_due"`
}

type GetLoanFullDataRow

type GetLoanFullDataRow struct {
	ID                 uint32         `json:"id"`
	ProductID          uint32         `json:"product_id"`
	ClientID           uint32         `json:"client_id"`
	LoanOfficer        uint32         `json:"loan_officer"`
	LoanPurpose        sql.NullString `json:"loan_purpose"`
	DueDate            sql.NullTime   `json:"due_date"`
	ApprovedBy         uint32         `json:"approved_by"`
	DisbursedOn        sql.NullTime   `json:"disbursed_on"`
	DisbursedBy        sql.NullInt32  `json:"disbursed_by"`
	TotalInstallments  uint32         `json:"total_installments"`
	InstallmentsPeriod uint32         `json:"installments_period"`
	Status             LoansStatus    `json:"status"`
	ProcessingFee      float64        `json:"processing_fee"`
	PaidAmount         float64        `json:"paid_amount"`
	UpdatedBy          sql.NullInt32  `json:"updated_by"`
	CreatedBy          uint32         `json:"created_by"`
	CreatedAt          time.Time      `json:"created_at"`
	FeePaid            bool           `json:"fee_paid"`
	ProductBranchName  string         `json:"product_branch_name"`
	LoanAmount         float64        `json:"loan_amount"`
	RepayAmount        float64        `json:"repay_amount"`
	InterestAmount     float64        `json:"interest_amount"`
	ClientName         string         `json:"client_name"`
	ClientPhone        string         `json:"client_phone"`
	ClientActive       bool           `json:"client_active"`
	ClientBranchID     uint32         `json:"client_branch_id"`
	ClientBranchName   string         `json:"client_branch_name"`
	LoanOfficerName    string         `json:"loan_officer_name"`
	LoanOfficerEmail   string         `json:"loan_officer_email"`
	LoanOfficerPhone   string         `json:"loan_officer_phone"`
	ApprovedByName     string         `json:"approved_by_name"`
	ApprovedByEmail    string         `json:"approved_by_email"`
	ApprovedByPhone    string         `json:"approved_by_phone"`
	DisbursedByName    sql.NullString `json:"disbursed_by_name"`
	DisbursedByEmail   sql.NullString `json:"disbursed_by_email"`
	DisbursedByPhone   sql.NullString `json:"disbursed_by_phone"`
	UpdatedByName      sql.NullString `json:"updated_by_name"`
	UpdatedByEmail     sql.NullString `json:"updated_by_email"`
	UpdatedByPhone     sql.NullString `json:"updated_by_phone"`
	CreatedByName      sql.NullString `json:"created_by_name"`
	CreatedByEmail     sql.NullString `json:"created_by_email"`
	CreatedByPhone     sql.NullString `json:"created_by_phone"`
}

type GetLoanReportDataByIdRow

type GetLoanReportDataByIdRow struct {
	LoanID                uint32      `json:"loan_id"`
	ClientName            string      `json:"client_name"`
	LoanAmount            float64     `json:"loan_amount"`
	RepayAmount           float64     `json:"repay_amount"`
	PaidAmount            float64     `json:"paid_amount"`
	Status                LoansStatus `json:"status"`
	TotalInstallments     uint32      `json:"total_installments"`
	PaidInstallments      int64       `json:"paid_installments"`
	RemainingInstallments uint32      `json:"remaining_installments"`
	InstallmentDetails    interface{} `json:"installment_details"`
}

type GetLoansReportDataParams

type GetLoansReportDataParams struct {
	StartDate time.Time `json:"start_date"`
	EndDate   time.Time `json:"end_date"`
}

type GetLoansReportDataRow

type GetLoansReportDataRow struct {
	LoanID            uint32       `json:"loan_id"`
	ClientName        string       `json:"client_name"`
	BranchName        string       `json:"branch_name"`
	LoanOfficer       string       `json:"loan_officer"`
	LoanAmount        float64      `json:"loan_amount"`
	RepayAmount       float64      `json:"repay_amount"`
	PaidAmount        float64      `json:"paid_amount"`
	OutstandingAmount interface{}  `json:"outstanding_amount"`
	Status            LoansStatus  `json:"status"`
	TotalInstallments uint32       `json:"total_installments"`
	PaidInstallments  int64        `json:"paid_installments"`
	DueDate           sql.NullTime `json:"due_date"`
	DisbursedDate     sql.NullTime `json:"disbursed_date"`
	DefaultRisk       interface{}  `json:"default_risk"`
}

type GetNonPostedRow

type GetNonPostedRow struct {
	ID                 uint32                     `json:"id"`
	TransactionNumber  string                     `json:"transaction_number"`
	AccountNumber      string                     `json:"account_number"`
	PhoneNumber        string                     `json:"phone_number"`
	PayingName         string                     `json:"paying_name"`
	Amount             float64                    `json:"amount"`
	AssignTo           sql.NullInt32              `json:"assign_to"`
	PaidDate           time.Time                  `json:"paid_date"`
	TransactionSource  NonPostedTransactionSource `json:"transaction_source"`
	AssignedBy         string                     `json:"assigned_by"`
	DeletedAt          sql.NullTime               `json:"deleted_at"`
	DeletedDescription sql.NullString             `json:"deleted_description"`
	ClientID           sql.NullInt32              `json:"client_id"`
	ClientName         sql.NullString             `json:"client_name"`
	ClientPhone        sql.NullString             `json:"client_phone"`
	ClientOverpayment  sql.NullString             `json:"client_overpayment"`
	ClientBranchName   sql.NullString             `json:"client_branch_name"`
}

type GetPaymentReportDataParams

type GetPaymentReportDataParams struct {
	FromPaidDate time.Time `json:"from_paid_date"`
	ToPaidDate   time.Time `json:"to_paid_date"`
}

type GetPaymentReportDataRow

type GetPaymentReportDataRow struct {
	TransactionNumber string                     `json:"transaction_number"`
	PayingName        string                     `json:"paying_name"`
	Amount            float64                    `json:"amount"`
	AccountNumber     string                     `json:"account_number"`
	TransactionSource NonPostedTransactionSource `json:"transaction_source"`
	PaidDate          time.Time                  `json:"paid_date"`
	AssignedName      string                     `json:"assigned_name"`
	AssignedBy        string                     `json:"assigned_by"`
}

type GetProductReportDataParams

type GetProductReportDataParams struct {
	StartDate sql.NullTime `json:"start_date"`
	EndDate   sql.NullTime `json:"end_date"`
}

type GetProductReportDataRow

type GetProductReportDataRow struct {
	ProductName            string      `json:"product_name"`
	TotalLoansIssued       int64       `json:"total_loans_issued"`
	TotalAmountDisbursed   interface{} `json:"total_amount_disbursed"`
	TotalAmountRepaid      interface{} `json:"total_amount_repaid"`
	TotalOutstandingAmount interface{} `json:"total_outstanding_amount"`
	ActiveLoans            int64       `json:"active_loans"`
	CompletedLoans         int64       `json:"completed_loans"`
	DefaultedLoans         int64       `json:"defaulted_loans"`
	DefaultRate            interface{} `json:"default_rate"`
}

type GetProductRow

type GetProductRow struct {
	ID             uint32    `json:"id"`
	BranchID       uint32    `json:"branch_id"`
	LoanAmount     float64   `json:"loan_amount"`
	RepayAmount    float64   `json:"repay_amount"`
	InterestAmount float64   `json:"interest_amount"`
	UpdatedBy      uint32    `json:"updated_by"`
	UpdatedAt      time.Time `json:"updated_at"`
	CreatedAt      time.Time `json:"created_at"`
	BranchName     string    `json:"branch_name"`
}

type GetTotalPaidByIDorAccountNoParams

type GetTotalPaidByIDorAccountNoParams struct {
	AssignTo      sql.NullInt32  `json:"assign_to"`
	AccountNumber sql.NullString `json:"account_number"`
}

type GetUnpaidInstallmentsDataParams

type GetUnpaidInstallmentsDataParams struct {
	Column1     interface{} `json:"column_1"`
	FullName    string      `json:"full_name"`
	PhoneNumber string      `json:"phone_number"`
	Limit       int32       `json:"limit"`
	Offset      int32       `json:"offset"`
}

type GetUnpaidInstallmentsDataRow

type GetUnpaidInstallmentsDataRow struct {
	InstallmentNumber uint32    `json:"installment_number"`
	RemainingAmount   float64   `json:"remaining_amount"`
	DueDate           time.Time `json:"due_date"`
	LoanOfficer       string    `json:"loan_officer"`
	LoanID            uint32    `json:"loan_id"`
	LoanAmount        float64   `json:"loan_amount"`
	RepayAmount       float64   `json:"repay_amount"`
	ProductBranchname string    `json:"product_branchname"`
	ClientBranchname  string    `json:"client_branchname"`
	ClientID          uint32    `json:"client_id"`
	ClientName        string    `json:"client_name"`
	ClientPhone       string    `json:"client_phone"`
	LoanPaidAmount    float64   `json:"loan_paid_amount"`
}

type GetUserAdminsReportDataParams

type GetUserAdminsReportDataParams struct {
	StartDate time.Time `json:"start_date"`
	EndDate   time.Time `json:"end_date"`
}

type GetUserAdminsReportDataRow

type GetUserAdminsReportDataRow struct {
	Name              string         `json:"name"`
	Role              UsersRole      `json:"role"`
	BranchName        sql.NullString `json:"branch_name"`
	ApprovedLoans     int64          `json:"approved_loans"`
	ActiveLoans       int64          `json:"active_loans"`
	CompletedLoans    int64          `json:"completed_loans"`
	DefaultRate       interface{}    `json:"default_rate"`
	ClientsRegistered int64          `json:"clients_registered"`
	PaymentsAssigned  int64          `json:"payments_assigned"`
}

type GetUserByEmailRow

type GetUserByEmailRow struct {
	ID              uint32    `json:"id"`
	FullName        string    `json:"full_name"`
	PhoneNumber     string    `json:"phone_number"`
	Email           string    `json:"email"`
	Password        string    `json:"password"`
	PasswordUpdated uint32    `json:"password_updated"`
	RefreshToken    string    `json:"refresh_token"`
	Role            UsersRole `json:"role"`
	BranchID        uint32    `json:"branch_id"`
	UpdatedBy       uint32    `json:"updated_by"`
	UpdatedAt       time.Time `json:"updated_at"`
	CreatedBy       uint32    `json:"created_by"`
	CreatedAt       time.Time `json:"created_at"`
	BranchName      string    `json:"branch_name"`
}

type GetUserRow

type GetUserRow struct {
	ID              uint32    `json:"id"`
	FullName        string    `json:"full_name"`
	PhoneNumber     string    `json:"phone_number"`
	Email           string    `json:"email"`
	Password        string    `json:"password"`
	PasswordUpdated uint32    `json:"password_updated"`
	RefreshToken    string    `json:"refresh_token"`
	Role            UsersRole `json:"role"`
	BranchID        uint32    `json:"branch_id"`
	UpdatedBy       uint32    `json:"updated_by"`
	UpdatedAt       time.Time `json:"updated_at"`
	CreatedBy       uint32    `json:"created_by"`
	CreatedAt       time.Time `json:"created_at"`
	BranchName      string    `json:"branch_name"`
}

type GetUserUsersReportDataParams

type GetUserUsersReportDataParams struct {
	StartDate time.Time `json:"start_date"`
	EndDate   time.Time `json:"end_date"`
	ID        uint32    `json:"id"`
}

type GetUserUsersReportDataRow

type GetUserUsersReportDataRow struct {
	Name                   string         `json:"name"`
	Role                   UsersRole      `json:"role"`
	Branch                 sql.NullString `json:"branch"`
	TotalClientsHandled    int64          `json:"total_clients_handled"`
	LoansApproved          int64          `json:"loans_approved"`
	TotalLoanAmountManaged interface{}    `json:"total_loan_amount_managed"`
	TotalCollectedAmount   interface{}    `json:"total_collected_amount"`
	DefaultRate            interface{}    `json:"default_rate"`
	AssignedPayments       int64          `json:"assigned_payments"`
	AssignedLoans          interface{}    `json:"assigned_loans"`
	AssignedPaymentsList   interface{}    `json:"assigned_payments_list"`
}

type HelperClientRow

type HelperClientRow struct {
	ID          uint32 `json:"id"`
	FullName    string `json:"full_name"`
	PhoneNumber string `json:"phone_number"`
}

type HelperProductRow

type HelperProductRow struct {
	Productid  uint32  `json:"productid"`
	Loanamount float64 `json:"loanamount"`
	Branchname string  `json:"branchname"`
}

type HelperUserRow

type HelperUserRow struct {
	ID       uint32 `json:"id"`
	FullName string `json:"full_name"`
}

type Installment

type Installment struct {
	ID                uint32       `json:"id"`
	LoanID            uint32       `json:"loan_id"`
	InstallmentNumber uint32       `json:"installment_number"`
	AmountDue         float64      `json:"amount_due"`
	RemainingAmount   float64      `json:"remaining_amount"`
	Paid              bool         `json:"paid"`
	PaidAt            sql.NullTime `json:"paid_at"`
	DueDate           time.Time    `json:"due_date"`
}

type ListAllNonPostedParams

type ListAllNonPostedParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type ListBrachesByCategoryParams

type ListBrachesByCategoryParams struct {
	Column1 interface{} `json:"column_1"`
	Name    string      `json:"name"`
	Limit   int32       `json:"limit"`
	Offset  int32       `json:"offset"`
}

type ListClientsByActiveStatusParams

type ListClientsByActiveStatusParams struct {
	Active bool  `json:"active"`
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type ListClientsByBranchParams

type ListClientsByBranchParams struct {
	BranchID uint32 `json:"branch_id"`
	Limit    int32  `json:"limit"`
	Offset   int32  `json:"offset"`
}

type ListClientsByCategoryParams

type ListClientsByCategoryParams struct {
	Column1     interface{}  `json:"column_1"`
	FullName    string       `json:"full_name"`
	PhoneNumber string       `json:"phone_number"`
	Active      sql.NullBool `json:"active"`
	Limit       int32        `json:"limit"`
	Offset      int32        `json:"offset"`
}

type ListClientsByCategoryRow

type ListClientsByCategoryRow struct {
	ID                uint32         `json:"id"`
	FullName          string         `json:"full_name"`
	PhoneNumber       string         `json:"phone_number"`
	IDNumber          sql.NullString `json:"id_number"`
	Dob               sql.NullTime   `json:"dob"`
	Gender            ClientsGender  `json:"gender"`
	Active            bool           `json:"active"`
	BranchID          uint32         `json:"branch_id"`
	AssignedStaff     uint32         `json:"assigned_staff"`
	Overpayment       float64        `json:"overpayment"`
	UpdatedBy         uint32         `json:"updated_by"`
	UpdatedAt         time.Time      `json:"updated_at"`
	CreatedAt         time.Time      `json:"created_at"`
	CreatedBy         uint32         `json:"created_by"`
	BranchName        string         `json:"branch_name"`
	Dueamount         interface{}    `json:"dueamount"`
	AssignedUserID    sql.NullInt32  `json:"assigned_user_id"`
	AssignedUserName  sql.NullString `json:"assigned_user_name"`
	AssignedUserPhone sql.NullString `json:"assigned_user_phone"`
	AssignedUserEmail sql.NullString `json:"assigned_user_email"`
	AssignedUserRole  NullUsersRole  `json:"assigned_user_role"`
	UpdatedUserID     sql.NullInt32  `json:"updated_user_id"`
	UpdatedUserName   sql.NullString `json:"updated_user_name"`
	UpdatedUserPhone  sql.NullString `json:"updated_user_phone"`
	UpdatedUserEmail  sql.NullString `json:"updated_user_email"`
	UpdatedUserRole   NullUsersRole  `json:"updated_user_role"`
	CreatedUserID     sql.NullInt32  `json:"created_user_id"`
	CreatedUserName   sql.NullString `json:"created_user_name"`
	CreatedUserPhone  sql.NullString `json:"created_user_phone"`
	CreatedUserEmail  sql.NullString `json:"created_user_email"`
	CreatedUserRole   NullUsersRole  `json:"created_user_role"`
}

type ListClientsParams

type ListClientsParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type ListExpectedPaymentsParams

type ListExpectedPaymentsParams struct {
	Column1    interface{} `json:"column_1"`
	FullName   string      `json:"full_name"`
	FullName_2 string      `json:"full_name_2"`
	Limit      int32       `json:"limit"`
	Offset     int32       `json:"offset"`
}

type ListExpectedPaymentsRow

type ListExpectedPaymentsRow struct {
	BranchName      string       `json:"branch_name"`
	ClientName      string       `json:"client_name"`
	LoanOfficerName string       `json:"loan_officer_name"`
	LoanID          uint32       `json:"loan_id"`
	LoanAmount      float64      `json:"loan_amount"`
	RepayAmount     float64      `json:"repay_amount"`
	TotalUnpaid     interface{}  `json:"total_unpaid"`
	DueDate         sql.NullTime `json:"due_date"`
}

type ListLoansByClientParams

type ListLoansByClientParams struct {
	ClientID uint32 `json:"client_id"`
	Limit    int32  `json:"limit"`
	Offset   int32  `json:"offset"`
}

type ListLoansByLoanOfficerParams

type ListLoansByLoanOfficerParams struct {
	LoanOfficer uint32 `json:"loan_officer"`
	Limit       int32  `json:"limit"`
	Offset      int32  `json:"offset"`
}

type ListLoansByStatusParams

type ListLoansByStatusParams struct {
	Status LoansStatus `json:"status"`
	Limit  int32       `json:"limit"`
	Offset int32       `json:"offset"`
}

type ListLoansParams

type ListLoansParams struct {
	Column1    interface{} `json:"column_1"`
	FullName   string      `json:"full_name"`
	FullName_2 string      `json:"full_name_2"`
	Column4    interface{} `json:"column_4"`
	FINDINSET  string      `json:"FIND_IN_SET"`
	Limit      int32       `json:"limit"`
	Offset     int32       `json:"offset"`
}

type ListLoansRow

type ListLoansRow struct {
	ID                 uint32         `json:"id"`
	ProductID          uint32         `json:"product_id"`
	ClientID           uint32         `json:"client_id"`
	LoanOfficer        uint32         `json:"loan_officer"`
	LoanPurpose        sql.NullString `json:"loan_purpose"`
	DueDate            sql.NullTime   `json:"due_date"`
	ApprovedBy         uint32         `json:"approved_by"`
	DisbursedOn        sql.NullTime   `json:"disbursed_on"`
	DisbursedBy        sql.NullInt32  `json:"disbursed_by"`
	TotalInstallments  uint32         `json:"total_installments"`
	InstallmentsPeriod uint32         `json:"installments_period"`
	Status             LoansStatus    `json:"status"`
	ProcessingFee      float64        `json:"processing_fee"`
	PaidAmount         float64        `json:"paid_amount"`
	UpdatedBy          sql.NullInt32  `json:"updated_by"`
	CreatedBy          uint32         `json:"created_by"`
	CreatedAt          time.Time      `json:"created_at"`
	FeePaid            bool           `json:"fee_paid"`
	ProductBranchID    uint32         `json:"product_branch_id"`
	ProductBranchName  string         `json:"product_branch_name"`
	LoanAmount         float64        `json:"loan_amount"`
	RepayAmount        float64        `json:"repay_amount"`
	InterestAmount     float64        `json:"interest_amount"`
	ClientName         string         `json:"client_name"`
	ClientPhone        string         `json:"client_phone"`
	ClientActive       bool           `json:"client_active"`
	ClientBranchID     uint32         `json:"client_branch_id"`
	ClientBranchName   string         `json:"client_branch_name"`
	LoanOfficerName    string         `json:"loan_officer_name"`
	LoanOfficerEmail   string         `json:"loan_officer_email"`
	LoanOfficerPhone   string         `json:"loan_officer_phone"`
	ApprovedByName     string         `json:"approved_by_name"`
	ApprovedByEmail    string         `json:"approved_by_email"`
	ApprovedByPhone    string         `json:"approved_by_phone"`
	DisbursedByName    sql.NullString `json:"disbursed_by_name"`
	DisbursedByEmail   sql.NullString `json:"disbursed_by_email"`
	DisbursedByPhone   sql.NullString `json:"disbursed_by_phone"`
	UpdatedByName      sql.NullString `json:"updated_by_name"`
	UpdatedByEmail     sql.NullString `json:"updated_by_email"`
	UpdatedByPhone     sql.NullString `json:"updated_by_phone"`
	CreatedByName      sql.NullString `json:"created_by_name"`
	CreatedByEmail     sql.NullString `json:"created_by_email"`
	CreatedByPhone     sql.NullString `json:"created_by_phone"`
}

type ListNonDisbursedLoansParams

type ListNonDisbursedLoansParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type ListNonPostedByCategoryParams

type ListNonPostedByCategoryParams struct {
	Column1           interface{} `json:"column_1"`
	PayingName        string      `json:"paying_name"`
	AccountNumber     string      `json:"account_number"`
	TransactionNumber string      `json:"transaction_number"`
	Column5           interface{} `json:"column_5"`
	FINDINSET         string      `json:"FIND_IN_SET"`
	FromPaidDate      time.Time   `json:"from_paid_date"`
	ToPaidDate        time.Time   `json:"to_paid_date"`
	Limit             int32       `json:"limit"`
	Offset            int32       `json:"offset"`
}

type ListNonPostedByCategoryRow

type ListNonPostedByCategoryRow struct {
	ID                 uint32                     `json:"id"`
	TransactionNumber  string                     `json:"transaction_number"`
	AccountNumber      string                     `json:"account_number"`
	PhoneNumber        string                     `json:"phone_number"`
	PayingName         string                     `json:"paying_name"`
	Amount             float64                    `json:"amount"`
	AssignTo           sql.NullInt32              `json:"assign_to"`
	PaidDate           time.Time                  `json:"paid_date"`
	TransactionSource  NonPostedTransactionSource `json:"transaction_source"`
	AssignedBy         string                     `json:"assigned_by"`
	DeletedAt          sql.NullTime               `json:"deleted_at"`
	DeletedDescription sql.NullString             `json:"deleted_description"`
	ClientID           sql.NullInt32              `json:"client_id"`
	ClientName         sql.NullString             `json:"client_name"`
	ClientPhone        sql.NullString             `json:"client_phone"`
	ClientOverpayment  sql.NullString             `json:"client_overpayment"`
	ClientBranchName   sql.NullString             `json:"client_branch_name"`
}

type ListNonPostedByTransactionSourceParams

type ListNonPostedByTransactionSourceParams struct {
	TransactionSource NonPostedTransactionSource `json:"transaction_source"`
	Limit             int32                      `json:"limit"`
	Offset            int32                      `json:"offset"`
}

type ListPaymentAllocationsByLoanIdRow

type ListPaymentAllocationsByLoanIdRow struct {
	ID                 uint32                     `json:"id"`
	NonPostedID        uint32                     `json:"non_posted_id"`
	LoanID             sql.NullInt32              `json:"loan_id"`
	InstallmentID      sql.NullInt32              `json:"installment_id"`
	Amount             float64                    `json:"amount"`
	Description        string                     `json:"description"`
	DeletedAt          sql.NullTime               `json:"deleted_at"`
	DeletedDescription sql.NullString             `json:"deleted_description"`
	CreatedAt          time.Time                  `json:"created_at"`
	TransactionSource  NonPostedTransactionSource `json:"transaction_source"`
	TransactionNumber  string                     `json:"transaction_number"`
	AccountNumber      string                     `json:"account_number"`
	PayingName         string                     `json:"paying_name"`
	Amount_2           float64                    `json:"amount_2"`
	PaidDate           time.Time                  `json:"paid_date"`
}

type ListPaymentAllocationsByNonPostedIDRow

type ListPaymentAllocationsByNonPostedIDRow struct {
	ID                 uint32                     `json:"id"`
	NonPostedID        uint32                     `json:"non_posted_id"`
	LoanID             sql.NullInt32              `json:"loan_id"`
	InstallmentID      sql.NullInt32              `json:"installment_id"`
	Amount             float64                    `json:"amount"`
	Description        string                     `json:"description"`
	DeletedAt          sql.NullTime               `json:"deleted_at"`
	DeletedDescription sql.NullString             `json:"deleted_description"`
	CreatedAt          time.Time                  `json:"created_at"`
	TransactionSource  NonPostedTransactionSource `json:"transaction_source"`
	TransactionNumber  string                     `json:"transaction_number"`
	AccountNumber      string                     `json:"account_number"`
	PayingName         string                     `json:"paying_name"`
	Amount_2           float64                    `json:"amount_2"`
	PaidDate           time.Time                  `json:"paid_date"`
}

type ListProductsByBranchParams

type ListProductsByBranchParams struct {
	BranchID uint32 `json:"branch_id"`
	Limit    int32  `json:"limit"`
	Offset   int32  `json:"offset"`
}

type ListProductsByCategoryParams

type ListProductsByCategoryParams struct {
	Column1 interface{} `json:"column_1"`
	Name    string      `json:"name"`
	Limit   int32       `json:"limit"`
	Offset  int32       `json:"offset"`
}

type ListProductsByCategoryRow

type ListProductsByCategoryRow struct {
	ID             uint32    `json:"id"`
	BranchID       uint32    `json:"branch_id"`
	LoanAmount     float64   `json:"loan_amount"`
	RepayAmount    float64   `json:"repay_amount"`
	InterestAmount float64   `json:"interest_amount"`
	UpdatedBy      uint32    `json:"updated_by"`
	UpdatedAt      time.Time `json:"updated_at"`
	CreatedAt      time.Time `json:"created_at"`
	BranchName     string    `json:"branch_name"`
}

type ListProductsParams

type ListProductsParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type ListUnassignedNonPostedParams

type ListUnassignedNonPostedParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type ListUsersByCategoryParams

type ListUsersByCategoryParams struct {
	Column1   interface{} `json:"column_1"`
	FullName  string      `json:"full_name"`
	Email     string      `json:"email"`
	Column4   interface{} `json:"column_4"`
	FINDINSET string      `json:"FIND_IN_SET"`
	Limit     int32       `json:"limit"`
	Offset    int32       `json:"offset"`
}

type ListUsersByCategoryRow

type ListUsersByCategoryRow struct {
	ID              uint32    `json:"id"`
	FullName        string    `json:"full_name"`
	PhoneNumber     string    `json:"phone_number"`
	Email           string    `json:"email"`
	Password        string    `json:"password"`
	PasswordUpdated uint32    `json:"password_updated"`
	RefreshToken    string    `json:"refresh_token"`
	Role            UsersRole `json:"role"`
	BranchID        uint32    `json:"branch_id"`
	UpdatedBy       uint32    `json:"updated_by"`
	UpdatedAt       time.Time `json:"updated_at"`
	CreatedBy       uint32    `json:"created_by"`
	CreatedAt       time.Time `json:"created_at"`
	BranchName      string    `json:"branch_name"`
}

type ListUsersParams

type ListUsersParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type Loan

type Loan struct {
	ID                 uint32         `json:"id"`
	ProductID          uint32         `json:"product_id"`
	ClientID           uint32         `json:"client_id"`
	LoanOfficer        uint32         `json:"loan_officer"`
	LoanPurpose        sql.NullString `json:"loan_purpose"`
	DueDate            sql.NullTime   `json:"due_date"`
	ApprovedBy         uint32         `json:"approved_by"`
	DisbursedOn        sql.NullTime   `json:"disbursed_on"`
	DisbursedBy        sql.NullInt32  `json:"disbursed_by"`
	TotalInstallments  uint32         `json:"total_installments"`
	InstallmentsPeriod uint32         `json:"installments_period"`
	Status             LoansStatus    `json:"status"`
	ProcessingFee      float64        `json:"processing_fee"`
	PaidAmount         float64        `json:"paid_amount"`
	UpdatedBy          sql.NullInt32  `json:"updated_by"`
	CreatedBy          uint32         `json:"created_by"`
	CreatedAt          time.Time      `json:"created_at"`
	FeePaid            bool           `json:"fee_paid"`
}

type LoansStatus

type LoansStatus string
const (
	LoansStatusINACTIVE  LoansStatus = "INACTIVE"
	LoansStatusACTIVE    LoansStatus = "ACTIVE"
	LoansStatusCOMPLETED LoansStatus = "COMPLETED"
	LoansStatusDEFAULTED LoansStatus = "DEFAULTED"
)

func (*LoansStatus) Scan

func (e *LoansStatus) Scan(src interface{}) error

type NonPosted

type NonPosted struct {
	ID                 uint32                     `json:"id"`
	TransactionNumber  string                     `json:"transaction_number"`
	AccountNumber      string                     `json:"account_number"`
	PhoneNumber        string                     `json:"phone_number"`
	PayingName         string                     `json:"paying_name"`
	Amount             float64                    `json:"amount"`
	AssignTo           sql.NullInt32              `json:"assign_to"`
	PaidDate           time.Time                  `json:"paid_date"`
	TransactionSource  NonPostedTransactionSource `json:"transaction_source"`
	AssignedBy         string                     `json:"assigned_by"`
	DeletedAt          sql.NullTime               `json:"deleted_at"`
	DeletedDescription sql.NullString             `json:"deleted_description"`
}

type NonPostedTransactionSource

type NonPostedTransactionSource string
const (
	NonPostedTransactionSourceMPESA    NonPostedTransactionSource = "MPESA"
	NonPostedTransactionSourceINTERNAL NonPostedTransactionSource = "INTERNAL"
)

func (*NonPostedTransactionSource) Scan

func (e *NonPostedTransactionSource) Scan(src interface{}) error

type NullClientsGender

type NullClientsGender struct {
	ClientsGender ClientsGender `json:"clients_gender"`
	Valid         bool          `json:"valid"` // Valid is true if ClientsGender is not NULL
}

func (*NullClientsGender) Scan

func (ns *NullClientsGender) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullClientsGender) Value

func (ns NullClientsGender) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullLoansStatus

type NullLoansStatus struct {
	LoansStatus LoansStatus `json:"loans_status"`
	Valid       bool        `json:"valid"` // Valid is true if LoansStatus is not NULL
}

func (*NullLoansStatus) Scan

func (ns *NullLoansStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullLoansStatus) Value

func (ns NullLoansStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullNonPostedTransactionSource

type NullNonPostedTransactionSource struct {
	NonPostedTransactionSource NonPostedTransactionSource `json:"non_posted_transaction_source"`
	Valid                      bool                       `json:"valid"` // Valid is true if NonPostedTransactionSource is not NULL
}

func (*NullNonPostedTransactionSource) Scan

func (ns *NullNonPostedTransactionSource) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullNonPostedTransactionSource) Value

Value implements the driver Valuer interface.

type NullUsersRole

type NullUsersRole struct {
	UsersRole UsersRole `json:"users_role"`
	Valid     bool      `json:"valid"` // Valid is true if UsersRole is not NULL
}

func (*NullUsersRole) Scan

func (ns *NullUsersRole) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullUsersRole) Value

func (ns NullUsersRole) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type PayInstallmentParams

type PayInstallmentParams struct {
	RemainingAmount float64      `json:"remaining_amount"`
	Paid            sql.NullBool `json:"paid"`
	PaidAt          sql.NullTime `json:"paid_at"`
	ID              uint32       `json:"id"`
}

type PaymentAllocation

type PaymentAllocation struct {
	ID                 uint32         `json:"id"`
	NonPostedID        uint32         `json:"non_posted_id"`
	LoanID             sql.NullInt32  `json:"loan_id"`
	InstallmentID      sql.NullInt32  `json:"installment_id"`
	Amount             float64        `json:"amount"`
	Description        string         `json:"description"`
	DeletedAt          sql.NullTime   `json:"deleted_at"`
	DeletedDescription sql.NullString `json:"deleted_description"`
	CreatedAt          time.Time      `json:"created_at"`
}

type Product

type Product struct {
	ID             uint32    `json:"id"`
	BranchID       uint32    `json:"branch_id"`
	LoanAmount     float64   `json:"loan_amount"`
	RepayAmount    float64   `json:"repay_amount"`
	InterestAmount float64   `json:"interest_amount"`
	UpdatedBy      uint32    `json:"updated_by"`
	UpdatedAt      time.Time `json:"updated_at"`
	CreatedAt      time.Time `json:"created_at"`
}

type Querier

type Querier interface {
	// SELECT * FROM non_posted WHERE id = ? LIMIT 1;
	AssignNonPosted(ctx context.Context, arg AssignNonPostedParams) (sql.Result, error)
	CheckActiveLoanForClient(ctx context.Context, clientID uint32) (bool, error)
	CheckUserExistance(ctx context.Context, email string) (int64, error)
	CountBranchesByCategory(ctx context.Context, arg CountBranchesByCategoryParams) (int64, error)
	CountClientLoans(ctx context.Context, arg CountClientLoansParams) (int64, error)
	CountClientsByCategory(ctx context.Context, arg CountClientsByCategoryParams) (int64, error)
	CountClientsNonPosted(ctx context.Context, arg CountClientsNonPostedParams) (int64, error)
	CountExpectedPayments(ctx context.Context, arg CountExpectedPaymentsParams) (int64, error)
	CountLoans(ctx context.Context, arg CountLoansParams) (int64, error)
	CountLoansByCategory(ctx context.Context, arg CountLoansByCategoryParams) (int64, error)
	CountNonPostedByCategory(ctx context.Context, arg CountNonPostedByCategoryParams) (int64, error)
	CountUnpaidInstallmentsData(ctx context.Context, arg CountUnpaidInstallmentsDataParams) (int64, error)
	CountUsersByCategory(ctx context.Context, arg CountUsersByCategoryParams) (int64, error)
	CreateBranch(ctx context.Context, name string) (sql.Result, error)
	CreateClient(ctx context.Context, arg CreateClientParams) (sql.Result, error)
	CreateClientOverpaymentTransaction(ctx context.Context, arg CreateClientOverpaymentTransactionParams) (sql.Result, error)
	CreateInstallment(ctx context.Context, arg CreateInstallmentParams) (sql.Result, error)
	CreateLoan(ctx context.Context, arg CreateLoanParams) (sql.Result, error)
	CreateNonPosted(ctx context.Context, arg CreateNonPostedParams) (sql.Result, error)
	CreatePaymentAllocation(ctx context.Context, arg CreatePaymentAllocationParams) (sql.Result, error)
	CreateProduct(ctx context.Context, arg CreateProductParams) (sql.Result, error)
	CreateUser(ctx context.Context, arg CreateUserParams) (sql.Result, error)
	DashBoardDataHelper(ctx context.Context) (DashBoardDataHelperRow, error)
	DashBoardInactiveLoans(ctx context.Context) ([]DashBoardInactiveLoansRow, error)
	DashBoardRecentsPayments(ctx context.Context) ([]DashBoardRecentsPaymentsRow, error)
	DeductClientOverpayment(ctx context.Context, arg DeductClientOverpaymentParams) (sql.Result, error)
	DeleteBranch(ctx context.Context, id uint32) error
	DeleteClient(ctx context.Context, id uint32) (sql.Result, error)
	DeleteLoan(ctx context.Context, id uint32) error
	DeleteNonPosted(ctx context.Context, id uint32) error
	DeletePaymentAllocation(ctx context.Context, id uint32) (sql.Result, error)
	DeletePaymentAllocationsByNonPostedId(ctx context.Context, arg DeletePaymentAllocationsByNonPostedIdParams) (sql.Result, error)
	DeleteProduct(ctx context.Context, id uint32) error
	DisburseLoan(ctx context.Context, arg DisburseLoanParams) (sql.Result, error)
	GetActiveLoanDetails(ctx context.Context, clientID uint32) (GetActiveLoanDetailsRow, error)
	GetBranch(ctx context.Context, id uint32) (Branch, error)
	GetBranchReportData(ctx context.Context, arg GetBranchReportDataParams) ([]GetBranchReportDataRow, error)
	GetClient(ctx context.Context, id uint32) (Client, error)
	GetClientActiveLoan(ctx context.Context, arg GetClientActiveLoanParams) (uint32, error)
	GetClientAdminsReportData(ctx context.Context, arg GetClientAdminsReportDataParams) ([]GetClientAdminsReportDataRow, error)
	GetClientByPhoneNumber(ctx context.Context, phoneNumber string) (Client, error)
	GetClientClientsReportData(ctx context.Context, arg GetClientClientsReportDataParams) (GetClientClientsReportDataRow, error)
	// JOIN users updated ON c.updated_by = updated.id
	GetClientFullData(ctx context.Context, id uint32) (GetClientFullDataRow, error)
	GetClientIDByPhoneNumber(ctx context.Context, phoneNumber string) (uint32, error)
	// Left joins for optional fields (disbursed_by, updated_by, created_by)
	GetClientLoans(ctx context.Context, arg GetClientLoansParams) ([]GetClientLoansRow, error)
	GetClientOverpayment(ctx context.Context, id uint32) (float64, error)
	GetClientOverpaymentTransaction(ctx context.Context, id uint32) (ClientOverpaymentTransaction, error)
	GetClientOverpaymentTransactionByPaymentId(ctx context.Context, paymentID sql.NullInt32) (ClientOverpaymentTransaction, error)
	GetClientOverpaymentTransactions(ctx context.Context, clientID uint32) ([]ClientOverpaymentTransaction, error)
	GetClientWithBranchName(ctx context.Context, id uint32) (GetClientWithBranchNameRow, error)
	GetClientsNonPosted(ctx context.Context, arg GetClientsNonPostedParams) ([]GetClientsNonPostedRow, error)
	GetInstallment(ctx context.Context, id uint32) (Installment, error)
	GetLoan(ctx context.Context, id uint32) (Loan, error)
	GetLoanClientID(ctx context.Context, id uint32) (uint32, error)
	GetLoanData(ctx context.Context) ([]uint32, error)
	GetLoanDetails(ctx context.Context, id uint32) (GetLoanDetailsRow, error)
	GetLoanEvents(ctx context.Context) ([]GetLoanEventsRow, error)
	// Left joins for optional fields (disbursed_by, updated_by, created_by)
	GetLoanFullData(ctx context.Context, id uint32) (GetLoanFullDataRow, error)
	GetLoanReportDataById(ctx context.Context, id uint32) (GetLoanReportDataByIdRow, error)
	GetLoanStatus(ctx context.Context, id uint32) (LoansStatus, error)
	GetLoansReportData(ctx context.Context, arg GetLoansReportDataParams) ([]GetLoansReportDataRow, error)
	GetNonPosted(ctx context.Context, id uint32) (GetNonPostedRow, error)
	GetPaymentReportData(ctx context.Context, arg GetPaymentReportDataParams) ([]GetPaymentReportDataRow, error)
	GetProduct(ctx context.Context, id uint32) (GetProductRow, error)
	// SELECT * FROM products WHERE id = ? LIMIT 1;
	GetProductRepayAmount(ctx context.Context, id uint32) (float64, error)
	GetProductReportData(ctx context.Context, arg GetProductReportDataParams) ([]GetProductReportDataRow, error)
	GetTotalPaidByIDorAccountNo(ctx context.Context, arg GetTotalPaidByIDorAccountNoParams) (interface{}, error)
	GetUnpaidInstallmentsData(ctx context.Context, arg GetUnpaidInstallmentsDataParams) ([]GetUnpaidInstallmentsDataRow, error)
	GetUser(ctx context.Context, id uint32) (GetUserRow, error)
	GetUserAdminsReportData(ctx context.Context, arg GetUserAdminsReportDataParams) ([]GetUserAdminsReportDataRow, error)
	// SELECT * FROM users WHERE id = ? LIMIT 1;
	GetUserByEmail(ctx context.Context, email string) (GetUserByEmailRow, error)
	GetUserUsersReportData(ctx context.Context, arg GetUserUsersReportDataParams) (GetUserUsersReportDataRow, error)
	HelperClient(ctx context.Context) ([]HelperClientRow, error)
	HelperProduct(ctx context.Context) ([]HelperProductRow, error)
	HelperUser(ctx context.Context) ([]HelperUserRow, error)
	HelperUserById(ctx context.Context, id uint32) (string, error)
	ListAllNonPosted(ctx context.Context, arg ListAllNonPostedParams) ([]NonPosted, error)
	ListAllNonPostedByTransactionSource(ctx context.Context, transactionSource NonPostedTransactionSource) ([]NonPosted, error)
	ListBrachesByCategory(ctx context.Context, arg ListBrachesByCategoryParams) ([]Branch, error)
	ListBranches(ctx context.Context) ([]Branch, error)
	ListClients(ctx context.Context, arg ListClientsParams) ([]Client, error)
	ListClientsByActiveStatus(ctx context.Context, arg ListClientsByActiveStatusParams) ([]Client, error)
	ListClientsByBranch(ctx context.Context, arg ListClientsByBranchParams) ([]Client, error)
	ListClientsByCategory(ctx context.Context, arg ListClientsByCategoryParams) ([]ListClientsByCategoryRow, error)
	ListExpectedPayments(ctx context.Context, arg ListExpectedPaymentsParams) ([]ListExpectedPaymentsRow, error)
	ListInstallmentsByLoan(ctx context.Context, loanID uint32) ([]Installment, error)
	// Left joins for optional fields (disbursed_by, updated_by, created_by)
	ListLoans(ctx context.Context, arg ListLoansParams) ([]ListLoansRow, error)
	ListLoansByClient(ctx context.Context, arg ListLoansByClientParams) ([]Loan, error)
	ListLoansByLoanOfficer(ctx context.Context, arg ListLoansByLoanOfficerParams) ([]Loan, error)
	ListLoansByStatus(ctx context.Context, arg ListLoansByStatusParams) ([]Loan, error)
	ListNonDisbursedLoans(ctx context.Context, arg ListNonDisbursedLoansParams) ([]Loan, error)
	ListNonPostedByCategory(ctx context.Context, arg ListNonPostedByCategoryParams) ([]ListNonPostedByCategoryRow, error)
	ListNonPostedByTransactionSource(ctx context.Context, arg ListNonPostedByTransactionSourceParams) ([]NonPosted, error)
	ListPaymentAllocationsByLoanId(ctx context.Context, loanID sql.NullInt32) ([]ListPaymentAllocationsByLoanIdRow, error)
	ListPaymentAllocationsByNonPostedID(ctx context.Context, nonPostedID uint32) ([]ListPaymentAllocationsByNonPostedIDRow, error)
	ListPaymentAllocationsByNonPostedId(ctx context.Context, nonPostedID uint32) ([]PaymentAllocation, error)
	ListProducts(ctx context.Context, arg ListProductsParams) ([]Product, error)
	ListProductsByBranch(ctx context.Context, arg ListProductsByBranchParams) ([]Product, error)
	ListProductsByCategory(ctx context.Context, arg ListProductsByCategoryParams) ([]ListProductsByCategoryRow, error)
	ListUnassignedNonPosted(ctx context.Context, arg ListUnassignedNonPostedParams) ([]NonPosted, error)
	ListUnpaidInstallmentsByLoan(ctx context.Context, loanID uint32) ([]Installment, error)
	ListUsers(ctx context.Context, arg ListUsersParams) ([]User, error)
	ListUsersByCategory(ctx context.Context, arg ListUsersByCategoryParams) ([]ListUsersByCategoryRow, error)
	NullifyClientOverpayment(ctx context.Context, id uint32) (sql.Result, error)
	PayInstallment(ctx context.Context, arg PayInstallmentParams) (sql.Result, error)
	ReduceLoan(ctx context.Context, arg ReduceLoanParams) (sql.Result, error)
	RevertInstallment(ctx context.Context, arg RevertInstallmentParams) (sql.Result, error)
	SoftDeleteNonPosted(ctx context.Context, arg SoftDeleteNonPostedParams) error
	TransferLoan(ctx context.Context, arg TransferLoanParams) (sql.Result, error)
	UpdateBranch(ctx context.Context, arg UpdateBranchParams) (sql.Result, error)
	UpdateClient(ctx context.Context, arg UpdateClientParams) (sql.Result, error)
	UpdateClientOverpayment(ctx context.Context, arg UpdateClientOverpaymentParams) (sql.Result, error)
	UpdateInstallment(ctx context.Context, arg UpdateInstallmentParams) (sql.Result, error)
	UpdateLoan(ctx context.Context, arg UpdateLoanParams) (sql.Result, error)
	UpdateLoanProcessingFeeStatus(ctx context.Context, arg UpdateLoanProcessingFeeStatusParams) (sql.Result, error)
	UpdateLoanStatus(ctx context.Context, arg UpdateLoanStatusParams) (sql.Result, error)
	UpdateNonPosted(ctx context.Context, arg UpdateNonPostedParams) (sql.Result, error)
	UpdateUser(ctx context.Context, arg UpdateUserParams) (sql.Result, error)
	UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) (sql.Result, error)
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AssignNonPosted

func (q *Queries) AssignNonPosted(ctx context.Context, arg AssignNonPostedParams) (sql.Result, error)

SELECT * FROM non_posted WHERE id = ? LIMIT 1;

func (*Queries) CheckActiveLoanForClient

func (q *Queries) CheckActiveLoanForClient(ctx context.Context, clientID uint32) (bool, error)

func (*Queries) CheckUserExistance

func (q *Queries) CheckUserExistance(ctx context.Context, email string) (int64, error)

func (*Queries) CountBranchesByCategory

func (q *Queries) CountBranchesByCategory(ctx context.Context, arg CountBranchesByCategoryParams) (int64, error)

func (*Queries) CountClientLoans

func (q *Queries) CountClientLoans(ctx context.Context, arg CountClientLoansParams) (int64, error)

func (*Queries) CountClientsByCategory

func (q *Queries) CountClientsByCategory(ctx context.Context, arg CountClientsByCategoryParams) (int64, error)

func (*Queries) CountClientsNonPosted

func (q *Queries) CountClientsNonPosted(ctx context.Context, arg CountClientsNonPostedParams) (int64, error)

func (*Queries) CountExpectedPayments

func (q *Queries) CountExpectedPayments(ctx context.Context, arg CountExpectedPaymentsParams) (int64, error)

func (*Queries) CountLoans

func (q *Queries) CountLoans(ctx context.Context, arg CountLoansParams) (int64, error)

func (*Queries) CountLoansByCategory

func (q *Queries) CountLoansByCategory(ctx context.Context, arg CountLoansByCategoryParams) (int64, error)

func (*Queries) CountNonPostedByCategory

func (q *Queries) CountNonPostedByCategory(ctx context.Context, arg CountNonPostedByCategoryParams) (int64, error)

func (*Queries) CountUnpaidInstallmentsData

func (q *Queries) CountUnpaidInstallmentsData(ctx context.Context, arg CountUnpaidInstallmentsDataParams) (int64, error)

func (*Queries) CountUsersByCategory

func (q *Queries) CountUsersByCategory(ctx context.Context, arg CountUsersByCategoryParams) (int64, error)

func (*Queries) CreateBranch

func (q *Queries) CreateBranch(ctx context.Context, name string) (sql.Result, error)

func (*Queries) CreateClient

func (q *Queries) CreateClient(ctx context.Context, arg CreateClientParams) (sql.Result, error)

func (*Queries) CreateClientOverpaymentTransaction

func (q *Queries) CreateClientOverpaymentTransaction(ctx context.Context, arg CreateClientOverpaymentTransactionParams) (sql.Result, error)

func (*Queries) CreateInstallment

func (q *Queries) CreateInstallment(ctx context.Context, arg CreateInstallmentParams) (sql.Result, error)

func (*Queries) CreateLoan

func (q *Queries) CreateLoan(ctx context.Context, arg CreateLoanParams) (sql.Result, error)

func (*Queries) CreateNonPosted

func (q *Queries) CreateNonPosted(ctx context.Context, arg CreateNonPostedParams) (sql.Result, error)

func (*Queries) CreatePaymentAllocation

func (q *Queries) CreatePaymentAllocation(ctx context.Context, arg CreatePaymentAllocationParams) (sql.Result, error)

func (*Queries) CreateProduct

func (q *Queries) CreateProduct(ctx context.Context, arg CreateProductParams) (sql.Result, error)

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (sql.Result, error)

func (*Queries) DashBoardDataHelper

func (q *Queries) DashBoardDataHelper(ctx context.Context) (DashBoardDataHelperRow, error)

func (*Queries) DashBoardInactiveLoans

func (q *Queries) DashBoardInactiveLoans(ctx context.Context) ([]DashBoardInactiveLoansRow, error)

func (*Queries) DashBoardRecentsPayments

func (q *Queries) DashBoardRecentsPayments(ctx context.Context) ([]DashBoardRecentsPaymentsRow, error)

func (*Queries) DeductClientOverpayment

func (q *Queries) DeductClientOverpayment(ctx context.Context, arg DeductClientOverpaymentParams) (sql.Result, error)

func (*Queries) DeleteBranch

func (q *Queries) DeleteBranch(ctx context.Context, id uint32) error

func (*Queries) DeleteClient

func (q *Queries) DeleteClient(ctx context.Context, id uint32) (sql.Result, error)

func (*Queries) DeleteLoan

func (q *Queries) DeleteLoan(ctx context.Context, id uint32) error

func (*Queries) DeleteNonPosted

func (q *Queries) DeleteNonPosted(ctx context.Context, id uint32) error

func (*Queries) DeletePaymentAllocation

func (q *Queries) DeletePaymentAllocation(ctx context.Context, id uint32) (sql.Result, error)

func (*Queries) DeletePaymentAllocationsByNonPostedId

func (q *Queries) DeletePaymentAllocationsByNonPostedId(ctx context.Context, arg DeletePaymentAllocationsByNonPostedIdParams) (sql.Result, error)

func (*Queries) DeleteProduct

func (q *Queries) DeleteProduct(ctx context.Context, id uint32) error

func (*Queries) DisburseLoan

func (q *Queries) DisburseLoan(ctx context.Context, arg DisburseLoanParams) (sql.Result, error)

func (*Queries) GetActiveLoanDetails

func (q *Queries) GetActiveLoanDetails(ctx context.Context, clientID uint32) (GetActiveLoanDetailsRow, error)

func (*Queries) GetBranch

func (q *Queries) GetBranch(ctx context.Context, id uint32) (Branch, error)

func (*Queries) GetBranchReportData

func (q *Queries) GetBranchReportData(ctx context.Context, arg GetBranchReportDataParams) ([]GetBranchReportDataRow, error)

func (*Queries) GetClient

func (q *Queries) GetClient(ctx context.Context, id uint32) (Client, error)

func (*Queries) GetClientActiveLoan

func (q *Queries) GetClientActiveLoan(ctx context.Context, arg GetClientActiveLoanParams) (uint32, error)

func (*Queries) GetClientAdminsReportData

func (q *Queries) GetClientAdminsReportData(ctx context.Context, arg GetClientAdminsReportDataParams) ([]GetClientAdminsReportDataRow, error)

func (*Queries) GetClientByPhoneNumber

func (q *Queries) GetClientByPhoneNumber(ctx context.Context, phoneNumber string) (Client, error)

func (*Queries) GetClientFullData

func (q *Queries) GetClientFullData(ctx context.Context, id uint32) (GetClientFullDataRow, error)

JOIN users updated ON c.updated_by = updated.id

func (*Queries) GetClientIDByPhoneNumber

func (q *Queries) GetClientIDByPhoneNumber(ctx context.Context, phoneNumber string) (uint32, error)

func (*Queries) GetClientLoans

func (q *Queries) GetClientLoans(ctx context.Context, arg GetClientLoansParams) ([]GetClientLoansRow, error)

Left joins for optional fields (disbursed_by, updated_by, created_by)

func (*Queries) GetClientOverpayment

func (q *Queries) GetClientOverpayment(ctx context.Context, id uint32) (float64, error)

func (*Queries) GetClientOverpaymentTransaction

func (q *Queries) GetClientOverpaymentTransaction(ctx context.Context, id uint32) (ClientOverpaymentTransaction, error)

func (*Queries) GetClientOverpaymentTransactionByPaymentId

func (q *Queries) GetClientOverpaymentTransactionByPaymentId(ctx context.Context, paymentID sql.NullInt32) (ClientOverpaymentTransaction, error)

func (*Queries) GetClientOverpaymentTransactions

func (q *Queries) GetClientOverpaymentTransactions(ctx context.Context, clientID uint32) ([]ClientOverpaymentTransaction, error)

func (*Queries) GetClientWithBranchName

func (q *Queries) GetClientWithBranchName(ctx context.Context, id uint32) (GetClientWithBranchNameRow, error)

func (*Queries) GetClientsNonPosted

func (q *Queries) GetClientsNonPosted(ctx context.Context, arg GetClientsNonPostedParams) ([]GetClientsNonPostedRow, error)

func (*Queries) GetInstallment

func (q *Queries) GetInstallment(ctx context.Context, id uint32) (Installment, error)

func (*Queries) GetLoan

func (q *Queries) GetLoan(ctx context.Context, id uint32) (Loan, error)

func (*Queries) GetLoanClientID

func (q *Queries) GetLoanClientID(ctx context.Context, id uint32) (uint32, error)

func (*Queries) GetLoanData

func (q *Queries) GetLoanData(ctx context.Context) ([]uint32, error)

func (*Queries) GetLoanDetails

func (q *Queries) GetLoanDetails(ctx context.Context, id uint32) (GetLoanDetailsRow, error)

func (*Queries) GetLoanEvents

func (q *Queries) GetLoanEvents(ctx context.Context) ([]GetLoanEventsRow, error)

func (*Queries) GetLoanFullData

func (q *Queries) GetLoanFullData(ctx context.Context, id uint32) (GetLoanFullDataRow, error)

Left joins for optional fields (disbursed_by, updated_by, created_by)

func (*Queries) GetLoanReportDataById

func (q *Queries) GetLoanReportDataById(ctx context.Context, id uint32) (GetLoanReportDataByIdRow, error)

func (*Queries) GetLoanStatus

func (q *Queries) GetLoanStatus(ctx context.Context, id uint32) (LoansStatus, error)

func (*Queries) GetLoansReportData

func (q *Queries) GetLoansReportData(ctx context.Context, arg GetLoansReportDataParams) ([]GetLoansReportDataRow, error)

func (*Queries) GetNonPosted

func (q *Queries) GetNonPosted(ctx context.Context, id uint32) (GetNonPostedRow, error)

func (*Queries) GetPaymentReportData

func (q *Queries) GetPaymentReportData(ctx context.Context, arg GetPaymentReportDataParams) ([]GetPaymentReportDataRow, error)

func (*Queries) GetProduct

func (q *Queries) GetProduct(ctx context.Context, id uint32) (GetProductRow, error)

func (*Queries) GetProductRepayAmount

func (q *Queries) GetProductRepayAmount(ctx context.Context, id uint32) (float64, error)

SELECT * FROM products WHERE id = ? LIMIT 1;

func (*Queries) GetProductReportData

func (q *Queries) GetProductReportData(ctx context.Context, arg GetProductReportDataParams) ([]GetProductReportDataRow, error)

func (*Queries) GetTotalPaidByIDorAccountNo

func (q *Queries) GetTotalPaidByIDorAccountNo(ctx context.Context, arg GetTotalPaidByIDorAccountNoParams) (interface{}, error)

func (*Queries) GetUnpaidInstallmentsData

func (q *Queries) GetUnpaidInstallmentsData(ctx context.Context, arg GetUnpaidInstallmentsDataParams) ([]GetUnpaidInstallmentsDataRow, error)

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, id uint32) (GetUserRow, error)

func (*Queries) GetUserAdminsReportData

func (q *Queries) GetUserAdminsReportData(ctx context.Context, arg GetUserAdminsReportDataParams) ([]GetUserAdminsReportDataRow, error)

func (*Queries) GetUserByEmail

func (q *Queries) GetUserByEmail(ctx context.Context, email string) (GetUserByEmailRow, error)

SELECT * FROM users WHERE id = ? LIMIT 1;

func (*Queries) GetUserUsersReportData

func (q *Queries) GetUserUsersReportData(ctx context.Context, arg GetUserUsersReportDataParams) (GetUserUsersReportDataRow, error)

func (*Queries) HelperClient

func (q *Queries) HelperClient(ctx context.Context) ([]HelperClientRow, error)

func (*Queries) HelperProduct

func (q *Queries) HelperProduct(ctx context.Context) ([]HelperProductRow, error)

func (*Queries) HelperUser

func (q *Queries) HelperUser(ctx context.Context) ([]HelperUserRow, error)

func (*Queries) HelperUserById

func (q *Queries) HelperUserById(ctx context.Context, id uint32) (string, error)

func (*Queries) ListAllNonPosted

func (q *Queries) ListAllNonPosted(ctx context.Context, arg ListAllNonPostedParams) ([]NonPosted, error)

func (*Queries) ListAllNonPostedByTransactionSource

func (q *Queries) ListAllNonPostedByTransactionSource(ctx context.Context, transactionSource NonPostedTransactionSource) ([]NonPosted, error)

func (*Queries) ListBrachesByCategory

func (q *Queries) ListBrachesByCategory(ctx context.Context, arg ListBrachesByCategoryParams) ([]Branch, error)

func (*Queries) ListBranches

func (q *Queries) ListBranches(ctx context.Context) ([]Branch, error)

func (*Queries) ListClients

func (q *Queries) ListClients(ctx context.Context, arg ListClientsParams) ([]Client, error)

func (*Queries) ListClientsByActiveStatus

func (q *Queries) ListClientsByActiveStatus(ctx context.Context, arg ListClientsByActiveStatusParams) ([]Client, error)

func (*Queries) ListClientsByBranch

func (q *Queries) ListClientsByBranch(ctx context.Context, arg ListClientsByBranchParams) ([]Client, error)

func (*Queries) ListClientsByCategory

func (q *Queries) ListClientsByCategory(ctx context.Context, arg ListClientsByCategoryParams) ([]ListClientsByCategoryRow, error)

func (*Queries) ListExpectedPayments

func (q *Queries) ListExpectedPayments(ctx context.Context, arg ListExpectedPaymentsParams) ([]ListExpectedPaymentsRow, error)

func (*Queries) ListInstallmentsByLoan

func (q *Queries) ListInstallmentsByLoan(ctx context.Context, loanID uint32) ([]Installment, error)

func (*Queries) ListLoans

func (q *Queries) ListLoans(ctx context.Context, arg ListLoansParams) ([]ListLoansRow, error)

Left joins for optional fields (disbursed_by, updated_by, created_by)

func (*Queries) ListLoansByClient

func (q *Queries) ListLoansByClient(ctx context.Context, arg ListLoansByClientParams) ([]Loan, error)

func (*Queries) ListLoansByLoanOfficer

func (q *Queries) ListLoansByLoanOfficer(ctx context.Context, arg ListLoansByLoanOfficerParams) ([]Loan, error)

func (*Queries) ListLoansByStatus

func (q *Queries) ListLoansByStatus(ctx context.Context, arg ListLoansByStatusParams) ([]Loan, error)

func (*Queries) ListNonDisbursedLoans

func (q *Queries) ListNonDisbursedLoans(ctx context.Context, arg ListNonDisbursedLoansParams) ([]Loan, error)

func (*Queries) ListNonPostedByCategory

func (q *Queries) ListNonPostedByCategory(ctx context.Context, arg ListNonPostedByCategoryParams) ([]ListNonPostedByCategoryRow, error)

func (*Queries) ListNonPostedByTransactionSource

func (q *Queries) ListNonPostedByTransactionSource(ctx context.Context, arg ListNonPostedByTransactionSourceParams) ([]NonPosted, error)

func (*Queries) ListPaymentAllocationsByLoanId

func (q *Queries) ListPaymentAllocationsByLoanId(ctx context.Context, loanID sql.NullInt32) ([]ListPaymentAllocationsByLoanIdRow, error)

func (*Queries) ListPaymentAllocationsByNonPostedID

func (q *Queries) ListPaymentAllocationsByNonPostedID(ctx context.Context, nonPostedID uint32) ([]ListPaymentAllocationsByNonPostedIDRow, error)

func (*Queries) ListPaymentAllocationsByNonPostedId

func (q *Queries) ListPaymentAllocationsByNonPostedId(ctx context.Context, nonPostedID uint32) ([]PaymentAllocation, error)

func (*Queries) ListProducts

func (q *Queries) ListProducts(ctx context.Context, arg ListProductsParams) ([]Product, error)

func (*Queries) ListProductsByBranch

func (q *Queries) ListProductsByBranch(ctx context.Context, arg ListProductsByBranchParams) ([]Product, error)

func (*Queries) ListProductsByCategory

func (q *Queries) ListProductsByCategory(ctx context.Context, arg ListProductsByCategoryParams) ([]ListProductsByCategoryRow, error)

func (*Queries) ListUnassignedNonPosted

func (q *Queries) ListUnassignedNonPosted(ctx context.Context, arg ListUnassignedNonPostedParams) ([]NonPosted, error)

func (*Queries) ListUnpaidInstallmentsByLoan

func (q *Queries) ListUnpaidInstallmentsByLoan(ctx context.Context, loanID uint32) ([]Installment, error)

func (*Queries) ListUsers

func (q *Queries) ListUsers(ctx context.Context, arg ListUsersParams) ([]User, error)

func (*Queries) ListUsersByCategory

func (q *Queries) ListUsersByCategory(ctx context.Context, arg ListUsersByCategoryParams) ([]ListUsersByCategoryRow, error)

func (*Queries) NullifyClientOverpayment

func (q *Queries) NullifyClientOverpayment(ctx context.Context, id uint32) (sql.Result, error)

func (*Queries) PayInstallment

func (q *Queries) PayInstallment(ctx context.Context, arg PayInstallmentParams) (sql.Result, error)

func (*Queries) ReduceLoan

func (q *Queries) ReduceLoan(ctx context.Context, arg ReduceLoanParams) (sql.Result, error)

func (*Queries) RevertInstallment

func (q *Queries) RevertInstallment(ctx context.Context, arg RevertInstallmentParams) (sql.Result, error)

func (*Queries) SoftDeleteNonPosted

func (q *Queries) SoftDeleteNonPosted(ctx context.Context, arg SoftDeleteNonPostedParams) error

func (*Queries) TransferLoan

func (q *Queries) TransferLoan(ctx context.Context, arg TransferLoanParams) (sql.Result, error)

func (*Queries) UpdateBranch

func (q *Queries) UpdateBranch(ctx context.Context, arg UpdateBranchParams) (sql.Result, error)

func (*Queries) UpdateClient

func (q *Queries) UpdateClient(ctx context.Context, arg UpdateClientParams) (sql.Result, error)

func (*Queries) UpdateClientOverpayment

func (q *Queries) UpdateClientOverpayment(ctx context.Context, arg UpdateClientOverpaymentParams) (sql.Result, error)

func (*Queries) UpdateInstallment

func (q *Queries) UpdateInstallment(ctx context.Context, arg UpdateInstallmentParams) (sql.Result, error)

func (*Queries) UpdateLoan

func (q *Queries) UpdateLoan(ctx context.Context, arg UpdateLoanParams) (sql.Result, error)

func (*Queries) UpdateLoanProcessingFeeStatus

func (q *Queries) UpdateLoanProcessingFeeStatus(ctx context.Context, arg UpdateLoanProcessingFeeStatusParams) (sql.Result, error)

func (*Queries) UpdateLoanStatus

func (q *Queries) UpdateLoanStatus(ctx context.Context, arg UpdateLoanStatusParams) (sql.Result, error)

func (*Queries) UpdateNonPosted

func (q *Queries) UpdateNonPosted(ctx context.Context, arg UpdateNonPostedParams) (sql.Result, error)

func (*Queries) UpdateUser

func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) (sql.Result, error)

func (*Queries) UpdateUserPassword

func (q *Queries) UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) (sql.Result, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type ReduceLoanParams

type ReduceLoanParams struct {
	PaidAmount float64       `json:"paid_amount"`
	UpdatedBy  sql.NullInt32 `json:"updated_by"`
	ID         uint32        `json:"id"`
}

type RevertInstallmentParams

type RevertInstallmentParams struct {
	RemainingAmount float64 `json:"remaining_amount"`
	ID              uint32  `json:"id"`
}

type SoftDeleteNonPostedParams

type SoftDeleteNonPostedParams struct {
	DeletedDescription sql.NullString `json:"deleted_description"`
	ID                 uint32         `json:"id"`
}

type TransferLoanParams

type TransferLoanParams struct {
	LoanOfficer uint32        `json:"loan_officer"`
	UpdatedBy   sql.NullInt32 `json:"updated_by"`
	ID          uint32        `json:"id"`
}

type UpdateBranchParams

type UpdateBranchParams struct {
	Name string `json:"name"`
	ID   uint32 `json:"id"`
}

type UpdateClientOverpaymentParams

type UpdateClientOverpaymentParams struct {
	Overpayment float64 `json:"overpayment"`
	PhoneNumber string  `json:"phone_number"`
	ClientID    uint32  `json:"client_id"`
}

type UpdateClientParams

type UpdateClientParams struct {
	FullName      string         `json:"full_name"`
	PhoneNumber   string         `json:"phone_number"`
	Gender        ClientsGender  `json:"gender"`
	AssignedStaff uint32         `json:"assigned_staff"`
	BranchID      uint32         `json:"branch_id"`
	Active        bool           `json:"active"`
	IDNumber      sql.NullString `json:"id_number"`
	Dob           sql.NullTime   `json:"dob"`
	UpdatedBy     uint32         `json:"updated_by"`
	ID            uint32         `json:"id"`
}

type UpdateInstallmentParams

type UpdateInstallmentParams struct {
	RemainingAmount float64      `json:"remaining_amount"`
	Paid            sql.NullBool `json:"paid"`
	PaidAt          sql.NullTime `json:"paid_at"`
	ID              uint32       `json:"id"`
}

type UpdateLoanParams

type UpdateLoanParams struct {
	PaidAmount float64       `json:"paid_amount"`
	UpdatedBy  sql.NullInt32 `json:"updated_by"`
	ID         uint32        `json:"id"`
}

type UpdateLoanProcessingFeeStatusParams

type UpdateLoanProcessingFeeStatusParams struct {
	FeePaid bool   `json:"fee_paid"`
	ID      uint32 `json:"id"`
}

type UpdateLoanStatusParams

type UpdateLoanStatusParams struct {
	Status LoansStatus `json:"status"`
	ID     uint32      `json:"id"`
}

type UpdateNonPostedParams

type UpdateNonPostedParams struct {
	TransactionSource  NonPostedTransactionSource `json:"transaction_source"`
	TransactionNumber  string                     `json:"transaction_number"`
	AccountNumber      string                     `json:"account_number"`
	PhoneNumber        string                     `json:"phone_number"`
	PayingName         string                     `json:"paying_name"`
	Amount             float64                    `json:"amount"`
	PaidDate           time.Time                  `json:"paid_date"`
	AssignTo           sql.NullInt32              `json:"assign_to"`
	AssignedBy         string                     `json:"assigned_by"`
	DeletedDescription sql.NullString             `json:"deleted_description"`
	ID                 uint32                     `json:"id"`
}

type UpdateUserParams

type UpdateUserParams struct {
	Role         NullUsersRole  `json:"role"`
	BranchID     sql.NullInt32  `json:"branch_id"`
	Password     sql.NullString `json:"password"`
	RefreshToken sql.NullString `json:"refresh_token"`
	UpdatedAt    sql.NullTime   `json:"updated_at"`
	UpdatedBy    sql.NullInt32  `json:"updated_by"`
	ID           uint32         `json:"id"`
}

type UpdateUserPasswordParams

type UpdateUserPasswordParams struct {
	Password string `json:"password"`
	Email    string `json:"email"`
}

type User

type User struct {
	ID              uint32    `json:"id"`
	FullName        string    `json:"full_name"`
	PhoneNumber     string    `json:"phone_number"`
	Email           string    `json:"email"`
	Password        string    `json:"password"`
	PasswordUpdated uint32    `json:"password_updated"`
	RefreshToken    string    `json:"refresh_token"`
	Role            UsersRole `json:"role"`
	BranchID        uint32    `json:"branch_id"`
	UpdatedBy       uint32    `json:"updated_by"`
	UpdatedAt       time.Time `json:"updated_at"`
	CreatedBy       uint32    `json:"created_by"`
	CreatedAt       time.Time `json:"created_at"`
}

type UsersRole

type UsersRole string
const (
	UsersRoleADMIN UsersRole = "ADMIN"
	UsersRoleAGENT UsersRole = "AGENT"
)

func (*UsersRole) Scan

func (e *UsersRole) Scan(src interface{}) error

Jump to

Keyboard shortcuts

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