first commit
This commit is contained in:
0
app/models/__init__.py
Normal file
0
app/models/__init__.py
Normal file
86
app/models/auto.py
Normal file
86
app/models/auto.py
Normal file
@@ -0,0 +1,86 @@
|
||||
from sqlalchemy import (Column, Integer,
|
||||
DECIMAL, TEXT,
|
||||
VARCHAR, DATE, INTEGER)
|
||||
from datetime import datetime
|
||||
from database import Base
|
||||
|
||||
|
||||
|
||||
|
||||
class Auto_Update(Base):
|
||||
__tablename__ = 'auto_update'
|
||||
|
||||
id = Column(Integer,
|
||||
primary_key=True,
|
||||
autoincrement=True,
|
||||
unique=False)
|
||||
|
||||
last_updated = Column(DATE())
|
||||
|
||||
|
||||
class Auto_Temp(Base):
|
||||
__tablename__ = 'auto_temp'
|
||||
|
||||
id = Column(Integer,
|
||||
primary_key=True,
|
||||
autoincrement=True,
|
||||
unique=False)
|
||||
|
||||
todays_date = Column(DATE)
|
||||
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(DATE())
|
||||
days_since_last_fill = Column(INTEGER())
|
||||
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))
|
||||
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())
|
||||
fill_date = Column(DATE())
|
||||
gallons_delivered = Column(DECIMAL(6, 2))
|
||||
price_per_gallon = Column(DECIMAL(6, 2))
|
||||
|
||||
total_amount_customer = Column(DECIMAL(6, 2))
|
||||
29
app/models/cards.py
Normal file
29
app/models/cards.py
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
from sqlalchemy import (Column, Integer,
|
||||
BOOLEAN, DATE, String,
|
||||
VARCHAR,
|
||||
INTEGER)
|
||||
|
||||
from database import Base
|
||||
|
||||
|
||||
class Card_Card(Base):
|
||||
__tablename__ = 'card_card'
|
||||
__table_args__ = {"schema": "public"}
|
||||
|
||||
id = Column(Integer,
|
||||
primary_key=True,
|
||||
autoincrement=True,
|
||||
unique=False)
|
||||
date_added = Column(DATE())
|
||||
user_id = Column(INTEGER())
|
||||
card_number = Column(VARCHAR(50))
|
||||
last_four_digits = Column(INTEGER())
|
||||
name_on_card = Column(VARCHAR(500))
|
||||
expiration_month = Column(INTEGER())
|
||||
expiration_year = Column(INTEGER())
|
||||
type_of_card = Column(VARCHAR(500))
|
||||
security_number = Column(INTEGER())
|
||||
accepted_or_declined = Column(INTEGER())
|
||||
main_card = Column(BOOLEAN())
|
||||
auth_net_payment_profile_id = Column(String, unique=True, index=True, nullable=False)
|
||||
31
app/models/customer.py
Normal file
31
app/models/customer.py
Normal file
@@ -0,0 +1,31 @@
|
||||
from sqlalchemy import (Column, Integer,
|
||||
String,
|
||||
VARCHAR,
|
||||
DATE, INTEGER)
|
||||
from database import Base
|
||||
|
||||
|
||||
class Customer_Customer(Base):
|
||||
__tablename__ = 'customer_customer'
|
||||
|
||||
id = Column(Integer,
|
||||
primary_key=True,
|
||||
autoincrement=True,
|
||||
unique=False)
|
||||
auth_net_profile_id = Column(String, unique=True, index=True, nullable=True)
|
||||
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(DATE())
|
||||
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)
|
||||
|
||||
|
||||
51
app/models/delivery.py
Normal file
51
app/models/delivery.py
Normal file
@@ -0,0 +1,51 @@
|
||||
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(VARCHAR(10))
|
||||
|
||||
gallons_ordered = Column(INTEGER)
|
||||
customer_asked_for_fill = Column(INTEGER)
|
||||
gallons_delivered = Column(DECIMAL(6, 2))
|
||||
customer_filled = Column(INTEGER)
|
||||
|
||||
delivery_status = Column(INTEGER)
|
||||
when_ordered = Column(DATE(), )
|
||||
when_delivered = Column(DATE())
|
||||
expected_delivery_date = Column(DATE(), default=None)
|
||||
automatic = Column(INTEGER)
|
||||
automatic_id = Column(INTEGER)
|
||||
oil_id = Column(INTEGER)
|
||||
supplier_price = Column(DECIMAL(6, 2))
|
||||
customer_price = Column(DECIMAL(6, 2))
|
||||
customer_temperature = Column(DECIMAL(6, 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(6, 2))
|
||||
|
||||
driver_employee_id = Column(INTEGER)
|
||||
driver_first_name = Column(VARCHAR(140))
|
||||
driver_last_name = Column(VARCHAR(140))
|
||||
|
||||
pre_charge_amount = Column(DECIMAL(6, 2))
|
||||
total_price = Column(DECIMAL(6, 2))
|
||||
final_price = Column(DECIMAL(6, 2))
|
||||
29
app/models/employee.py
Normal file
29
app/models/employee.py
Normal file
@@ -0,0 +1,29 @@
|
||||
from sqlalchemy import (Column, INTEGER,
|
||||
DECIMAL, TEXT,
|
||||
VARCHAR, TIMESTAMP, DATE)
|
||||
import datetime
|
||||
from database import Base
|
||||
|
||||
|
||||
class Employee_Employee(Base):
|
||||
__tablename__ = 'employee_employee'
|
||||
__table_args__ = {"schema": "public"}
|
||||
|
||||
id = Column(INTEGER,
|
||||
primary_key=True,
|
||||
autoincrement=True,
|
||||
unique=False)
|
||||
|
||||
user_id = Column(INTEGER)
|
||||
employee_first_name = Column(VARCHAR(250))
|
||||
employee_last_name = Column(VARCHAR(250))
|
||||
employee_apt = Column(VARCHAR(250))
|
||||
employee_address = Column(VARCHAR(1000))
|
||||
employee_town = Column(VARCHAR(140))
|
||||
employee_state = Column(VARCHAR(140))
|
||||
employee_zip = Column(VARCHAR(25))
|
||||
employee_birthday = Column(DATE())
|
||||
employee_type = Column(INTEGER)
|
||||
employee_phone_number = Column(VARCHAR(25))
|
||||
employee_start_date = Column(DATE())
|
||||
employee_end_date = Column(DATE(), default=None)
|
||||
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(6, 2))
|
||||
supplier_price = Column(DECIMAL(6, 2))
|
||||
customer_price = Column(DECIMAL(6, 2))
|
||||
total_amount_oil = Column(DECIMAL(6, 2))
|
||||
total_amount_prime = Column(DECIMAL(6, 2))
|
||||
total_amount_same_day = Column(DECIMAL(6, 2))
|
||||
total_amount_fee = Column(DECIMAL(6, 2))
|
||||
total_amount = Column(DECIMAL(6, 2))
|
||||
taxes_paid = Column(DECIMAL(6, 2))
|
||||
total_profit = Column(DECIMAL(6, 2))
|
||||
total_profit_oil = Column(DECIMAL(6, 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(6, 2))
|
||||
price_for_customer = Column(DECIMAL(6, 2))
|
||||
price_for_employee = Column(DECIMAL(6, 2))
|
||||
price_same_day = Column(DECIMAL(6, 2))
|
||||
price_prime = Column(DECIMAL(6, 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(6, 2))
|
||||
taxes_other = Column(DECIMAL(6, 2))
|
||||
Reference in New Issue
Block a user