32 lines
891 B
Python
Executable File
32 lines
891 B
Python
Executable File
|
|
from app import db, ma, login_manager
|
|
from datetime import datetime
|
|
|
|
|
|
class Stats_Customer(db.Model):
|
|
__tablename__ = 'stats_customer'
|
|
__table_args__ = {"schema": "public"}
|
|
|
|
id = db.Column(db.Integer,
|
|
primary_key=True,
|
|
autoincrement=True,
|
|
unique=False)
|
|
customer_id = db.Column(db.INTEGER)
|
|
total_calls = db.Column(db.INTEGER)
|
|
service_calls_total = db.Column(db.INTEGER)
|
|
service_calls_total_spent = db.Column(db.DECIMAL(6, 2))
|
|
service_calls_total_profit = db.Column(db.DECIMAL(6, 2))
|
|
|
|
|
|
oil_deliveries = db.Column(db.INTEGER)
|
|
oil_total_gallons = db.Column(db.DECIMAL(6, 2))
|
|
oil_total_spent = db.Column(db.DECIMAL(6, 2))
|
|
oil_total_profit = db.Column(db.DECIMAL(6, 2))
|
|
|
|
class Stats_Customer_schema(ma.SQLAlchemyAutoSchema):
|
|
class Meta:
|
|
model = Stats_Customer
|
|
|
|
|
|
|