feat: add simulation settings and location board redesign

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-08-11 15:02:34 +08:00
co-authored by Claude
parent 65e77cc227
commit cf1d26dba9
13 changed files with 8289 additions and 141 deletions
+10 -2
View File
@@ -3,7 +3,7 @@ from __future__ import annotations
import uuid
from datetime import datetime, timezone
from sqlalchemy import Boolean, DateTime, ForeignKey, Integer, Numeric, String, Text, Uuid
from sqlalchemy import Boolean, DateTime, ForeignKey, Index, Integer, Numeric, String, Text, Uuid
from sqlalchemy.orm import Mapped, mapped_column, relationship
from app.extensions import db
@@ -22,6 +22,13 @@ class TimestampMixin:
)
class SimulationSetting(TimestampMixin, db.Model):
__tablename__ = "simulation_settings"
key: Mapped[str] = mapped_column(String(255), primary_key=True)
value: Mapped[str] = mapped_column(Text, nullable=False)
class EngineFamily(TimestampMixin, db.Model):
__tablename__ = "engine_families"
@@ -130,9 +137,10 @@ class VehicleCost(TimestampMixin, db.Model):
class Asset(TimestampMixin, db.Model):
__tablename__ = "assets"
__table_args__ = (Index("ix_assets_name", "name"),)
id: Mapped[uuid.UUID] = mapped_column(Uuid, primary_key=True, default=uuid.uuid4)
name: Mapped[str] = mapped_column(String(255), nullable=False, unique=True, index=True)
name: Mapped[str] = mapped_column(String(255), nullable=False, unique=True)
asset_type: Mapped[str] = mapped_column(String(120), nullable=False, index=True)
is_retired: Mapped[bool] = mapped_column(Boolean, default=False, nullable=False)
program: Mapped[str | None] = mapped_column(String(255))