"""reference_transaction_type model.""" from abacus_common_logic.connectors.database import db from abacus_common_logic.models.base import CRUDMixin from sqlalchemy import func class ReferenceTransactionType(db.Model, CRUDMixin): """reference_transaction_type model.""" __tablename__ = 'reference_transaction_type' reference_transaction_type_id = db.Column(db.Integer, primary_key=True) transaction_type_name = db.Column(db.String(180), nullable=False) transaction_type_code = db.Column(db.String(4), nullable=False) @classmethod def default_order(cls): """Override to customize default ordering.""" return func.lower(cls.transaction_type_name) @classmethod def get_all(cls): """Get all reference transaction types in order.""" return cls.query.order_by(cls.default_order()).all()