small fixes
This commit is contained in:
25
app/models/admin.py
Normal file
25
app/models/admin.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from sqlalchemy import (Column, Integer,
|
||||
DECIMAL, TEXT,
|
||||
VARCHAR, DATE, INTEGER)
|
||||
from datetime import datetime
|
||||
from database import Base
|
||||
|
||||
|
||||
|
||||
class Admin_Company(Base):
|
||||
__tablename__ = 'admin_company'
|
||||
__table_args__ = {"schema": "public"}
|
||||
|
||||
id = Column(Integer,
|
||||
primary_key=True,
|
||||
autoincrement=True,
|
||||
unique=False)
|
||||
creation_date = Column(DATE())
|
||||
account_prefix = Column(VARCHAR(5))
|
||||
company_name = Column(VARCHAR(250))
|
||||
company_address = Column(VARCHAR(250))
|
||||
company_town = Column(VARCHAR(100))
|
||||
company_zip = Column(VARCHAR(25))
|
||||
company_state = Column(INTEGER())
|
||||
company_phone_number = Column(VARCHAR(50))
|
||||
|
||||
@@ -1,30 +1,21 @@
|
||||
from sqlalchemy import Column, Integer,\
|
||||
DECIMAL, TEXT,\
|
||||
VARCHAR, TIMESTAMP, DATE, INTEGER
|
||||
from sqlalchemy import (Column, Integer,
|
||||
DECIMAL, TEXT,
|
||||
VARCHAR, DATE, INTEGER)
|
||||
from datetime import datetime
|
||||
from database import Base
|
||||
|
||||
|
||||
|
||||
|
||||
class Auto_Customer(Base):
|
||||
__tablename__ = 'auto_temp'
|
||||
class Auto_Update(Base):
|
||||
__tablename__ = 'auto_update'
|
||||
|
||||
id = Column(Integer,
|
||||
primary_key=True,
|
||||
autoincrement=True,
|
||||
unique=False)
|
||||
customer_id = Column(INTEGER())
|
||||
customer_full_name = Column(VARCHAR(250))
|
||||
last_fill = Column(TIMESTAMP(), default=datetime.utcnow())
|
||||
last_updated = Column(TIMESTAMP(), default=datetime.utcnow())
|
||||
estimated_gallons_left = Column(INTEGER)
|
||||
estimated_gallons_left_prev_day = Column(INTEGER)
|
||||
tank_height = Column(VARCHAR(25))
|
||||
tank_size = Column(VARCHAR(25))
|
||||
house_factor = Column(DECIMAL(5, 2))
|
||||
|
||||
|
||||
last_updated = Column(DATE())
|
||||
|
||||
|
||||
class Auto_Temp(Base):
|
||||
@@ -35,7 +26,7 @@ class Auto_Temp(Base):
|
||||
autoincrement=True,
|
||||
unique=False)
|
||||
|
||||
todays_date = Column(TIMESTAMP(), default=datetime.utcnow())
|
||||
todays_date = Column(DATE)
|
||||
temp = Column(DECIMAL(5, 2))
|
||||
temp_max = Column(DECIMAL(5, 2))
|
||||
temp_min = Column(DECIMAL(5, 2))
|
||||
@@ -59,10 +50,36 @@ class Auto_Delivery(Base):
|
||||
customer_address = Column(VARCHAR(1000))
|
||||
customer_zip = Column(VARCHAR(25))
|
||||
customer_full_name = Column(VARCHAR(250))
|
||||
last_fill = Column(TIMESTAMP())
|
||||
last_updated = Column(TIMESTAMP())
|
||||
estimated_gallons_left = Column(INTEGER())
|
||||
estimated_gallons_left_prev_day = Column(INTEGER())
|
||||
last_fill = Column(DATE())
|
||||
last_updated = Column(DATE())
|
||||
estimated_gallons_left = Column(DECIMAL(6, 2))
|
||||
estimated_gallons_left_prev_day = Column(DECIMAL(6, 2))
|
||||
tank_height = Column(VARCHAR(25))
|
||||
tank_size = Column(VARCHAR(25))
|
||||
house_factor = Column(DECIMAL(5, 2))
|
||||
house_factor = Column(DECIMAL(5, 2))
|
||||
auto_status = Column(INTEGER())
|
||||
|
||||
|
||||
class Tickets_Auto_Delivery(Base):
|
||||
__tablename__ = 'auto_tickets'
|
||||
|
||||
id = Column(Integer,
|
||||
primary_key=True,
|
||||
autoincrement=True,
|
||||
unique=False)
|
||||
customer_id = Column(INTEGER())
|
||||
account_number = Column(VARCHAR(25))
|
||||
|
||||
customer_town = Column(VARCHAR(140))
|
||||
customer_state = Column(Integer)
|
||||
customer_address = Column(VARCHAR(1000))
|
||||
customer_zip = Column(VARCHAR(25))
|
||||
customer_full_name = Column(VARCHAR(250))
|
||||
customer_zip = Column(VARCHAR(25))
|
||||
|
||||
oil_prices_id = Column(INTEGER())
|
||||
|
||||
gallons_delivered = Column(DECIMAL(6, 2))
|
||||
price_per_gallon = Column(DECIMAL(6, 2))
|
||||
|
||||
total_amount_customer = Column(DECIMAL(6, 2))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from sqlalchemy import Column, Integer,\
|
||||
DECIMAL, TEXT,\
|
||||
VARCHAR, TIMESTAMP, DATE
|
||||
VARCHAR, BOOLEAN, DATE
|
||||
from database import Base
|
||||
|
||||
|
||||
@@ -26,4 +26,5 @@ class MoneyDelivery(Base):
|
||||
total_discount_total = Column(DECIMAL(6, 2))
|
||||
taxes_paid = Column(DECIMAL(6, 2))
|
||||
total_profit = Column(DECIMAL(6, 2))
|
||||
total_profit_oil = Column(DECIMAL(6, 2))
|
||||
total_profit_oil = Column(DECIMAL(6, 2))
|
||||
auto = Column(BOOLEAN)
|
||||
Reference in New Issue
Block a user