updated timezone params header

This commit is contained in:
2025-04-03 15:20:39 +03:00
parent ee405133be
commit f284d4c61b
7 changed files with 322 additions and 120 deletions

View File

@@ -35,6 +35,55 @@ class UsersTokens(CrudCollection):
# users = relationship("Users", back_populates="tokens", foreign_keys=[user_id])
class Credentials(CrudCollection):
"""
Credentials class to store user credentials
"""
__tablename__ = "credentials"
__exclude__fields__ = []
credential_token: Mapped[str] = mapped_column(
String, server_default="", comment="Credential token for authentication"
)
user_id: Mapped[int] = mapped_column(
ForeignKey("users.id"), nullable=False, comment="Foreign key to users table"
)
user_uu_id: Mapped[str] = mapped_column(
String, server_default="", comment="User UUID", index=True
)
person_id: Mapped[int] = mapped_column(
ForeignKey("people.id"), nullable=False, comment="Foreign key to person table"
)
person_uu_id: Mapped[str] = mapped_column(
String, server_default="", comment="Person UUID", index=True
)
name: Mapped[str] = mapped_column(
String, server_default="", comment="Name of the user", index=True
)
surname: Mapped[str] = mapped_column(
String, server_default="", comment="Surname of the user", index=True
)
email: Mapped[str] = mapped_column(
String, server_default="", comment="Email address of the user", index=True
)
phone: Mapped[str] = mapped_column(
String, server_default="", comment="Phone number of the user", index=True
)
is_verified: Mapped[bool] = mapped_column(
Boolean, server_default="0", comment="Flag to check if user is verified"
)
def generate_token(self) -> str:
"""
Generate a unique token for the user
"""
name_token, rest_of_token = "", ""
if self.name and self.surname:
name_token = f"{self.name[0].upper()}{self.surname[0].upper()}"
return ""
class Users(CrudCollection):
"""
Application User frame to connect to API with assigned token-based HTTP connection