import Dexie, { type Table } from 'dexie';

import type { key_val } from '$lib/stores/ae_stores';

// li = list
// kv = key value list

/**
 * Event - A core Aether event
 * Related Files:
 * - src/lib/ae_events/ae_events__event.ts (API)
 * - src/routes/events/[event_id]/+page.svelte (View)
 * - src/routes/events/[event_id]/settings/+page.svelte (Admin Settings)
 */
export interface Event {
    id: string;
    // id_random: string;
    event_id: string;
    event_id_random: string; // NO LONGER USE "_random"

    code: string;

    account_id: string;
    account_id_random: string; // NO LONGER USE "_random"

    conference: boolean;
    type: string;
    name: string;
    summary?: null | string;
    description?: null | string;

    start_datetime?: Date;
    end_datetime?: Date;
    timezone?: null | string;
    location_address_json?: null | string;
    location_text?: null | string;

    attend_json?: null | string;
    attend_text?: null | string;

    status?: null | string; // draft, active, inactive, archived, unknown; currently only used with IDAA
    default_qry_str?: null | string; // full-text search composite field (built server-side)
    // review?: null|boolean;
    // approve?: null|boolean;
    // ready?: null|boolean;
    // ready_on?: null|Date;
    // archive?: null|boolean;
    // archive_on?: null|Date;

    mod_abstracts_json?: null | key_val;
    mod_badges_json?: null | key_val;
    mod_exhibits_json?: null | key_val;
    mod_meetings_json?: null | key_val;
    mod_pres_mgmt_json?: null | key_val;
    cfg_json?: null | key_val;

    enable?: null | boolean;
    hide?: null | boolean;
    priority?: null | boolean;
    sort?: null | number;
    group?: null | string;
    notes?: null | string;
    created_on?: Date | null;
    updated_on?: null | Date;

    // Generated fields for sorting locally only
    tmp_sort_1?: null | string;
    tmp_sort_2?: null | string;

    // IDAA Recovery Meetings:
    // Currently only really used for IDAA
    contact_li_json?: null | any[]; // full_name, email, phone_mobile, phone_home, phone_office, other_text
    // contact_li_json_ext?: null|string;
    external_person_id?: null | string;

    physical?: null | boolean;
    virtual?: null | boolean;

    recurring?: null | boolean;
    recurring_pattern?: null | string;
    recurring_start_time?: null | string;
    recurring_end_time?: null | string;
    recurring_text?: null | string;

    weekday_sunday?: null | boolean;
    weekday_monday?: null | boolean;
    weekday_tuesday?: null | boolean;
    weekday_wednesday?: null | boolean;
    weekday_thursday?: null | boolean;
    weekday_friday?: null | boolean;
    weekday_saturday?: null | boolean;

    attend_url?: null | string;
    attend_url_text?: null | string;
    attend_url_code?: null | string; // Meeting ID, Conference ID, etc.
    attend_url_passcode?: null | string;
    attend_phone?: null | string;
    attend_phone_passcode?: null | string;

    // Additional fields for convenience (database views)
    file_count?: null | number;
    file_count_all?: null | number;
    internal_use_count?: null | number;
    event_file_id_li_json?: null | string;
}

/**
 * Badge - An event badge
 * Related Files:
 * - src/lib/ae_events/ae_events__event_badge.ts (API)
 * - src/routes/events/[event_id]/(badges)/badges/[badge_id]/+page.svelte (View)
 * - src/routes/events/[event_id]/settings/+page.svelte (Admin)
 */
export interface Badge {
    id: string;
    // id_random: string;
    event_badge_id: string;
    event_badge_id_random: string; // NO LONGER USE "_random"

    event_id: string;
    event_id_random: string;

    event_badge_template_id?: null | string;
    event_badge_template_id_random?: null | string;

    pronouns?: null | string;
    informal_name?: null | string;
    title_names?: null | string;
    given_name: string;
    middle_name?: null | string;
    family_name?: null | string;
    designations?: null | string;

    professional_title?: null | string;
    professional_title_override?: null | string;

