MambuPy.api.mambuloan
MambuLoan entity: a MambuEntity struct for credit Loans.
Classes
|
MambuLoan entity |
- class MambuPy.api.mambuloan.MambuLoan(**kwargs)[source]
Bases:
MambuEntity
,MambuEntityWritable
,MambuEntityAttachable
,MambuEntityCommentable
,MambuEntityOwnable
,MambuEntitySearchable
MambuLoan entity
- __abstractmethods__ = frozenset({})
- __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 tzattrsdisbursementDate (
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 tzattrskwargs (dict) – allowed extra params for the disbursement transaction request.
MambuPy.api.vos.MambuDisbursementLoanTransactionInput._schema_fields
has the allowed fields permitted for this operation
- 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:
amount (float) – the amount of the repayment
notes (str) – notes to attach to the repayment transaction.
valueDate (
datetime
) – value date for the repayment operation. If naive datetime, use TZ info from tzattrs.kwargs (dict) – allowed extra params for the repayment transaction request.
MambuPy.api.vos.MambuRepaymentLoanTransactionInput._schema_fields
has the allowed fields permitted for this operation
- set_state(action, notes)[source]
Request to change status of a MambuLoan
- Parameters:
- Raises:
MambuPyError – if action not in _accepted_actions