--
-- Host: localhost    Database: Gestionnaire
-- ------------------------------------------------------


--
-- Table structure for table `mm_audit_log`
--

CREATE TABLE `mm_audit_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `action` varchar(50) NOT NULL,
  `table_name` varchar(50) DEFAULT NULL,
  `record_id` int(11) DEFAULT NULL,
  `old_values` text DEFAULT NULL,
  `new_values` text DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `mm_audit_log`
--


--
-- Table structure for table `mm_caisses`
--

CREATE TABLE `mm_caisses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `code` varchar(20) NOT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT 1,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `code` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `mm_caisses`
--

INSERT INTO `mm_caisses` VALUES
(1,'Caisse Sbeitla','SBEITLA','Caisse principale de Sbeitla',1,'2026-03-05 17:24:26'),
(2,'Caisse Kasserine','KASSERINE','Caisse principale de Kasserine',1,'2026-03-05 17:24:26');

--
-- Table structure for table `mm_permissions`
--

CREATE TABLE `mm_permissions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `module` varchar(50) NOT NULL,
  `can_view` tinyint(1) DEFAULT 0,
  `can_admin` tinyint(1) DEFAULT 0,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_user_module` (`user_id`,`module`),
  CONSTRAINT `mm_permissions_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `mm_users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `mm_permissions`
--

INSERT INTO `mm_permissions` VALUES
(1,1,'caisse',1,1,'2026-03-05 17:24:26'),
(3,1,'staff',1,1,'2026-03-05 17:24:26'),
(5,2,'caisse',1,0,'2026-03-18 11:29:07'),
(6,2,'staff',1,0,'2026-03-18 11:29:22');

--
-- Table structure for table `mm_staff`
--

CREATE TABLE `mm_staff` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(20) NOT NULL,
  `full_name` varchar(100) NOT NULL,
  `email` varchar(100) DEFAULT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `position` varchar(100) DEFAULT NULL,
  `department` varchar(100) DEFAULT NULL,
  `hire_date` date DEFAULT NULL,
  `salary` decimal(10,2) DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT 1,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `last_name` varchar(100) DEFAULT NULL,
  `first_name` varchar(100) DEFAULT NULL,
  `contract_type` varchar(50) DEFAULT NULL,
  `company` varchar(100) DEFAULT NULL,
  `contract_start` date DEFAULT NULL,
  `contract_end` date DEFAULT NULL,
  `real_salary` decimal(10,2) DEFAULT NULL,
  `declared_salary` decimal(10,2) DEFAULT NULL,
  `bank` varchar(100) DEFAULT NULL,
  `rib` varchar(50) DEFAULT NULL,
  `cin` varchar(50) DEFAULT NULL,
  `cin_copy` varchar(10) DEFAULT NULL,
  `diploma` varchar(200) DEFAULT NULL,
  `diploma_copy` varchar(10) DEFAULT NULL,
  `diploma_date` date DEFAULT NULL,
  `photo` varchar(10) DEFAULT NULL,
  `cv` varchar(10) DEFAULT NULL,
  `address` text DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `code` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=276 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `mm_staff`
--

