MambuPy.orm.schema_loans

Schema tables for Mambu Loan Accounts.

Todo

this are just very basic schemas for loan tables. A lot of fields are missing.

Classes

DisbursementDetails(**kwargs)

DisbursementDetails table.

LoanAccount(**kwargs)

LoanAccount table.

LoanProduct(**kwargs)

LoanProduct table.

LoanTransaction(**kwargs)

LoanTransaction table.

Repayment(**kwargs)

Repayment table.

TransactionChannel(**kwargs)

TransactionChannel table.

TransactionDetails(**kwargs)

TransactionDetails table.

class MambuPy.orm.schema_loans.DisbursementDetails(**kwargs)[source]

Bases: Base

DisbursementDetails table.

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

__mapper__ = <Mapper at 0x7f136cfb5e80; DisbursementDetails>
__module__ = 'MambuPy.orm.schema_loans'
__repr__()[source]

Return repr(self).

__table__ = Table('disbursementdetails', MetaData(bind=None), Column('encodedKey', String(), table=<disbursementdetails>, primary_key=True, nullable=False), Column('expectedDisbursementDate', DateTime(), table=<disbursementdetails>), Column('disbursementDate', DateTime(), table=<disbursementdetails>), Column('firstRepaymentDate', DateTime(), table=<disbursementdetails>), schema='mambu_db')
__table_args__ = {'keep_existing': True, 'schema': 'mambu_db'}
__tablename__ = 'disbursementdetails'
_sa_class_manager = {'disbursementDate': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'encodedKey': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'expectedDisbursementDate': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'firstRepaymentDate': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}
disbursementDate
encodedKey
expectedDisbursementDate
firstRepaymentDate
class MambuPy.orm.schema_loans.LoanAccount(**kwargs)[source]

Bases: Base

LoanAccount table.

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

__mapper__ = <Mapper at 0x7f136cfc9310; LoanAccount>
__module__ = 'MambuPy.orm.schema_loans'
__repr__()[source]

Return repr(self).

__table__ = Table('loanaccount', MetaData(bind=None), Column('encodedKey', String(), table=<loanaccount>, primary_key=True, nullable=False), Column('id', String(), table=<loanaccount>), Column('accountState', String(), table=<loanaccount>), Column('accountSubstate', String(), table=<loanaccount>), Column('loanAmount', Numeric(precision=50, scale=10), table=<loanaccount>), Column('notes', String(), table=<loanaccount>), Column('principalBalance', Numeric(precision=50, scale=10), table=<loanaccount>), Column('principalPaid', Numeric(precision=50, scale=10), table=<loanaccount>), Column('principalDue', Numeric(precision=50, scale=10), table=<loanaccount>), Column('interestBalance', Numeric(precision=50, scale=10), table=<loanaccount>), Column('interestPaid', Numeric(precision=50, scale=10), table=<loanaccount>), Column('interestDue', Numeric(precision=50, scale=10), table=<loanaccount>), Column('interestRate', Numeric(precision=50, scale=10), table=<loanaccount>), Column('interestCalculationMethod', String(), table=<loanaccount>), Column('interestBalanceCalculationMethod', String(), table=<loanaccount>), Column('repaymentInstallments', Integer(), table=<loanaccount>), Column('repaymentPeriodUnit', String(), table=<loanaccount>), Column('repaymentPeriodCount', Integer(), table=<loanaccount>), Column('accountHolderType', String(), table=<loanaccount>), Column('feesBalance', Numeric(precision=50, scale=10), table=<loanaccount>), Column('feesPaid', Numeric(precision=50, scale=10), table=<loanaccount>), Column('feesDue', Numeric(precision=50, scale=10), table=<loanaccount>), Column('penaltyBalance', Numeric(precision=50, scale=10), table=<loanaccount>), Column('penaltyPaid', Numeric(precision=50, scale=10), table=<loanaccount>), Column('penaltyDue', Numeric(precision=50, scale=10), table=<loanaccount>), Column('creationDate', DateTime(), table=<loanaccount>), Column('approvedDate', DateTime(), table=<loanaccount>), Column('closedDate', DateTime(), table=<loanaccount>), Column('rescheduledAccountKey', String(), table=<loanaccount>), Column('assignedCentreKey', String(), table=<loanaccount>), Column('lastSetToArrearsDate', DateTime(), table=<loanaccount>), Column('productTypeKey', String(), ForeignKey('mambu_db.loanproduct.encodedKey'), table=<loanaccount>), Column('disbursementDetailsKey', String(), ForeignKey('mambu_db.disbursementdetails.encodedKey'), table=<loanaccount>), Column('assignedBranchKey', String(), ForeignKey('mambu_db.branch.encodedKey'), table=<loanaccount>), Column('assignedUserKey', String(), ForeignKey('mambu_db.user.encodedKey'), table=<loanaccount>), Column('accountHolderKey', String(), table=<loanaccount>), schema='mambu_db')
__table_args__ = {'keep_existing': True, 'schema': 'mambu_db'}
__tablename__ = 'loanaccount'
_sa_class_manager = {'accountHolderKey': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'accountHolderType': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'accountState': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'accountSubstate': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'activities': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'approvedDate': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'assignedBranchKey': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'assignedCentreKey': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'assignedUserKey': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'branch': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'closedDate': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'creationDate': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'customInformation': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'disbursementDetails': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'disbursementDetailsKey': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'encodedKey': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'feesBalance': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'feesDue': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'feesPaid': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'holder_client': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'holder_group': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'interestBalance': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'interestBalanceCalculationMethod': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'interestCalculationMethod': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'interestDue': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'interestPaid': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'interestRate': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'lastSetToArrearsDate': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'loanAmount': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'notes': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'penaltyBalance': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'penaltyDue': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'penaltyPaid': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'principalBalance': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'principalDue': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'principalPaid': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'product': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'productTypeKey': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'repaymentInstallments': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'repaymentPeriodCount': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'repaymentPeriodUnit': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'repayments': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'rescheduledAccountKey': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'tasks': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'transactions': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'user': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}
accountHolderKey
accountHolderType
accountState
accountSubstate
activities
approvedDate
assignedBranchKey
assignedCentreKey
assignedUserKey
branch
closedDate
creationDate
customInformation
disbursementDetails
disbursementDetailsKey
encodedKey
feesBalance
feesDue
feesPaid
holder_client
holder_group
id
interestBalance
interestBalanceCalculationMethod
interestCalculationMethod
interestDue
interestPaid
interestRate
lastSetToArrearsDate
loanAmount
notes
penaltyBalance
penaltyDue
penaltyPaid
principalBalance
principalDue
principalPaid
product
productTypeKey
repaymentInstallments
repaymentPeriodCount
repaymentPeriodUnit
repayments
rescheduledAccountKey
tasks
transactions
user
class MambuPy.orm.schema_loans.LoanProduct(**kwargs)[source]