    full_name?: string;
    full_name_override?: null | string;

    affiliations?: string;
    affiliations_override?: null | string;

    email?: string;
    email_override?: null | string;

    address_line_1?: null | string;
    address_line_2?: null | string;
    address_line_3?: null | string;
    city?: null | string;
    country_subdivision_code?: null | string;
    state_province?: null | string;
    state_province_abb?: null | string;
    postal_code?: null | string;
    country_alpha_2_code?: null | string;
    country?: null | string;
    full_address?: null | string;
    location?: null | string;
    location_override?: null | string;

    query_str?: null | string;

    badge_type?: string;
    badge_type_code?: string;
    badge_type_code_override?: null | string;
    badge_type_override?: null | string;

    external_event_id?: string;
    external_id?: string;
    external_person_id?: string;

    // passcode?: null|string;

    cfg_json?: null | string;
    // data_json?: null|string;

    default_qry_str?: null | string;

    alert?: null | boolean;

    enable?: null | boolean;
    hide?: null | boolean;
    priority?: null | boolean;
    sort?: null | number;
    group?: null | string;
    notes?: null | string;
    created_on?: Date | null;
    updated_on?: null | Date;

    // Generated fields for sorting locally only
    tmp_sort_1?: null | string;
    tmp_sort_2?: null | string;

    print_count?: null | number;
    print_first_datetime?: null | Date | string;
    print_last_datetime?: null | Date | string;

    // Additional fields for convenience (database views)
    person_external_id?: null | string; // This may be semi-random or unique only withing the account.
    person_external_sys_id?: null | string; // Generated by an external system. Ideally this should be something like a UUID. It may be the same as the external_id if nothing given.
    person_given_name?: string;
    person_family_name?: null | string;
    person_full_name?: null | string;
    person_professional_title?: null | string;
    person_affiliations?: null | string;
    person_primary_email?: null | string;
    person_passcode?: null | string;
}

// Updated 2025-10-06
export interface Badge_template {
    id: string;
    // id_random: string;

    event_badge_template_id?: null | string;
    event_badge_template_id_random?: null | string; // NO LONGER USE "_random"

    event_id: string;
    event_id_random: string; // NO LONGER USE "_random"

    name: string;
    description?: null | string;

    logo_filename?: null | string;
    logo_path?: null | string;

    header_path?: null | string;
    background_image_path?: null | string;
    secondary_header_path?: null | string;
    footer_path?: null | string;

    header_row_1?: null | string;
    header_row_2?: null | string;

    badge_type_list?: any; // This is an array of objects with code and name
    badge_type_info_kv?: any; // This is a key value list with code as the key and name as the value. Use this for exhibitor, presenter, attendee, staff, vip, etc.
    other_info_kv?: any; // This is a key value list with code as the key and name as the value. Use this for other custom fields.

    ticket_list?: any; // This is an array of objects with num, code, and name

    ticket_1_text?: null | string;
    ticket_2_text?: null | string;
    ticket_3_text?: null | string;
    ticket_4_text?: null | string;
    ticket_5_text?: null | string;
    ticket_6_text?: null | string;
    ticket_7_text?: null | string;
    ticket_8_text?: null | string;

    wireless_ssid?: null | string;
    wireless_password?: null | string;

    show_qr_front: boolean;
    show_qr_back: boolean;

    layout?: null | string;
    style_filename?: null | string;
    style_href?: null | string;
    duplex?: null | number | boolean;

    cfg_json?: null | string;
    other_json?: null | string;
    data_json?: null | string;

    enable?: null | boolean;
    hide?: null | boolean;
    priority?: null | boolean;
    sort?: null | number;
    group?: null | string;
    notes?: null | string;
    created_on?: Date | null;
    updated_on?: null | Date;

    // Generated fields for sorting locally only

    // Additional fields for convenience (database views)
}

// Updated 2024-10-16
export interface Device {
    id: string;
    // id_random: string; // NO LONGER USE "_random"
    event_device_id: string;
    // event_device_id_random: string; // NO LONGER USE "_random"