INSERT INTO `mm_staff` VALUES
(233,'1','saadaly zied','zied.saadli@topgeo.net','98654321','Technicien Topography','Topography','2026-03-01',1000.00,1,'2026-03-13 14:47:14','2026-03-18 10:18:25','zied','saadaly','SIVP','TOPGEO','2026-03-01','2026-03-25',1000.00,997.00,'atb','9876543110','12684689','','Topographie','','2026-03-01','','','Tunis, Tunisie'),
(234,'2','MANEL  TOUMI',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','TOUMI ','MANEL ','CDI','TOPGEO',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(235,'3','AHLEM  ZERAI','ahlemzerai39@gmail.com','95822598',NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','ZERAI',' AHLEM ','SIVP','TOPGEO',NULL,NULL,NULL,NULL,'poste',NULL,'12699516',NULL,'master géophisique',NULL,NULL,NULL,NULL,'al ayoun'),
(236,'4','YASSINE  MSAHLI',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','MSAHLI ','YASSINE ','SIVP','TOPGEO',NULL,NULL,NULL,NULL,'poste','17  60 6000 000 37 15 61 43 6','90094036',NULL,'bac ',NULL,NULL,NULL,NULL,'sbietla'),
(237,'5','ASSIL AOUINI',NULL,'22273315',NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','AOUINI','ASSIL','SIVP','TOPGEO',NULL,NULL,NULL,NULL,'poste','17  00 1000 000 364 622 606 ','9530289',NULL,'BAC+3 GEOMA',NULL,NULL,NULL,'**','BORJ ELAMRI'),
(238,'6','OUNALLAH RAYERN',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','RAYERN ','OUNALLAH','SIVP','TOPGEO',NULL,NULL,NULL,NULL,'poste','1700  2000  000  36 46 22 164','14435822',NULL,'TOPO BAC+3',NULL,NULL,NULL,'**','NABEUL'),
(239,'7','JALLALI ISLEM',NULL,'56144183',NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','ISLEM ','JALLALI','SIVP','TOPGEO',NULL,NULL,NULL,NULL,'POSTE','170  61 000 000 366 18 58 58 ','14351933',NULL,'carthographie ',NULL,NULL,NULL,NULL,'TUNIS'),
(240,'8','ACHACH  ASMA',NULL,'28444718',NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','ASMA ','ACHACH ','SIVP','TOPGEO',NULL,NULL,NULL,NULL,'poste','17  90 1000 000 329  78 17 07','13499178',NULL,'Ing géeomatique ',NULL,NULL,NULL,NULL,'mednin'),
(241,'9','CHOUIKHI HAMZA',NULL,'27049366',NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','HAMZA ','CHOUIKHI','SIVP','TOPGEO',NULL,NULL,NULL,NULL,'poste','17 00 1000  000 36  75 11 945','13477169',NULL,'CIVIL',NULL,NULL,NULL,'**','mednin'),
(242,'10','BADAIY KORTLI',NULL,'95962272',NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','KORTLI ','BADAIY','CIAP','TOPGEO',NULL,NULL,NULL,NULL,'POSTE','17 60 6000 000 35 909 34 44','12718533',NULL,'9 emme',NULL,NULL,NULL,NULL,'alayoun kasserine '),
(243,'11','ACHREF KORTLI',NULL,'92405017',NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','KORTLI ','ACHREF','SIVP','TOPGEO',NULL,NULL,NULL,NULL,'poste','17 60 6000 000 366 786 805','12694040',NULL,'BAC+3',NULL,NULL,NULL,NULL,'alayoun kasserine '),
(244,'12','ANIS  KORTLI',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','KORTLI ','ANIS ','CDI','TOPGEO',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(245,'26','MARIEM SADOUR',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','SADOUR ','MARIEM','CDI','TOPGEO INT',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(246,'36','AYOUB  JARBOUAI',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','JARBOUAI ','AYOUB ','SIVP','TOPGEO',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(247,'13','tambohawet wided',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','wided ','tambohawet','en cours Bureau emploi','TOPGEO',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(248,'14','omar maram',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','maram ','omar','en cours Bureau emploi','TOPGEO',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(249,'15','SABRINNE  SAHRAOUI',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','SAHRAOUI ','SABRINNE ','en cours karama','TOPGEO',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(250,'16','SAMAR GHAOUI',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','GHAOUI',' SAMAR','karama en cours','TOPGEO',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(251,'17','MOUNA BALTI',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','BALTI ','MOUNA','contrat sivp a fini le 19 janvier 2026 nous att...','EDF',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(252,'20','AMANI  HAJJI',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','ELHAJ','HAYET','contrat sivp a fini le 19 janvier 2026 nous att...','EDF',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(253,'32','OUMAYMA  AMRI',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','AMRI ','OUMAYMA ','contrat sivp a fini le 23 janvier 2026 nous att...',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(254,'18','_ ZAINEB',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','ZAINEB ','_','en attente de la réception du diplôme ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(255,'19','_ NOUR',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','NOUR ','_','en attente de la réception du diplôme ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(256,'21','BACHIR  SOUISSI',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','SOUISSI ','BACHIR ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(257,'22','fakher klidi',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','klidi ','fakher','en cours','TOPGEO',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(258,'39','ZAKRANNI  RIMA',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','RIMA','ZAKRANNI ','karama  en cours manque attestation de solde ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(259,'23','MHREZ  HRIZI',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','HRIZI ','MHREZ ','sans contrat',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(260,'24','LOUNICI  KORTLI',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','KORTLI ','LOUNICI ','sans contrat',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(261,'25','HAMZA  CHEBBI',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','CHEBBI ','HAMZA ','sans contrat',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(262,'33','HOUCEM  BOUALAGUI',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','BOUALAGUI ','HOUCEM ','sans contrat',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'**','sbietla'),
(263,'34','FATMA RHILI',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','RHILI ','FATMA','sans contrat',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(264,'35','MARAM MISSAOUI',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','MISSAOUI ','MARAM','sans contrat',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(265,'37','HEDI SAADALI',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','SAADALI ','HEDI','cdi le contrat est perdu',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(266,'38','KHALIL BOUZIDI',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','BOUZIDI ','KHALIL','karama le contrat est perdu',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(267,'40','TAHA CHRAIET',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','CHRAIET',' TAHA','karama le contrat est perdu',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(268,'41','_ SAIEF',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','SAIEF ','_','sivp',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(269,'43','_ ASMA 2',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','ASMA 2','_','elle est encore étudiante',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(270,'44','WAJDI AYADI',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','AYADI',' WAJDI',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(271,'46','_ ABDALLAH',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','ABDALLAH ','_',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(272,'47','_ YASSINE CNCT',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','YASSINE CNCT','_',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(273,'48','_ SOUMAYA',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','SOUMAYA ','_',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(274,'49','_ MOEZ',NULL,NULL,NULL,NULL,NULL,0.00,1,'2026-03-13 14:47:15','2026-03-13 14:47:15','MOEZ ','_',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);

--
-- Table structure for table `mm_staff_documents`
--

CREATE TABLE `mm_staff_documents` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `staff_id` int(11) NOT NULL,
  `document_type` varchar(50) NOT NULL,
  `file_name` varchar(255) NOT NULL,
  `file_path` varchar(255) NOT NULL,
  `file_size` int(11) DEFAULT NULL,
  `mime_type` varchar(100) DEFAULT NULL,
  `upload_date` timestamp NULL DEFAULT current_timestamp(),
  `uploaded_by` int(11) NOT NULL,
  `is_active` tinyint(1) DEFAULT 1,
  PRIMARY KEY (`id`),
  KEY `staff_id` (`staff_id`),
  KEY `uploaded_by` (`uploaded_by`),
  CONSTRAINT `mm_staff_documents_ibfk_1` FOREIGN KEY (`staff_id`) REFERENCES `mm_staff` (`id`) ON DELETE CASCADE,
  CONSTRAINT `mm_staff_documents_ibfk_2` FOREIGN KEY (`uploaded_by`) REFERENCES `mm_users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `mm_staff_documents`
--

INSERT INTO `mm_staff_documents` VALUES
(3,257,'Diplôme','logo.jpeg','/var/www/html/gestionnaire/api/gestionnaire/../../uploads/staff_documents/69b7efb4e7841_1773662132_logo.jpeg',30515,'image/jpeg','2026-03-16 11:55:32',1,0),
(4,233,'CIN','logo.jpeg','../../uploads/staff_documents/69b80d3464aef_1773669684.jpeg',30515,'image/jpeg','2026-03-16 14:01:24',1,1),
(5,233,'Diplôme','logo.jpeg','../../uploads/staff_documents/69b93201b36ff_1773744641.jpeg',30515,'image/jpeg','2026-03-17 10:50:41',1,1),
(6,233,'CV','Examen-tek-up-juin2021.docx','../../uploads/staff_documents/69b949279ed1e_1773750567.docx',84627,'application/vnd.openxmlformats-officedocument.wordprocessingml.document','2026-03-17 12:29:27',1,1),
(7,233,'Photo','photo.jpg','../../uploads/staff_documents/69b94fdff06c6_1773752287.jpg',61436,'image/jpeg','2026-03-17 12:58:08',1,0),
(8,233,'Photo','photo.jpg','../../uploads/staff_documents/69b951dc7b97d_1773752796.jpg',66038,'image/jpeg','2026-03-17 13:06:36',1,0),
(9,233,'Photo','photo.png','../../uploads/staff_documents/69b95681a4194_1773753985.png',929024,'image/png','2026-03-17 13:26:25',1,0),
(10,233,'Photo','photo.png','../../uploads/staff_documents/69b95a4cae759_1773754956.png',866464,'image/png','2026-03-17 13:42:36',1,0),
(11,233,'Photo','photo.png','../../uploads/staff_documents/69ba5cca9c109_1773821130.png',441016,'image/png','2026-03-18 08:05:30',1,0),
(12,233,'Photo','photo.png','../../uploads/staff_documents/69ba853b2735c_1773831483.png',866464,'image/png','2026-03-18 10:58:03',1,0);

--
-- Table structure for table `mm_transactions`
--

CREATE TABLE `mm_transactions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `caisse_id` int(11) NOT NULL,
  `type` enum('income','expense') NOT NULL,
  `amount` decimal(15,3) NOT NULL,
  `staff_id` int(11) DEFAULT NULL,
  `person_name` varchar(100) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `transaction_date` date NOT NULL,
  `created_by` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `caisse_id` (`caisse_id`),
  KEY `created_by` (`created_by`),
  KEY `staff_id` (`staff_id`),
  CONSTRAINT `mm_transactions_ibfk_1` FOREIGN KEY (`caisse_id`) REFERENCES `mm_caisses` (`id`) ON DELETE CASCADE,
  CONSTRAINT `mm_transactions_ibfk_2` FOREIGN KEY (`created_by`) REFERENCES `mm_users` (`id`),
  CONSTRAINT `mm_transactions_ibfk_3` FOREIGN KEY (`staff_id`) REFERENCES `mm_staff` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `mm_transactions`
--



