/*
    Предрейсовые осмотры - мобильное приложение
    Индексный файл для всех SQL запросов
*/

//---------------------
//Подключение библиотек
//---------------------

//Таблицы
const CREATE_TABLE_APP_SETTINGS = require('./settings/create_table_app_settings.sql');
const CREATE_TABLE_INSPECTIONS = require('./inspections/create_table_inspections.sql');
const CREATE_TABLE_AUTH_SESSION = require('./auth/create_table_auth_session.sql');

//Индексы
const CREATE_INDEX_INSPECTIONS_STATUS = require('./inspections/create_index_inspections_status.sql');
const CREATE_INDEX_INSPECTIONS_CREATED = require('./inspections/create_index_inspections_created.sql');

//Настройки
const SETTINGS_GET = require('./settings/get_setting.sql');
const SETTINGS_SET = require('./settings/set_setting.sql');
const SETTINGS_DELETE = require('./settings/delete_setting.sql');
const SETTINGS_CLEAR_ALL = require('./settings/clear_all_settings.sql');
const SETTINGS_GET_ALL = require('./settings/get_all_settings.sql');

//Осмотры
const INSPECTIONS_INSERT = require('./inspections/insert_inspection.sql');
const INSPECTIONS_UPSERT = require('./inspections/upsert_inspection.sql');
const INSPECTIONS_GET_ALL = require('./inspections/get_all_inspections.sql');
const INSPECTIONS_GET_BY_ID = require('./inspections/get_inspection_by_id.sql');
const INSPECTIONS_DELETE = require('./inspections/delete_inspection.sql');
const INSPECTIONS_DELETE_ALL = require('./inspections/delete_all_inspections.sql');
const INSPECTIONS_COUNT = require('./inspections/count_inspections.sql');

//Авторизация
const AUTH_SESSION_SET = require('./auth/set_auth_session.sql');
const AUTH_SESSION_GET = require('./auth/get_auth_session.sql');
const AUTH_SESSION_CLEAR = require('./auth/clear_auth_session.sql');

//Утилиты
const UTILITY_CHECK_TABLE = require('./utility/check_table_exists.sql');
const UTILITY_DROP_TABLE = require('./utility/drop_table.sql');
const UTILITY_VACUUM = require('./utility/vacuum.sql');

//-----------
//Тело модуля
//-----------

//Сбор всех SQL запросов в один объект
const SQLQueries = {
    CREATE_TABLE_APP_SETTINGS,
    CREATE_TABLE_INSPECTIONS,
    CREATE_TABLE_AUTH_SESSION,
    CREATE_INDEX_INSPECTIONS_STATUS,
    CREATE_INDEX_INSPECTIONS_CREATED,
    SETTINGS_GET,
    SETTINGS_SET,
    SETTINGS_DELETE,
    SETTINGS_CLEAR_ALL,
    SETTINGS_GET_ALL,
    INSPECTIONS_INSERT,
    INSPECTIONS_UPSERT,
    INSPECTIONS_GET_ALL,
    INSPECTIONS_GET_BY_ID,
    INSPECTIONS_DELETE,
    INSPECTIONS_DELETE_ALL,
    INSPECTIONS_COUNT,
    AUTH_SESSION_SET,
    AUTH_SESSION_GET,
    AUTH_SESSION_CLEAR,
    UTILITY_CHECK_TABLE,
    UTILITY_DROP_TABLE,
    UTILITY_VACUUM
};

//----------------
//Интерфейс модуля
//----------------

module.exports = SQLQueries;