    event_id: string;
    // event_id_random: string; // NO LONGER USE "_random"
    event_location_id?: string;
    // event_location_id_random?: string; // NO LONGER USE "_random"

    code?: string;
    name: string;
    description?: null | string;

    passcode?: null | string;

    local_file_cache_path?: null | string;
    host_file_temp_path?: null | string;
    recording_path?: null | string;

    record_audio?: null | boolean;
    record_video?: null | boolean;

    trigger_open_file_id?: null | string;
    trigger_open_session_id?: null | string;
    trigger_recording_start?: null | boolean;
    trigger_recording_stop?: null | boolean;
    trigger_reset?: null | boolean;
    trigger_show_admin?: null | boolean;
    trigger_show_hidden?: null | boolean;

    alert?: null | boolean;
    alert_msg?: null | string;
    alert_on?: null | string;
    status?: null | string;
    status_msg?: null | string;
    status_on?: null | Date;
    record_status?: null | string;
    record_status_msg?: null | string;
    record_status_on?: null | Date;
    heartbeat?: null | string;

    info_hostname?: null | string;
    info_ip_list?: null | string; // Semi-colon separated list of IP addresses

    meta_json?: null | string;
    other_json?: null | string;

    enable?: null | boolean;
    hide?: null | boolean;
    priority?: null | boolean;
    sort?: null | number;
    group?: null | string;
    notes?: null | string;
    created_on?: Date | null;
    updated_on?: null | Date;

    // Generated fields for sorting locally only
    tmp_sort_1?: null | string;
    tmp_sort_2?: null | string;

    // Additional fields for convenience (database views)
    event_name?: string;
    event_location_code?: string;
    event_location_name?: string;
}

export interface Exhibit {
    id: string;
    id_random: string; // NO LONGER USE "_random"
    event_exhibit_id: string;
    event_exhibit_id_random: string; // NO LONGER USE "_random"

    event_id: string;
    event_id_random: string; // NO LONGER USE "_random"

    code: string;
    name: string;
    // tagline: null|string;
    description: null | string;
    staff_passcode: null;
    data_json: null | string;

    leads_api_access: null | boolean;
    leads_custom_questions_json: null | string;
    leads_device_sm_qty: null | number;
    leads_device_lg_qty: null | number;
    license_max: number;
    license_li_json: null | string;
    cfg_json: string;

    enable?: null | boolean;
    hide?: null | boolean;
    priority?: null | boolean;
    sort?: null | number;
    group?: null | string;
    notes?: null | string;
    created_on?: Date | null;
    updated_on?: null | Date;

    // Generated fields for sorting locally only
    // tmp_sort_1?: null|string;
    // tmp_sort_2?: null|string;
}

export interface Exhibit_tracking {
    id: string;
    id_random: string; // NO LONGER USE "_random"
    event_exhibit_tracking_id: string;
    event_exhibit_tracking_id_random: string; // NO LONGER USE "_random"

    event_exhibit_id: string;
    event_exhibit_id_random: string; // NO LONGER USE "_random"
    event_badge_id: string;
    event_badge_id_random: string; // NO LONGER USE "_random"
    event_person_id: string;
    event_person_id_random?: string; // NO LONGER USE "_random"

    event_id: string;
    event_id_random: string;

    external_person_id?: null | string; // This is an email address

    exhibitor_notes?: null | string;

    responses_json?: null | string;
    data_json?: null | string;

    event_exhibit_name: string; // Extra field for convenience

    event_badge_title_names?: null | string;
    event_badge_given_name: string;
    event_badge_family_name?: null | string;
    event_badge_designations?: null | string;
    event_badge_full_name: string;
    event_badge_full_name_override?: null | string;

    event_badge_professional_title?: null | string;
    event_badge_professional_title_override?: null | string;

    event_badge_affiliations?: null | string;
    event_badge_affiliations_override?: null | string;

    event_badge_email?: null | string;
    event_badge_email_override?: null | string;

    event_badge_location?: null | string;
    event_badge_location_override?: null | string;

