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

    @Field("min_barcode_count")
    private Integer minBarcodeCount;

    @Field("max_barcode_count")
    private Integer maxBarcodeCount;

    public BarcodeTask(Integer minBarcodeCount, Integer maxBarcodeCount) {
        this.minBarcodeCount = minBarcodeCount;
        this.maxBarcodeCount = maxBarcodeCount;
    }

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

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

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

    public class TaskSpecificData {
        public String taskType = getTaskType();
        public Integer minBarcodeCount = BarcodeTask.this.minBarcodeCount;
        public Integer maxBarcodeCount = BarcodeTask.this.maxBarcodeCount;
    }
}
