80 lines
2.4 KiB
Python
80 lines
2.4 KiB
Python
from sqlalchemy import Column, TEXT, DECIMAL, INTEGER, VARCHAR, DATE
|
|
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)
|
|
# how many gallons ordered
|
|
gallons_ordered = Column(INTEGER)
|
|
# if customer asked for a fill
|
|
customer_asked_for_fill = Column(INTEGER)
|
|
# integer value if delivered, waiting, cancelled etc
|
|
gallons_delivered =Column(DECIMAL(6, 2))
|
|
# if customer has a full tank
|
|
customer_filled = Column(INTEGER)
|
|
# integer value if delivered, waiting, cancelled etc
|
|
# waiting = 0
|
|
# delivered = 1
|
|
# out for delivery = 2
|
|
# cancelled = 3
|
|
# partial delivery = 4
|
|
# issue = 5
|
|
# finalized = 10
|
|
delivery_status = Column(INTEGER)
|
|
|
|
# when the call to order took place
|
|
when_ordered = Column(DATE(), default=None)
|
|
# when the delivery date happened
|
|
when_delivered = Column(DATE(), default=None)
|
|
# when the delivery is expected ie what day
|
|
expected_delivery_date = Column(DATE(), default=None)
|
|
# automatic delivery
|
|
automatic = Column(INTEGER)
|
|
automatic_id = Column(INTEGER)
|
|
# OIL info and id from table
|
|
oil_id = Column(INTEGER)
|
|
supplier_price = Column(DECIMAL(6, 2))
|
|
customer_price = Column(DECIMAL(6, 2))
|
|
# weather
|
|
customer_temperature = Column(DECIMAL(6, 2))
|
|
# services
|
|
dispatcher_notes = Column(TEXT())
|
|
|
|
prime = Column(INTEGER)
|
|
same_day = Column(INTEGER)
|
|
emergency = Column(INTEGER)
|
|
|
|
# cash = 0
|
|
# credit = 1
|
|
# credit/cash = 2
|
|
# check = 3
|
|
# other = 4
|
|
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))
|
|
check_number = Column(VARCHAR(20))
|
|
|
|
|
|
promo_id = Column(INTEGER)
|
|
promo_money_discount = Column(DECIMAL(6, 2))
|