-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1
-- Généré le : sam. 14 mars 2026 à 04:13
-- Version du serveur : 10.4.32-MariaDB
-- Version de PHP : 8.2.12

START TRANSACTION;



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

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

--
-- Structure de la table `abonnements`
--

CREATE TABLE `abonnements` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `client_id` bigint(20) UNSIGNED NOT NULL,
  `type_abonnement` int(11) NOT NULL,
  `prix` decimal(10,2) NOT NULL,
  `date_debut` date NOT NULL,
  `date_fin` date NOT NULL,
  `statut` enum('Actif','En attente','Expiré','Résilié') NOT NULL DEFAULT 'Actif',
  `facture_path` varchar(255) DEFAULT NULL,
  `engin_type` varchar(255) DEFAULT NULL,
  `engin_immatriculation` varchar(255) DEFAULT NULL,
  `gps_numero` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `abonnements` (`id`, `client_id`, `type_abonnement`, `prix`, `date_debut`, `date_fin`, `statut`, `facture_path`, `engin_type`, `engin_immatriculation`, `gps_numero`, `created_at`, `updated_at`) VALUES
(57, 46, 4, 8000.00, '2026-03-13', '2026-07-13', 'Actif', NULL, 'Moto', 'BP2323', '+228 93543842', '2026-03-13 15:13:41', '2026-03-14 02:03:52'),
(71, 24, 2, 4000.00, '2026-03-14', '2026-05-14', 'Actif', NULL, 'Voiture', 'BP2389', '+228 93543842', '2026-03-14 02:06:14', '2026-03-14 02:06:14'),
(72, 24, 2, 4000.00, '2025-01-14', '2025-03-14', 'Actif', NULL, 'Voiture', 'BP2323', 'GPS 259785', '2026-03-14 02:08:25', '2026-03-14 02:08:25'),
(73, 37, 1, 2000.00, '2026-02-14', '2026-03-14', 'Actif', NULL, 'Voiture', 'BP2323', '+228 93543842', '2026-03-14 02:32:01', '2026-03-14 02:32:01'),
(74, 37, 1, 2000.00, '2026-03-14', '2026-04-14', 'Actif', NULL, 'Voiture', 'BP2323', '+228 93543842', '2026-03-14 02:33:34', '2026-03-14 02:33:34');

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

--
-- Structure de la table `alertes`
--

CREATE TABLE `alertes` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `client_id` bigint(20) UNSIGNED NOT NULL,
  `abonnement_id` bigint(20) UNSIGNED NOT NULL,
  `type` varchar(255) NOT NULL,
  `message` text NOT NULL,
  `statut` enum('lu','non lu') NOT NULL DEFAULT 'non lu',
  `date_envoi` datetime NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Structure de la table `clients`
--

CREATE TABLE `clients` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `nom` varchar(255) NOT NULL,
  `prenom` varchar(255) NOT NULL,
  `contact` varchar(255) NOT NULL,
  `contact_2` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `adresse` text NOT NULL,
  `engin_type` varchar(255) DEFAULT NULL,
  `engin_immatriculation` varchar(255) DEFAULT NULL,
  `gps_numero` varchar(255) DEFAULT NULL,
  `agent_id` bigint(20) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `clients` (`id`, `nom`, `prenom`, `contact`, `contact_2`, `email`, `adresse`, `engin_type`, `engin_immatriculation`, `gps_numero`, `agent_id`, `created_at`, `updated_at`) VALUES
(19, 'ADA', 'Nina', '79447163', NULL, NULL, 'LEGBASSITO', NULL, NULL, NULL, 3, '2025-10-10 11:17:13', '2026-03-13 14:47:05'),
(24, 'jerome', 'yawo', '91505051', NULL, 'yawonoumatekpo@gmail.com', 'Togo-lome', NULL, NULL, NULL, 3, '2026-03-10 20:47:21', '2026-03-10 20:47:21'),
(37, 'AZAVI', 'Petit', '91505051', NULL, 'noumatekpojerome@gmail.com', 'GHANA', NULL, NULL, NULL, 3, '2026-03-10 23:21:27', '2026-03-12 23:21:54'),
(38, 'KOKOROKO', 'Komla', '90101001', NULL, 'kokorokokomla@gmailcom', 'TOGO-Lomé', NULL, NULL, NULL, 7, '2026-03-11 15:36:42', '2026-03-11 15:36:42'),
(39, 'yawo', 'koffi', '98652565', NULL, NULL, 'Lome', NULL, NULL, NULL, 7, '2026-03-11 17:44:12', '2026-03-11 17:44:12'),
(40, 'AVISSI', 'Man', '91505051', NULL, 'yawo.noumatekpo@itcSolutionspro.com', 'TOGO', NULL, NULL, NULL, 3, '2026-03-12 01:09:58', '2026-03-12 01:09:58'),
(43, 'BADJONDA', 'Guemba Junior', '+228 93 70 27 81', NULL, 'badjondaguembajunior@gmail.com', 'TOGO-Agoe-Legbassito', NULL, NULL, NULL, 3, '2026-03-12 16:19:58', '2026-03-12 16:19:58'),
(44, 'KAMASAN', 'Olivier', '91505051', NULL, 'itcsolutionspro@gmail.com', 'Togo-lome', NULL, NULL, NULL, 3, '2026-03-12 23:24:30', '2026-03-12 23:24:30'),
(45, 'AGOSSOU', 'Komla', '98754563', NULL, 'noumatekpoyawo@gmail.com', 'Togo', NULL, NULL, NULL, 3, '2026-03-12 23:29:12', '2026-03-12 23:29:12'),
(46, 'NGUECHOUNG', 'Arnold', '97167199', NULL, 'nguechoungarnold@gmail.com', 'TOGO-Agoe', NULL, NULL, NULL, 3, '2026-03-13 15:12:12', '2026-03-13 15:25:19');

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

