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 PhotoTask extends BaseTask {

    @Field("min_photo_count")
    private Integer minPhotoCount;

    @Field("max_photo_count")
    private Integer maxPhotoCount;

    public PhotoTask(Integer minPhotoCount, Integer maxPhotoCount) {
        this.minPhotoCount = minPhotoCount;
        this.maxPhotoCount = maxPhotoCount;
    }

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

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

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

    public class TaskSpecificData {
        public String taskType = getTaskType();
        public Integer minPhotoCount = PhotoTask.this.minPhotoCount;
        public Integer maxPhotoCount = PhotoTask.this.maxPhotoCount;
    }
}