    event_badge_country?: null | string;

    default_qry_str?: string | null;

    enable?: null | boolean;
    hide?: null | boolean;
    priority?: null | boolean;
    sort?: null | number;
    group?: null | string;
    notes?: null | string;
    created_on?: Date | null;
    updated_on?: null | Date;

    // Generated fields for sorting locally only
    // tmp_sort_1?: null|string;
    // tmp_sort_2?: null|string;
}

export interface EventFile {
    id: string;
    id_random: string; // NO LONGER USE "_random"
    event_file_id: string;
    event_file_id_random?: string; // NO LONGER USE "_random"

    hosted_file_id: string;
    hosted_file_id_random?: string; // NO LONGER USE "_random"
    hash_sha256: string;

    for_type?: string;
    for_id?: string;
    for_id_random?: string; // NO LONGER USE "_random"

    event_id: string;
    event_id_random?: string; // NO LONGER USE "_random"
    event_session_id?: string;
    event_session_id_random?: string; // NO LONGER USE "_random"
    event_presentation_id?: string;
    event_presentation_id_random?: string; // NO LONGER USE "_random"
    event_presenter_id?: string;
    event_presenter_id_random?: string; // NO LONGER USE "_random"
    event_location_id?: string;
    event_location_id_random?: string; // NO LONGER USE "_random"

    filename: string;
    extension: string;

    open_in_os?: null | string; // null, empty, 'mac', or 'win'

    lu_file_purpose_id: string;
    lu_event_file_purpose_name: string;
    file_purpose: string;

    enable?: null | boolean;
    hide?: null | boolean;
    priority?: null | boolean;
    sort?: null | number;
    group?: null | string;
    notes?: null | string;
    created_on?: Date | null;
    updated_on?: null | Date;

    // Generated fields for sorting locally only
    tmp_sort_1?: null | string;
    tmp_sort_2?: null | string;

    // Additional fields for convenience (database views)
    filename_no_ext: string;
    filename_w_ext: string;
    hosted_file_content_type: string;
    file_size: number; // In bytes
    hosted_file_size?: number; // In bytes

    event_location_code?: null | string;
    event_location_name?: null | string;
    event_session_code?: null | string;
    event_session_type_code?: null | string;
    event_session_name?: string;
    event_session_start_datetime?: null | Date;
    event_session_end_datetime?: null | Date;
    event_presentation_code?: null | string;
    event_presentation_type_code?: null | string;
    event_presentation_name?: string;
    event_presentation_start_datetime?: null | Date;
    event_presentation_end_datetime?: null | Date;
    event_presenter_given_name?: null | string;
    event_presenter_family_name?: null | string;
    event_presenter_full_name?: null | string;
    event_presenter_email?: null | string;
}

// Updated 2024-06-25
export interface Location {
    id: string;
    // id_random: string;
    event_location_id: string;
    event_location_id_random: string; // NO LONGER USE "_random"

    external_id?: null | string;
    code?: null | string;

    type_code?: string;

    event_id: string;
    event_id_random: string; // NO LONGER USE "_random"

    name: string;
    description?: null | string;

    passcode?: null | string;

    hide_event_launcher?: null | boolean;

    alert?: null | boolean;
    alert_msg?: null | string;

    data_json?: null | string;

    enable?: null | boolean;
    hide?: null | boolean;
    priority?: null | boolean;
    sort?: null | number;
    group?: null | string;
    notes?: null | string;
    created_on?: Date | null;
    updated_on?: null | Date;

    // Generated fields for sorting locally only
    tmp_sort_1?: null | string;
    tmp_sort_2?: null | string;

    // Additional fields for convenience (database views)
    file_count?: null | number;
    file_count_all?: null | number;
    internal_use_count?: null | number;
    event_file_id_li_json?: null | string;

    event_name?: null | string;

    // A key value list of the sessions
    event_session_kv?: null | key_val;
    // A key value list of the files
    event_file_kv?: null | key_val;
}

