# ============================================================
# user_model.py — Central import hub
# All functions are implemented in sub-modules under models/
# Import from here to maintain backward compatibility with
# all existing routes and services.
# ============================================================

# Shared DB context
from models.db import db_cursor                                     # noqa: F401

# Schema / initialization
from models.schema import (                                         # noqa: F401
    initialize_database,
    ensure_column,
    column_exists,
    ensure_index,
    ensure_unique_index,
    _table_exists,
)

# User operations
from models.user_queries import (                                   # noqa: F401
    create_user,
    create_registered_user,
    get_all_users,
    get_user_by_email,
    get_user_by_email_or_phone,
    get_user_by_face_id,
    get_user_token,
    get_user_matched_image_ids,
    update_user,
    update_user_face_id,
)

# Visitor registration operations
from models.visitor_queries import (                                # noqa: F401
    get_visitor_registration_by_identifier,
    get_visitors,
    count_visitors,
    get_visitor_by_id,
    create_visitor,
    update_visitor,
    get_remaining_visitors,
)

# Email delivery operations
from models.email_queries import (                                  # noqa: F401
    is_delivery_logged,
    log_email_delivery,
    log_email_deliveries,
    get_email_delivery_stats,
    get_all_email_deliveries,
)

# Event / day_events / images / matches
from models.event_queries import (                                  # noqa: F401
    get_event_config,
    get_latest_event,
    get_events,
    update_event_config,
    get_day_events_grouped,
    get_all_day_events,
    add_day,
    add_day_event,
    delete_day_event,
    delete_day,
    create_event_image,
    get_all_event_images,
    create_match,
    append_image_to_user_array,
    get_user_image_array,
)

# Admin / assets / dashboard
from models.admin_queries import (                                  # noqa: F401
    get_admin_user_by_username,
    create_admin_user,
    get_site_assets,
    update_site_asset,
    create_admin_asset,
    get_latest_admin_asset,
    get_dashboard_counts,
    get_dashboard_chart_data,
    get_image_links,
    update_image_link,
)