package com.iqser.red.service.persistence.management.v1.processor.model;

import java.util.Collections;
import java.util.List;
import java.util.Set;

import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.BaseAnnotation;

import lombok.Builder;
import lombok.Getter;

@Getter
@Builder
@SuppressWarnings("checkstyle:all") // explicit initialization of false. IMO it improves readability here.
public class ManualChangesQueryOptions {

    @Builder.Default
    private boolean includeOnlyUnprocessed = false;
    @Builder.Default
    private boolean includeDictChanges = true;
    @Builder.Default
    private boolean includeDeletions = false;
    @Builder.Default
    private Set<Class<? extends BaseAnnotation>> excludedClasses = Collections.emptySet();
    @Builder.Default
    private List<String> annotationIds = Collections.emptyList();


    public static ManualChangesQueryOptions allWithoutDeleted() {

        return ManualChangesQueryOptions.builder().includeDeletions(false).includeDictChanges(true).includeOnlyUnprocessed(false).build();
    }


    public static ManualChangesQueryOptions all() {

        return ManualChangesQueryOptions.builder().includeDeletions(true).includeDictChanges(true).includeOnlyUnprocessed(false).build();
    }


    public static ManualChangesQueryOptions unprocessedOnly() {

        return ManualChangesQueryOptions.builder().includeDeletions(false).includeDictChanges(true).includeOnlyUnprocessed(true).build();
    }

    public static ManualChangesQueryOptions unprocessedOnlyForIds(List<String> annotationIds) {

        return ManualChangesQueryOptions.builder().includeDeletions(false).includeDictChanges(true).includeOnlyUnprocessed(true).annotationIds(annotationIds).build();
    }


    public static ManualChangesQueryOptions localChangesOnly() {

        return ManualChangesQueryOptions.builder().includeDeletions(false).includeDictChanges(false).includeOnlyUnprocessed(false).build();
    }

}
