MambuPy.api.mambuloan

MambuLoan entity: a MambuEntity struct for credit Loans.

Classes

MambuLoan(**kwargs)

MambuLoan entity

class MambuPy.api.mambuloan.MambuLoan(**kwargs)[source]

Bases: MambuEntity, MambuEntityWritable, MambuEntityAttachable, MambuEntityCommentable, MambuEntityOwnable, MambuEntitySearchable

MambuLoan entity

__abstractmethods__ = frozenset({})
__init__(**kwargs)[source]
__module__ = 'MambuPy.api.mambuloan'
_abc_impl = <_abc_data object>
_accepted_actions = ['REQUEST_APPROVAL', 'SET_INCOMPLETE', 'APPROVE', 'UNDO_APPROVE', 'REJECT', 'WITHDRAW', 'CLOSE', 'UNDO_REJECT', 'UNDO_WITHDRAW', 'UNDO_CLOSE']

accepted actions to change

_default_tzattrs = {'disbursementDetails': {'disbursementDate': None, 'expectedDisbursementDate': None, 'firstRepaymentDate': None}}
_entities = [('assignedUserKey', 'mambuuser.MambuUser', 'assignedUser'), ('assignedBranchKey', 'mambubranch.MambuBranch', 'assignedBranch'), ('assignedCentreKey', 'mambucentre.MambuCentre', 'assignedCentre'), ('productTypeKey', 'mambuproduct.MambuProduct', 'productType'), ('originalAccountKey', 'mambuloan.MambuLoan', 'originalAccount'), ('accountHolderKey', '', 'accountHolder')]

3-tuples of elements and Mambu Entities

_filter_keys = ['branchId', 'centreId', 'accountState', 'accountHolderType', 'accountHolderId', 'creditOfficerUsername']

allowed filters for get_all filtering

_ownerType = 'LOAN_ACCOUNT'

owner type of this entity

_prefix = 'loans'

prefix constant for connections to Mambu

_sortBy_fields = ['creationDate', 'lastModifiedDate', 'id', 'loanName']

allowed fields for get_all sorting

_vos = [('disbursementDetails', 'MambuDisbursementDetails')]

2-tuples of elements and Value Objects

approve(notes)[source]

Request to approve a loan account.

Parameters:

notes (str) – notes to attach to the approval operation.

close(notes)[source]

Request to close a loan account.

Parameters:

notes (str) – notes to attach to the closing operation.

disburse(notes, firstRepaymentDate=None, disbursementDate=None, **kwargs)[source]

Request to disburse a loan account.

Parameters:
  • notes (str) – notes to attach to the disbursement transaction.

  • firstRepaymentDate (datetime) – first repayment date for the loan account. If None, value is fetched from disbursement details. If naive datetime, use TZ info from tzattrs

  • disbursementDate (datetime) – disbursement date for the loan account. If None, value is fetched from disbursement details, expected disbursement date. If naive datetime, use TZ info from tzattrs

  • kwargs (dict) – allowed extra params for the disbursement transaction request. MambuPy.api.vos.MambuDisbursementLoanTransactionInput._schema_fields has the allowed fields permitted for this operation

get_schedule()[source]

Retrieves the installments schedule.

reject(notes)[source]

Request to reject a loan account.

Parameters:

notes (str) – notes to attach to the reject operation.

repay(amount, notes, valueDate, **kwargs)[source]

Request to repay a loan account.

Parameters:
set_state(action, notes)[source]

Request to change status of a MambuLoan

Parameters:
  • action (str) – specify the action state

  • notes (str) – notes to associate to the change of status

Raises:

MambuPyError – if action not in _accepted_actions

writeoff(notes)[source]

Request to writeoff a loan account.

Parameters:

notes (str) – notes to attach to the writting off operation.