Bases: Base

LoanProduct table.

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

__mapper__ = <Mapper at 0x7f136cfb5520; LoanProduct>
__module__ = 'MambuPy.orm.schema_loans'
__repr__()[source]

Return repr(self).

__table__ = Table('loanproduct', MetaData(bind=None), Column('encodedKey', String(), table=<loanproduct>, primary_key=True, nullable=False), Column('id', String(), table=<loanproduct>), Column('productName', String(), table=<loanproduct>), Column('activated', Integer(), table=<loanproduct>), schema='mambu_db')
__table_args__ = {'keep_existing': True, 'schema': 'mambu_db'}
__tablename__ = 'loanproduct'
_sa_class_manager = {'activated': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'encodedKey': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'loans': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'productName': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}
activated
encodedKey
id
loans
productName
class MambuPy.orm.schema_loans.LoanTransaction(**kwargs)[source]

Bases: Base

LoanTransaction table.

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

__mapper__ = <Mapper at 0x7f136cf16f70; LoanTransaction>
__module__ = 'MambuPy.orm.schema_loans'
__repr__()[source]

Return repr(self).

__table__ = Table('loantransaction', MetaData(bind=None), Column('encodedKey', String(), table=<loantransaction>, primary_key=True, nullable=False), Column('transactionId', Integer(), table=<loantransaction>), Column('creationDate', DateTime(), table=<loantransaction>), Column('entryDate', DateTime(), table=<loantransaction>), Column('principalAmount', Numeric(precision=50, scale=10), table=<loantransaction>), Column('interestAmount', Numeric(precision=50, scale=10), table=<loantransaction>), Column('feesAmount', Numeric(precision=50, scale=10), table=<loantransaction>), Column('penaltyAmount', Numeric(precision=50, scale=10), table=<loantransaction>), Column('reversalTransactionKey', String(), table=<loantransaction>), Column('amount', Numeric(precision=50, scale=10), table=<loantransaction>), Column('type', String(), table=<loantransaction>), Column('comment', String(), table=<loantransaction>), Column('parentAccountKey', String(), ForeignKey('mambu_db.loanaccount.encodedKey'), table=<loantransaction>), Column('details_encodedkey_oid', String(), ForeignKey('mambu_db.transactiondetails.encodedKey'), table=<loantransaction>), schema='mambu_db')
__table_args__ = {'keep_existing': True, 'schema': 'mambu_db'}
__tablename__ = 'loantransaction'
_sa_class_manager = {'account': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'amount': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'comment': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'creationDate': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'details_encodedkey_oid': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'encodedKey': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'entryDate': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'feesAmount': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'interestAmount': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'parentAccountKey': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'penaltyAmount': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'principalAmount': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'reversalTransactionKey': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'transactionDetails': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'transactionId': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'type': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}
account
amount
comment
creationDate
details_encodedkey_oid
encodedKey
entryDate
feesAmount
interestAmount
parentAccountKey
penaltyAmount
principalAmount
reversalTransactionKey
transactionDetails
transactionId
type
class MambuPy.orm.schema_loans.Repayment(**kwargs)[source]

