ebanutsya

This commit is contained in:
2023-11-06 07:22:50 +03:00
parent b7a4df1e30
commit 9fe15529a8
8 changed files with 239 additions and 26 deletions

10
database/enums.py Normal file
View File

@@ -0,0 +1,10 @@
from enum import unique, IntEnum
@unique
class AssemblyState(IntEnum):
NOT_STARTED = 0,
ASSEMBLING_PRODUCTS = 1,
ALL_PRODUCTS_ASSEMBLED = 2,
CONFIRMED = 3,
ENDED = 4

View File

@@ -17,14 +17,15 @@ class Assembly(db.Model):
__tablename__ = 'assemblies'
id = db.Column(db.Integer, primary_key=True, comment='ID сборки')
created_at = db.Column(db.DateTime, nullable=False, comment='Дата и время начала сборки')
created_at = db.Column(db.DateTime, nullable=True, comment='Дата и время начала сборки')
ended_at = db.Column(db.DateTime, nullable=True, comment='Дата и время конца сборки')
user_id = db.Column(db.Integer, db.ForeignKey('users.id'), nullable=False)
user = db.relationship('User', backref='assemblies')
order_id = db.Column(db.Integer, nullable=False, comment='ID заказа в базе данных')
active = db.Column(db.Boolean, nullable=False, comment='Активная ли сборка')
is_active = db.Column(db.Boolean, nullable=False, comment='Активная ли сборка')
state = db.Column(db.Integer, nullable=False, comment='Состояние сборки')
class Barcode(db.Model):