// Updated 2024-06-10
export interface Presentation {
    id: string;
    // id_random: string;
    event_presentation_id: string;
    event_presentation_id_random: string; // NO LONGER USE "_random"

    external_id?: null | string;
    code?: null | string;

    for_type?: string;
    for_id?: string;
    for_id_random?: string; // NO LONGER USE "_random"

    type_code?: string;

    event_id: string;
    event_id_random: string; // NO LONGER USE "_random"
    event_session_id: string;
    event_session_id_random: string; // NO LONGER USE "_random"
    event_abstract_id?: null | string;
    event_abstract_id_random?: null | string; // NO LONGER USE "_random"

    abstract_code?: null | string;

    name: string;
    description?: null | string;

    start_datetime?: null | Date;
    end_datetime?: null | Date;

    passcode?: null | string;

    hide_event_launcher?: null | boolean;

    enable?: null | boolean;
    hide?: null | boolean;
    priority?: null | boolean;
    sort?: null | number;
    group?: null | string;
    notes?: null | string;
    created_on?: Date | null;
    updated_on?: null | Date;

    // Generated fields for sorting locally only
    tmp_sort_1?: null | string;
    tmp_sort_2?: null | string;

    // Additional fields for convenience (database views)
    // file_count: null|number;

    event_session_code?: null | string;
    event_session_name?: null | string;

    // A key value list of the presenters
    event_presenter_kv?: null | key_val;
    event_presenter_li?: null | Array<any>;
}

// Updated 2024-06-10
export interface Presenter {
    id: string;
    // id_random: string;
    event_presenter_id: string;
    event_presenter_id_random: string; // NO LONGER USE "_random"

    external_id?: string;
    code?: string;

    event_id: string;
    event_id_random: string; // NO LONGER USE "_random"
    event_session_id: string;
    event_session_id_random: string; // NO LONGER USE "_random"
    event_person_id?: null | string;
    event_person_id_random?: null | string; // NO LONGER USE "_random"
    event_presentation_id: string;
    event_presentation_id_random: string; // NO LONGER USE "_random"
    person_id?: null | string;
    person_id_random?: null | string; // NO LONGER USE "_random"
    person_profile_id?: null | string; // The new table person_profile will be used soon...
    person_profile_id_random?: null | string; // NO LONGER USE "_random"

    pronouns?: null | string;
    informal_name?: null | string;
    title_names?: null | string;
    given_name: string;
    middle_name?: null | string;
    family_name?: null | string;
    designations?: null | string;

    professional_title?: null | string;

    full_name?: string;
    full_name_override: null | string;

    affiliations?: null | string;

    email?: string;

    biography?: null | string;

    agree?: null | boolean; // General catchall for agreement or consent
    comments?: null | string;

    passcode?: null | string;

    hide_event_launcher?: null | boolean;

    data_json?: null | string;

    enable?: null | boolean;
    hide?: null | boolean;
    priority?: null | boolean;
    sort?: null | number;
    group?: null | string;
    notes?: null | string;
    created_on?: Date | null;
    updated_on?: null | Date;

    // Generated fields for sorting locally only
    tmp_sort_1?: null | string;
    tmp_sort_2?: null | string;

    // Additional fields for convenience (database views)
    file_count?: null | number;
    // file_count_all?: null|number;
    // internal_use_count?: null|number;
    event_file_id_li_json?: null | string;

    event_session_code?: null | string;
    event_session_name?: string;
    event_session_start_datetime?: null | Date;
    event_presentation_code?: null | string;
    event_presentation_name?: string;
    event_presentation_start_datetime?: null | Date;

    person_external_id?: null | string; // This may be semi-random or unique only withing the account.
    person_external_sys_id?: null | string; // Generated by an external system. Ideally this should be something like a UUID. It may be the same as the external_id if nothing given.
    person_given_name?: string;
    person_family_name?: null | string;
    person_full_name?: null | string;
    person_professional_title?: null | string;
    person_affiliations?: null | string;
    person_primary_email?: null | string;
    person_passcode?: null | string;

