"""Vendor Payment Hold Log Model. Model for getting details about vendor_payment_hold_log. """ from sqlalchemy import Column from sqlalchemy import DateTime from sqlalchemy import Enum from sqlalchemy import ForeignKey from sqlalchemy import func from sqlalchemy import String from sqlalchemy import Text from ows_accounting.utils import mysql class VendorPaymentHoldLog(mysql.BaseModel): """Class for vendor_payment_hold_log table.""" __tablename__ = 'vendor_payment_hold_log' timestamp = Column(DateTime, primary_key=True, server_default=func.now()) user_id = Column(String(10), primary_key=True, nullable=False) vendor_payment_hold_id = Column( ForeignKey('vendor_payment_hold.id'), primary_key=True) action = Column(Enum('create', 'update'), nullable=False) description = Column(Text, nullable=True) status = Column(Enum('active', 'inactive'), nullable=True) def as_dict(self): """Return object as dict. Returns: dict: Dictionary representation of the object. """ hold_log_dict = { 'timestamp': self.timestamp.isoformat(), 'action': self.action, 'description': self.description, 'status': self.status, 'user_id': self.user_id } return hold_log_dict