from events.types.payload import Payload


class TaskModified(Payload):
    OPERATION_ADD = "ADD"
    OPERATION_EDIT = "EDIT"
    OPERATION_DELETE = "DELETE"
    def __init__(self, task_id: str, operation: str):
        super().__init__({
            'task_id': task_id,
            'operation': operation
        })

    @property
    def task_id(self) -> str:
        return self.get("task_id")

    @property
    def operation(self) -> str:
        return self.get("operation")