    // A key value list of the files
    event_file_kv?: null | key_val;
}

export interface Registration {
    // Nothing here yet
}

/**
 * Session - An event session
 * Related Files:
 * - src/lib/ae_events/ae_events__event_session.ts (API)
 * - src/routes/events/[event_id]/(pres_mgmt)/session/[session_id]/+page.svelte (View)
 * - src/routes/events/[event_id]/(launcher)/menu_session_list.svelte (Launcher)
 */
export interface Session {
    id: string;
    // id_random: string;
    event_session_id: string;
    event_session_id_random: string; // NO LONGER USE "_random"

    external_id: null | string;
    code: null | string;

    for_type: string;
    for_id: string;
    for_id_random: string; // NO LONGER USE "_random"

    type_code?: string;

    event_id: string;
    event_id_random: string; // NO LONGER USE "_random"
    event_location_id?: null | string;
    event_location_id_random?: null | string; // NO LONGER USE "_random"

    poc_person_id?: null | string;
    poc_person_id_random?: null | string; // NO LONGER USE "_random"
    poc_agree?: null | boolean; // General catchall for agreement or consent by the POC
    poc_kv_json?: null | key_val; // Key value list of the POC by type (examples: 'advocate', 'chair', 'champion', 'moderator', 'organizer')

    name: string;
    description?: null | string;

    start_datetime?: null | Date;
    end_datetime?: null | Date;

    passcode?: null | string;

    hide_event_launcher?: null | boolean;

    alert?: null | boolean;
    alert_msg?: null | string;

    data_json?: null | string;

    ux_mode?: null | string; // 'colloquium', 'lecture', 'panel', 'poster', 'symposium', 'workshop'
    // colloquium - Specialists present on related topics with questions
    // symposium - A discussion, less formal

    enable?: null | boolean;
    hide?: null | boolean;
    priority?: null | boolean;
    sort?: null | number;
    group?: null | string;
    notes?: null | string;
    created_on?: Date | null;
    updated_on?: null | Date;

    // Generated fields for sorting locally only
    tmp_sort_1?: null | string;
    tmp_sort_2?: null | string;

    // Additional fields for convenience (database views)
    default_qry_str?: null | string;
    file_count?: null | number; // Only files directly under a session
    file_count_all?: null | number; // All files under a session
    internal_use_count?: null | number; // Files marked for internal use
    event_file_id_li_json?: null | string;

    poc_person_given_name?: null | string;
    poc_person_family_name?: null | string;
    poc_person_full_name?: null | string;
    poc_person_primary_email?: null | string;
    poc_person_passcode?: null | string;

    event_name?: null | string;

    event_location_code?: null | string;
    event_location_name?: null | string;

    // A key value list of the presentations
    event_presentation_kv?: null | key_val;
    event_presentation_li?: null | [any];
    // Concatenated search strings from JOINed views (v_event_session_w_file_count)
    event_presentation_li_qry_str?: null | string;
    event_presenter_li_qry_str?: null | string;
    // A key value list of the files
    event_file_kv?: null | key_val;
    event_file_li?: null | [any];
}

// Updated 2024-10-16
export class MySubClassedDexie extends Dexie {
    // 'badge' is added by dexie when declaring the stores()
    // We just tell the typing system this is the case
    event!: Table<Event>;
    badge!: Table<Badge>;
    badge_template!: Table<Badge_template>;
    device!: Table<Device>;
    exhibit!: Table<Exhibit>;
    exhibit_tracking!: Table<Exhibit_tracking>;
    file!: Table<EventFile>;
    location!: Table<Location>;
    presentation!: Table<Presentation>;
    presenter!: Table<Presenter>;
    session!: Table<Session>;

