services are checked
This commit is contained in:
@@ -8,8 +8,9 @@ from sqlalchemy import (
|
||||
Boolean,
|
||||
Integer,
|
||||
Index,
|
||||
Identity,
|
||||
)
|
||||
from sqlalchemy.orm import mapped_column
|
||||
from sqlalchemy.orm import mapped_column, Mapped
|
||||
|
||||
|
||||
class Events(CrudCollection):
|
||||
@@ -21,20 +22,30 @@ class Events(CrudCollection):
|
||||
__tablename__ = "events"
|
||||
__exclude__fields__ = []
|
||||
|
||||
event_type = mapped_column(String, nullable=False, comment="default")
|
||||
function_code = mapped_column(String, nullable=False, comment="function code")
|
||||
function_class = mapped_column(String, nullable=False, comment="class name")
|
||||
event_type: Mapped[str] = mapped_column(String, nullable=False, comment="default")
|
||||
function_code: Mapped[str] = mapped_column(
|
||||
String, nullable=False, comment="function code"
|
||||
)
|
||||
function_class: Mapped[str] = mapped_column(
|
||||
String, nullable=False, comment="class name"
|
||||
)
|
||||
|
||||
# name = mapped_column(String, nullable=True) # form or page title
|
||||
description = mapped_column(String, server_default="") # form or page description
|
||||
property_description = mapped_column(String, server_default="")
|
||||
# name: Mapped[str] = mapped_column(String, nullable=True) # form or page title
|
||||
description: Mapped[str] = mapped_column(
|
||||
String, server_default=""
|
||||
) # form or page description
|
||||
property_description: Mapped[str] = mapped_column(String, server_default="")
|
||||
|
||||
marketing_layer = mapped_column(SmallInteger, server_default="3")
|
||||
cost = mapped_column(Numeric(20, 2), server_default="0.00")
|
||||
unit_price = mapped_column(Numeric(20, 2), server_default="0.00")
|
||||
cost: Mapped[float] = mapped_column(Numeric(20, 2), server_default="0.00")
|
||||
unit_price: Mapped[float] = mapped_column(Numeric(20, 2), server_default="0.00")
|
||||
|
||||
endpoint_id = mapped_column(ForeignKey("endpoint_restriction.id"), nullable=True)
|
||||
endpoint_uu_id = mapped_column(String, nullable=True, comment="Endpoint UUID")
|
||||
endpoint_id: Mapped[Identity] = mapped_column(
|
||||
ForeignKey("endpoint_restriction.id"), nullable=True
|
||||
)
|
||||
endpoint_uu_id: Mapped[str] = mapped_column(
|
||||
String, nullable=True, comment="Endpoint UUID"
|
||||
)
|
||||
|
||||
__table_args__ = ({"comment": "Events Information"},)
|
||||
|
||||
@@ -47,9 +58,13 @@ class Modules(CrudCollection):
|
||||
__tablename__ = "modules"
|
||||
__exclude__fields__ = []
|
||||
|
||||
module_name = mapped_column(String, nullable=False, comment="Module Name")
|
||||
module_description = mapped_column(String, server_default="")
|
||||
module_code = mapped_column(String, nullable=False, comment="Module Code")
|
||||
module_name: Mapped[str] = mapped_column(
|
||||
String, nullable=False, comment="Module Name"
|
||||
)
|
||||
module_description: Mapped[str] = mapped_column(String, server_default="")
|
||||
module_code: Mapped[str] = mapped_column(
|
||||
String, nullable=False, comment="Module Code"
|
||||
)
|
||||
module_layer = mapped_column(Integer, nullable=False, comment="Module Layer")
|
||||
is_default_module = mapped_column(Boolean, server_default="0")
|
||||
|
||||
@@ -77,12 +92,20 @@ class Services(CrudCollection):
|
||||
__tablename__ = "services"
|
||||
__exclude__fields__ = []
|
||||
|
||||
module_id = mapped_column(ForeignKey("modules.id"), nullable=False)
|
||||
module_uu_id = mapped_column(String, nullable=False, comment="Module UUID")
|
||||
service_name = mapped_column(String, nullable=False, comment="Service Name")
|
||||
service_description = mapped_column(String, server_default="")
|
||||
service_code = mapped_column(String, nullable=True, comment="Service Code")
|
||||
related_responsibility = mapped_column(String, server_default="")
|
||||
module_id: Mapped[Identity] = mapped_column(
|
||||
ForeignKey("modules.id"), nullable=False
|
||||
)
|
||||
module_uu_id: Mapped[str] = mapped_column(
|
||||
String, nullable=False, comment="Module UUID"
|
||||
)
|
||||
service_name: Mapped[str] = mapped_column(
|
||||
String, nullable=False, comment="Service Name"
|
||||
)
|
||||
service_description: Mapped[str] = mapped_column(String, server_default="")
|
||||
service_code: Mapped[str] = mapped_column(
|
||||
String, nullable=True, comment="Service Code"
|
||||
)
|
||||
related_responsibility: Mapped[str] = mapped_column(String, server_default="")
|
||||
|
||||
__table_args__ = ({"comment": "Services Information"},)
|
||||
|
||||
@@ -95,9 +118,11 @@ class Service2Events(CrudCollection):
|
||||
__tablename__ = "services2events"
|
||||
__exclude__fields__ = []
|
||||
|
||||
service_id = mapped_column(ForeignKey("services.id"), nullable=False)
|
||||
service_id: Mapped[Identity] = mapped_column(
|
||||
ForeignKey("services.id"), nullable=False
|
||||
)
|
||||
service_uu_id = mapped_column(String, nullable=False, comment="Service UUID")
|
||||
event_id = mapped_column(ForeignKey("events.id"), nullable=False)
|
||||
event_id: Mapped[Identity] = mapped_column(ForeignKey("events.id"), nullable=False)
|
||||
event_uu_id = mapped_column(String, nullable=False, comment="Event UUID")
|
||||
|
||||
__table_args__ = ({"comment": "Service2Events Information"},)
|
||||
@@ -144,7 +169,7 @@ class Event2Occupant(CrudCollection):
|
||||
build_living_space_uu_id = mapped_column(
|
||||
String, nullable=False, comment="Build Living Space UUID"
|
||||
)
|
||||
event_id = mapped_column(ForeignKey("events.id"), nullable=False)
|
||||
event_id: Mapped[Identity] = mapped_column(ForeignKey("events.id"), nullable=False)
|
||||
event_uu_id = mapped_column(String, nullable=False, comment="Event UUID")
|
||||
|
||||
__table_args__ = (
|
||||
@@ -180,13 +205,19 @@ class ModulePrice(CrudCollection):
|
||||
__exclude__fields__ = []
|
||||
|
||||
campaign_code = mapped_column(String, nullable=False, comment="Campaign Code")
|
||||
module_id = mapped_column(ForeignKey("modules.id"), nullable=False)
|
||||
module_id: Mapped[Identity] = mapped_column(
|
||||
ForeignKey("modules.id"), nullable=False
|
||||
)
|
||||
module_uu_id = mapped_column(String, nullable=False, comment="Module UUID")
|
||||
service_id = mapped_column(ForeignKey("services.id"), nullable=False)
|
||||
service_id: Mapped[Identity] = mapped_column(
|
||||
ForeignKey("services.id"), nullable=False
|
||||
)
|
||||
service_uu_id = mapped_column(String, nullable=False, comment="Service UUID")
|
||||
event_id = mapped_column(ForeignKey("events.id"), nullable=False)
|
||||
event_id: Mapped[Identity] = mapped_column(ForeignKey("events.id"), nullable=False)
|
||||
event_uu_id = mapped_column(String, nullable=False, comment="Event UUID")
|
||||
is_counted_percentage = mapped_column(Numeric(6, 2), server_default="0.00") # %22
|
||||
is_counted_percentage: Mapped[float] = mapped_column(
|
||||
Numeric(6, 2), server_default="0.00"
|
||||
) # %22
|
||||
discounted_price = mapped_column(
|
||||
Numeric(20, 2), server_default="0.00"
|
||||
) # Normal: 78.00 TL
|
||||
@@ -207,7 +238,7 @@ class ModulePrice(CrudCollection):
|
||||
# __tablename__ = "modules2_occupant"
|
||||
#
|
||||
#
|
||||
# discounted_percentage = mapped_column(Numeric(6, 2), server_default="0.00") # %22
|
||||
# discounted_percentage: Mapped[float] = mapped_column(Numeric(6, 2), server_default="0.00") # %22
|
||||
# discounted_price = mapped_column(
|
||||
# Numeric(20, 2), server_default="0.00"
|
||||
# ) # Normal: 78.00 TL
|
||||
@@ -230,7 +261,7 @@ class ModulePrice(CrudCollection):
|
||||
#
|
||||
# __tablename__ = "modules2_employee"
|
||||
#
|
||||
# discounted_percentage = mapped_column(Numeric(6, 2), server_default="0.00") # %22
|
||||
# discounted_percentage: Mapped[float] = mapped_column(Numeric(6, 2), server_default="0.00") # %22
|
||||
# discounted_price = mapped_column(
|
||||
# Numeric(20, 2), server_default="0.00"
|
||||
# ) # Normal: 78.00 TL
|
||||
|
||||
Reference in New Issue
Block a user