import { IBase, IDataTypesAttributeConfigurationAbstract } from '../../common';
import { ITenantAttribute, IDataTypeInstance } from '../Attributes';
import { ITenantETLAttributeSetMap } from '../ETLAttributeSetMaps';
import { ITenantAttributeLanguage } from '../Languages';
import { ITenantAttributeScope } from '../Scopes';

export declare enum CHANGE_TRACKING_MODE {
    DEFAULT = -1,
    MANUAL = 0,
    SEMIAUTOMATIC = 1,// changes must be confirmed manually
    AUTOMATIC = 2,
    SEMIAUTOMATIC_DIFFERENT_USER = 3
}
export declare const enum SOURCE_TYPE {
    DataHub = 0,
    NATIVE = 1,
    EMPTY = 2,
    SUB_ENTITY = 3
}
export interface ISourcePorts {
    sourceType: SOURCE_TYPE;
    sourceAttribute: {
        name: string;
        id: number;
    };
    sourceNativeField: string;
    sourceDataTypeInstance?: IDataTypeInstance;
    sourceLanguage?: ITenantAttributeLanguage;
    sourceScope?: ITenantAttributeScope;
    portName: string;
}
/** Actindo.Modules.Actindo.DataHub.Models.Tenant.ETLAttributeMap */
export interface ITenantETLAttributeMap<T extends IDataTypesAttributeConfigurationAbstract = IDataTypesAttributeConfigurationAbstract> extends IBase {
    sourcePorts: ISourcePorts[];
    destinationKey: string;
    destinationType: number;
    destinationNativeField: string;
    destinationAttribute: ITenantAttribute;
    etlAttributeSetMap: ITenantETLAttributeSetMap;
    destinationLanguage: ITenantAttributeLanguage;
    destinationScope: ITenantAttributeScope;
    configuration: T;
    extension: string;
    extensionName: string;
    overrideChangeTrackingMode: CHANGE_TRACKING_MODE;
}
export interface IM extends IBase {
    attributeId: number;
    attributeSetName: string;
    calculatedFromFields: boolean;
    configTextSet: string;
    configuration: IDataTypesAttributeConfigurationAbstract;
    destinationAttributeNotMappable: boolean;
    dhAttribute: ITenantAttribute;
    dhAttributeName: string;
    inherited: boolean;
    ownerPluginName: string;
    parentSetName: string;
    readOnly: boolean;
    requireFlag: boolean;
    requiredFlag: boolean;
    uniqueFlag: number;
    _E: number;
}
export interface IETLAttributeMapping<T extends IDataTypesAttributeConfigurationAbstract = IDataTypesAttributeConfigurationAbstract> {
    /** target attribute */
    a: ITenantAttribute<T>;
    /** extension mapping */
    em?: ITenantETLAttributeMap<T>;
    m: IM;
}
export interface IPossibleExtensionRequest {
    /** of destination attribute */
    dataType: string;
    /** needed for self mappable */
    destinationAttributeId: number;
    /** needed for self mappable */
    etlAttributeSetMapId: number;
}
export interface IPossibleSourceAttributesRequest {
    etlSetMapId: number;
    dataTypes: string[];
    extension: string;
    destinationAttributeId: number;
}
export interface IExtensionPort {
    id: string;
    portName: string;
    name: string;
    sourceDataTypes: string[];
    optional: boolean;
}
/** Actindo.Modules.Actindo.DataHub.Response.PossibleExtensionContainer */
export interface IPossibleExtensionContainer {
    id: string;
    name: string;
    ports: IExtensionPort[];
    class: string;
    configurationImport: string;
    configurationComponent: string;
}
/** Actindo.Modules.Actindo.DataHub.Request.ETLAttributeMapSource */
export interface IETLAttributeMapSource {
    portName: string;
    sourceType: number;
    sourceValue?: unknown;
    dhSourceAttributeId: string;
    dhSourceAttributeLanguageId?: number;
    dhSourceAttributeScopeId?: number;
}
export interface ICreateAttributeMapRequest {
    etlAttributeSetMapId: number;
    dhDestinationAttributeId: string;
    destinationType: number;
    dhDestinationAttributeLanguageId?: number;
    dhDestinationAttributeScopeId?: number;
    sourceType?: number;
    dhSourceAttributeId?: string;
    dhSourceAttributeLanguageId?: number;
    dhSourceAttributeScopeId?: number;
    sources?: IETLAttributeMapSource[];
    extension: string;
    config?: unknown;
    overrideChangeTrackingMode: CHANGE_TRACKING_MODE;
    id?: string;
}
/** Actindo.Modules.Actindo.DataHub.Models.Tenant.ETLValueMap */
export interface IDataHubETLValueMap<S = unknown, D = unknown> {
    etlAttributeMap: ITenantETLAttributeMap;
    sourceValue: S;
    destinationValue: D;
    disabled: boolean;
    createdBy: number;
    created: string;
    modified: string;
    modifiedBy: number;
    id: number;
}
