""" Booked Vendor Contract Model. Model for getting information about vendor booked contracts. """ from sqlalchemy import Column, SmallInteger, String from contracts.connectors import mysql class Currency(mysql.BaseModel): """Class for Currency model.""" __tablename__ = 'currencies' currency_id = Column('id', SmallInteger, primary_key=True, autoincrement=True) code = Column('ISO_4217_code', String(12)) symbol = Column('symbol_html_entity_code', String(45)) decimal_mark = Column(String(1)) thousands_separator = Column(String(1)) symbol_infront = Column(String(1)) subunit_to_unit = Column(SmallInteger) subunit_name = Column(String(45)) supported_payout_currency = Column(String(1)) def as_dict(self): """Return object as dict. Returns: dict: Dictionary representation of the object """ contract_dict = { 'currency_id': self.currency_id, 'code': self.code, 'symbol': self.symbol, 'decimal_mark': self.decimal_mark, 'thousands_separator': self.thousands_separator, 'symbol_infront': self.symbol_infront, 'subunit_to_unit': self.subunit_to_unit, 'supported_payout_currency': self.supported_payout_currency, } return contract_dict