[update]: Eligibility check request
This commit is contained in:
+11
-9
@@ -1,5 +1,5 @@
|
||||
from datetime import datetime, timezone
|
||||
from app import db
|
||||
from app.extensions import db
|
||||
|
||||
class Account(db.Model):
|
||||
__tablename__ = 'accounts'
|
||||
@@ -12,14 +12,16 @@ class Account(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))
|
||||
|
||||
# Database relationship
|
||||
# customer = db.relationship(
|
||||
# 'Customer',
|
||||
# primaryjoin='Account.customer_id == Customer.id',
|
||||
# backref='accounts',
|
||||
# foreign_keys=[customer_id],
|
||||
# viewonly=True
|
||||
# )
|
||||
@classmethod
|
||||
def create_account(cls, id, customer_id, account_type, status='active'):
|
||||
account = cls(
|
||||
id=id,
|
||||
customer_id=customer_id,
|
||||
account_type=account_type
|
||||
)
|
||||
db.session.add(account)
|
||||
db.session.commit()
|
||||
return account
|
||||
|
||||
@classmethod
|
||||
def is_valid_account(cls, account_id, customer_id):
|
||||
|
||||
Reference in New Issue
Block a user