Solaris.Lending.Loans (Solaris v1.0.0)

Copy Markdown View Source

Loan servicing: repayment schedules, history, dunning cases.

See also:

Summary

Functions

Retrieves a specific loan.

Returns the active SDD mandate for a credit line.

Retrieves a specific dunning case.

Returns the full repayment history for a loan.

Returns the full repayment schedule for a loan.

Lists all loans across all customers.

Lists all dunning cases across all customers.

Lists notifications for a dunning case.

Functions

get(loan_id, opts \\ [])

@spec get(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Solaris.Error.t()}

Retrieves a specific loan.

get_credit_line_mandate(credit_line_id, opts \\ [])

@spec get_credit_line_mandate(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Solaris.Error.t()}

Returns the active SDD mandate for a credit line.

get_dunning_case(dunning_case_id, opts \\ [])

@spec get_dunning_case(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Solaris.Error.t()}

Retrieves a specific dunning case.

get_repayment_history(loan_id, opts \\ [])

@spec get_repayment_history(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Solaris.Error.t()}

Returns the full repayment history for a loan.

Includes all past SDD/SCT transactions.

get_repayment_schedule(loan_id, opts \\ [])

@spec get_repayment_schedule(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Solaris.Error.t()}

Returns the full repayment schedule for a loan.

Includes balance, fees, penalties, interest, and installment breakdown.

Examples

{:ok, schedule} = Solaris.Lending.Loans.get_repayment_schedule("cloan_123")

Enum.each(schedule["installments"], fn i ->
  IO.puts("Due: #{i["due_date"]}#{i["amount"]["amount"]} #{i["amount"]["currency"]}")
end)

list(opts \\ [])

@spec list(keyword()) :: {:ok, map()} | {:error, Solaris.Error.t()}

Lists all loans across all customers.

Options

  • :page, :per_page, :after, :before
  • :status — filter by loan status

list_dunning_cases(opts \\ [])

@spec list_dunning_cases(keyword()) :: {:ok, map()} | {:error, Solaris.Error.t()}

Lists all dunning cases across all customers.

list_dunning_notifications(dunning_case_id, opts \\ [])

@spec list_dunning_notifications(
  String.t(),
  keyword()
) :: {:ok, [map()]} | {:error, Solaris.Error.t()}

Lists notifications for a dunning case.