[feat]: add models bind to eco database

This commit is contained in:
VivianDee
2025-07-25 15:13:59 +01:00
parent 8c215a7f35
commit 5c99bf96c2
6 changed files with 122 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
from sqlalchemy import Column, String, Date, Boolean, Integer
from app.extensions import db
class Account(db.Model):
__tablename__ = 'accounts'
__bind_key__ = 'eco'
id = Column(Integer, primary_key=True)
affiliate_code = Column(String(3), nullable=False)
customer_id = Column(String(9), nullable=False)
account_id = Column(String(10), unique=True, nullable=False)
registration_date = Column(Date, nullable=False)
account_currency_code = Column(String(3), nullable=False)
plastic_card_attached = Column(Boolean, default=False)
def __repr__(self):
return f"<Account(id={self.id}, account_id={self.account_id}, customer_id={self.customer_id})>"