import { IVueComponents, IDataTableQuery } from '../../../../../_common';
import { IBaseEntity, IDataTypesAttributeConfigurationAbstract } from '../../common';
import { ITenantAttributeGroup } from '../Groups';

export interface IDataTypeInstance<T extends IDataTypesAttributeConfigurationAbstract = IDataTypesAttributeConfigurationAbstract> {
    alwaysChangeable: boolean;
    /** true if specific configuration in attribute set is possible */
    attributeSetConfigAllowed: boolean;
    /** false if attribute cannot be further configured e.g. boolean value */
    configurable: boolean;
    configurationImport: string;
    /** web component for editing value */
    valueEditWebComponent: string;
    dataTypeFriendlyName: string;
    defaultConfiguration: T;
    deprecated: boolean;
    /** true if datatype shows up in the edit UI */
    editable: boolean;
    /** true if custom filter is needed */
    hasCustomFilter: boolean;
    /** true if custom renderer for grid value is needed */
    hasCustomRender: boolean;
    id: string;
    /** determines if data type allows multi language attributes */
    multilanguage: boolean;
    name: string;
    /** true if data type allows scopable attributes */
    scopable: boolean;
    /** true if attribute allows self mapping entityA->setter(entityB->getter()) */
    selfMappable: boolean;
    /** import to the valueEditWebComponent */
    valueEditHtmlImport: string;
    configurationWebComponent: string;
    /** true if attribute allows filtering for its values */
    filterable?: boolean;
    vueComponents?: IVueComponents;
    render?: {
        component: string;
        importPath: string;
    };
}
/** Actindo.Modules.Actindo.DataHub.Models.Tenant.Attribute */
export interface ITenantAttribute<T extends IDataTypesAttributeConfigurationAbstract = IDataTypesAttributeConfigurationAbstract> extends IBaseEntity {
    /** Textual representation of attribute configuration */
    configText: string;
    config?: T;
    configuration: T;
    /** the assigned data type */
    dataType: string;
    /** text representation of the data type */
    dataTypeFriendlyName: string;
    /** instance of the data type */
    dataTypeInstance: IDataTypeInstance;
    group: ITenantAttributeGroup;
    /** id of the group the attribute is assigned to */
    groupId: number;
    /** group name for the attribute assigned group */
    groupName: string;
    /** attribute sorting in its assigned group */
    groupOrder: number;
    multilanguage: boolean;
    /** set if has been created via a plugin */
    ownerPluginId: number;
    scopable: boolean;
    required?: boolean;
}
export interface IAttributesDataTableQuery extends IDataTableQuery {
    excludedIds?: number[];
    attributeSetId?: number;
    getDefiningAttributes?: boolean;
    serializeOptionals?: string[];
}
export interface INewAttributeRequest {
    dataType: string;
    key: string;
    multilanguage: boolean;
    scopable: boolean;
    active: boolean;
    config?: object;
}
export interface IUpdateAttributeRequest {
    name: string;
    description: string;
    active: boolean;
    readOnly: boolean;
    config: object;
    resetToDefaultConfiguration: boolean;
    id: number;
    thawAfterSave?: boolean;
}
/** Actindo.Modules.Actindo.DataHub.DataTypes.DataTypeAbstract */
export interface IDataTypesDataType {
    alwaysChangeable: boolean;
    /** true if specific configuration in attribute set is possible */
    attributeSetConfigAllowed: boolean;
    /** false if attribute cannot be further configured e.g. boolean value */
    configurable: boolean;
    configurationImport: string;
    configurationWebComponent: string;
    dataTypeFriendlyName: string;
    defaultConfiguration: object;
    deprecated: boolean;
    /** true if datatype shows up in the edit UI */
    editable: boolean;
    /** true if attribute allows filtering for its values */
    filterable: boolean;
    /** true if custom filter is needed */
    hasCustomFilter: boolean;
    /** true if custom renderer for grid value is needed */
    hasCustomRender: boolean;
    id: string;
    /** determines if data type allows multilanguage attributes */
    multilanguage: boolean;
    name: string;
    /** true if data type allows scopable attrbiutes */
    scopable: boolean;
    /** true if attribute allows self mapping entityA->setter(entityB->getter()) */
    selfMappable: boolean;
    /** import to the valueEditWebComponent */
    valueEditHtmlImport: string;
    /** web component for editing value */
    valueEditWebComponent: string;
    _E: number;
}
/** Actindo.Modules.Actindo.DataHub.Cache.Entities.AttributeInSetCache */
export interface ICacheEntitiesAttributeInSetCache {
    id: number;
    name: string[];
    description: string[];
    key: string;
    active: boolean;
    dataType: string;
    dataTypeFriendlyName: string;
    dataTypeInstance: IDataTypeInstance;
    multilanguage: boolean;
    scopable: boolean;
    groupId: number;
    groupOrder: number;
    setMapId: number;
    configuration: object;
    required: boolean;
    calculated: boolean;
    calculatedFrom: string;
}
/** Actindo.Modules.Actindo.DataHub.Models.Tenant.AttributeSetMap */
export interface ITenantAttributeSetMap extends IBaseEntity {
    attributeSetId: number;
    required: number;
    dhAttribute: ITenantAttribute;
    configuration: IDataTypesAttributeConfigurationAbstract;
    requiredFlag: boolean;
    requireFlag: boolean;
    uniqueFlag: boolean;
    ownerPluginId: number;
    ownerPluginName: string;
    inherited: boolean;
    parentSetName: string;
    configTextSet: string;
    dhAttributeName: string;
    attributeId: number;
    attributeSetName: string;
    calculatedFromFields: string;
    destinationAttributeNotMappable: boolean;
}
export interface INewAttributeAssignment {
    attributeSetId?: number;
    attributeId?: number;
    requireFlag: boolean;
}
