package de.assecutor.votianlt.model.task;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.data.mongodb.core.mapping.Field;

import java.util.List;

@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class TodoListTask extends BaseTask {

    @Field("todo_items")
    private List<String> todoItems;

    public TodoListTask(List<String> todoItems) {
        this.todoItems = todoItems;
    }

    @Override
    public String getTaskType() {
        return "TODOLIST";
    }

    @Override
    public String getDisplayName() {
        return TaskType.TODOLIST.getDisplayName();
    }

    @Override
    public Object getTaskSpecificData() {
        return new TaskSpecificData();
    }

    public class TaskSpecificData {
        public String taskType = getTaskType();
        public List<String> todoItems = TodoListTask.this.todoItems;
    }
}
