diff --git a/app/crud/verification_token.py b/app/crud/verification_token.py index 7f2d288..32b84aa 100644 --- a/app/crud/verification_token.py +++ b/app/crud/verification_token.py @@ -8,7 +8,15 @@ class VerificationTokenRepository: + """Repository class for managing verification tokens in the database.""" + def get_token(self, db: Session, token: str) -> VerificationToken | None: + """ + Args: + :param db: + :param token: + :return: + """ statement = select(VerificationToken).where(VerificationToken.token == token) return db.execute(statement).scalar_one_or_none() diff --git a/app/models/verification_token.py b/app/models/verification_token.py index 47107dd..53d65d5 100644 --- a/app/models/verification_token.py +++ b/app/models/verification_token.py @@ -12,6 +12,16 @@ def default_expiry() -> datetime: class VerificationToken(Base): + """Model representing a verification token for email verification or password reset. + + Attributes: + id (int): Primary key identifier for the token. + user_id (int): Foreign key referencing the associated user. + token (str): Unique token string used for verification. + expires_at (datetime): Timestamp indicating when the token expires. + created_at (datetime): Timestamp indicating when the token was created. + """ + __tablename__ = "verification_tokens" id: Mapped[int] = mapped_column(primary_key=True, index=True)