updated classes

This commit is contained in:
2024-07-17 18:04:38 -04:00
parent 6624cf541b
commit c7e6579c20
2 changed files with 70 additions and 1 deletions

68
app/models/auto.py Normal file
View File

@@ -0,0 +1,68 @@
from sqlalchemy import Column, Integer,\
DECIMAL, Text,\
VARCHAR, TIMESTAMP, Date, INTEGER
from datetime import datetime, timezone
from database import Base
class Auto_Customer(Base):
__tablename__ = 'auto_temp'
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))
class Auto_Temp(Base):
__tablename__ = 'auto_temp'
id = Column(Integer,
primary_key=True,
autoincrement=True,
unique=False)
todays_date = Column(TIMESTAMP(), default=datetime.utcnow())
temp = Column(DECIMAL(5, 2))
temp_max = Column(DECIMAL(5, 2))
temp_min = Column(DECIMAL(5, 2))
temp_avg = Column(DECIMAL(5, 2))
degree_day = Column(INTEGER())
class Auto_Delivery(Base):
__tablename__ = 'auto_delivery'
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))
last_fill = Column(TIMESTAMP())
last_updated = Column(TIMESTAMP())
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))

View File

@@ -9,8 +9,9 @@ app.include_router(delivery.router)
origins = [
"http://localhost:9000",
"https://localhost:5173",
"https://localhost:9511",
"http://localhost",
"http://localhost:9514",
]