66 lines
2.6 KiB
Python
66 lines
2.6 KiB
Python
# import db object from flask app
|
|
from app import db
|
|
from sqlalchemy import Column, ForeignKey, Integer, Table, Numeric, String, DateTime,Boolean
|
|
from sqlalchemy.orm import declarative_base, relationship
|
|
|
|
Base = declarative_base()
|
|
|
|
|
|
class EnquiryParent(Base):
|
|
__tablename__ = "out_enquity_amount_p"
|
|
id = Column(Integer, primary_key=True)
|
|
losid = Column(Integer, nullable = False)
|
|
ref_no = Column(Integer, nullable = False)
|
|
facility_type = Column(Integer, nullable = False)
|
|
total_amt = Column(Numeric, nullable = False)
|
|
total_count = Column(Integer, nullable = False)
|
|
is_active = Column(Boolean, nullable = False)
|
|
createdAt = Column(DateTime, nullable = False)
|
|
updatedAt = Column(DateTime, nullable = False)
|
|
createdby = Column(Integer, nullable = False)
|
|
updatedby = Column(Integer, nullable = False)
|
|
output_type = Column(Integer, nullable = False)
|
|
# children = relationship("Child")
|
|
|
|
|
|
class EnquiryChild(Base):
|
|
__tablename__ = "out_enquiry_amount_c"
|
|
id = Column(Integer, primary_key=True)
|
|
# enquiry_amount_id = Column(Integer, ForeignKey("parent.id"))
|
|
enquiry_amount_id = Column(Integer, nullable = False)
|
|
months_range = Column(String, nullable = False)
|
|
amt = Column(Integer, nullable = False)
|
|
count = Column(Integer, nullable = False)
|
|
is_active = Column(Integer, nullable = False)
|
|
createdAt = Column(DateTime, nullable = True)
|
|
createdby = Column(Integer, nullable = True)
|
|
updatedAt = Column(DateTime, nullable = True)
|
|
updatedby = Column(Integer, nullable = True)
|
|
# parent = relationship("Parent")
|
|
|
|
|
|
# database tables
|
|
# class Op_enquiry_amount_and_count_unique_enquiries(db.Model):
|
|
# id = db.Column(db.Integer, primary_key =True)
|
|
# temp_id = db.Column(db.Integer, nullable = False)
|
|
# ApplicationRefno = db.Column(db.Numeric, nullable = False)
|
|
# BorrowerCurrentDetailsID = db.Column(db.Integer, nullable = False)
|
|
# CFHistory24Monthsmonth = db.Column(db.DateTime, nullable = False)
|
|
# CFHistory24MonthsACorDPD = db.Column(db.String, nullable = False)
|
|
# CFHistory24MonthsOSAmount = db.Column(db.Numeric, nullable = False)
|
|
|
|
# [id]
|
|
# ,[enquiry_amount_count_cedit_facility]
|
|
# ,[enquiry_amount_count_1]
|
|
# ,[enquiry_amount_count_2_to_3]
|
|
# ,[enquiry_amount_count_4_to_6]
|
|
# ,[enquiry_amount_count_7_to_12]
|
|
# ,[enquiry_amount_count_13_to_24]
|
|
# ,[enquiry_amount_count_25_to_36]
|
|
# ,[enquiry_amount_count_greater_than_36]
|
|
# ,[enquiry_amount_count_total]
|
|
# ,[is_active]
|
|
# ,[createdAt]
|
|
# ,[createdby]
|
|
# ,[updatedAt]
|
|
# ,[updatedby] |