awesome-fastapi-projects/app/models.py
Vladyslav Fedoriuk 0610553651
Fix GitHub Actions Worklows and refactor tests (#27)
* Refactor conftest

* Fix docstrings
2023-11-18 20:27:38 +01:00

39 lines
828 B
Python

"""Module contains the models for the application."""
from pydantic import BaseModel, ConfigDict, NonNegativeInt
from app.types import DependencyId, RepoId, RevisionHash, SourceGraphRepoId
class DependencyCreateData(BaseModel):
"""A dependency of a repository."""
name: str
class DependencyDetail(BaseModel):
"""A dependency of a repository."""
model_config = ConfigDict(
from_attributes=True,
)
id: DependencyId
name: str
class RepoDetail(BaseModel):
"""A repository that is being tracked."""
model_config = ConfigDict(
from_attributes=True,
)
id: RepoId
url: str
description: str
stars: NonNegativeInt
source_graph_repo_id: SourceGraphRepoId | None
dependencies: list[DependencyDetail]
last_checked_revision: RevisionHash | None