-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3306
-- Généré le : sam. 15 nov. 2025 à 21:10
-- Version du serveur : 9.1.0
-- Version de PHP : 8.1.31

START TRANSACTION;



--
-- Base de données : `timcash_db`
--

-- --------------------------------------------------------

--
-- Structure de la table `admin_stock`
--

CREATE TABLE IF NOT EXISTS `admin_stock` (
  `id` int NOT NULL,
  `balance` float DEFAULT NULL,
  `total_credits` float DEFAULT NULL,
  `total_debits` float DEFAULT NULL,
  `total_commissions` float DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Déchargement des données de la table `admin_stock`
--

INSERT INTO `admin_stock` (`id`, `balance`, `total_credits`, `total_debits`, `total_commissions`, `updated_at`) VALUES
(0, 847029000, 31780, 2000, 24480, '2025-11-09 11:29:02');

-- --------------------------------------------------------

--
-- Structure de la table `advertisements`
--

CREATE TABLE IF NOT EXISTS `advertisements` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `image_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ad_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `target_countries` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `target_cities` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `start_date` datetime DEFAULT NULL,
  `end_date` datetime DEFAULT NULL,
  `budget` float DEFAULT NULL,
  `spent` float DEFAULT NULL,
  `impressions` int DEFAULT NULL,
  `clicks` int DEFAULT NULL,
  `ctr` float DEFAULT NULL,
  `created_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `alembic_version`
--

CREATE TABLE IF NOT EXISTS `alembic_version` (
  `version_num` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`version_num`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Déchargement des données de la table `alembic_version`
--

INSERT INTO `alembic_version` (`version_num`) VALUES
('6e967ed76cd6');

-- --------------------------------------------------------

--
-- Structure de la table `audit_logs`
--

CREATE TABLE IF NOT EXISTS `audit_logs` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `action` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `resource_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `resource_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `old_values` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `new_values` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ip_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `timestamp` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `campaigns`
--

CREATE TABLE IF NOT EXISTS `campaigns` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `campaign_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `target_audience` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reward_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reward_value` float DEFAULT NULL,
  `min_transaction_amount` float DEFAULT NULL,
  `max_reward_per_user` float DEFAULT NULL,
  `total_budget` float DEFAULT NULL,
  `spent_budget` float DEFAULT NULL,
  `start_date` datetime DEFAULT NULL,
  `end_date` datetime DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT NULL,
  `participants_count` int DEFAULT NULL,
  `total_rewards_given` float DEFAULT NULL,
  `created_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `campaign_participations`
--

CREATE TABLE IF NOT EXISTS `campaign_participations` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `campaign_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `transaction_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reward_earned` float DEFAULT NULL,
  `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `cards`
--

CREATE TABLE IF NOT EXISTS `cards` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `uid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `cities`
--

CREATE TABLE IF NOT EXISTS `cities` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `country_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `branch_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT NULL,
  `users` int DEFAULT NULL,
  `volume` float DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Déchargement des données de la table `cities`
--

INSERT INTO `cities` (`id`, `name`, `country_id`, `branch_code`, `is_active`, `users`, `volume`, `created_at`) VALUES
('018239e9-c0ef-44a1-a117-adc098635f5e', 'Thiès', '6f6fc0c4-f847-4a09-825c-98ede436b8a8', 'TIM-SN-THI', 1, 0, 0, '2025-10-06 10:02:55'),
('04093bdb-6b53-4276-8aa7-3f5d059d9c57', 'Tengréla', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-TEN', 1, 0, 0, '2025-10-25 13:09:25'),
('0b64ea14-cda0-4930-a85d-fff4dcb74cab', 'Sikensi', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-SIK', 1, 0, 0, '2025-10-25 13:09:25'),
('0be21f40-3e03-4bdd-b213-f89c2927b0f2', 'Grand-Béréby', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-GBE', 1, 0, 0, '2025-10-25 13:09:25'),
('0de1e899-659a-461d-88ac-d642e2209080', 'Minignan', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-MIN', 1, 0, 0, '2025-10-25 13:09:25'),
('11357005-b996-48dc-b863-2edb05974847', 'Plateau', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-PLT', 1, 0, 0, '2025-10-25 13:09:25'),
('1bd48e45-eddc-4af2-8b5b-0e3606895e8e', 'Grand-Lahou', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-GLA', 1, 0, 0, '2025-10-25 13:09:25'),
('1ebf3d86-3039-44bf-b652-cc520998aa71', 'Tiébissou', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-TIE', 1, 0, 0, '2025-10-25 13:09:25'),
('1fd094db-43e2-443f-87cf-fa81af1b8f60', 'Bouaflé', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-BFL', 1, 0, 0, '2025-10-25 13:09:25'),
('2047f3ba-b5f7-4d40-aee5-594c79010ace', 'Biankouma', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-BIA', 1, 0, 0, '2025-10-25 13:09:25'),
('20f35a3f-b577-49bb-9005-ed59440963cc', 'Lakota', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-LAK', 1, 0, 0, '2025-10-25 13:09:25'),
('2392e079-b682-448d-9007-d7a25a362ef7', 'Sassandra', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-SAS', 1, 0, 0, '2025-10-25 13:09:25'),
('27356e7a-cc50-488c-ab80-9fba1159a09b', 'Mankono', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-MNK', 1, 0, 0, '2025-10-25 13:09:25'),
('2785f9e3-70cc-47c3-bf65-7f9c964236d6', 'Daoukro', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-DAO', 1, 0, 0, '2025-10-25 13:09:25'),
('28cd27cb-b050-4cb8-adbb-8c7b71ae7993', 'Koumassi', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-KOU', 1, 0, 0, '2025-10-25 13:09:25'),
('29c171e1-a8a0-47a7-b4c7-06857e3e06c9', 'San-Pédro', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-SDP', 1, 0, 0, '2025-10-25 13:09:25'),
('2a430805-c875-4559-bf8b-e16d39d8aa60', 'Alépé', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-ALE', 1, 0, 0, '2025-10-25 13:09:25'),
('2b190a64-0308-41f1-a7d4-fbe4dbfd4ba6', 'Zuénoula', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-ZUE', 1, 0, 0, '2025-10-25 13:09:25'),
('2b2f4eb3-92bc-4f46-bbd2-9dda4f3551ac', 'Tanda', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-TAN', 1, 0, 0, '2025-10-25 13:09:25'),
('2cc5b710-51dd-4773-9d2f-8cd62126e288', 'Botro', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-BOT', 1, 0, 0, '2025-10-25 13:09:25'),
('329a093e-7129-413c-91bc-37a6a1831720', 'Dimbokro', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-DIM', 1, 0, 0, '2025-10-25 13:09:25'),
('32ce0d8f-7c80-45dc-957e-dcdbef991133', 'Korhogo', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-KOR', 1, 0, 0, '2025-10-25 13:09:25'),
('334601a4-b7c7-4489-b67c-a4202054165e', 'Séguéla', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-SEG', 1, 0, 0, '2025-10-25 13:09:25'),
('34b94053-7ef8-4838-8cac-98d03bb7c45f', 'Rubino', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-RUB', 1, 0, 0, '2025-10-25 13:09:25'),
('34d2dcfd-44d0-4d60-918b-0c3931679fbd', 'Dabou', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-DAB', 1, 0, 0, '2025-10-25 13:09:25'),
('37d57514-db7b-465d-aa24-97efe2a04874', 'Daloa', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-DAL', 1, 0, 0, '2025-10-25 13:09:25'),
('39dacd24-ac81-478b-aa68-2270763a8462', 'Jacqueville', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-JAC', 1, 0, 0, '2025-10-25 13:09:25'),
('3c145967-40ba-4991-9e45-d3c431992159', 'Dakar', '6f6fc0c4-f847-4a09-825c-98ede436b8a8', 'TIM-SN-DKR', 1, 0, 0, '2025-10-06 10:02:55'),
('420d31d6-96df-4890-a4d1-7aeee42bd671', 'Bamako', 'da76db7c-fb94-43c0-8515-cefeb7b771bd', 'TIM-ML-BAM', 1, 0, 0, '2025-10-06 10:02:55'),
('46a52772-c391-43a6-9dcf-85799b1bab31', 'Grand-Bassam', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-GBS', 1, 0, 0, '2025-10-25 13:09:25'),
('498d12e9-25c4-4dd1-b2d9-7e1c43713ba1', 'Odienné', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-ODI', 1, 0, 0, '2025-10-25 13:09:25'),
('4a43a634-282a-4b2f-b3e2-7f8700cd11a5', 'Oumé', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-OUM', 1, 0, 0, '2025-10-25 13:09:25'),
('4eb720d4-473d-4407-b7b8-18f66599d7f2', 'Ouangolodougou', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-OUA', 1, 0, 0, '2025-10-25 13:09:25'),
('5207aa2d-f5f1-456f-87e8-eaffc6058d92', 'Issia', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-ISS', 1, 0, 0, '2025-10-25 13:09:25'),
('552c0591-0287-4619-9bf7-0f37a51e0497', 'Bangolo', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-BAN', 1, 0, 0, '2025-10-25 13:09:25'),
('55989a6b-95cd-48e9-b0a8-2c6d00e44d6f', 'Abobo', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-ABO', 1, 0, 0, '2025-10-25 13:09:25'),
('58acf407-ebc1-4ff4-aec0-3693861e5901', 'Agnibilékrou', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-AGN', 1, 0, 0, '2025-10-25 13:09:25'),
('6046777f-879a-4093-85e7-84fb06484255', 'Katiola', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-KAT', 1, 0, 0, '2025-10-25 13:09:25'),
('61310ecd-00ad-48b5-923c-1c77483c9818', 'Treichville', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-TRE', 1, 0, 0, '2025-10-25 13:09:25'),
('653f5df1-9477-486d-8d02-53969757957b', 'Boundiali', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-BDI', 1, 0, 0, '2025-10-25 13:09:25'),
('655d9629-9554-40bd-be88-dc4aa1932cf9', 'Agboville', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-AGB', 1, 0, 0, '2025-10-25 13:09:25'),
('6924950a-e86e-44f5-bda8-060332dc91fa', 'Touba', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-TOU', 1, 0, 0, '2025-10-25 13:09:25'),
('69fa1bfe-3cd5-49f4-9dc0-1af0d67f76d8', 'Vavoua', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-VAV', 1, 0, 0, '2025-10-25 13:09:25'),
('6c995c84-d1ef-4e4a-995f-55769f5ea10e', 'Tiassalé', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-TIA', 1, 0, 0, '2025-10-25 13:09:25'),
('71e279cd-75d8-4e84-aaea-0ec7266de060', 'Bondoukou', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-BON', 1, 0, 0, '2025-10-25 13:09:25'),
('73dcb406-8f91-4486-a847-8c0e52a75ac0', 'Sakassou', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-SAK', 1, 0, 0, '2025-10-25 13:09:25'),
('76d0dfa5-591e-429a-8440-aa793f54557c', 'Gagnoa', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-GAG', 1, 0, 0, '2025-10-25 13:09:25'),
('76ec637d-8254-4626-84c3-d318cc02a971', 'Soubré', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-SOU', 1, 0, 0, '2025-10-25 13:09:25'),
('7ba39dc9-463a-409b-91bd-520ccce4a2dc', 'Béoumi', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-BEO', 1, 0, 0, '2025-10-25 13:09:25'),
('7c6319c1-0b88-4aec-8815-d60de3e7b72a', 'Bouna', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-BOU', 1, 0, 0, '2025-10-25 13:09:25'),
('7f3e0a4d-0aad-4bd1-a2da-ffa5cf998c7c', 'Kani', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-KAN', 1, 0, 0, '2025-10-25 13:09:25'),
('8017943b-abe4-4bf6-9a2d-9236a57d4249', 'Ayamé', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-AYA', 1, 0, 0, '2025-10-25 13:09:25'),
('84ae3c72-ef8d-403f-b35b-78afbc035849', 'Cocody', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-COC', 1, 0, 0, '2025-10-25 13:09:25'),
('86ab5ddc-92b9-479f-8e36-aa44d73068fc', 'Danané', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-DAN', 1, 0, 0, '2025-10-25 13:09:25'),
('90ecfddc-8469-487e-8be2-2cdff33ab152', 'Yamoussoukro', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-YAM', 1, 0, 0, '2025-10-06 10:02:55'),
('93615d7e-8f43-4dd0-8109-8ede37461a85', 'Sikasso', 'da76db7c-fb94-43c0-8515-cefeb7b771bd', 'TIM-ML-SIK', 1, 0, 0, '2025-10-06 10:02:55'),
('96640b32-209b-47fc-878a-09a5f0ea2707', 'Port-Bouët', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-PBO', 1, 0, 0, '2025-10-25 13:09:25'),
('987e4f1e-131c-44f0-90ce-808a8533dc94', 'Marcory', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-MAR', 1, 0, 0, '2025-10-25 13:09:25'),
('9a6a394f-e231-493c-9f59-d0c005154631', 'Bouaké', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-BKE', 1, 0, 0, '2025-10-06 10:02:55'),
('a8bc53d6-1652-499d-bcbc-93c0832bdbc1', 'Aboisso', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-ABI', 1, 0, 0, '2025-10-25 13:09:25'),
('aa00b012-3903-4970-a5cf-c8e9afb8b05e', 'Ferkessédougou', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-FER', 1, 0, 0, '2025-10-25 13:09:25'),
('aad21ccc-703c-46f6-abef-8c8c99e4bcd4', 'Yopougon', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-YOP', 1, 0, 0, '2025-10-25 13:09:25'),
('aadc0de4-d202-48aa-917c-6cd28e16b375', 'Gohitafla', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-GOH', 1, 0, 0, '2025-10-25 13:09:25'),
('ac07b0b9-0a06-4308-85fd-063d9ce93746', 'San Pedro', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-SPE', 1, 0, 0, '2025-10-06 10:02:55'),
('ac5a33d8-41f6-4414-974a-e23755032edf', 'Bingerville', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-BIN', 1, 0, 0, '2025-10-25 13:09:25'),
('ad0e5b36-4ed0-4def-9560-6c33531769aa', 'Facobly', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-FAC', 1, 0, 0, '2025-10-25 13:09:25'),
('b2b80f55-d9b7-44a4-8018-8830e3aab417', 'Grand-Bassam', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-GBA', 1, NULL, NULL, '2025-10-25 17:47:19'),
('b4d3e203-57ca-45dd-b457-dc384d9bb1d5', 'Zouan-Hounien', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-ZOU', 1, 0, 0, '2025-10-25 13:09:25'),
('b5863216-4137-4d05-a020-bcad631b1c3d', 'Anyama', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-ANY', 1, 0, 0, '2025-10-25 13:09:25'),
('b6807935-25c8-4926-8e3b-4e45945ffc2c', 'Divo', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-DIV', 1, 0, 0, '2025-10-25 13:09:25'),
('b71dce81-b87f-4705-9217-dad429e1dc01', 'Bongouanou', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-BGN', 1, 0, 0, '2025-10-25 13:09:25'),
('bd16bba5-8956-48d7-a98b-6f857f4c0cf5', 'Adjamé', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-ADJ', 1, 0, 0, '2025-10-25 13:09:25'),
('be4d2f60-b22e-46b7-bfe7-d2aff677f342', 'Songon', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-SON', 1, 0, 0, '2025-10-25 13:09:25'),
('c19f42d4-99f3-403e-9903-d075f0bc12d6', 'Tiapoum', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-TIP', 1, 0, 0, '2025-10-25 13:09:25'),
('c27a8937-aed9-4fd8-8a63-b28a0ab88ce5', 'Attécoubé', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-ATC', 1, 0, 0, '2025-10-25 13:09:25'),
('c3669f87-0ad6-4dd6-aba5-b3e7265dd62c', 'Abengourou', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-ABE', 1, 0, 0, '2025-10-25 13:09:25'),
('c3925cbe-fe61-40c6-a5a4-c5270feb1329', 'Toumodi', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-TOM', 1, 0, 0, '2025-10-25 13:09:25'),
('c81d1576-5a72-455b-97d1-f2031e3085f6', 'Abidjan', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-ABJ', 1, 0, 0, '2025-10-06 10:02:55'),
('cccfcc3a-36c6-4932-8aac-aa25b84bb05e', 'Man', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-MAN', 1, 0, 0, '2025-10-25 13:09:25'),
('cd4dad96-bb47-4af2-be89-ef92b3c1bc90', 'Adzopé', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-ADZ', 1, 0, 0, '2025-10-25 13:09:25'),
('d460cd92-f282-4225-abe0-850b17de5b83', 'Sinfra', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-SIN', 1, 0, 0, '2025-10-25 13:09:25'),
('d8b3579c-ed1a-47af-bf8e-855058998e31', 'Mbahiakro', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-MBA', 1, 0, 0, '2025-10-25 13:09:25'),
('d9c30089-fc31-4d0f-9ff9-588d29c60ddf', 'Saint-Louis', '6f6fc0c4-f847-4a09-825c-98ede436b8a8', 'TIM-SN-STL', 1, 0, 0, '2025-10-06 10:02:55'),
('df0044c0-2dc2-4d84-8df1-353d2c94af5d', 'Duékoué', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-DUK', 1, 0, 0, '2025-10-25 13:09:25'),
('edfdbb35-d148-4433-b84b-9d5da1660e9a', 'Dabakala', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-DBK', 1, 0, 0, '2025-10-25 13:09:25'),
('f548854a-cdee-4b0c-9337-2b72fe166696', 'Samatiguila', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-SAM', 1, 0, 0, '2025-10-25 13:09:25'),
('ff16a94e-63b4-4ef4-ba28-96ba1dcb9d32', 'Tabou', '33dac6d2-4a96-48a1-9376-448308e5b118', 'TIM-CI-TAB', 1, 0, 0, '2025-10-25 13:09:25');

-- --------------------------------------------------------

--
-- Structure de la table `commission_rates`
--

CREATE TABLE IF NOT EXISTS `commission_rates` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `rate_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` float NOT NULL,
  `category` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `min_amount` float DEFAULT NULL,
  `max_amount` float DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT NULL,
  `updated_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Déchargement des données de la table `commission_rates`
--

INSERT INTO `commission_rates` (`id`, `name`, `rate_type`, `value`, `category`, `description`, `min_amount`, `max_amount`, `is_active`, `updated_by`, `created_at`, `updated_at`) VALUES
('3d87ab8f-9d18-4b7d-9fe1-c10897761408', 'Commission TIM CASH Recharge', 'percentage', 0.02, 'recharge_cinetpay', 'Commission 2% TIM CASH sur recharges (CinetPay déduit automatiquement sa commission variable)', NULL, NULL, 1, 'admin@timcash.ci', '2025-10-26 13:44:29', '2025-11-09 14:22:05'),
('573535f7-bd91-4b67-9c8e-d8e0ba24e599', 'Intérêt Prêt SOS', 'percentage', 0.06, 'loan_interest', 'Taux d\'intérêt 6% sur les prêts SOS', NULL, NULL, 1, 'admin@timcash.ci', '2025-10-26 13:30:25', '2025-11-09 16:11:35'),
('5b487c7c-3d4c-4c0c-a55f-dc545b975991', 'Penalite Retard Pret', 'percentage', 0.15, 'loan_penalty', 'Penalite Retard Pret - 15.0%', NULL, NULL, 1, 'system', '2025-11-09 16:13:18', NULL),
('754beb1c-4acd-4590-9f90-26f2f3f823cd', 'Commission TIM BUSINESS Recharge', 'percentage', 0.1, 'recharge_business', 'Commission 10% sur recharges TIM BUSINESS (4% TIM BUSINESS + 6% TIM CASH)', NULL, NULL, 1, 'admin@timcash.ci', '2025-10-26 13:34:16', '2025-11-09 16:11:35');

-- --------------------------------------------------------

--
-- Structure de la table `countries`
--

CREATE TABLE IF NOT EXISTS `countries` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `currency` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `currency_symbol` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `flag` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT NULL,
  `total_users` int DEFAULT NULL,
  `total_volume` float DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Déchargement des données de la table `countries`
--

INSERT INTO `countries` (`id`, `name`, `code`, `currency`, `currency_symbol`, `flag`, `is_active`, `total_users`, `total_volume`, `created_at`) VALUES
('33dac6d2-4a96-48a1-9376-448308e5b118', 'Côte d\'Ivoire', 'CI', 'FCFA', 'FCFA', '🇨🇮', 1, 0, 0, '2025-10-06 10:02:55'),
('6f6fc0c4-f847-4a09-825c-98ede436b8a8', 'Sénégal', 'SN', 'FCFA', 'FCFA', '🇸🇳', 1, 0, 0, '2025-10-06 10:02:55'),
('da76db7c-fb94-43c0-8515-cefeb7b771bd', 'Mali', 'ML', 'FCFA', 'FCFA', '🇲🇱', 1, 0, 0, '2025-10-06 10:02:55');

-- --------------------------------------------------------

--
-- Structure de la table `device_capabilities`
--

CREATE TABLE IF NOT EXISTS `device_capabilities` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `device_model` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `brand` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `has_nfc` tinyint(1) DEFAULT NULL,
  `nfc_enabled` tinyint(1) DEFAULT NULL,
  `os_version` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_count` int DEFAULT NULL,
  `transaction_count` int DEFAULT NULL,
  `success_rate` float DEFAULT NULL,
  `location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `country` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_seen` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `feature_flags`
--

CREATE TABLE IF NOT EXISTS `feature_flags` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `is_enabled` tinyint(1) DEFAULT NULL,
  `rollout_percentage` float DEFAULT NULL,
  `target_users` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `target_countries` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `start_date` datetime DEFAULT NULL,
  `end_date` datetime DEFAULT NULL,
  `created_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `kyc_documents`
--

CREATE TABLE IF NOT EXISTS `kyc_documents` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `document_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `document_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `document_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `verification_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `verified_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `expiry_date` datetime DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `verified_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `loans`
--

CREATE TABLE IF NOT EXISTS `loans` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` float NOT NULL,
  `interest_rate` float DEFAULT NULL,
  `penalty_rate` float DEFAULT NULL,
  `remaining_balance` float NOT NULL,
  `monthly_payment` float NOT NULL,
  `total_payments` int NOT NULL,
  `payments_completed` int DEFAULT NULL,
  `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `due_date` datetime DEFAULT NULL,
  `days_overdue` int DEFAULT NULL,
  `guarantee_deposit` float DEFAULT NULL,
  `deposit_paid` tinyint(1) DEFAULT NULL,
  `auto_approved` tinyint(1) DEFAULT NULL,
  `wallet_credited` tinyint(1) DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `approved_at` datetime DEFAULT NULL,
  `document_recto` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `document_verso` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Déchargement des données de la table `loans`
--

INSERT INTO `loans` (`id`, `user_id`, `amount`, `interest_rate`, `penalty_rate`, `remaining_balance`, `monthly_payment`, `total_payments`, `payments_completed`, `status`, `due_date`, `days_overdue`, `guarantee_deposit`, `deposit_paid`, `auto_approved`, `wallet_credited`, `created_at`, `approved_at`, `document_recto`, `document_verso`) VALUES
('1bc21a6e-ec92-41a6-adc4-d6bbb5d0c87c', '419e303a-5c0a-441f-a927-26635934fa38', 5000, 0.06, 0.15, 5300, 5300, 1, 0, 'PENDING', '2025-11-08 09:56:14', 0, 0, 0, 0, 0, '2025-11-05 10:56:13', NULL, 'uploads/test_recto.jpg', 'uploads/test_verso.jpg'),
('a5b9f7d8-c04b-473c-ab0b-0a8fef7b7593', '5f40278c-b737-4f53-87f0-aac8c1b11af3', 5000, 0.06, 0.15, 5300, 5300, 1, 0, 'OVERDUE', '2025-11-08 10:29:03', 0, 0, 0, 0, 0, '2025-11-09 11:29:02', NULL, NULL, NULL),
('ca0e950b-58c5-4de3-8a53-a2efc7a98fdb', '497a06d8-0dfb-4120-8bdf-1ae4cc30a57a', 5000, 0.06, 0.15, 0, 5300, 1, 1, 'COMPLETED', '2025-11-12 10:29:02', 0, 0, 0, 0, 0, '2025-11-09 11:29:02', NULL, NULL, NULL),
('e2f6be07-86f9-4720-89fc-39212ff64434', '419e303a-5c0a-441f-a927-26635934fa38', 2000, 0.06, 0.15, 0, 0, 0, NULL, 'APPROVED', '2025-10-09 10:22:41', NULL, NULL, NULL, NULL, NULL, '2025-10-06 10:22:41', NULL, NULL, NULL),
('eed2ded4-4d71-4aa0-ba6a-53892df52d90', '212a7106-d9eb-4b24-a8ce-4c23610be9d6', 5000, 0.06, 0.15, 3300, 5300, 1, 0, 'APPROVED', '2025-11-12 10:29:03', 0, 0, 0, 0, 0, '2025-11-09 11:29:02', NULL, NULL, NULL);

-- --------------------------------------------------------

--
-- Structure de la table `loan_activation_fees`
--

CREATE TABLE IF NOT EXISTS `loan_activation_fees` (
  `id` varchar(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` varchar(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` float NOT NULL DEFAULT '12000',
  `status` enum('pending','paid','validated','expired') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `payment_reference` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `validated_by` varchar(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `validated_at` datetime DEFAULT NULL,
  `expires_at` datetime DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user_id` (`user_id`),
  KEY `idx_status` (`status`),
  KEY `idx_created_at` (`created_at`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `loan_profiles`
--

CREATE TABLE IF NOT EXISTS `loan_profiles` (
  `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `document_recto` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
  `document_verso` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
  `total_loans_taken` int DEFAULT '0',
  `total_loans_repaid` int DEFAULT '0',
  `total_amount_borrowed` float DEFAULT '0',
  `total_amount_repaid` float DEFAULT '0',
  `is_eligible_for_quick_loan` tinyint(1) DEFAULT '0',
  `last_loan_repaid_at` datetime DEFAULT NULL,
  `available_amounts` text COLLATE utf8mb4_unicode_ci,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`),
  KEY `idx_user_id` (`user_id`),
  KEY `idx_eligible` (`is_eligible_for_quick_loan`),
  KEY `idx_last_repaid` (`last_loan_repaid_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Déchargement des données de la table `loan_profiles`
--

INSERT INTO `loan_profiles` (`id`, `user_id`, `document_recto`, `document_verso`, `total_loans_taken`, `total_loans_repaid`, `total_amount_borrowed`, `total_amount_repaid`, `is_eligible_for_quick_loan`, `last_loan_repaid_at`, `available_amounts`, `created_at`, `updated_at`) VALUES
('b45f137e-fa14-4628-b5b6-5c6e4993d634', '419e303a-5c0a-441f-a927-26635934fa38', 'uploads/test_recto.jpg', 'uploads/test_verso.jpg', 2, 1, 7000, 2000, 1, '2025-10-06 10:22:41', '[5000, 10000, 15000, 20000, 30000, 40000, 50000]', '2025-11-12 18:36:49', '2025-11-12 18:36:49');

-- --------------------------------------------------------

--
-- Structure de la table `loyalty_programs`
--

CREATE TABLE IF NOT EXISTS `loyalty_programs` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `points_balance` int DEFAULT NULL,
  `tier_level` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `total_points_earned` int DEFAULT NULL,
  `total_points_redeemed` int DEFAULT NULL,
  `referral_count` int DEFAULT NULL,
  `last_activity` datetime DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `merchants`
--

CREATE TABLE IF NOT EXISTS `merchants` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `business_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `business_registration` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `category` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `city_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `latitude` float DEFAULT NULL,
  `longitude` float DEFAULT NULL,
  `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `website` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `logo_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_verified` tinyint(1) DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT NULL,
  `commission_rate` float DEFAULT NULL,
  `total_transactions` int DEFAULT NULL,
  `total_volume` float DEFAULT NULL,
  `rating` float DEFAULT NULL,
  `review_count` int DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `verified_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `merchant_reviews`
--

CREATE TABLE IF NOT EXISTS `merchant_reviews` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `merchant_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `rating` int NOT NULL,
  `comment` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `is_verified_purchase` tinyint(1) DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `nfc_card_transactions`
--

CREATE TABLE IF NOT EXISTS `nfc_card_transactions` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `card_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `transaction_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `operation_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `card_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `device_info` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `notifications`
--

CREATE TABLE IF NOT EXISTS `notifications` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `priority` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_read` tinyint(1) DEFAULT NULL,
  `action_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `amount` float DEFAULT NULL,
  `merchant` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `read_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Déchargement des données de la table `notifications`
--

INSERT INTO `notifications` (`id`, `user_id`, `title`, `message`, `type`, `priority`, `is_read`, `action_url`, `amount`, `merchant`, `created_at`, `read_at`) VALUES
('0b0970b5-1c47-4286-a3b6-1968be72ed79', '65e32534-82df-423c-8072-89c47c123e5b', 'Wallet crédité', 'Votre wallet a été crédité de 1500.0.', 'wallet_recharge', 'HIGH', 0, NULL, 1500, 'Kouassi ', '2025-10-07 19:06:46', NULL),
('73fac83c-4546-4f84-9c7b-c633d31bfa0f', '419e303a-5c0a-441f-a927-26635934fa38', 'Wallet débité', 'Votre wallet a été débité de 1680.0 pour recharger le client Yao Joel.', 'wallet_debit', 'HIGH', 0, NULL, 1680, 'Yao Joel', '2025-10-07 19:06:46', NULL);

-- --------------------------------------------------------

--
-- Structure de la table `products`
--

CREATE TABLE IF NOT EXISTS `products` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `merchant_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `product_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `price` float NOT NULL,
  `currency` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `image_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT NULL,
  `stock_quantity` int DEFAULT NULL,
  `min_purchase` float DEFAULT NULL,
  `max_purchase` float DEFAULT NULL,
  `commission_rate` float DEFAULT NULL,
  `total_sales` int DEFAULT NULL,
  `total_revenue` float DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `product_purchases`
--

CREATE TABLE IF NOT EXISTS `product_purchases` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `product_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `merchant_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `quantity` int DEFAULT NULL,
  `unit_price` float NOT NULL,
  `total_amount` float NOT NULL,
  `commission_amount` float DEFAULT NULL,
  `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reference` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `recipient_info` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `referrals`
--

CREATE TABLE IF NOT EXISTS `referrals` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `referrer_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `referred_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `referral_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reward_amount` float DEFAULT NULL,
  `conditions_met` tinyint(1) DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `completed_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `security_events`
--

CREATE TABLE IF NOT EXISTS `security_events` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `event_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `severity` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `ip_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `additional_data` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_resolved` tinyint(1) DEFAULT NULL,
  `resolved_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `resolved_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `support_messages`
--

CREATE TABLE IF NOT EXISTS `support_messages` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `ticket_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `sender_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_internal` tinyint(1) DEFAULT NULL,
  `attachments` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `support_tickets`
--

CREATE TABLE IF NOT EXISTS `support_tickets` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `assigned_to` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `subject` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `category` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `priority` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `resolution` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `satisfaction_rating` int DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `resolved_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `system_metrics`
--

CREATE TABLE IF NOT EXISTS `system_metrics` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `metric_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `metric_value` float NOT NULL,
  `metric_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `category` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `timestamp` datetime DEFAULT CURRENT_TIMESTAMP,
  `additional_data` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `transactions`
--

CREATE TABLE IF NOT EXISTS `transactions` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `transaction_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` float NOT NULL,
  `commission_amount` float DEFAULT NULL,
  `commission_rate` float DEFAULT NULL,
  `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `reference` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `external_reference` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_method` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `merchant_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `device_info` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `completed_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Déchargement des données de la table `transactions`
--

INSERT INTO `transactions` (`id`, `user_id`, `transaction_type`, `amount`, `commission_amount`, `commission_rate`, `status`, `description`, `reference`, `external_reference`, `payment_method`, `merchant_name`, `location`, `device_info`, `created_at`, `completed_at`) VALUES
('2416668f-1289-4ee4-9f18-afd90562478b', '419e303a-5c0a-441f-a927-26635934fa38', 'COMMISSION', 12000, 0, 0, 'COMPLETED', 'Prêt SOS - Prêt d\'urgence', NULL, NULL, NULL, NULL, NULL, NULL, '2025-10-07 10:40:55', NULL),
('3cc475d3-c2c7-4c78-b5a2-ccb25e131a9f', '212a7106-d9eb-4b24-a8ce-4c23610be9d6', 'REMBOURSEMENT_AUTO', 2000, 0, 0, 'COMPLETED', 'Remboursement automatique prêt eed2ded4 - Partiel', 'AUTO-REPAY-94b62bd0', 'eed2ded4-4d71-4aa0-ba6a-53892df52d90', NULL, NULL, NULL, NULL, '2025-11-09 11:29:02', '2025-11-09 10:29:03'),
('475954a0-f850-4215-b8b4-23b02fcda17c', '65e32534-82df-423c-8072-89c47c123e5b', 'RECHARGE_BY_BUSINESS', 1500, 300, 0.166667, 'COMPLETED', 'Recharge effectuée via Kouassi ', 'RCG-OUT-bd687755', 'bd687755-d738-4a04-ae9c-f1947923c999', NULL, NULL, NULL, NULL, '2025-10-07 19:06:45', NULL),
('50a84075-1520-4738-83be-62ecc02c5b92', 'system', 'MOBILE_TRANSFER', 837022000, 0, NULL, 'COMPLETED', 'Correction automatique du stock admin après migration mobile', 'STOCK-FIX-20251103132900', NULL, NULL, NULL, NULL, NULL, '2025-11-03 13:29:00', NULL),
('5778dfe9-8ac1-4b38-ae0e-0e927910a001', '419e303a-5c0a-441f-a927-26635934fa38', 'MOBILE_TRANSFER', 2120, 0, 0, 'PENDING', NULL, 'REPAY-e2f6be07', NULL, NULL, NULL, NULL, NULL, '2025-10-06 10:24:21', NULL),
('7d3ce945-77bb-4510-b309-89ced9305a28', '419e303a-5c0a-441f-a927-26635934fa38', 'COMMISSION', 12000, 0, 0, 'COMPLETED', 'Prêt SOS - Prêt d\'urgence', NULL, NULL, NULL, NULL, NULL, NULL, '2025-10-06 15:00:15', NULL),
('932d3ba2-c410-4558-93f6-4c80e8c6f4c9', '419e303a-5c0a-441f-a927-26635934fa38', 'PRET_MOBILE', 2000, 120, 0.06, 'COMPLETED', 'Prêt SOS - Prêt d\'urgence', 'LOAN-e2f6be07', 'e2f6be07-86f9-4720-89fc-39212ff64434', NULL, NULL, NULL, NULL, '2025-10-06 10:22:41', NULL),
('9b7fe3d7-d22b-4220-b1d8-b17b233d1c4a', '497a06d8-0dfb-4120-8bdf-1ae4cc30a57a', 'REMBOURSEMENT_AUTO', 5300, 0, 0, 'COMPLETED', 'Remboursement automatique prêt ca0e950b - Complet', 'AUTO-REPAY-49d618c5', 'ca0e950b-58c5-4de3-8a53-a2efc7a98fdb', NULL, NULL, NULL, NULL, '2025-11-09 11:29:02', '2025-11-09 10:29:03'),
('be196e12-d7c9-43e6-af07-d7aa7504521d', '7a7d020d-b1b4-11f0-a236-ace2d379c3d3', 'MOBILE_TRANSFER', 10000000, 0, 0, 'COMPLETED', 'pour alimenter les demandes de R-online (Ancien: 0 → Nouveau: 10,000,000 FCFA)', 'STOCK-SET-20251026115923', NULL, NULL, NULL, NULL, NULL, '2025-10-26 11:59:23', NULL),
('d7bf0ab7-12d8-4f7b-b17b-e942faa49d54', '419e303a-5c0a-441f-a927-26635934fa38', 'RECHARGE_BY_BUSINESS', -1680, 180, 0.107143, 'COMPLETED', 'Débit pour rechargement client Yao Joel', 'RCG-DEB-bd687755', 'bd687755-d738-4a04-ae9c-f1947923c999', NULL, NULL, NULL, NULL, '2025-10-07 19:06:45', NULL);

-- --------------------------------------------------------

--
-- Structure de la table `transaction_analytics`
--

CREATE TABLE IF NOT EXISTS `transaction_analytics` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `transaction_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `merchant_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `transaction_date` datetime DEFAULT NULL,
  `hour_of_day` int DEFAULT NULL,
  `day_of_week` int DEFAULT NULL,
  `month` int DEFAULT NULL,
  `year` int DEFAULT NULL,
  `amount_range` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `device_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `location_city` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `location_country` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_first_transaction` tinyint(1) DEFAULT NULL,
  `time_since_last_transaction` int DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `user_profiles`
--

CREATE TABLE IF NOT EXISTS `user_profiles` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `date_of_birth` datetime DEFAULT NULL,
  `gender` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `city_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `postal_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `occupation` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `monthly_income` float DEFAULT NULL,
  `emergency_contact_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `emergency_contact_phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `preferred_language` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `timezone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `avatar_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `kyc_status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `kyc_level` int DEFAULT NULL,
  `risk_score` float DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `virtual_card_prices`
--

CREATE TABLE IF NOT EXISTS `virtual_card_prices` (
  `id` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `card_color` enum('gold','amber','green','infinite','silver','black','blue','red','purple','orange') COLLATE utf8mb4_unicode_ci NOT NULL,
  `base_price` float NOT NULL DEFAULT '650',
  `tim_mini_price` float DEFAULT NULL,
  `tim_maxi_price` float DEFAULT NULL,
  `tim_business_price` float DEFAULT NULL,
  `commission_rate` float DEFAULT '0',
  `is_available` tinyint(1) DEFAULT '1',
  `is_premium` tinyint(1) DEFAULT '0',
  `max_purchases_per_user` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `card_color` (`card_color`),
  KEY `idx_card_color` (`card_color`),
  KEY `idx_is_available` (`is_available`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Déchargement des données de la table `virtual_card_prices`
--

INSERT INTO `virtual_card_prices` (`id`, `card_color`, `base_price`, `tim_mini_price`, `tim_maxi_price`, `tim_business_price`, `commission_rate`, `is_available`, `is_premium`, `max_purchases_per_user`, `created_at`, `updated_at`) VALUES
('53038842-bb17-11f0-bf7a-ace2d379c3d3', 'gold', 650, NULL, NULL, NULL, 0, 1, 0, NULL, '2025-11-06 13:48:49', '2025-11-06 13:48:49'),
('53038b37-bb17-11f0-bf7a-ace2d379c3d3', 'amber', 650, NULL, NULL, NULL, 0, 1, 0, NULL, '2025-11-06 13:48:49', '2025-11-06 13:48:49'),
('53038c79-bb17-11f0-bf7a-ace2d379c3d3', 'green', 650, NULL, NULL, NULL, 0, 1, 0, NULL, '2025-11-06 13:48:49', '2025-11-06 13:48:49'),
('53038d7a-bb17-11f0-bf7a-ace2d379c3d3', 'infinite', 650, NULL, NULL, NULL, 0, 1, 1, NULL, '2025-11-06 13:48:49', '2025-11-06 13:48:49'),
('53038e79-bb17-11f0-bf7a-ace2d379c3d3', 'blue', 500, NULL, NULL, NULL, 0, 0, 0, NULL, '2025-11-06 13:48:49', '2025-11-06 13:48:49'),
('53039009-bb17-11f0-bf7a-ace2d379c3d3', 'red', 500, NULL, NULL, NULL, 0, 0, 0, NULL, '2025-11-06 13:48:49', '2025-11-06 13:48:49'),
('530390fc-bb17-11f0-bf7a-ace2d379c3d3', 'purple', 500, NULL, NULL, NULL, 0, 0, 0, NULL, '2025-11-06 13:48:49', '2025-11-06 13:48:49'),
('530391df-bb17-11f0-bf7a-ace2d379c3d3', 'orange', 500, NULL, NULL, NULL, 0, 0, 0, NULL, '2025-11-06 13:48:49', '2025-11-06 13:48:49'),
('530392db-bb17-11f0-bf7a-ace2d379c3d3', 'silver', 1000, NULL, NULL, NULL, 0, 0, 0, NULL, '2025-11-06 13:48:49', '2025-11-06 13:48:49'),
('530393d8-bb17-11f0-bf7a-ace2d379c3d3', 'black', 3000, NULL, NULL, NULL, 0, 0, 0, NULL, '2025-11-06 13:48:49', '2025-11-06 13:48:49');

-- --------------------------------------------------------

--
-- Structure de la table `wallets`
--

CREATE TABLE IF NOT EXISTS `wallets` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `balance` float DEFAULT NULL,
  `max_balance` float DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT NULL,
  `nfc_enabled` tinyint(1) DEFAULT NULL,
  `currency` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Déchargement des données de la table `wallets`
--

INSERT INTO `wallets` (`id`, `user_id`, `balance`, `max_balance`, `is_active`, `nfc_enabled`, `currency`, `created_at`, `updated_at`) VALUES
('0128313e-26b5-484b-9252-0536d451b371', '65e32534-82df-423c-8072-89c47c123e5b', 1500, 2000000, 1, 1, 'FCFA', '2025-10-07 10:21:54', '2025-10-07 19:06:45'),
('0462a628-bb27-4bc0-aab0-286bed036558', '1f56775c-971b-4484-aa94-f0723e1bab5a', 0, 2000000, 1, 1, 'FCFA', '2025-10-06 15:12:08', NULL),
('051734b1-e7af-41be-8cb0-962da36d160f', '1081eb93-afb3-4026-87f1-66ba4690e348', 0, 2000000, 1, 1, 'FCFA', '2025-11-05 13:13:30', NULL),
('09c8b1c5-71ae-438e-888c-1137bfd99efe', '46637982-bb99-4ce7-a991-3d6e368d9313', 0, 2000000, 1, 1, 'FCFA', '2025-11-05 13:13:30', NULL),
('0c7de757-82b7-4cda-b9f3-c3b33c1c2c96', '32e5338d-f9fa-4a49-81db-f56dcb95b738', 0, 2000000, 1, 1, 'FCFA', '2025-11-05 13:13:30', NULL),
('23dccbd7-af32-44ce-9e35-6728981238e6', '3c8d103e-40b9-4c9f-8c05-d2f5f3c850b0', 0, 2000000, 1, 1, 'FCFA', '2025-11-05 13:13:30', NULL),
('2a9ed0c7-d8af-48d6-ab6f-a0c0ff116a78', 'd4345b19-5677-4226-93b1-e20f97fc48b2', 0, 2000000, 1, 1, 'FCFA', '2025-11-05 13:13:30', NULL),
('2c632ed5-9243-4229-b74f-54a66f723e89', '7c193211-9db1-421d-a64d-24dd387450ae', 0, 2000000, 1, 1, 'FCFA', '2025-11-05 13:13:30', NULL),
('4567b49e-9157-4f2b-afb9-ac37c388f7ed', 'a4c8f960-f5ff-4c38-b23d-8d5bac17cbd0', 0, 2000000, 1, 1, 'FCFA', '2025-11-05 13:13:30', NULL),
('500dfe1a-e8dd-4f67-83e5-a71047203b8a', '212a7106-d9eb-4b24-a8ce-4c23610be9d6', 0, 2000000, 1, 1, 'FCFA', '2025-11-09 11:29:02', NULL),
('57e41534-8a7b-42eb-9ee7-1be4a3deb27a', '7902fd66-6ac4-4b45-86f5-4ecc0ed56294', 0, 2000000, 1, 1, 'FCFA', '2025-11-05 13:13:30', NULL),
('5f2c1e6e-c9f6-47e2-ba2c-1dc73a6784bd', '342856de-2def-43ee-bfc1-7074d78cf92e', 0, 2000000, 1, 1, 'FCFA', '2025-11-05 13:13:30', NULL),
('67e0f1b9-1500-4c46-8abb-a4ef9d440126', '4df1393f-8dcf-4fc0-bd79-28f88d64e07d', 0, 2000000, 1, 1, 'FCFA', '2025-11-09 11:28:26', NULL),
('7bcb85e7-aa21-40ad-916b-645749cb56de', 'efa595b2-0e1f-4079-9095-48d63eec98e3', 0, 2000000, 1, 1, 'FCFA', '2025-11-05 13:13:31', NULL),
('7be1a372-108e-42e7-8732-1558270c4aa8', 'b11220dd-a7fc-4f31-ae98-7b295a0c2876', 0, 2000000, 1, 1, 'FCFA', '2025-11-05 13:13:30', NULL),
('7c5e867d-20d9-4440-910d-ad5fb36f3989', '02715d6d-aab1-433c-a6ce-65e348f626f5', 0, 2000000, 1, 1, 'FCFA', '2025-11-09 11:28:26', NULL),
('829e0fa8-b0dd-4d8a-84d8-6e7c6ecbaa4e', '5f40278c-b737-4f53-87f0-aac8c1b11af3', 0, 2000000, 1, 1, 'FCFA', '2025-11-09 11:29:02', NULL),
('852ca0f0-fcbb-4cbf-b650-45e2d73ac626', '5b558aed-9e48-455c-a8ce-68ae19ef9f80', 0, 2000000, 1, 1, 'FCFA', '2025-11-05 13:13:30', NULL),
('87d9ab83-9285-43ac-999b-e9081e9d2e4c', '39e9c67d-99ae-409e-b76e-bd22df20953c', 0, 2000000, 1, 1, 'FCFA', '2025-11-05 13:13:30', NULL),
('97776e35-c461-44bc-8431-55201dc8a842', '51fd2994-78aa-4f1b-8a10-9e116b0d6dfd', 0, 2000000, 1, 1, 'FCFA', '2025-11-05 13:13:30', NULL),
('a6f95001-52a6-4bce-ad3c-e65820d92d52', 'da9bd2b5-c3eb-4a58-b3e8-4d1430eabdba', 0, 2000000, 1, 1, 'FCFA', '2025-11-05 13:13:31', NULL),
('a90adbad-4568-40fd-b380-b9df3c56bc6c', '21fe78f4-85eb-4c7f-b7c6-a3229636b3b7', 0, 2000000, 1, 1, 'FCFA', '2025-11-05 13:13:30', NULL),
('aa70ebe3-2002-4390-b593-81bb4ca3a424', '6d9dc18b-4f1b-403e-81e3-2d9a6f7b90e8', 0, 2000000, 1, 1, 'FCFA', '2025-11-05 13:13:30', NULL),
('b039d243-aeb2-4dec-9fcd-0e6439a10dd2', '0cf5a971-95fc-4f96-be4d-d01bbbce524a', 0, 2000000, 1, 1, 'FCFA', '2025-11-05 13:13:30', NULL),
('b1cb4281-9ee8-49db-8e3b-405d91c5ed30', 'bfc3802e-8a97-4808-8cf2-2cb3f83e7e4b', 0, 2000000, 1, 1, 'FCFA', '2025-11-05 13:13:30', NULL),
('b6253e15-b52a-43b6-b904-2dbfaaf023a9', '0370881b-523d-4be7-9bea-c6c2ca7b277b', 0, 2000000, 1, 1, 'FCFA', '2025-11-05 13:13:30', NULL),
('b731d5bd-2157-423a-aae0-1e35d592693d', '5187e120-bf3b-4d37-a5c9-d410100b7207', 0, 2000000, 1, 1, 'FCFA', '2025-11-05 13:13:30', NULL),
('b82e8f6e-f193-43a3-bd15-c6515527cafe', 'ea954334-034f-42bb-b0eb-534c43ffae7e', 0, 2000000, 1, 1, 'FCFA', '2025-11-09 11:28:25', NULL),
('cf668eb1-4cd2-4a36-ba36-6876e91bfb38', '497a06d8-0dfb-4120-8bdf-1ae4cc30a57a', 0, 2000000, 1, 1, 'FCFA', '2025-11-09 11:29:02', NULL),
('d6336fa3-0c90-4429-8612-17ba8785e563', '29429ae0-858e-4fc7-977f-3c7f8e83c988', 0, 2000000, 1, 1, 'FCFA', '2025-11-05 13:13:30', NULL),
('df612582-1ea0-48ca-8b26-0d33be2105a4', 'dfaf6aa1-f7c4-46fa-a68b-020931fbb39b', 0, NULL, 1, 1, 'FCFA', '2025-10-06 12:43:19', NULL),
('e0e2670c-0ad7-4da1-b8e6-5564e1832769', '7a7d020d-b1b4-11f0-a236-ace2d379c3d3', 0, 2000000, 1, 1, 'FCFA', '2025-10-25 17:09:22', NULL),
('e38dcc15-4e56-43c6-a2f4-5c8a84c73d7c', '52e44f93-33c3-49ee-b770-f723555f9d3a', 0, 2000000, 1, 1, 'FCFA', '2025-11-05 13:13:30', NULL),
('f44190c0-8bc7-4dd2-8128-1c96745f1d96', '419e303a-5c0a-441f-a927-26635934fa38', 320, NULL, 1, 1, 'FCFA', '2025-10-06 10:20:31', '2025-10-07 19:06:45');

-- --------------------------------------------------------

--
-- Structure de la table `workflows`
--

CREATE TABLE IF NOT EXISTS `workflows` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `category` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `triggers` int DEFAULT NULL,
  `executions` int DEFAULT NULL,
  `success_rate` float DEFAULT NULL,
  `steps` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `last_run` datetime DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Contraintes pour les tables déchargées
--

--
-- Contraintes pour la table `loan_profiles`
--
ALTER TABLE `loan_profiles`
  ADD CONSTRAINT `loan_profiles_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
COMMIT;

