package de.assecutor.votianlt.model.task;

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

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

    @Field("comment_text")
    private String commentText;

    @Field("required")
    private boolean required = false;

    public CommentTask(String commentText, boolean required) {
        this.commentText = commentText;
        this.required = required;
    }

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

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

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

    public class TaskSpecificData {
        public String taskType = getTaskType();
        public String commentText = CommentTask.this.commentText;
        public boolean required = CommentTask.this.required;
    }
}