feat: enhance organization management; add member registration and validation, update user registration flow, and improve enum handling
Test / test (push) Successful in 16s
Test / test (pull_request) Successful in 14s

This commit is contained in:
k1nq
2025-11-29 08:50:11 +05:00
parent 994b400221
commit e7e3752888
11 changed files with 462 additions and 20 deletions
+13
View File
@@ -1,6 +1,13 @@
"""Declarative base for SQLAlchemy models."""
from __future__ import annotations
from enum import StrEnum
from typing import TypeVar
from sqlalchemy.orm import DeclarativeBase, declared_attr
EnumT = TypeVar("EnumT", bound=StrEnum)
class Base(DeclarativeBase):
"""Base class that configures naming conventions."""
@@ -8,3 +15,9 @@ class Base(DeclarativeBase):
@declared_attr.directive
def __tablename__(cls) -> str: # type: ignore[misc]
return cls.__name__.lower()
def enum_values(enum_cls: type[EnumT]) -> list[str]:
"""Return enum member values to keep DB representation stable."""
return [member.value for member in enum_cls]