[add]: Kafka Integration

This commit is contained in:
VivianDee
2025-04-03 10:49:21 +01:00
parent 39d1a1eddc
commit b180f8411d
21 changed files with 131 additions and 26 deletions
+8
View File
@@ -1,4 +1,5 @@
from datetime import datetime, timezone
from sqlalchemy.orm import relationship
from app.extensions import db
from app.models.account import Account
@@ -11,6 +12,13 @@ class Customer(db.Model):
created_at = db.Column(db.DateTime, default=datetime.now(timezone.utc))
updated_at = db.Column(db.DateTime, default=datetime.now(timezone.utc), onupdate=datetime.now(timezone.utc))
accounts = relationship(
"Account",
primaryjoin="Customer.id == Account.customer_id",
foreign_keys="Account.customer_id",
back_populates="customer",
)
@classmethod
def is_eligible(cls, customer_id):
customer = cls.query.filter_by(id=customer_id).first()