--
-- Structure de la table `migrations`
--

CREATE TABLE `migrations` (
  `id` int(10) UNSIGNED NOT NULL,
  `migration` varchar(255) NOT NULL,
  `batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2025_09_01_144614_create_users_table', 1),
(2, '2025_09_01_144615_create_clients_table', 1),
(3, '2025_09_01_144616_create_abonnements_table', 1),
(4, '2025_09_01_144616_create_paiements_table', 1),
(5, '2025_09_01_144627_create_alertes_table', 1),
(6, '2025_09_01_163222_create_sessions_table', 2),
(7, '2025_09_01_234300_add_facture_path_to_paiements_table', 3),
(8, '2025_10_09_172744_add_engin_fields_to_abonnements_table', 4),
(9, '2025_10_09_175619_make_engin_fields_nullable_in_clients_table', 5),
(10, '2026_03_09_171422_create_cache_table', 6),
(11, '2025_10_15_000000_add_email_to_clients_table', 7),
(12, '2026_03_11_161313_add_is_active_to_users_table', 8),
(13, '2026_03_11_165813_add_commission_to_users_table', 9),
(14, '2026_03_14_024654_add_contact_2_to_clients_table', 10);

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

--
-- Structure de la table `paiements`
--

CREATE TABLE `paiements` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `abonnement_id` bigint(20) UNSIGNED NOT NULL,
  `montant` decimal(10,2) NOT NULL,
  `date_paiement` date NOT NULL,
  `methode_paiement` varchar(255) NOT NULL,
  `reference` varchar(255) DEFAULT NULL,
  `facture_path` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `paiements` (`id`, `abonnement_id`, `montant`, `date_paiement`, `methode_paiement`, `reference`, `facture_path`, `created_at`, `updated_at`) VALUES
(40, 57, 2000.00, '2026-03-14', 'Mobile Money', '25642', NULL, '2026-03-14 02:04:37', '2026-03-14 02:04:37'),
(41, 71, 2000.00, '2026-03-14', 'Mobile Money', '9865320', NULL, '2026-03-14 02:06:51', '2026-03-14 02:06:51');

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

--
-- Structure de la table `sessions`
--

CREATE TABLE `sessions` (
  `id` varchar(255) NOT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text DEFAULT NULL,
  `payload` longtext NOT NULL,
  `last_activity` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `sessions` (`id`, `user_id`, `ip_address`, `user_agent`, `payload`, `last_activity`) VALUES
('6ugyAHMymbJiip6c2j2RmrWc3t5rXHYJLMk7YXpu', 3, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36', 'YTo1OntzOjY6Il90b2tlbiI7czo0MDoibmU3MzBuYXJad3M2Z2NRVnVBMXF4VU5DZXBWWko4RHpmRFRqTzU5ciI7czozOiJ1cmwiO2E6MDp7fXM6OToiX3ByZXZpb3VzIjthOjI6e3M6MzoidXJsIjtzOjMxOiJodHRwOi8vMTI3LjAuMC4xOjgwMDAvZGFzaGJvYXJkIjtzOjU6InJvdXRlIjtzOjk6ImRhc2hib2FyZCI7fXM6NjoiX2ZsYXNoIjthOjI6e3M6Mzoib2xkIjthOjA6e31zOjM6Im5ldyI7YTowOnt9fXM6NTA6ImxvZ2luX3dlYl81OWJhMzZhZGRjMmIyZjk0MDE1ODBmMDE0YzdmNThlYTRlMzA5ODlkIjtpOjM7fQ==', 1773448823),
('ARH5rdxBIZssdl0FzHA2YXmdk2OogjRPi8Kr614n', 3, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36', 'YTo1OntzOjY6Il90b2tlbiI7czo0MDoiUWhIRWlEaENuUWF2bUltRlJRcndleXRITk91R0hwZ2tGWnU3Rm9tViI7czozOiJ1cmwiO2E6MDp7fXM6OToiX3ByZXZpb3VzIjthOjI6e3M6MzoidXJsIjtzOjU5OiJodHRwOi8vMTI3LjAuMC4xOjgwMDAvY2xpZW50cy9qV0RCVkRaZHY1L2Fib25uZW1lbnRzL2NyZWF0ZSI7czo1OiJyb3V0ZSI7czoxODoiYWJvbm5lbWVudHMuY3JlYXRlIjt9czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo1MDoibG9naW5fd2ViXzU5YmEzNmFkZGMyYjJmOTQwMTU4MGYwMTRjN2Y1OGVhNGUzMDk4OWQiO2k6Mzt9', 1773457456),
('G2RZvdg1YlW6VA3imfBRnrLbao29dizZ3V5gFwM7', 3, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36', 'YTo1OntzOjY6Il90b2tlbiI7czo0MDoiTWVma0g1YzdJM1VHaE5tSGFpWFBmYkJhU0U3UlFnOGxHNEZIVHc3MyI7czozOiJ1cmwiO2E6MDp7fXM6OToiX3ByZXZpb3VzIjthOjI6e3M6MzoidXJsIjtzOjMxOiJodHRwOi8vMTI3LjAuMC4xOjgwMDAvZGFzaGJvYXJkIjtzOjU6InJvdXRlIjtzOjk6ImRhc2hib2FyZCI7fXM6NjoiX2ZsYXNoIjthOjI6e3M6Mzoib2xkIjthOjA6e31zOjM6Im5ldyI7YTowOnt9fXM6NTA6ImxvZ2luX3dlYl81OWJhMzZhZGRjMmIyZjk0MDE1ODBmMDE0YzdmNThlYTRlMzA5ODlkIjtpOjM7fQ==', 1773451498),
('gvDAuwFNplezHXlb9WpmmsXrJCxdVFv6s7fNQJyH', NULL, '127.0.0.1', 'Symfony', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoiajhGZVZqQjF5NVZ4SnA1bHFKdkk5am5aM3BJRWJYSUZSUWV2MWNKbyI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6MjE6Imh0dHA6Ly9sb2NhbGhvc3Q6ODAwMCI7czo1OiJyb3V0ZSI7Tjt9czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319fQ==', 1773446982),
('vutxNC2dqaP9Tw5YsMw3vqSapPKJhstnHmZgE0yx', NULL, '127.0.0.1', 'Symfony', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoiT0ZZWEdoQ0lMcEhTV3FGRkJEelA4WDVRQnJQYWZraHl4M1JzZGFmQyI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6Mjc6Imh0dHA6Ly9sb2NhbGhvc3Q6ODAwMC9sb2dpbiI7czo1OiJyb3V0ZSI7czo1OiJsb2dpbiI7fXM6NjoiX2ZsYXNoIjthOjI6e3M6Mzoib2xkIjthOjA6e31zOjM6Im5ldyI7YTowOnt9fX0=', 1773446982);

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

--
-- Index pour la table `abonnements`
--
ALTER TABLE `abonnements`
  ADD PRIMARY KEY (`id`),
  ADD KEY `abonnements_client_id_foreign` (`client_id`);

--
-- Index pour la table `alertes`
--
ALTER TABLE `alertes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `alertes_client_id_foreign` (`client_id`),
  ADD KEY `alertes_abonnement_id_foreign` (`abonnement_id`);

--
-- Index pour la table `clients`
--
ALTER TABLE `clients`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `clients_email_unique` (`email`),
  ADD KEY `clients_agent_id_foreign` (`agent_id`);

--
-- Index pour la table `migrations`
--
ALTER TABLE `migrations`
  ADD PRIMARY KEY (`id`);

--
-- Index pour la table `paiements`
--
ALTER TABLE `paiements`
  ADD PRIMARY KEY (`id`),
  ADD KEY `paiements_abonnement_id_foreign` (`abonnement_id`);

--
-- Index pour la table `sessions`
--
ALTER TABLE `sessions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sessions_user_id_index` (`user_id`),
  ADD KEY `sessions_last_activity_index` (`last_activity`);

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

--
-- AUTO_INCREMENT pour la table `abonnements`
--
ALTER TABLE `abonnements`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=75;

--
-- AUTO_INCREMENT pour la table `alertes`
--
ALTER TABLE `alertes`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `clients`
--
ALTER TABLE `clients`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=48;

--
-- AUTO_INCREMENT pour la table `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT pour la table `paiements`
--
ALTER TABLE `paiements`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=42;

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

--
-- Contraintes pour la table `abonnements`
--
ALTER TABLE `abonnements`
  ADD CONSTRAINT `abonnements_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE;

--
-- Contraintes pour la table `alertes`
--
ALTER TABLE `alertes`
  ADD CONSTRAINT `alertes_abonnement_id_foreign` FOREIGN KEY (`abonnement_id`) REFERENCES `abonnements` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `alertes_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE;

--
-- Contraintes pour la table `clients`
--
ALTER TABLE `clients`
  ADD CONSTRAINT `clients_agent_id_foreign` FOREIGN KEY (`agent_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Contraintes pour la table `paiements`
--
ALTER TABLE `paiements`
  ADD CONSTRAINT `paiements_abonnement_id_foreign` FOREIGN KEY (`abonnement_id`) REFERENCES `abonnements` (`id`) ON DELETE CASCADE;
COMMIT;