    constructor() {
        super('ae_events_db');
        this.version(6).stores({
            // NO LONGER USE "_random"
            event: `
                id, event_id, event_id_random,
                code,
                account_id, account_id_random,
                conference, type,
                name,
                start_datetime, end_datetime,
                timezone,
                cfg_json,
                tmp_sort_1, tmp_sort_2,
                enable, hide, priority, sort, group, notes, created_on, updated_on`,

            badge: `
                event_badge_id_random, event_badge_id, id,
                event_id, event_id_random,
                full_name, full_name_override, email, email_override,
                affiliations, affiliations_override,
                badge_type, badge_type_code, badge_type_code_override, badge_type_override,
                external_event_id, external_id, external_person_id,
                default_qry_str,
                alert,
                tmp_sort_1, tmp_sort_2,
                print_count, print_first_datetime, print_last_datetime,
                enable, hide, priority, sort, group, notes, created_on, updated_on`,

            badge_template: `
                id, id_random, event_badge_template_id, badge_template_id, event_id, event_id_random`,

            device: `
                id, id_random, event_device_id_random, event_device_id,
                event_id, event_id_random, event_location_id, event_location_id_random,
                code, name,
                for_type, for_id, for_id_random,
                alert,
                tmp_sort_1, tmp_sort_2,
                enable, hide, priority, sort, group, notes, created_on, updated_on`,

            exhibit: `
                id, id_random, event_exhibit_id, event_exhibit_id_random,
                event_id, event_id_random,
                code, name, description, staff_passcode,
                data_json, license_max, license_li_json, cfg_json,
                enable, hide, priority, sort, group, notes, created_on, updated_on, [priority+name]`,

            exhibit_tracking: `
                id, id_random, event_exhibit_tracking_id, event_exhibit_tracking_id_random,
                event_exhibit_id, event_exhibit_id_random,
                event_badge_id, event_badge_id_random, event_person_id, event_person_id_random,
                exhibitor_notes, responses_json, data_json,
                event_badge_full_name, event_badge_email,
                enable, hide, priority, sort, group, notes, created_on, updated_on`,

            file: `
                id, event_file_id,
                hosted_file_id,
                hash_sha256,
                for_type, for_id,
                event_id, event_session_id, event_presentation_id, event_presenter_id, event_location_id,
                filename, extension,
                lu_file_purpose_id, lu_event_file_purpose_name, file_purpose,
                tmp_sort_1, tmp_sort_2,
                enable, hide, priority, sort, group, created_on, updated_on`,

            location: `
                id, event_location_id, event_location_id_random,
                external_id, code,
                event_id, event_id_random,
                name, description,
                passcode,
                hide_event_launcher,
                alert, alert_msg,
                data_json,
                tmp_sort_1, tmp_sort_2,
                enable, hide, priority, sort, group, created_on, updated_on`,

            presentation: `
                id, event_presentation_id, event_presentation_id_random,
                external_id, code,
                for_type, for_id, for_id_random,
                type_code,
                event_id, event_session_id, event_abstract_id,
                event_id_random, event_session_id_random, event_abstract_id_random,
                abstract_code, name, description, start_datetime, end_datetime,
                hide_event_launcher,
                tmp_sort_1, tmp_sort_2,
                enable, hide, priority, sort, group, created_on, updated_on`,

            presenter: `
                id, event_presenter_id, event_presenter_id_random,
                external_id, code,
                event_id, event_session_id, event_person_id, event_presentation_id,
                event_id_random, event_session_id_random, event_person_id_random, event_presentation_id_random,
                person_id, person_profile_id,
                person_id_random, person_profile_id_random,
                given_name, family_name,
                full_name, affiliations, email,
                agree,
                hide_event_launcher,
                tmp_sort_1, tmp_sort_2,
                enable, hide, priority, sort, group, created_on, updated_on`,

            session: `
                id, event_session_id, event_session_id_random,
                external_id, code,
                for_type, for_id, for_id_random,
                type_code,
                event_id, event_location_id,
                poc_person_id,
                event_id_random, event_location_id_random,
                poc_person_id_random,
                name, start_datetime, end_datetime,
                hide_event_launcher,
                ux_mode,
                alert,
                tmp_sort_1, tmp_sort_2,
                enable, hide, priority, sort, group, created_on, updated_on`
        });
    }
}

export const db_events = new MySubClassedDexie();
