from datetime import date

class Assignment():
    def __init__(self, assignment_id: str, description: str, deadline: date) -> None:
        self.__assignment_id = assignment_id
        self.__description = description
        self.__deadline = deadline
    
    def get_assignment_id(self) -> str:
        return self.__assignment_id
    
    def get_description(self) -> str:
        return self.__description
    
    def get_deadline(self) -> date:
        return self.__deadline
    
    def set_assignment_id(self, assignment_id: str) -> None:
        self.__assignment_id = assignment_id

    def set_description(self, description: str) -> None:
        self.__description = description
    
    def set_deadline(self, deadline: date) -> None:
        self.__deadline = deadline
    
    def __str__(self) -> str:
        return f"Assignment ID: {self.__assignment_id} | Description: {self.__description} | Deadline: {self.__deadline.isoformat()}"
    
    def toJson(self) -> dict:
        return {
            "assignment_id": self.__assignment_id,
            "description": self.__description,
            "deadline": {
                "year": self.__deadline.year,
                "month": self.__deadline.month,
                "day": self.__deadline.day
            }
        }
    
