forked from DigiFi/digifi-BankToProductCore
22 lines
958 B
Python
22 lines
958 B
Python
from sqlalchemy import Column, String, Numeric, Date, Integer
|
|
from app.extensions import db
|
|
|
|
class Offer(db.Model):
|
|
__tablename__ = 'offers'
|
|
__bind_key__ = 'eco'
|
|
|
|
id = Column(Integer, primary_key=True)
|
|
offer_id = Column(String(50), unique=True, nullable=False)
|
|
session_id = Column(String(50), nullable=False)
|
|
customer_id = Column(String(9), nullable=False)
|
|
product_id = Column(String(4), nullable=False)
|
|
amount = Column(Numeric(12, 2), nullable=False)
|
|
upfront_payment = Column(Numeric(12, 2), nullable=False)
|
|
interest_rate = Column(Numeric(5, 2), nullable=False)
|
|
installment_amount = Column(Numeric(12, 2), nullable=False)
|
|
total_repayment_amount = Column(Numeric(12, 2), nullable=False)
|
|
expiration_date = Column(Date, nullable=False)
|
|
status = Column(String(20), default='AVAILABLE')
|
|
|
|
def __repr__(self):
|
|
return f"<Offer(id={self.id}, offer_id={self.offer_id}, status={self.status})>" |