Files
eamco_payment_api/app/classes/customer.py
2024-02-28 16:08:07 -05:00

81 lines
2.4 KiB
Python

from app import db, ma, login_manager
from datetime import datetime
class Customer_Customer(db.Model):
__tablename__ = 'customer_customer'
__bind_key__ = 'eamco'
__table_args__ = {"schema": "public"}
id = db.Column(db.Integer,
primary_key=True,
autoincrement=True,
unique=False)
customer_last_name = db.Column(db.VARCHAR(250))
customer_first_name = db.Column(db.VARCHAR(250))
customer_town = db.Column(db.VARCHAR(140))
customer_state = db.Column(db.INTEGER)
customer_zip = db.Column(db.VARCHAR(25))
customer_first_call = db.Column(db.TIMESTAMP(), default=datetime.utcnow())
customer_email = db.Column(db.VARCHAR(500))
customer_automatic = db.Column(db.INTEGER)
customer_phone_number = db.Column(db.VARCHAR(25))
customer_home_type = db.Column(db.INTEGER)
customer_apt = db.Column(db.VARCHAR(140))
customer_address = db.Column(db.VARCHAR(1000))
class Customer_Customer_schema(ma.SQLAlchemyAutoSchema):
class Meta:
model = Customer_Customer
class Customer_Property(db.Model):
__tablename__ = 'customer_property'
__bind_key__ = 'eamco'
__table_args__ = {"schema": "public"}
id = db.Column(db.Integer,
primary_key=True,
autoincrement=True,
unique=False)
customer_id = db.Column(db.INTEGER)
# residential = 0
# condo = 1
# apartment = 2
# commercial = 3
# business = 4
# vehicle = 4
customer_property_type = db.Column(db.INTEGER)
class Customer_Property_schema(ma.SQLAlchemyAutoSchema):
class Meta:
model = Customer_Property
class Customer_Payment_Credit(db.Model):
__tablename__ = 'customer_payment'
__bind_key__ = 'eamco'
__table_args__ = {"schema": "public"}
id = db.Column(db.Integer,
primary_key=True,
autoincrement=True,
unique=False)
customer_id = db.Column(db.INTEGER)
credit_card_type = db.Column(db.INTEGER)
credit_card_name = db.Column(db.VARCHAR(240))
credit_card_number = db.Column(db.VARCHAR(140))
credit_card_security = db.Column(db.VARCHAR(140))
customer_card_expiration = db.Column(db.TIMESTAMP(), default=datetime.utcnow())
class Customer_Payment_Credit_schema(ma.SQLAlchemyAutoSchema):
class Meta:
model = Customer_Payment_Credit