Bases: Base

Repayment table.

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

__mapper__ = <Mapper at 0x7f136cf1eee0; Repayment>
__module__ = 'MambuPy.orm.schema_loans'
__repr__()[source]

Return repr(self).

__table__ = Table('repayment', MetaData(bind=None), Column('encodedKey', String(), table=<repayment>, primary_key=True, nullable=False), Column('dueDate', DateTime(), table=<repayment>), Column('principalDue', Numeric(precision=50, scale=10), table=<repayment>), Column('principalPaid', Numeric(precision=50, scale=10), table=<repayment>), Column('interestDue', Numeric(precision=50, scale=10), table=<repayment>), Column('interestPaid', Numeric(precision=50, scale=10), table=<repayment>), Column('feesDue', Numeric(precision=50, scale=10), table=<repayment>), Column('feesPaid', Numeric(precision=50, scale=10), table=<repayment>), Column('penaltyDue', Numeric(precision=50, scale=10), table=<repayment>), Column('penaltyPaid', Numeric(precision=50, scale=10), table=<repayment>), Column('repaidDate', DateTime(), table=<repayment>), Column('lastPaidDate', DateTime(), table=<repayment>), Column('state', String(), table=<repayment>), Column('parentAccountKey', String(), ForeignKey('mambu_db.loanaccount.encodedKey'), table=<repayment>), schema='mambu_db')
__table_args__ = {'keep_existing': True, 'schema': 'mambu_db'}
__tablename__ = 'repayment'
_sa_class_manager = {'account': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'dueDate': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'encodedKey': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'feesDue': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'feesPaid': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'interestDue': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'interestPaid': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'lastPaidDate': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'parentAccountKey': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'penaltyDue': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'penaltyPaid': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'principalDue': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'principalPaid': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'repaidDate': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'state': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}
account
dueDate
encodedKey
feesDue
feesPaid
interestDue
interestPaid
lastPaidDate
parentAccountKey
penaltyDue
penaltyPaid
principalDue
principalPaid
repaidDate
state
class MambuPy.orm.schema_loans.TransactionChannel(**kwargs)[source]

Bases: Base

TransactionChannel table.

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

__mapper__ = <Mapper at 0x7f136cf16610; TransactionChannel>
__module__ = 'MambuPy.orm.schema_loans'
__repr__()[source]

Return repr(self).

__table__ = Table('transactionchannel', MetaData(bind=None), Column('encodedKey', String(), table=<transactionchannel>, primary_key=True, nullable=False), Column('id', String(), table=<transactionchannel>), Column('name', String(), table=<transactionchannel>), schema='mambu_db')
__table_args__ = {'keep_existing': True, 'schema': 'mambu_db'}
__tablename__ = 'transactionchannel'
_sa_class_manager = {'encodedKey': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'name': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}
encodedKey
id
name
class MambuPy.orm.schema_loans.TransactionDetails(**kwargs)[source]

Bases: Base

TransactionDetails table.

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

__mapper__ = <Mapper at 0x7f136cf272e0; TransactionDetails>
__module__ = 'MambuPy.orm.schema_loans'
__repr__()[source]

Return repr(self).

__table__ = Table('transactiondetails', MetaData(bind=None), Column('encodedKey', String(), table=<transactiondetails>, primary_key=True, nullable=False), Column('transactionChannelKey', String(), ForeignKey('mambu_db.transactionchannel.encodedKey'), table=<transactiondetails>), schema='mambu_db')
__table_args__ = {'keep_existing': True, 'schema': 'mambu_db'}
__tablename__ = 'transactiondetails'
_sa_class_manager = {'encodedKey': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'transactionChannel': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'transactionChannelKey': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}
encodedKey
transactionChannel
transactionChannelKey