diff --git a/backend/db/implementation/SqlProjectDAO.py b/backend/db/implementation/SqlProjectDAO.py index c8632aa0..94983f36 100644 --- a/backend/db/implementation/SqlProjectDAO.py +++ b/backend/db/implementation/SqlProjectDAO.py @@ -14,7 +14,7 @@ class SqlProjectDAO(SqlAbstractDAO[Project, ProjectDataclass], ProjectDAO): def __init__(self) -> None: self.model_class = Project - def create_project(self, subject_id: int, name: str, deadline: datetime, archived: bool, requirements: str, + def create_project(self, subject_id: int, name: str, deadline: datetime, archived: bool, description: str, requirements: str, visible: bool, max_students: int) -> ProjectDataclass: with Session(engine) as session: subject: Subject | None = session.get(Subject, subject_id) @@ -23,7 +23,7 @@ def create_project(self, subject_id: int, name: str, deadline: datetime, archive raise ItemNotFoundError(msg) new_project: Project = Project(subject_id=subject_id, name=name, deadline=deadline, - archived=archived, requirements=requirements, visible=visible, + archived=archived, description=description, requirements=requirements, visible=visible, max_students=max_students) session.add(new_project) diff --git a/backend/db/interface/ProjectDAO.py b/backend/db/interface/ProjectDAO.py index 9864b47c..35735ec2 100644 --- a/backend/db/interface/ProjectDAO.py +++ b/backend/db/interface/ProjectDAO.py @@ -9,14 +9,15 @@ class ProjectDAO(AbstractDAO[Project, ProjectDataclass]): @abstractmethod - def create_project(self, subject_id: int, name: str, deadline: datetime, archived: bool, requirements: str, + def create_project(self, subject_id: int, name: str, deadline: datetime, archived: bool, description: str, requirements: str, visible: bool, max_students: int) -> ProjectDataclass: """ Creƫert een nieuw ProjectDataClass in de database en associeert het met een SubjectDataClass. :param max_students: maximaal aantal studenten per groep per project - :param visible: of het project zichtbaar is voor de studenten - :param requirements: Uitleg van het project + :param visible: of het project zichtbaar is voor de studentent + :param description: Beschrijving van het project + :param requirements: Vereisten van het project :param archived: Of het project gearchiveerd is :param name: De naam van het project :param deadline: De deadline van het project diff --git a/backend/db/models/models.py b/backend/db/models/models.py index 03019e09..df2e9f18 100644 --- a/backend/db/models/models.py +++ b/backend/db/models/models.py @@ -107,6 +107,7 @@ class Project(Base, AbstractModel): name: Mapped[str] deadline: Mapped[datetime] archived: Mapped[bool] + description: Mapped[str] requirements: Mapped[str] visible: Mapped[bool] max_students: Mapped[int] @@ -121,6 +122,7 @@ def to_domain_model(self) -> ProjectDataclass: name=self.name, deadline=self.deadline, archived=self.archived, + description=self.description, requirements=self.requirements, visible=self.visible, max_students=self.max_students, diff --git a/backend/domain/models/ProjectDataclass.py b/backend/domain/models/ProjectDataclass.py index 37dd6975..2c45bf36 100644 --- a/backend/domain/models/ProjectDataclass.py +++ b/backend/domain/models/ProjectDataclass.py @@ -10,6 +10,7 @@ class ProjectDataclass(JsonRepresentable): name: str deadline: datetime archived: bool + description: str requirements: str visible: bool max_students: int diff --git a/backend/fill_database_mock.py b/backend/fill_database_mock.py index f379f5d4..da04f028 100644 --- a/backend/fill_database_mock.py +++ b/backend/fill_database_mock.py @@ -29,7 +29,8 @@ name="PROJECT", archived=False, visible=True, - requirements="Maak iets in javafx", + description="Maak iets in javafx", + requirements="Een zip bestand met java-code", max_students=2, deadline=datetime(2000, 1, 1, 0, 0, 0, tzinfo=tz.LOCAL), )