import { DimensionType, FieldType, MetricType } from '../types/field';
import { OrderFieldsByStrategy } from '../types/table';
import { TimeFrames } from '../types/timeFrames';
export const VALID_ID_COLUMN_NAMES = [
    { input: 'userid', output: 'user' },
    { input: 'user_id', output: 'user' },
    { input: 'user__id', output: 'user' },
    { input: 'UNiqUE_*093USER___ID', output: 'unique_user' },
    { input: 'gid', output: 'g' },
    { input: 'userId', output: 'user' },
    { input: 'USERID', output: 'user' },
    { input: '$$__nth.rc*#)id', output: 'nth_rc' },
    { input: '0932_user_id', output: 'user' },
    { input: 'valid_id', output: 'valid' },
];
export const INVALID_ID_COLUMN_NAMES = [
    'isValid',
    'invalid',
    '',
    'id',
    'i',
    'my_fave_column',
    '12345_id',
];
const ID_COLUMN_WITHOUT_METRICS = {
    name: 'user_id',
    meta: {},
    data_type: DimensionType.STRING,
};
const column = {
    name: 'myColumnName',
    meta: {},
};
const COLUMN_WITH_METRICS = {
    user_id: {
        name: 'user_id',
        data_type: DimensionType.STRING,
        meta: {
            metrics: {
                user_count: { type: MetricType.COUNT_DISTINCT },
            },
        },
    },
    num_participating_athletes: {
        name: 'num_participating_athletes',
        data_type: DimensionType.NUMBER,
        meta: {
            dimension: {
                sql: 'num_participating_men + num_participating_women',
            },
            metrics: {
                total_num_participating_athletes: { type: MetricType.SUM },
            },
        },
    },
};
const COLUMN_WITH_DEFAULT_TIME_INTERVALS = {
    user_created: {
        name: 'user_created',
        data_type: DimensionType.TIMESTAMP,
        meta: {
            dimension: {
                time_intervals: 'default',
            },
        },
    },
};
const COLUMN_WITH_NO_TIME_INTERVALS = {
    user_created: {
        name: 'user_created',
        data_type: DimensionType.TIMESTAMP,
        meta: {
            dimension: {
                time_intervals: undefined,
            },
        },
    },
};
const COLUMN_WITH_OFF_BOOLEAN_TIME_INTERVALS = {
    user_created: {
        name: 'user_created',
        data_type: DimensionType.TIMESTAMP,
        meta: {
            dimension: {
                time_intervals: false,
            },
        },
    },
};
const COLUMN_WITH_OFF_TIME_INTERVALS = {
    user_created: {
        name: 'user_created',
        data_type: DimensionType.TIMESTAMP,
        meta: {
            dimension: {
                time_intervals: 'OFF',
            },
        },
    },
};
const COLUMN_WITH_CUSTOM_TIME_INTERVALS = {
    user_created: {
        name: 'user_created',
        data_type: DimensionType.DATE,
        meta: {
            dimension: {
                time_intervals: [TimeFrames.YEAR],
            },
        },
    },
};
export const model = {
    alias: 'myTable',
    checksum: { name: '', checksum: '' },
    fqn: [],
    language: '',
    package_name: '',
    path: '',
    raw_code: '',
    compiled: true,
    unique_id: 'unique_id',
    description: 'my fun table',
    resource_type: 'model',
    columns: {
        myColumnName: column,
    },
    meta: {},
    database: 'myDatabase',
    schema: 'mySchema',
    name: 'myTable',
    tags: [],
    relation_name: 'relation_name',
    depends_on: { nodes: [] },
    patch_path: null,
    original_file_path: '',
};
export const BASE_LIGHTDASH_TABLE = {
    name: model.name,
    label: 'My table',
    database: model.database,
    schema: model.schema,
    sqlTable: model.relation_name,
    description: model.description,
    sqlWhere: undefined,
    requiredAttributes: undefined,
    anyAttributes: undefined,
    primaryKey: undefined,
    dimensions: {
        myColumnName: {
            compact: undefined,
            separator: undefined,
            description: undefined,
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            format: undefined,
            groups: [],
            colors: undefined,
            hidden: false,
            index: 0,
            label: 'My column name',
            name: 'myColumnName',
            round: undefined,
            source: undefined,
            sql: '${TABLE}.myColumnName',
            table: 'myTable',
            tableLabel: 'My table',
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            type: DimensionType.STRING,
            isIntervalBase: false,
        },
    },
    metrics: {},
    orderFieldsBy: OrderFieldsByStrategy.LABEL,
    requiredFilters: [],
    groupLabel: undefined,
    groupDetails: {},
};
export const MODEL_WITH_SINGLE_PRIMARY_KEY = {
    ...model,
    meta: {
        primary_key: 'user_id',
    },
    columns: {
        user_id: {
            name: 'user_id',
            data_type: DimensionType.STRING,
            meta: {},
        },
    },
};
export const MODEL_WITH_COMPOSITE_PRIMARY_KEY = {
    ...model,
    meta: {
        primary_key: ['user_id', 'order_id'],
    },
    columns: {
        user_id: {
            name: 'user_id',
            data_type: DimensionType.STRING,
            meta: {},
        },
        order_id: {
            name: 'order_id',
            data_type: DimensionType.STRING,
            meta: {},
        },
    },
};
export const LIGHTDASH_TABLE_WITH_SINGLE_PRIMARY_KEY = {
    ...BASE_LIGHTDASH_TABLE,
    primaryKey: ['user_id'],
    dimensions: {
        user_id: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: DimensionType.STRING,
            sql: '${TABLE}.user_id',
            name: 'user_id',
            label: 'User id',
            table: 'myTable',
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
    },
};
export const LIGHTDASH_TABLE_WITH_COMPOSITE_PRIMARY_KEY = {
    ...BASE_LIGHTDASH_TABLE,
    primaryKey: ['user_id', 'order_id'],
    dimensions: {
        user_id: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: DimensionType.STRING,
            sql: '${TABLE}.user_id',
            name: 'user_id',
            label: 'User id',
            table: 'myTable',
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
        order_id: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: DimensionType.STRING,
            sql: '${TABLE}.order_id',
            name: 'order_id',
            label: 'Order id',
            table: 'myTable',
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 1,
            isIntervalBase: false,
        },
    },
};
export const MODEL_WITH_GROUP_LABEL = {
    ...model,
    meta: {
        group_label: 'revenue',
    },
};
export const MODEL_WITH_GROUPS_BLOCK = {
    ...model,
    meta: {
        group_details: {
            revenue: {
                label: 'Revenue',
                description: 'Revenue description',
                ai_hint: [
                    'Use revenue fields for billing questions.',
                    'Prefer revenue metrics over raw dimensions.',
                ],
            },
        },
    },
    columns: {
        user_id: {
            name: 'user_id',
            data_type: DimensionType.STRING,
            meta: {
                metrics: {
                    user_id_count: {
                        type: MetricType.COUNT_DISTINCT,
                        groups: ['revenue'],
                    },
                },
            },
        },
    },
};
export const LIGHTDASH_TABLE_WITH_GROUP_LABEL = {
    ...BASE_LIGHTDASH_TABLE,
    groupLabel: 'revenue',
};
export const LIGHTDASH_TABLE_WITH_GROUP_BLOCK = {
    ...BASE_LIGHTDASH_TABLE,
    dimensions: {
        user_id: {
            compact: undefined,
            separator: undefined,
            description: undefined,
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            format: undefined,
            groups: [],
            colors: undefined,
            hidden: false,
            index: 0,
            label: 'User id',
            name: 'user_id',
            round: undefined,
            source: undefined,
            sql: '${TABLE}.user_id',
            table: 'myTable',
            tableLabel: 'My table',
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            type: DimensionType.STRING,
            isIntervalBase: false,
        },
    },
    metrics: {
        user_id_count: {
            compact: undefined,
            separator: undefined,
            description: 'Count distinct of User id',
            dimensionReference: 'myTable_user_id',
            fieldType: FieldType.METRIC,
            filters: [],
            format: undefined,
            groups: ['revenue'],
            hidden: false,
            index: 0,
            label: 'User id count',
            name: 'user_id_count',
            percentile: undefined,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            round: undefined,
            showUnderlyingValues: undefined,
            source: undefined,
            sql: '${TABLE}.user_id',
            table: 'myTable',
            tableLabel: 'My table',
            type: MetricType.COUNT_DISTINCT,
            spotlight: {
                visibility: 'show',
                categories: [],
            },
        },
    },
    groupDetails: {
        revenue: {
            label: 'Revenue',
            description: 'Revenue description',
            aiHint: [
                'Use revenue fields for billing questions.',
                'Prefer revenue metrics over raw dimensions.',
            ],
        },
    },
};
export const MODEL_WITH_SQL_WHERE = {
    ...model,
    meta: {
        sql_where: '${payment_method} IS NOT NULL',
    },
};
export const MODEL_WITH_SQL_FILTER = {
    ...model,
    meta: {
        sql_filter: '${payment_method} IS NOT NULL',
    },
};
export const MODEL_WITH_AI_HINT = {
    ...model,
    meta: {
        ai_hint: 'This is a customers table.',
    },
};
export const MODEL_WITH_AI_HINT_IN_CONFIG = {
    ...model,
    config: {
        meta: {
            ai_hint: 'This is a customers table from config.',
        },
    },
    meta: {},
};
export const MODEL_WITH_NO_METRICS = {
    ...model,
    columns: {
        [ID_COLUMN_WITHOUT_METRICS.name]: ID_COLUMN_WITHOUT_METRICS,
    },
};
export const LIGHTDASH_TABLE_WITHOUT_AUTO_METRICS = {
    ...BASE_LIGHTDASH_TABLE,
    dimensions: {
        user_id: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: DimensionType.STRING,
            sql: '${TABLE}.user_id',
            name: 'user_id',
            label: 'User id',
            table: MODEL_WITH_NO_METRICS.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
    },
};
export const MODEL_WITH_METRIC = {
    ...model,
    description: 'my test table',
    columns: COLUMN_WITH_METRICS,
};
export const MODEL_WITH_WRONG_METRIC = {
    ...model,
    columns: {
        user_id: {
            name: 'user_id',
            data_type: DimensionType.STRING,
            meta: {
                metrics: {
                    user_id: { type: MetricType.COUNT_DISTINCT },
                },
            },
        },
    },
};
export const MODEL_WITH_WRONG_METRICS = {
    ...model,
    columns: {
        user_id: {
            name: 'user_id',
            data_type: DimensionType.STRING,
            meta: {},
        },
        other: {
            name: 'other',
            data_type: DimensionType.STRING,
            meta: {
                metrics: {
                    user_id: { type: MetricType.COUNT_DISTINCT },
                },
            },
        },
        user_id2: {
            name: 'user_id2',
            data_type: DimensionType.STRING,
            meta: {
                metrics: {
                    user_id2: { type: MetricType.COUNT_DISTINCT },
                },
            },
        },
    },
};
export const LIGHTDASH_TABLE_WITH_METRICS = {
    ...BASE_LIGHTDASH_TABLE,
    description: MODEL_WITH_METRIC.description,
    dimensions: {
        user_id: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: DimensionType.STRING,
            sql: '${TABLE}.user_id',
            name: 'user_id',
            label: 'User id',
            table: MODEL_WITH_METRIC.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
        num_participating_athletes: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: DimensionType.NUMBER,
            sql: 'num_participating_men + num_participating_women',
            name: 'num_participating_athletes',
            label: 'Num participating athletes',
            table: MODEL_WITH_METRIC.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            isIntervalBase: false,
            index: 1,
        },
    },
    metrics: {
        user_count: {
            fieldType: FieldType.METRIC,
            type: MetricType.COUNT_DISTINCT,
            sql: '${TABLE}.user_id',
            name: 'user_count',
            label: 'User count',
            table: MODEL_WITH_METRIC.name,
            tableLabel: 'My table',
            description: 'Count distinct of User id',
            source: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            percentile: undefined,
            compact: undefined,
            separator: undefined,
            showUnderlyingValues: undefined,
            groups: [],
            filters: [],
            index: 0,
            dimensionReference: 'myTable_user_id',
            requiredAttributes: undefined,
            anyAttributes: undefined,
            spotlight: {
                visibility: 'show',
                categories: [],
            },
        },
        total_num_participating_athletes: {
            fieldType: FieldType.METRIC,
            type: MetricType.SUM,
            sql: 'num_participating_men + num_participating_women',
            name: 'total_num_participating_athletes',
            label: 'Total num participating athletes',
            table: MODEL_WITH_METRIC.name,
            tableLabel: 'My table',
            description: 'Sum of Num participating athletes',
            source: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            percentile: undefined,
            compact: undefined,
            separator: undefined,
            showUnderlyingValues: undefined,
            groups: [],
            filters: [],
            index: 1,
            dimensionReference: 'myTable_num_participating_athletes',
            requiredAttributes: undefined,
            anyAttributes: undefined,
            spotlight: {
                visibility: 'show',
                categories: [],
            },
        },
    },
};
export const MODEL_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS = {
    ...model,
    columns: COLUMN_WITH_DEFAULT_TIME_INTERVALS,
};
export const MODEL_WITH_NO_TIME_INTERVAL_DIMENSIONS = {
    ...model,
    columns: COLUMN_WITH_NO_TIME_INTERVALS,
};
export const LIGHTDASH_TABLE_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS_BIGQUERY = {
    ...BASE_LIGHTDASH_TABLE,
    dimensions: {
        user_created: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: DimensionType.TIMESTAMP,
            sql: '${TABLE}.user_created',
            name: 'user_created',
            label: 'User created',
            table: MODEL_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isIntervalBase: true,
        },
        user_created_raw: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: DimensionType.TIMESTAMP,
            sql: '${TABLE}.user_created',
            name: 'user_created_raw',
            label: 'User created raw',
            table: MODEL_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: TimeFrames.RAW,
            timeIntervalBaseDimensionName: 'user_created',
            timeIntervalBaseDimensionType: DimensionType.TIMESTAMP,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: ['User created'],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
        user_created_day: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: DimensionType.DATE,
            sql: 'TIMESTAMP_TRUNC(${TABLE}.user_created, DAY)',
            name: 'user_created_day',
            label: 'User created day',
            table: MODEL_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: TimeFrames.DAY,
            timeIntervalBaseDimensionName: 'user_created',
            timeIntervalBaseDimensionType: DimensionType.TIMESTAMP,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: ['User created'],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
        user_created_week: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: DimensionType.DATE,
            sql: 'TIMESTAMP_TRUNC(${TABLE}.user_created, WEEK)',
            name: 'user_created_week',
            label: 'User created week',
            table: MODEL_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: TimeFrames.WEEK,
            timeIntervalBaseDimensionName: 'user_created',
            timeIntervalBaseDimensionType: DimensionType.TIMESTAMP,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: ['User created'],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
        user_created_month: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: DimensionType.DATE,
            sql: 'TIMESTAMP_TRUNC(${TABLE}.user_created, MONTH)',
            name: 'user_created_month',
            label: 'User created month',
            table: MODEL_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: TimeFrames.MONTH,
            timeIntervalBaseDimensionName: 'user_created',
            timeIntervalBaseDimensionType: DimensionType.TIMESTAMP,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: ['User created'],
            colors: undefined,
            isIntervalBase: false,
            index: 0,
        },
        user_created_quarter: {
            description: undefined,
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            format: undefined,
            groups: ['User created'],
            colors: undefined,
            hidden: false,
            label: 'User created quarter',
            name: 'user_created_quarter',
            round: undefined,
            compact: undefined,
            separator: undefined,
            source: undefined,
            sql: 'TIMESTAMP_TRUNC(${TABLE}.user_created, QUARTER)',
            table: 'myTable',
            tableLabel: 'My table',
            timeInterval: TimeFrames.QUARTER,
            timeIntervalBaseDimensionName: 'user_created',
            timeIntervalBaseDimensionType: DimensionType.TIMESTAMP,
            type: DimensionType.DATE,
            index: 0,
            isIntervalBase: false,
        },
        user_created_year: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: DimensionType.DATE,
            sql: 'TIMESTAMP_TRUNC(${TABLE}.user_created, YEAR)',
            name: 'user_created_year',
            label: 'User created year',
            table: MODEL_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: TimeFrames.YEAR,
            timeIntervalBaseDimensionName: 'user_created',
            timeIntervalBaseDimensionType: DimensionType.TIMESTAMP,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: ['User created'],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
    },
};
export const LIGHTDASH_TABLE_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS_SNOWFLAKE = {
    ...BASE_LIGHTDASH_TABLE,
    dimensions: {
        user_created: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: DimensionType.TIMESTAMP,
            sql: "TO_TIMESTAMP_NTZ(CONVERT_TIMEZONE('UTC', ${TABLE}.user_created))",
            name: 'user_created',
            table: MODEL_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            label: 'User created',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isIntervalBase: true,
        },
        user_created_raw: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: DimensionType.TIMESTAMP,
            sql: "TO_TIMESTAMP_NTZ(CONVERT_TIMEZONE('UTC', ${TABLE}.user_created))",
            name: 'user_created_raw',
            table: MODEL_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            label: 'User created raw',
            source: undefined,
            timeInterval: TimeFrames.RAW,
            timeIntervalBaseDimensionName: 'user_created',
            timeIntervalBaseDimensionType: DimensionType.TIMESTAMP,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: ['User created'],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
        user_created_day: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: DimensionType.DATE,
            sql: "DATE_TRUNC('DAY', TO_TIMESTAMP_NTZ(CONVERT_TIMEZONE('UTC', ${TABLE}.user_created)))",
            name: 'user_created_day',
            table: MODEL_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            label: 'User created day',
            isIntervalBase: false,
            source: undefined,
            timeInterval: TimeFrames.DAY,
            timeIntervalBaseDimensionName: 'user_created',
            timeIntervalBaseDimensionType: DimensionType.TIMESTAMP,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: ['User created'],
            colors: undefined,
            index: 0,
        },
        user_created_week: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: DimensionType.DATE,
            sql: "DATE_TRUNC('WEEK', TO_TIMESTAMP_NTZ(CONVERT_TIMEZONE('UTC', ${TABLE}.user_created)))",
            name: 'user_created_week',
            table: MODEL_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            label: 'User created week',
            source: undefined,
            timeInterval: TimeFrames.WEEK,
            timeIntervalBaseDimensionName: 'user_created',
            timeIntervalBaseDimensionType: DimensionType.TIMESTAMP,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: ['User created'],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
        user_created_month: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: DimensionType.DATE,
            sql: "DATE_TRUNC('MONTH', TO_TIMESTAMP_NTZ(CONVERT_TIMEZONE('UTC', ${TABLE}.user_created)))",
            name: 'user_created_month',
            table: MODEL_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            label: 'User created month',
            source: undefined,
            timeInterval: TimeFrames.MONTH,
            timeIntervalBaseDimensionName: 'user_created',
            timeIntervalBaseDimensionType: DimensionType.TIMESTAMP,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: ['User created'],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
        user_created_quarter: {
            description: undefined,
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            format: undefined,
            groups: ['User created'],
            colors: undefined,
            hidden: false,
            label: 'User created quarter',
            name: 'user_created_quarter',
            round: undefined,
            compact: undefined,
            separator: undefined,
            source: undefined,
            sql: "DATE_TRUNC('QUARTER', TO_TIMESTAMP_NTZ(CONVERT_TIMEZONE('UTC', ${TABLE}.user_created)))",
            table: 'myTable',
            tableLabel: 'My table',
            timeInterval: TimeFrames.QUARTER,
            timeIntervalBaseDimensionName: 'user_created',
            timeIntervalBaseDimensionType: DimensionType.TIMESTAMP,
            type: DimensionType.DATE,
            index: 0,
            isIntervalBase: false,
        },
        user_created_year: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: DimensionType.DATE,
            sql: "DATE_TRUNC('YEAR', TO_TIMESTAMP_NTZ(CONVERT_TIMEZONE('UTC', ${TABLE}.user_created)))",
            name: 'user_created_year',
            table: MODEL_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            label: 'User created year',
            source: undefined,
            timeInterval: TimeFrames.YEAR,
            timeIntervalBaseDimensionName: 'user_created',
            timeIntervalBaseDimensionType: DimensionType.TIMESTAMP,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: ['User created'],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
    },
};
export const MODEL_WITH_OFF_TIME_INTERVAL_DIMENSIONS = {
    ...model,
    columns: COLUMN_WITH_OFF_TIME_INTERVALS,
};
export const MODEL_WITH_OFF_BOOLEAN_TIME_INTERVAL_DIMENSIONS = {
    ...model,
    columns: COLUMN_WITH_OFF_BOOLEAN_TIME_INTERVALS,
};
export const LIGHTDASH_TABLE_WITH_OFF_TIME_INTERVAL_DIMENSIONS = {
    ...BASE_LIGHTDASH_TABLE,
    dimensions: {
        user_created: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: DimensionType.TIMESTAMP,
            sql: '${TABLE}.user_created',
            name: 'user_created',
            label: 'User created',
            table: MODEL_WITH_OFF_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
    },
};
export const MODEL_WITH_CUSTOM_TIME_INTERVAL_DIMENSIONS = {
    ...model,
    columns: COLUMN_WITH_CUSTOM_TIME_INTERVALS,
};
export const LIGHTDASH_TABLE_WITH_CUSTOM_TIME_INTERVAL_DIMENSIONS = {
    ...BASE_LIGHTDASH_TABLE,
    dimensions: {
        user_created: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: DimensionType.DATE,
            sql: '${TABLE}.user_created',
            name: 'user_created',
            label: 'User created',
            table: MODEL_WITH_CUSTOM_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isIntervalBase: true,
        },
        user_created_year: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: DimensionType.DATE,
            sql: 'DATE_TRUNC(${TABLE}.user_created, YEAR)',
            name: 'user_created_year',
            label: 'User created year',
            table: MODEL_WITH_CUSTOM_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: TimeFrames.YEAR,
            timeIntervalBaseDimensionName: 'user_created',
            timeIntervalBaseDimensionType: DimensionType.DATE,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: ['User created'],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
    },
};
export const warehouseSchema = {
    [model.database]: {
        [model.schema]: {
            [model.name]: {
                [column.name]: DimensionType.STRING,
            },
        },
    },
};
export const warehouseSchemaWithMissingTable = {
    [model.database]: {
        [model.schema]: {},
    },
};
export const warehouseSchemaWithMissingColumn = {
    [model.database]: {
        [model.schema]: {
            [model.name]: {},
        },
    },
};
export const warehouseSchemaWithUpperCaseColumn = {
    [model.database]: {
        [model.schema]: {
            [model.name]: {
                [column.name.toUpperCase()]: DimensionType.STRING,
            },
        },
    },
};
export const expectedModelWithType = {
    ...model,
    columns: {
        myColumnName: { ...column, data_type: DimensionType.STRING },
    },
};
export const LIGHTDASH_TABLE_SQL_WHERE = {
    ...BASE_LIGHTDASH_TABLE,
    sqlWhere: '${payment_method} IS NOT NULL',
};
export const MODEL_WITH_ADDITIONAL_DIMENSIONS = {
    ...model,
    columns: {
        metadata: {
            name: 'metadata',
            data_type: DimensionType.STRING,
            meta: {
                dimension: {
                    hidden: true,
                },
                additional_dimensions: {
                    version: {
                        type: DimensionType.NUMBER,
                        sql: "${metadata}-->'version'",
                    },
                    created_at: {
                        type: DimensionType.TIMESTAMP,
                        sql: "${metadata}-->'created_at'",
                    },
                },
            },
        },
    },
};
export const LIGHTDASH_TABLE_WITH_ADDITIONAL_DIMENSIONS = {
    ...BASE_LIGHTDASH_TABLE,
    dimensions: {
        metadata: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: DimensionType.STRING,
            sql: '${TABLE}.metadata',
            name: 'metadata',
            label: 'Metadata',
            table: BASE_LIGHTDASH_TABLE.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: true,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
        version: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: DimensionType.NUMBER,
            sql: "${metadata}-->'version'",
            name: 'version',
            label: 'Version',
            table: BASE_LIGHTDASH_TABLE.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isAdditionalDimension: true,
            isIntervalBase: false,
        },
        created_at: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: DimensionType.TIMESTAMP,
            sql: "${metadata}-->'created_at'",
            name: 'created_at',
            label: 'Created at',
            table: BASE_LIGHTDASH_TABLE.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isAdditionalDimension: true,
            isIntervalBase: true,
        },
        created_at_day: {
            colors: undefined,
            compact: undefined,
            separator: undefined,
            description: undefined,
            fieldType: FieldType.DIMENSION,
            format: undefined,
            groups: ['Created at'],
            hidden: false,
            index: 0,
            isAdditionalDimension: true,
            isIntervalBase: false,
            label: 'Created at day',
            name: 'created_at_day',
            requiredAttributes: undefined,
            anyAttributes: undefined,
            round: undefined,
            source: undefined,
            sql: "DATE_TRUNC('DAY', ${metadata}-->'created_at')",
            table: 'myTable',
            tableLabel: 'My table',
            timeInterval: TimeFrames.DAY,
            timeIntervalBaseDimensionName: 'created_at',
            timeIntervalBaseDimensionType: DimensionType.TIMESTAMP,
            type: DimensionType.DATE,
        },
        created_at_month: {
            colors: undefined,
            compact: undefined,
            separator: undefined,
            description: undefined,
            fieldType: FieldType.DIMENSION,
            format: undefined,
            groups: ['Created at'],
            hidden: false,
            index: 0,
            isAdditionalDimension: true,
            isIntervalBase: false,
            label: 'Created at month',
            name: 'created_at_month',
            requiredAttributes: undefined,
            anyAttributes: undefined,
            round: undefined,
            source: undefined,
            sql: "DATE_TRUNC('MONTH', ${metadata}-->'created_at')",
            table: 'myTable',
            tableLabel: 'My table',
            timeInterval: TimeFrames.MONTH,
            timeIntervalBaseDimensionName: 'created_at',
            timeIntervalBaseDimensionType: DimensionType.TIMESTAMP,
            type: DimensionType.DATE,
        },
        created_at_quarter: {
            colors: undefined,
            compact: undefined,
            separator: undefined,
            description: undefined,
            fieldType: FieldType.DIMENSION,
            format: undefined,
            groups: ['Created at'],
            hidden: false,
            index: 0,
            isAdditionalDimension: true,
            isIntervalBase: false,
            label: 'Created at quarter',
            name: 'created_at_quarter',
            requiredAttributes: undefined,
            anyAttributes: undefined,
            round: undefined,
            source: undefined,
            sql: "DATE_TRUNC('QUARTER', ${metadata}-->'created_at')",
            table: 'myTable',
            tableLabel: 'My table',
            timeInterval: TimeFrames.QUARTER,
            timeIntervalBaseDimensionName: 'created_at',
            timeIntervalBaseDimensionType: DimensionType.TIMESTAMP,
            type: DimensionType.DATE,
        },
        created_at_raw: {
            colors: undefined,
            compact: undefined,
            separator: undefined,
            description: undefined,
            fieldType: FieldType.DIMENSION,
            format: undefined,
            groups: ['Created at'],
            hidden: false,
            index: 0,
            isAdditionalDimension: true,
            isIntervalBase: false,
            label: 'Created at raw',
            name: 'created_at_raw',
            requiredAttributes: undefined,
            anyAttributes: undefined,
            round: undefined,
            source: undefined,
            sql: "${metadata}-->'created_at'",
            table: 'myTable',
            tableLabel: 'My table',
            timeInterval: TimeFrames.RAW,
            timeIntervalBaseDimensionName: 'created_at',
            timeIntervalBaseDimensionType: DimensionType.TIMESTAMP,
            type: DimensionType.TIMESTAMP,
        },
        created_at_week: {
            colors: undefined,
            compact: undefined,
            separator: undefined,
            description: undefined,
            fieldType: FieldType.DIMENSION,
            format: undefined,
            groups: ['Created at'],
            hidden: false,
            index: 0,
            isAdditionalDimension: true,
            isIntervalBase: false,
            label: 'Created at week',
            name: 'created_at_week',
            requiredAttributes: undefined,
            anyAttributes: undefined,
            round: undefined,
            source: undefined,
            sql: "DATE_TRUNC('WEEK', ${metadata}-->'created_at')",
            table: 'myTable',
            tableLabel: 'My table',
            timeInterval: TimeFrames.WEEK,
            timeIntervalBaseDimensionName: 'created_at',
            timeIntervalBaseDimensionType: DimensionType.TIMESTAMP,
            type: DimensionType.DATE,
        },
        created_at_year: {
            colors: undefined,
            compact: undefined,
            separator: undefined,
            description: undefined,
            fieldType: FieldType.DIMENSION,
            format: undefined,
            groups: ['Created at'],
            hidden: false,
            index: 0,
            isAdditionalDimension: true,
            isIntervalBase: false,
            label: 'Created at year',
            name: 'created_at_year',
            requiredAttributes: undefined,
            anyAttributes: undefined,
            round: undefined,
            source: undefined,
            sql: "DATE_TRUNC('YEAR', ${metadata}-->'created_at')",
            table: 'myTable',
            tableLabel: 'My table',
            timeInterval: TimeFrames.YEAR,
            timeIntervalBaseDimensionName: 'created_at',
            timeIntervalBaseDimensionType: DimensionType.TIMESTAMP,
            type: DimensionType.DATE,
        },
    },
};
export const SPOTLIGHT_CONFIG_WITH_CATEGORIES_AND_HIDE = {
    spotlight: {
        default_visibility: 'show',
        categories: {
            category_1: { label: 'Category 1' },
            category_2: { label: 'Category 2', color: 'red' },
        },
    },
};
export const MODEL_WITH_NO_CATEGORIES = {
    ...MODEL_WITH_METRIC,
    meta: {
        spotlight: {
            visibility: 'hide',
        },
    },
};
export const LIGHTDASH_TABLE_WITH_NO_CATEGORIES = {
    ...LIGHTDASH_TABLE_WITH_METRICS,
    metrics: Object.fromEntries(Object.entries(LIGHTDASH_TABLE_WITH_METRICS.metrics).map(([key, metric]) => [
        key,
        {
            ...metric,
            spotlight: { ...metric.spotlight, visibility: 'hide' },
        },
    ])),
    dimensions: LIGHTDASH_TABLE_WITH_METRICS.dimensions,
};
export const MODEL_WITH_MODEL_LEVEL_CATEGORIES = {
    ...MODEL_WITH_METRIC,
    meta: {
        spotlight: {
            visibility: 'hide',
            categories: ['category_1'],
        },
    },
};
export const LIGHTDASH_TABLE_WITH_MODEL_LEVEL_CATEGORIES = {
    ...LIGHTDASH_TABLE_WITH_NO_CATEGORIES,
    metrics: Object.fromEntries(Object.entries(LIGHTDASH_TABLE_WITH_NO_CATEGORIES.metrics).map(([key, metric]) => [
        key,
        {
            ...metric,
            spotlight: {
                visibility: 'hide',
                categories: ['category_1'],
            },
        },
    ])),
};
export const MODEL_WITH_METRIC_LEVEL_CATEGORIES = {
    ...MODEL_WITH_MODEL_LEVEL_CATEGORIES,
    columns: {
        user_id: {
            name: 'user_id',
            data_type: DimensionType.STRING,
            meta: {
                metrics: {
                    user_count: {
                        type: MetricType.COUNT_DISTINCT,
                        spotlight: {
                            visibility: 'hide',
                            categories: ['category_2'],
                        },
                    },
                },
            },
        },
        num_participating_athletes: {
            name: 'num_participating_athletes',
            data_type: DimensionType.NUMBER,
            meta: {
                dimension: {
                    sql: 'num_participating_men + num_participating_women',
                },
                metrics: {
                    total_num_participating_athletes: {
                        type: MetricType.SUM,
                    },
                },
            },
        },
    },
};
export const LIGHTDASH_TABLE_WITH_METRIC_LEVEL_CATEGORIES = {
    ...LIGHTDASH_TABLE_WITH_MODEL_LEVEL_CATEGORIES,
    metrics: Object.fromEntries(Object.entries(LIGHTDASH_TABLE_WITH_MODEL_LEVEL_CATEGORIES.metrics).map(([key, metric]) => [
        key,
        {
            ...metric,
            spotlight: {
                visibility: 'hide',
                categories: [
                    'category_1',
                    ...(key === 'user_count' ? ['category_2'] : []),
                ],
            },
        },
    ])),
};
export const LIGHTDASH_TABLE_WITH_AI_HINT = {
    ...BASE_LIGHTDASH_TABLE,
    aiHint: ['This is a customers table.'],
};
export const LIGHTDASH_TABLE_WITH_AI_HINT_FROM_CONFIG = {
    ...BASE_LIGHTDASH_TABLE,
    aiHint: ['This is a customers table from config.'],
};
export const MODEL_WITH_DIMENSION_AI_HINT = {
    ...model,
    columns: {
        user_name: {
            name: 'user_name',
            data_type: DimensionType.STRING,
            meta: {
                dimension: {
                    ai_hint: 'User name dimension with AI hint.',
                },
            },
        },
    },
};
export const MODEL_WITH_METRIC_AI_HINT = {
    ...model,
    columns: {
        user_id: {
            name: 'user_id',
            data_type: DimensionType.STRING,
            meta: {
                metrics: {
                    user_count_with_ai: {
                        type: MetricType.COUNT_DISTINCT,
                        ai_hint: 'Count of unique users with AI hint.',
                    },
                },
            },
        },
    },
};
export const LIGHTDASH_TABLE_WITH_DIMENSION_AI_HINT = {
    ...BASE_LIGHTDASH_TABLE,
    dimensions: {
        user_name: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: DimensionType.STRING,
            sql: '${TABLE}.user_name',
            name: 'user_name',
            label: 'User name',
            table: 'myTable',
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
            aiHint: ['User name dimension with AI hint.'],
        },
    },
};
export const LIGHTDASH_TABLE_WITH_METRIC_AI_HINT = {
    ...BASE_LIGHTDASH_TABLE,
    dimensions: {
        user_id: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: DimensionType.STRING,
            sql: '${TABLE}.user_id',
            name: 'user_id',
            label: 'User id',
            table: 'myTable',
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
    },
    metrics: {
        user_count_with_ai: {
            fieldType: FieldType.METRIC,
            type: MetricType.COUNT_DISTINCT,
            sql: '${TABLE}.user_id',
            name: 'user_count_with_ai',
            label: 'User count with ai',
            table: 'myTable',
            tableLabel: 'My table',
            description: 'Count distinct of User id',
            source: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            percentile: undefined,
            compact: undefined,
            separator: undefined,
            showUnderlyingValues: undefined,
            groups: [],
            filters: [],
            index: 0,
            dimensionReference: 'myTable_user_id',
            requiredAttributes: undefined,
            anyAttributes: undefined,
            spotlight: {
                visibility: 'show',
                categories: [],
            },
            aiHint: ['Count of unique users with AI hint.'],
        },
    },
};
export const MODEL_WITH_MODEL_METRIC_AI_HINT = {
    ...model,
    meta: {
        metrics: {
            completion_percentage: {
                type: MetricType.NUMBER,
                sql: '${total_completed}/${total_orders}',
                ai_hint: 'Completion percentage of orders.',
            },
        },
    },
};
export const MODEL_WITH_AI_HINT_ARRAY = {
    ...model,
    meta: {
        ai_hint: ['This is a customers table.', 'Contains customer data.'],
    },
};
export const MODEL_WITH_DIMENSION_AI_HINT_ARRAY = {
    ...model,
    columns: {
        user_name: {
            name: 'user_name',
            data_type: DimensionType.STRING,
            meta: {
                dimension: {
                    ai_hint: ['User name dimension.', 'Contains PII data.'],
                },
            },
        },
    },
};
export const MODEL_WITH_METRIC_AI_HINT_ARRAY = {
    ...model,
    columns: {
        user_id: {
            name: 'user_id',
            data_type: DimensionType.STRING,
            meta: {
                metrics: {
                    user_count_with_ai: {
                        type: MetricType.COUNT_DISTINCT,
                        ai_hint: [
                            'Count of unique users.',
                            'Excludes null values.',
                        ],
                    },
                },
            },
        },
    },
};
export const LIGHTDASH_TABLE_WITH_MODEL_METRIC_AI_HINT = {
    ...BASE_LIGHTDASH_TABLE,
    metrics: {
        completion_percentage: {
            fieldType: FieldType.METRIC,
            type: MetricType.NUMBER,
            sql: '${total_completed}/${total_orders}',
            name: 'completion_percentage',
            label: 'Completion percentage',
            table: 'myTable',
            tableLabel: 'My table',
            description: undefined,
            source: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            percentile: undefined,
            compact: undefined,
            separator: undefined,
            showUnderlyingValues: undefined,
            groups: [],
            filters: [],
            index: 0,
            dimensionReference: undefined,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            spotlight: {
                visibility: 'show',
                categories: [],
            },
            aiHint: ['Completion percentage of orders.'],
        },
    },
};
export const LIGHTDASH_TABLE_WITH_AI_HINT_ARRAY = {
    ...BASE_LIGHTDASH_TABLE,
    aiHint: ['This is a customers table.', 'Contains customer data.'],
};
export const LIGHTDASH_TABLE_WITH_DIMENSION_AI_HINT_ARRAY = {
    ...BASE_LIGHTDASH_TABLE,
    dimensions: {
        user_name: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: DimensionType.STRING,
            sql: '${TABLE}.user_name',
            name: 'user_name',
            label: 'User name',
            table: 'myTable',
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
            aiHint: ['User name dimension.', 'Contains PII data.'],
        },
    },
};
export const LIGHTDASH_TABLE_WITH_METRIC_AI_HINT_ARRAY = {
    ...BASE_LIGHTDASH_TABLE,
    dimensions: {
        user_id: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: DimensionType.STRING,
            sql: '${TABLE}.user_id',
            name: 'user_id',
            label: 'User id',
            table: 'myTable',
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
    },
    metrics: {
        user_count_with_ai: {
            fieldType: FieldType.METRIC,
            type: MetricType.COUNT_DISTINCT,
            sql: '${TABLE}.user_id',
            name: 'user_count_with_ai',
            label: 'User count with ai',
            table: 'myTable',
            tableLabel: 'My table',
            description: 'Count distinct of User id',
            source: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            percentile: undefined,
            compact: undefined,
            separator: undefined,
            showUnderlyingValues: undefined,
            groups: [],
            filters: [],
            index: 0,
            dimensionReference: 'myTable_user_id',
            requiredAttributes: undefined,
            anyAttributes: undefined,
            spotlight: {
                visibility: 'show',
                categories: [],
            },
            aiHint: ['Count of unique users.', 'Excludes null values.'],
        },
    },
};
export const MODEL_WITH_DEFAULT_SHOW_UNDERLYING_VALUES = {
    ...model,
    meta: {
        default_show_underlying_values: ['user_id', 'user_name'],
        metrics: {
            total_revenue: {
                type: MetricType.SUM,
                sql: '${TABLE}.revenue',
            },
            average_revenue: {
                type: MetricType.AVERAGE,
                sql: '${TABLE}.revenue',
                show_underlying_values: ['custom_field'], // This should override the default
            },
        },
    },
    columns: {
        user_id: {
            name: 'user_id',
            data_type: DimensionType.STRING,
        },
        user_name: {
            name: 'user_name',
            data_type: DimensionType.STRING,
        },
        revenue: {
            name: 'revenue',
            data_type: DimensionType.NUMBER,
        },
    },
};
export const LIGHTDASH_TABLE_WITH_DEFAULT_SHOW_UNDERLYING_VALUES = {
    ...BASE_LIGHTDASH_TABLE,
    dimensions: {
        user_id: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            description: undefined,
            type: DimensionType.STRING,
            sql: '${TABLE}.user_id',
            name: 'user_id',
            label: 'User id',
            table: 'myTable',
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
        user_name: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            description: undefined,
            type: DimensionType.STRING,
            sql: '${TABLE}.user_name',
            name: 'user_name',
            label: 'User name',
            table: 'myTable',
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 1,
            isIntervalBase: false,
        },
        revenue: {
            fieldType: FieldType.DIMENSION,
            requiredAttributes: undefined,
            description: undefined,
            type: DimensionType.NUMBER,
            sql: '${TABLE}.revenue',
            name: 'revenue',
            label: 'Revenue',
            table: 'myTable',
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 2,
            isIntervalBase: false,
        },
    },
    metrics: {
        total_revenue: {
            fieldType: FieldType.METRIC,
            type: MetricType.SUM,
            sql: '${TABLE}.revenue',
            name: 'total_revenue',
            label: 'Total revenue',
            table: 'myTable',
            tableLabel: 'My table',
            description: undefined,
            source: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            percentile: undefined,
            compact: undefined,
            separator: undefined,
            showUnderlyingValues: ['user_id', 'user_name'], // Should inherit from model default
            groups: [],
            filters: [],
            index: 0,
            requiredAttributes: undefined,
            spotlight: {
                visibility: 'show',
                categories: [],
            },
        },
        average_revenue: {
            fieldType: FieldType.METRIC,
            type: MetricType.AVERAGE,
            sql: '${TABLE}.revenue',
            name: 'average_revenue',
            label: 'Average revenue',
            table: 'myTable',
            tableLabel: 'My table',
            description: undefined,
            source: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            percentile: undefined,
            compact: undefined,
            separator: undefined,
            showUnderlyingValues: ['custom_field'], // Should use metric-specific override
            groups: [],
            filters: [],
            index: 1,
            requiredAttributes: undefined,
            spotlight: {
                visibility: 'show',
                categories: [],
            },
        },
    },
};
export const MODEL_WITH_METRIC_DRIVERS = {
    ...model,
    columns: {
        ...COLUMN_WITH_METRICS,
        num_participating_athletes: {
            ...COLUMN_WITH_METRICS.num_participating_athletes,
            meta: {
                ...COLUMN_WITH_METRICS.num_participating_athletes.meta,
                metrics: {
                    total_num_participating_athletes: {
                        type: MetricType.SUM,
                        drivers: ['user_count', 'other_table.other_metric'],
                    },
                },
            },
        },
    },
};
export const MODEL_WITH_CUSTOM_GRANULARITY = {
    ...model,
    columns: {
        created_at: {
            name: 'created_at',
            data_type: DimensionType.TIMESTAMP,
            meta: {
                dimension: {
                    type: DimensionType.TIMESTAMP,
                    time_intervals: ['DAY', 'slt_week'],
                },
            },
        },
    },
};
export const MODEL_WITH_CUSTOM_GRANULARITY_AND_REQUIRED_ATTRIBUTES = {
    ...model,
    columns: {
        created_at: {
            name: 'created_at',
            data_type: DimensionType.TIMESTAMP,
            meta: {
                dimension: {
                    type: DimensionType.TIMESTAMP,
                    time_intervals: ['DAY', 'slt_week'],
                    required_attributes: {
                        department: 'finance',
                    },
                },
            },
        },
    },
};
export const MODEL_WITH_DUPLICATE_METRIC_DIMENSION_NAME = {
    ...model,
    columns: {
        myColumnName: {
            name: 'myColumnName',
            data_type: DimensionType.STRING,
            meta: {},
        },
    },
    meta: {
        metrics: {
            myColumnName: {
                type: MetricType.COUNT,
                sql: '${TABLE}.myColumnName',
            },
        },
    },
};
//# sourceMappingURL=translator.mock.js.map