"""CustomerMasterMaster model.""" from typing import List from abacus_common_logic.connectors.database import db from abacus_common_logic.models.base import CRUDMixin class CustomerMasterMaster(db.Model, CRUDMixin): """CustomerMasterMaster model. This model maps `customer_master_master` table from art_relations. """ __tablename__ = 'customer_master_master' customer_master_master_id = db.Column(db.SmallInteger, primary_key=True) customer_name = db.Column(db.String(50), nullable=False) vendor_dms_master_restriction = db.relationship( 'VendorDmsMasterRestriction', backref='customer_master_master', cascade='all, delete-orphan', ) @classmethod def get_by_ids(cls, ids: List[str]) -> List['CustomerMasterMaster']: """Get customer_master_master's by ids.""" return cls.query.filter(cls.customer_master_master_id.in_(ids)).all()