import { CollectionDocument } from '../models/collection-document.model';
export interface ReportBuilderCollectionJoin {
    collection: string;
    alias?: string;
    local_key?: string;
    foreign_key?: string;
}
export interface ReportBuilderReportModel extends CollectionDocument {
    collection_root: string;
    collection_joins?: ReportBuilderCollectionJoin[];
    report_name: string;
    fields_sort: ReportBuilderReportFieldsSort[];
    fields_filter: ReportBuilderReportFieldsFilterOrs[];
    fields_custom?: ReportBuilderReportCustomField[];
    fields_selected: ReportBuilderReportFieldsSelected[];
    fields_total: ReportBuilderReportFieldsTotal[];
    fields_link: ReportBuilderReportFieldsLink[];
    id_user: string;
    user: string;
    date_created: Date;
    active?: boolean;
    shared_users: string[];
    type: ReportBuilderReportType;
    group_type: string;
    groups_row: ReportBuilderGroupsRow[];
    groups_column: ReportBuilderGroupsRow[];
    id_date_field?: string;
    date_interval?: string;
    fields_layout?: ReportBuilderLayoutColumn[];
}
export interface ReportBuilderReportFieldsLink {
    field_first: string;
    field_second: string;
    id: number;
}
export interface ReportBuilderReportFieldsTotal {
    type: string;
    fields: string[];
    id: number;
}
export interface ReportBuilderGroupsRow {
    field: string;
    fieldPathName: string;
    id: string;
    columnName: string;
    fill_color?: string;
    font_color?: string;
    treeItem?: any;
}
export type ReportBuilderReportType = 'List' | 'Group' | 'Dated';
export interface ReportBuilderReportFieldsSort {
    field: string;
    order: string;
}
export interface ReportBuilderReportFieldsFilterOrs {
    ors: ReportBuilderReportFieldsFilter[];
}
export interface ReportBuilderReportFieldsFilter {
    field: string;
    fieldType: string;
    condition: string;
    value: any;
    highValue: any;
    dateValue: any;
    highDateValue: any;
    booleanValue: string;
    is_rolling: boolean;
    rolling_interval: string;
}
export interface ReportBuilderReportFieldsSelected {
    collection_name: string;
    columnName: string;
    fieldName: string;
    fieldType: string;
    distinctFieldValues: string[];
    fieldPath: string;
    lookup_collection: string;
    lookup_local_key: string;
    lookup_foreign_key: string;
    lookup_as: string;
    text: string;
    value: string;
    isLeaf: boolean;
    isActive: boolean;
    isSelected: boolean;
    depth: number;
    leafValueType: string;
    leafValueTypes: string[];
    leafFormatType: string;
    leafFormatTypes: string[];
    id?: string;
    show: boolean;
}
export interface ReportBuilderReportCustomField {
    id: string;
    columnName: string;
    selFieldId: string;
    leafValueType: string;
    operations: ReportBuilderReportCustomOp[];
}
export interface ReportBuilderReportCustomOp {
    fields: ReportBuilderReportCustomOpField[];
    operation: string;
}
export interface ReportBuilderReportCustomOpField {
    field: string;
}
export interface ReportBuilderLayoutColumn {
    id?: string;
    header: string;
    mappings: ReportBuilderLayoutMapping[];
}
export interface ReportBuilderLayoutMapping {
    collection: string;
    mode: 'variable' | 'text';
    fieldPath?: string;
    fieldId?: string;
    text?: string;
    leafValueType?: string;
    leafFormatType?: string;
}
