first commit
This commit is contained in:
0
app/models/__init__.py
Normal file
0
app/models/__init__.py
Normal file
BIN
app/models/__pycache__/__init__.cpython-312.pyc
Normal file
BIN
app/models/__pycache__/__init__.cpython-312.pyc
Normal file
Binary file not shown.
BIN
app/models/__pycache__/auto.cpython-312.pyc
Normal file
BIN
app/models/__pycache__/auto.cpython-312.pyc
Normal file
Binary file not shown.
46
app/models/auto.py
Normal file
46
app/models/auto.py
Normal file
@@ -0,0 +1,46 @@
|
||||
from sqlalchemy import Column, Integer,\
|
||||
DECIMAL, Text,\
|
||||
VARCHAR, TIMESTAMP, Date, INTEGER
|
||||
from datetime import datetime, timezone
|
||||
from database import Base
|
||||
|
||||
|
||||
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(50, 2))
|
||||
temp_max = Column(DECIMAL(50, 2))
|
||||
temp_min = Column(DECIMAL(50, 2))
|
||||
temp_avg = Column(DECIMAL(50, 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))
|
||||
32
app/models/customer.py
Normal file
32
app/models/customer.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from sqlalchemy import (Column, Integer,
|
||||
DECIMAL, Text,
|
||||
VARCHAR, TIMESTAMP,
|
||||
Date, INTEGER)
|
||||
from datetime import datetime, timezone
|
||||
from database import Base
|
||||
|
||||
|
||||
class Customer_Customer(Base):
|
||||
__tablename__ = 'customer_customer'
|
||||
|
||||
id = Column(Integer,
|
||||
primary_key=True,
|
||||
autoincrement=True,
|
||||
unique=False)
|
||||
|
||||
account_number = Column(VARCHAR(25))
|
||||
customer_last_name = Column(VARCHAR(250))
|
||||
customer_first_name = Column(VARCHAR(250))
|
||||
customer_town = Column(VARCHAR(140))
|
||||
customer_state = Column(INTEGER)
|
||||
customer_zip = Column(VARCHAR(25))
|
||||
customer_first_call = Column(TIMESTAMP())
|
||||
customer_email = Column(VARCHAR(500))
|
||||
customer_automatic = Column(INTEGER)
|
||||
customer_phone_number = Column(VARCHAR(25))
|
||||
customer_home_type = Column(INTEGER)
|
||||
customer_apt = Column(VARCHAR(140))
|
||||
customer_address = Column(VARCHAR(1000))
|
||||
company_id = Column(INTEGER)
|
||||
|
||||
|
||||
50
app/models/delivery.py
Normal file
50
app/models/delivery.py
Normal file
@@ -0,0 +1,50 @@
|
||||
from sqlalchemy import (Column, Integer,
|
||||
DECIMAL, Text,
|
||||
VARCHAR, TIMESTAMP, Date)
|
||||
import datetime
|
||||
from database import Base
|
||||
|
||||
|
||||
class Delivery(Base):
|
||||
__tablename__ = "delivery_delivery"
|
||||
|
||||
id = Column(Integer,
|
||||
primary_key=True,
|
||||
autoincrement=True,
|
||||
unique=False)
|
||||
|
||||
customer_id = Column(Integer)
|
||||
customer_name = Column(VARCHAR(1000))
|
||||
customer_address = Column(VARCHAR(1000))
|
||||
customer_town = Column(VARCHAR(140))
|
||||
customer_state = Column(VARCHAR(140))
|
||||
customer_zip = Column(Integer)
|
||||
|
||||
gallons_ordered = Column(Integer)
|
||||
customer_asked_for_fill = Column(Integer)
|
||||
gallons_delivered = Column(DECIMAL(50, 2))
|
||||
customer_filled = Column(Integer)
|
||||
|
||||
delivery_status = Column(Integer)
|
||||
when_ordered = Column(TIMESTAMP(), default=datetime.datetime.utcnow())
|
||||
when_delivered = Column(TIMESTAMP(), default=None)
|
||||
expected_delivery_date = Column(Date(), default=None)
|
||||
automatic = Column(Integer)
|
||||
oil_id = Column(Integer)
|
||||
supplier_price = Column(DECIMAL(50, 2))
|
||||
customer_price = Column(DECIMAL(50, 2))
|
||||
customer_temperature = Column(DECIMAL(50, 2))
|
||||
dispatcher_notes = Column(Text())
|
||||
prime = Column(Integer)
|
||||
same_day = Column(Integer)
|
||||
payment_type = Column(Integer)
|
||||
payment_card_id = Column(Integer)
|
||||
cash_recieved = Column(DECIMAL(50, 2))
|
||||
|
||||
driver_employee_id = Column(Integer)
|
||||
driver_first_name = Column(VARCHAR(140))
|
||||
driver_last_name = Column(VARCHAR(140))
|
||||
|
||||
pre_charge_amount = Column(DECIMAL(50, 2))
|
||||
total_price = Column(DECIMAL(50, 2))
|
||||
final_price = Column(DECIMAL(50, 2))
|
||||
28
app/models/money.py
Normal file
28
app/models/money.py
Normal file
@@ -0,0 +1,28 @@
|
||||
from sqlalchemy import (Column, Integer,
|
||||
DECIMAL, Text,
|
||||
VARCHAR, TIMESTAMP, Date)
|
||||
from datetime import datetime, timezone
|
||||
from database import Base
|
||||
|
||||
|
||||
class MoneyDelivery(Base):
|
||||
__tablename__ = 'money_delivery'
|
||||
|
||||
id = Column(Integer,
|
||||
primary_key=True,
|
||||
autoincrement=True,
|
||||
unique=False)
|
||||
|
||||
delivery_id = Column(Integer)
|
||||
time_added = Column(TIMESTAMP(), default=datetime.utcnow())
|
||||
gallons_delivered = Column(DECIMAL(50, 2))
|
||||
supplier_price = Column(DECIMAL(50, 2))
|
||||
customer_price = Column(DECIMAL(50, 2))
|
||||
total_amount_oil = Column(DECIMAL(50, 2))
|
||||
total_amount_prime = Column(DECIMAL(50, 2))
|
||||
total_amount_same_day = Column(DECIMAL(50, 2))
|
||||
total_amount_fee = Column(DECIMAL(50, 2))
|
||||
total_amount = Column(DECIMAL(50, 2))
|
||||
taxes_paid = Column(DECIMAL(50, 2))
|
||||
total_profit = Column(DECIMAL(50, 2))
|
||||
total_profit_oil = Column(DECIMAL(50, 2))
|
||||
34
app/models/pricing.py
Normal file
34
app/models/pricing.py
Normal file
@@ -0,0 +1,34 @@
|
||||
from sqlalchemy import (Column, Integer, DECIMAL, TIMESTAMP)
|
||||
from datetime import datetime
|
||||
from database import Base
|
||||
|
||||
|
||||
class Pricing_Oil_Oil(Base):
|
||||
__tablename__ = 'pricing_oil_oil'
|
||||
|
||||
|
||||
id = Column(Integer,
|
||||
primary_key=True,
|
||||
autoincrement=True,
|
||||
unique=False)
|
||||
|
||||
price_from_supplier = Column(DECIMAL(50, 2))
|
||||
price_for_customer = Column(DECIMAL(50, 2))
|
||||
price_for_employee = Column(DECIMAL(50, 2))
|
||||
price_same_day = Column(DECIMAL(50, 2))
|
||||
price_prime = Column(DECIMAL(50, 2))
|
||||
date = Column(TIMESTAMP(), default=datetime.utcnow())
|
||||
|
||||
|
||||
|
||||
class Pricing_Taxes(Base):
|
||||
__tablename__ = 'taxes_pricing'
|
||||
|
||||
|
||||
id = Column(Integer,
|
||||
primary_key=True,
|
||||
autoincrement=True,
|
||||
unique=False)
|
||||
state_id = Column(Integer)
|
||||
taxes_oil = Column(DECIMAL(50, 2))
|
||||
taxes_other = Column(DECIMAL(50, 2))
|
||||
Reference in New Issue
Block a user