This commit is contained in:
2026-03-16 16:45:08 +03:00
parent 274510fc38
commit 37af7fd6f3
9 changed files with 156 additions and 626 deletions

View File

@@ -1,10 +1,11 @@
# [DEF:backend.src.models.auth:Module]
# [DEF:AuthModels:Module]
#
# @TIER: STANDARD
# @COMPLEXITY: 3
# @SEMANTICS: auth, models, user, role, permission, sqlalchemy
# @PURPOSE: SQLAlchemy models for multi-user authentication and authorization.
# @LAYER: Domain
# @RELATION: INHERITS_FROM -> backend.src.models.mapping.Base
# @RELATION: INHERITS_FROM -> [Base]
#
# @INVARIANT: Usernames and emails must be unique.
@@ -102,4 +103,4 @@ class ADGroupMapping(Base):
role = relationship("Role")
# [/DEF:ADGroupMapping:Class]
# [/DEF:backend.src.models.auth:Module]
# [/DEF:AuthModels:Module]

View File

@@ -1,10 +1,11 @@
# [DEF:backend.src.models.mapping:Module]
# [DEF:MappingModels:Module]
#
# @TIER: STANDARD
# @COMPLEXITY: 3
# @SEMANTICS: database, mapping, environment, migration, sqlalchemy, sqlite
# @PURPOSE: Defines the database schema for environment metadata and database mappings using SQLAlchemy.
# @LAYER: Domain
# @RELATION: DEPENDS_ON -> sqlalchemy
# @RELATION: DEPENDS_ON -> [sqlalchemy]
#
# @INVARIANT: All primary keys are UUID strings.
# @CONSTRAINT: source_env_id and target_env_id must be valid environment IDs.
@@ -98,5 +99,5 @@ class ResourceMapping(Base):
last_synced_at = Column(DateTime(timezone=True), server_default=func.now(), onupdate=func.now())
# [/DEF:ResourceMapping:Class]
# [/DEF:backend.src.models.mapping:Module]
# [/DEF:MappingModels:Module]

View File

@@ -1,11 +1,12 @@
# [DEF:backend.src.models.profile:Module]
# [DEF:ProfileModels:Module]
#
# @TIER: STANDARD
# @COMPLEXITY: 3
# @SEMANTICS: profile, preferences, persistence, user, dashboard-filter, git, ui-preferences, sqlalchemy
# @PURPOSE: Defines persistent per-user profile settings for dashboard filter, Git identity/token, and UX preferences.
# @LAYER: Domain
# @RELATION: DEPENDS_ON -> backend.src.models.auth
# @RELATION: INHERITS_FROM -> backend.src.models.mapping.Base
# @RELATION: DEPENDS_ON -> [AuthModels]
# @RELATION: INHERITS_FROM -> [Base]
#
# @INVARIANT: Exactly one preference row exists per user_id.
# @INVARIANT: Sensitive Git token is stored encrypted and never returned in plaintext.
@@ -57,4 +58,4 @@ class UserDashboardPreference(Base):
user = relationship("User")
# [/DEF:UserDashboardPreference:Class]
# [/DEF:backend.src.models.profile:Module]
# [/DEF:ProfileModels:Module]