- Added models, DTOs, services, and routes for ports, including CRUD operations. - Introduced unit conversions with corresponding models, DTOs, services, and routes. - Developed units of measure with detailed models, DTOs, services, and routes for various types. - Ensured all new features are integrated with FastAPI and SQLAlchemy for seamless database interactions.
33 lines
965 B
Python
33 lines
965 B
Python
from api.v1.common.base_models import TenantScopedMixin, TimestampMixin
|
|
from core.database import Base
|
|
from sqlalchemy import (
|
|
ForeignKeyConstraint,
|
|
Integer,
|
|
PrimaryKeyConstraint,
|
|
String,
|
|
UniqueConstraint,
|
|
)
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
|
|
class FractionRuleOctave(Base, TenantScopedMixin, TimestampMixin):
|
|
__tablename__ = "fraction_rule_octave"
|
|
__table_args__ = (
|
|
PrimaryKeyConstraint("id", name="fraction_rule_octave_pkey"),
|
|
UniqueConstraint(
|
|
"tenant_id",
|
|
"company_id",
|
|
"permission",
|
|
"line",
|
|
"fraction",
|
|
name="uq_fraction_rule_octave_permission_line_fraction",
|
|
),
|
|
{"schema": "a76"},
|
|
)
|
|
|
|
id: Mapped[int] = mapped_column(Integer, primary_key=True)
|
|
|
|
permission: Mapped[str] = mapped_column(String(20))
|
|
line: Mapped[int] = mapped_column(Integer)
|
|
fraction: Mapped[str] = mapped_column(String(10))
|