CREATE TABLE IF NOT EXISTS users(
    id INT(10) AUTO_INCREMENT PRIMARY KEY,
    uid VARCHAR(120) NOT NULL,
    username VARCHAR(120) NOT NULL,
    email VARCHAR(120) NOT NULL,
    mobile_number VARCHAR(20) NOT NULL,
    password VARCHAR(255) DEFAULT NULL,
    email_verified ENUM("Yes", "No") DEFAULT "No",
    document_verified ENUM("Yes", "No") DEFAULT "No",
    mobile_verified ENUM("Yes", "No") DEFAULT "No",
    user_type ENUM("superadmin","admin","user",'employee'),
    status ENUM("Active", "Not active") DEFAULT "Not active",
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);


CREATE TABLE IF NOT EXISTS add_merchant(
    id INT(10) AUTO_INCREMENT PRIMARY KEY,
    uid VARCHAR(120) NOT NULL,
   	select_merchant VARCHAR(120) NOT NULL,
    currency VARCHAR(120) NOT NULL,
    minimum_amount DECIMAL(10,2) NOT NULL,
    maximum_amount DECIMAL(10,2) NOT NULL,
    reserve DECIMAL(10,2) NOT NULL,
    fee DECIMAL(10,2) NOT NULL,
    include_extra_fee ENUM("true","false") DEFAULT 'false',
    extra_fee DECIMAL(10,2) NOT NULL,
    allow_customers_to_send_money ENUM("true","false") DEFAULT 'false',
    require_user_to_login ENUM("true","false") DEFAULT 'false',
    require_user_to_verify_email ENUM("true","false") DEFAULT 'false',
    require_user_to_verify_documents ENUM("true","false") DEFAULT 'false',
    require_user_to_verify_mobile_number ENUM("true","false") DEFAULT 'false',
    status ENUM("Active","Not Active") DEFAULT 'Not Active',
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);


CREATE TABLE IF NOT EXISTS add_crypto(
    id INT(10) AUTO_INCREMENT PRIMARY KEY,
    uid VARCHAR(120) NOT NULL,
    merchant_source VARCHAR(255) NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);


CREATE TABLE IF NOT EXISTS add_manual_payment(
    id INT(10) AUTO_INCREMENT PRIMARY KEY,
    uid VARCHAR(120) NOT NULL,
   	gateway VARCHAR(120) NOT NULL,
    currency VARCHAR(120) NOT NULL,
    currency_code VARCHAR(120) DEFAULT NULL,
    minimum_amount DECIMAL(10,2) NOT NULL,
    maximum_amount DECIMAL(10,2) NOT NULL,
    reserve DECIMAL(10,2) NOT NULL,
    fee DECIMAL(10,2) NOT NULL,
    field_name JSON NOT NULL,
    field_value JSON NOT NULL,
    include_extra_fee ENUM("true","false") DEFAULT 'false',
    extra_fee DECIMAL(10,2) NOT NULL,
    allow_customers_to_send_money ENUM("true","false") DEFAULT 'false',
    is_crypto_currency ENUM("true","false") DEFAULT 'false',
    require_user_to_login ENUM("true","false") DEFAULT 'false',
    require_user_to_verify_email ENUM("true","false") DEFAULT 'false',
    require_user_to_verify_personal_documents ENUM("true","false") DEFAULT 'false',
    require_user_to_verify_mobile_number ENUM("true","false") DEFAULT 'false',
    icon VARCHAR(255) DEFAULT NULL,
    status ENUM("Active","Not Active") DEFAULT 'Not Active',
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);



