# Path: app/models/database.py

# 
# Path: app/models/user.py
# class User(db.Model):
#     "Class used for configuring the User model in the database"
#     id = db.Column(db.Integer, primary_key=True)
#     username = db.Column(db.String(80), unique=True, nullable=False)
#     admin = db.Column(db.Boolean)
#     bias = db.Column(db.Integer)
#     runs = db.relation(
#         "Order",
#         backref="courier",
#         primaryjoin="Order.courier_id==User.id",
#         foreign_keys="Order.courier_id",
#     )
#     orderItems = db.relationship("OrderItem", backref="user", lazy="dynamic")
# 
#     def configure(self, username: str, admin: bool, bias: int) -> None:
#         "Configure the User"
#         self.username = username
#         self.admin = admin
#         self.bias = bias
# 
#     # pylint: disable=C0111, R0201
#     def is_authenticated(self) -> bool:
#         return True
# 
#     def is_active(self) -> bool:
#         return True
# 
#     def is_admin(self) -> bool:
#         return self.admin
# 
#     def is_anonymous(self) -> bool:
#         return False
# 
#     def get_id(self) -> str:
#         return str(self.id)
# 
#     def __repr__(self) -> str:
#         return "%s" % self.username


import typing
from datetime import datetime
from collections import defaultdict
from utils import first
from hlds.definitions import location_definitions
from .database import db
from .user import User
"Script for everything Order related in the database"



class Order(db.Model):
    "Class used for configuring the Order model in the database"
    id = db.Column(db.Integer, primary_key=True)
    courier_id = db.Column(db.Integer, nullable=True)
    location_id = db.Column(db.String(64))
    location_name = db.Column(db.String(128))
    starttime = db.Column(db.DateTime)
    stoptime = db.Column(db.DateTime)

# Path: app/models/database.py

# 
# Path: app/models/user.py
# class User(db.Model):
#     "Class used for configuring the User model in the database"
#     id = db.Column(db.Integer, primary_key=True)
#     username = db.Column(db.String(80), unique=True, nullable=False)
#     admin = db.Column(db.Boolean)
#     bias = db.Column(db.Integer)
#     runs = db.relation(
#         "Order",
#         backref="courier",
#         primaryjoin="Order.courier_id==User.id",
#         foreign_keys="Order.courier_id",
#     )
#     orderItems = db.relationship("OrderItem", backref="user", lazy="dynamic")
# 
#     def configure(self, username: str, admin: bool, bias: int) -> None:
#         "Configure the User"
#         self.username = username
#         self.admin = admin
#         self.bias = bias
# 
#     # pylint: disable=C0111, R0201
#     def is_authenticated(self) -> bool:
#         return True
# 
#     def is_active(self) -> bool:
#         return True
# 
#     def is_admin(self) -> bool:
#         return self.admin
# 
#     def is_anonymous(self) -> bool:
#         return False
# 
#     def get_id(self) -> str:
#         return str(self.id)
# 
#     def __repr__(self) -> str:
#         return "%s" % self.username


# Path: app/models/order.py
import typing
from datetime import datetime
from collections import defaultdict
from utils import first
from hlds.definitions import location_definitions
from .database import db
from .user import User

"Script for everything Order related in the database"



class Order(db.Model):
    "Class used for configuring the Order model in the database"
    id = db.Column(db.Integer, primary_key=True)
    courier_id = db.Column(db.Integer, nullable=True)
    location_id = db.Column(db.String(64))
    location_name = db.Column(db.String(128))
    starttime = db.Column(db.DateTime)
    stoptime = db.Column(db.DateTime)

    public = db.Column(db.Boolean, default=True)