MambuPy.rest1to2.mambuloan

Classes

MambuLoan(*args, **kwargs)

MambuLoans(*args, **kwargs)

class MambuPy.rest1to2.mambuloan.MambuLoan(*args, **kwargs)[source]

Bases: MambuStruct, MambuLoan

DEFAULTS = {'notes': ''}
__init__(*args, **kwargs)[source]

Tasks done here:

Just initializes the MambuStruct.

__module__ = 'MambuPy.rest1to2.mambuloan'
_get_roles(fullDetails=True, *args, **kwargs)[source]

Get a list of roles and clients for the loan account.

The roles are mentionend in the holder of the loan account.

The holder acquires a “roles” property, a list of dictionaries with the following keys:

role (str): role name client (obj): MambuClient that has the mentioned role

Parameters:

fullDetails (bool) – whether instantiate clients with full details or not

Returns:

int - number of requests done to Mambu

property feesBalance
property feesPaid
getDebt()[source]

Sums up all the balances of the account and returns them.

property interestBalance
property penaltyBalance
property penaltyPaid
preprocess()[source]
property principalBalance
property repaymentInstallments
property repaymentPeriodCount
property repaymentPeriodUnit
setActivities(*args, **kwargs)[source]

Adds the activities for this loan to a ‘activities’ field.

Activities are MambuActivity objects.

Activities get sorted by activity timestamp.

Returns the number of requests done to Mambu.

setProduct(*args, **kwargs)[source]

Adds the product for this loan to a ‘product’ field.

Product is a MambuProduct object.

cache argument allows to use AllMambuProducts singleton to retrieve the products. See mambuproduct.AllMambuProducts code and pydoc for further information.

Returns the number of requests done to Mambu.

setRepayments(*args, **kwargs)[source]

Adds the repayments for this loan to a ‘repayments’ field.

Repayments are MambuRepayment objects.

Repayments get sorted by due date.

Returns the number of requests done to Mambu.

Todo

since pagination logic was added, is not always true that just 1 request was done. It may be more! But since request counter singleton holds true information about how many requests were done to Mambu, in fact this return value may be obsolete

setTransactions(*args, **kwargs)[source]

Adds the transactions for this loan to a ‘transactions’ field.

Transactions are MambuTransaction objects.

Transactions get sorted by transaction id.

Returns the number of requests done to Mambu.

Todo

since pagination logic was added, is not always true that just 1 request was done. It may be more! But since request counter singleton holds true information about how many requests were done to Mambu, in fact this return value may be obsolete

setUser(*args, **kwargs)[source]

Adds the user for this loan to a ‘user’ field.

User is a MambuUser object.

Returns the number of requests done to Mambu.

class MambuPy.rest1to2.mambuloan.MambuLoans(*args, **kwargs)[source]

Bases: MambuStruct, MambuLoans

__init__(*args, **kwargs)[source]

By default, entid argument is empty. That makes perfect sense: you want several groups, not just one.

__iter__()[source]
__module__ = 'MambuPy.rest1to2.mambuloan'
__repr__()[source]

Mambu object repr tells the class name and the usual ‘id’ for it.

If an iterable, it instead gives its length.