CREATE TABLE IF NOT EXISTS card_details(
    id INT(10) AUTO_INCREMENT PRIMARY KEY,
    uid VARCHAR(120) NOT NULL,
   	card_number VARCHAR(120) NOT NULL,
    fullname VARCHAR(120) NOT NULL,
    email VARCHAR(120) NOT NULL,
    phone_number VARCHAR(15) NOT NULL,
    agree_with_rules ENUM("true","false") DEFAULT 'false',
    agree_with_KYC_policy ENUM("true","false") DEFAULT 'false',
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

CREATE TABLE IF NOT EXISTS exchange_details(
    id INT(10) AUTO_INCREMENT PRIMARY KEY,
    uid VARCHAR(120) NOT NULL,
    give_currency_minimum_amount DECIMAL(10,2) DEFAULT NULL,
    give_currency_maximum_amount DECIMAL(10,2) DEFAULT NULL,
    take_currency_minimum_amount DECIMAL(10,2) DEFAULT NULL,
    take_currency_maximum_amount DECIMAL(10,2) DEFAULT NULL,
    give_amount DECIMAL(10,2) DEFAULT NULL,
    take_amount DECIMAL(10,2) DEFAULT NULL,
    give_currency VARCHAR(120) DEFAULT NULL
    take_currency VARCHAR(120) DEFAULT NULL,
    rate DECIMAL(10,2) DEFAULT NULL,
    fee DECIMAL(10,2) DEFAULT NULL,
   	fields_values JSON DEFAULT NULL,
    agree_with_rules ENUM("true","false") DEFAULT 'false',
    agree_with_KYC_policy ENUM("true","false") DEFAULT 'false',
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

CREATE TABLE IF NOT EXISTS pages(
    id INT(10) AUTO_INCREMENT PRIMARY KEY,
    uid VARCHAR(120) NOT NULL,
   	title VARCHAR(120) NOT NULL,
    heading VARCHAR(120) NOT NULL,
    content TEXT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);


CREATE TABLE IF NOT EXISTS testimonials(
    id INT(10) AUTO_INCREMENT PRIMARY KEY,
    uid VARCHAR(120) NOT NULL,
    feedback TEXT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

CREATE TABLE IF NOT EXISTS faqs(
    id INT(10) AUTO_INCREMENT PRIMARY KEY,
    uid VARCHAR(120) NOT NULL,
    question TEXT NOT NULL,
    answer TEXT NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

CREATE TABLE IF NOT EXISTS settings(
    id INT(10) AUTO_INCREMENT PRIMARY KEY,
    uid VARCHAR(120) NOT NULL,
    title VARCHAR(255) NOT NULL,
    meta_title VARCHAR(255) DEFAULT NULL,
    meta_description TEXT DEFAULT NULL,
    meta_keywords TEXT DEFAULT NULL,
    site_name VARCHAR(255) NOT NULL,
    site_url VARCHAR(255) NOT NULL,
    info_email VARCHAR(255) NOT NULL,
    support_email VARCHAR(255) NOT NULL,
    skype VARCHAR(255) DEFAULT NULL,
    whatsapp VARCHAR(255) DEFAULT NULL,
    referral_commission DECIMAL(10,2) NULL,
    require_user_to_login ENUM("Yes","No") DEFAULT 'No',
    require_user_to_upload_documents ENUM("true","false") DEFAULT 'false',
    require_user_to_verify_email ENUM("true","false") DEFAULT 'false',
    require_user_to_verify_mobile_number ENUM("true","false") DEFAULT 'false',
    nexmo_api_key VARCHAR(255) DEFAULT NULL,
    nexmo_api_secret VARCHAR(255) DEFAULT NULL,
    work_time_start VARCHAR(255) DEFAULT NULL,
    work_time_end VARCHAR(255) DEFAULT NULL,
    work_time_gmt_zone VARCHAR(255) DEFAULT NULL,
    footer_short_info TEXT DEFAULT NULL,
    social_media_links JSON DEFAULT NULL,
    brands_logo JSON DEFAULT NULL,
    copyright TEXT DEFAULT NULL,
    logo VARCHAR(255) DEFAULT NULL,
    favicon VARCHAR(255) DEFAULT NULL,
    location VARCHAR(255) DEFAULT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);







