import { DetailsRadioOption } from '@iqser/common-ui';
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
import { ManualRedactionEntryWrapper } from '@models/file/manual-redaction-entry.wrapper';
import { Dictionary, Dossier, File, IAddRedactionRequest, IManualRedactionEntry } from '@red/domain';
import { RemoveRedactionOption } from './dialog-options';

export interface RedactTextData {
    manualRedactionEntryWrapper: ManualRedactionEntryWrapper;
    dossierId: string;
    file: File;
    applyToAllDossiers?: boolean;
    isApprover?: boolean;
}

export interface EditRedactionData {
    annotations: AnnotationWrapper[];
    dossierId: string;
    applyToAllDossiers: boolean;
    isApprover?: boolean;
}

export type AddAnnotationData = RedactTextData;
export type AddHintData = RedactTextData;

export interface RedactTextResult {
    redaction: IManualRedactionEntry;
    dictionary: Dictionary;
}

export type RedactRecommendationData = EditRedactionData;

export interface RedactRecommendationResult {
    redaction: IAddRedactionRequest;
    isMulti: boolean;
}

export interface EditRedactResult {
    legalBasis: string;
    section: string;
    comment: string;
    type: string;
    value: string;
}

export type AddHintResult = RedactTextResult;
export type AddAnnotationResult = RedactTextResult;

export interface ResizeAnnotationData {
    redaction: AnnotationWrapper;
    text: string;
    dossierId: string;
}

export interface ResizeRedactionData extends ResizeAnnotationData {
    applyToAllDossiers?: boolean;
    isApprover?: boolean;
}

export interface ResizeAnnotationResult {
    comment: string;
    updateDictionary: boolean;
    addToAllDossiers?: boolean;
}

export type ResizeRedactionResult = ResizeAnnotationResult;

export interface RemoveRedactionPermissions {
    canRemoveOnlyHere: boolean;
    canRemoveFromDictionary: boolean;
    canMarkAsFalsePositive: boolean;
}

export interface RemoveRedactionData {
    redactions: AnnotationWrapper[];
    dossier: Dossier;
    falsePositiveContext: string[];
    permissions: RemoveRedactionPermissions;
    applyToAllDossiers: boolean;
    isApprover: boolean;
}

export type RemoveAnnotationData = RemoveRedactionData;

export interface RemoveRedactionResult {
    comment: string;
    option: DetailsRadioOption<RemoveRedactionOption>;
    applyToAllDossiers?: boolean;
}

export type RemoveAnnotationResult = RemoveRedactionResult;
