-- Table structure for table `auth_rule`
--

CREATE TABLE `auth_rule` (
  `name` varchar(64) NOT NULL,
  `data` blob DEFAULT NULL,
  `created_at` int(11) DEFAULT NULL,
  `updated_at` int(11) DEFAULT NULL,
  PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `auth_rule`
--


--
-- Table structure for table `banking`
--

CREATE TABLE `banking` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `bank` int(11) NOT NULL,
  `account` varchar(250) NOT NULL,
  `number` varchar(250) NOT NULL,
  `saving` int(11) NOT NULL,
  `user` int(11) NOT NULL,
  `username` varchar(250) NOT NULL,
  `date` timestamp(6) NOT NULL DEFAULT current_timestamp(6),
  PRIMARY KEY (`id`),
  KEY `user` (`user`),
  KEY `bank` (`bank`),
  CONSTRAINT `banking_ibfk_1` FOREIGN KEY (`user`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `banking_ibfk_2` FOREIGN KEY (`bank`) REFERENCES `subcategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `banking`
--

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `after_insert_or_update_banking` AFTER INSERT ON `banking` FOR EACH ROW BEGIN
    -- Check if the bank_id already exists in the banksavings table
    IF EXISTS (SELECT 1 FROM `banksavings` WHERE `bank_id` = NEW.bank) THEN
        -- If the record exists, update the total_savings by adding the new saving amount
        UPDATE `banksavings`
        SET `total_savings` = `total_savings` + NEW.saving
        WHERE `bank_id` = NEW.bank;
    ELSE
        -- If the record does not exist, insert a new record
        INSERT INTO `banksavings` (`bank_id`, `total_savings`)
        VALUES (NEW.bank, NEW.saving);
    END IF;
END */;;
DELIMITER ;

--
-- Table structure for table `banksavings`
--

CREATE TABLE `banksavings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `bank_id` int(11) NOT NULL,
  `total_savings` bigint(20) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_bank` (`bank_id`),
  CONSTRAINT `banksavings_ibfk_1` FOREIGN KEY (`bank_id`) REFERENCES `subcategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `banksavings`
--

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `update_total_savings_after_update` AFTER UPDATE ON `banksavings` FOR EACH ROW BEGIN
    DECLARE new_total_savings BIGINT;
    -- Recalculate the total_savings for the bank_id of the updated record
    SELECT SUM(`total_savings`) INTO new_total_savings
    FROM `banksavings`
    WHERE `bank_id` = NEW.bank_id;
    -- Check if total_savings is calculated successfully
    IF new_total_savings IS NOT NULL THEN
        -- Update the corresponding row in subcategories table
        UPDATE `subcategories`
        SET `total` = new_total_savings
        WHERE `id` = NEW.bank_id;
    END IF;
END */;;
DELIMITER ;

--
-- Table structure for table `bills`
--

CREATE TABLE `bills` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `utility_type` int(11) NOT NULL,
  `unit` float DEFAULT NULL,
  `amount` float NOT NULL,
  `total` float NOT NULL,
  `charge_id` int(11) NOT NULL,
  `date` timestamp(6) NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `utility_type` (`utility_type`),
  KEY `charge_id` (`charge_id`),
  CONSTRAINT `bills_ibfk_1` FOREIGN KEY (`utility_type`) REFERENCES `utilities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `bills_ibfk_2` FOREIGN KEY (`charge_id`) REFERENCES `charges` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=66 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `bills`
--


--
-- Table structure for table `cashmoney`
--

CREATE TABLE `cashmoney` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `landlord_id` int(11) NOT NULL,
  `amount` float DEFAULT NULL,
  `pay` float DEFAULT NULL,
  `balance` float DEFAULT NULL,
  `due` float DEFAULT NULL,
  `note` mediumtext DEFAULT NULL,
  `first` varchar(200) DEFAULT NULL,
  `last` varchar(200) DEFAULT NULL,
  `middle` varchar(200) DEFAULT NULL,
  `phone` varchar(15) DEFAULT NULL,
  `status` int(11) NOT NULL DEFAULT 0,
  `user_id` int(11) DEFAULT NULL,
  `username` varchar(200) DEFAULT NULL,
  `date` datetime(6) DEFAULT NULL,
  `updateDate` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
  `start_date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `landlord_id` (`landlord_id`),
  KEY `user_id` (`user_id`),
  CONSTRAINT `cashmoney_ibfk_1` FOREIGN KEY (`landlord_id`) REFERENCES `landlords` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `cashmoney_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `cashmoney`
--


--
-- Table structure for table `category`
--

CREATE TABLE `category` (
  `id` int(85) NOT NULL AUTO_INCREMENT,
  `expcateg` varchar(2000) NOT NULL,
  `user` varchar(90) NOT NULL,
  `date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `category_ibfk` (`user`)
) ENGINE=InnoDB AUTO_INCREMENT=160 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `category`
--

INSERT INTO `category` VALUES (154,'Administrative Expenses','superadmin','2025-08-26 13:53:58');
INSERT INTO `category` VALUES (155,'Operational Expenses','superadmin','2025-09-11 19:11:44');
INSERT INTO `category` VALUES (156,'Operation expenses','Innocent','2025-08-27 16:31:34');
INSERT INTO `category` VALUES (157,'Tenants who left','Innocent','2025-08-27 16:35:30');
INSERT INTO `category` VALUES (158,'Mobile money & bank charges','TWINOMUGISHA INNOCENT ','2025-09-11 18:56:50');
INSERT INTO `category` VALUES (159,'Occupied rooms commission','TWINOMUGISHA INNOCENT ','2025-10-15 13:39:35');

--
-- Table structure for table `charges`
--

CREATE TABLE `charges` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tenat` int(11) NOT NULL,
  `first_name` varchar(250) DEFAULT NULL,
  `last_name` varchar(250) DEFAULT NULL,
  `phone` varchar(25) DEFAULT NULL,
  `property` varchar(250) DEFAULT NULL,
  `unit` varchar(250) DEFAULT NULL,
  `mode` varchar(250) DEFAULT NULL,
  `property_id` int(11) DEFAULT NULL,
  `status` int(11) NOT NULL DEFAULT 0,
  `user` int(11) DEFAULT NULL,
  `user_name` varchar(250) DEFAULT NULL,
  `date` timestamp(6) NOT NULL DEFAULT current_timestamp(6),
  `latitude` decimal(10,8) DEFAULT NULL,
  `longitude` decimal(11,8) DEFAULT NULL,
  `location_address` varchar(255) DEFAULT NULL,
  `client_ip` varchar(45) DEFAULT NULL,
  `client_isp` varchar(255) DEFAULT NULL,
  `client_city` varchar(100) DEFAULT NULL,
  `client_country` varchar(100) DEFAULT NULL,
  `client_user_agent` varchar(255) DEFAULT NULL,
  `client_device` varchar(150) DEFAULT NULL,
  `client_os` varchar(150) DEFAULT NULL,
  `client_browser` varchar(150) DEFAULT NULL,
  `client_network_type` varchar(150) DEFAULT NULL,
  `client_meta_json` varchar(150) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `tenat` (`tenat`),
  KEY `property_id` (`property_id`),
  KEY `user` (`user`),
  CONSTRAINT `charges_ibfk_1` FOREIGN KEY (`tenat`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `charges_ibfk_2` FOREIGN KEY (`property_id`) REFERENCES `property` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `charges_ibfk_3` FOREIGN KEY (`user`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `charges`
--


--
-- Table structure for table `cities`
--

CREATE TABLE `cities` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `cities`
--

INSERT INTO `cities` VALUES (1,'Mbarara City');
INSERT INTO `cities` VALUES (5,'kampala City');
INSERT INTO `cities` VALUES (6,'Masaka');
INSERT INTO `cities` VALUES (7,'Hoima');
INSERT INTO `cities` VALUES (8,'Kiruhura');
INSERT INTO `cities` VALUES (9,'FortPortal');
INSERT INTO `cities` VALUES (10,'Nairobi');
INSERT INTO `cities` VALUES (12,'Gulu');
INSERT INTO `cities` VALUES (13,'Isingiro');

--
-- Table structure for table `compcategories`
--

CREATE TABLE `compcategories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(250) DEFAULT NULL,
  `description` varchar(3000) DEFAULT NULL,
  `date` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `compcategories`
--

INSERT INTO `compcategories` VALUES (4,'Electrical Issues','Power outages, faulty wiring, broken lights, electrical appliances','2025-09-23 10:44:45.756915');
INSERT INTO `compcategories` VALUES (5,'Internet / IT Services','WiFi issues, cable problems, networking','2025-09-23 10:45:34.497546');
INSERT INTO `compcategories` VALUES (6,'Parking & Vehicles','Parking space disputes, gate barriers, unauthorized vehicles','2025-09-23 10:46:16.230430');
INSERT INTO `compcategories` VALUES (7,'Noise','Disturbances caused by other tenants, surroundings, or construction','2025-09-15 09:31:45.464450');
INSERT INTO `compcategories` VALUES (8,'Maintenance','Issues related to repairs and upkeep of property facilities','2025-09-15 09:30:35.361521');
INSERT INTO `compcategories` VALUES (9,'Other / Miscellaneous','others','2025-09-23 10:46:58.094449');

--
-- Table structure for table `complaints`
--

CREATE TABLE `complaints` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(200) NOT NULL,
  `description` varchar(3000) DEFAULT NULL,
  `due_date` datetime(6) DEFAULT NULL,
  `categories` int(11) DEFAULT NULL,
  `category` int(11) DEFAULT NULL,
  `priorities` int(11) DEFAULT NULL,
  `priority` varchar(250) DEFAULT NULL,
  `assign` int(11) DEFAULT NULL,
  `fname` int(11) DEFAULT NULL,
  `lname` varchar(200) NOT NULL,
  `statusies` int(11) DEFAULT NULL,
  `status` varchar(250) DEFAULT NULL,
  `remark` varchar(3000) DEFAULT NULL,
  `cover` varchar(8000) DEFAULT NULL,
  `imageFile` longtext DEFAULT NULL,
  `username` varchar(200) DEFAULT NULL,
  `date` datetime(6) DEFAULT NULL,
  `update_date` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
  `resolution_notes` longtext DEFAULT NULL,
  `complaint_type` enum('landlord','tenant','staff') NOT NULL,
  PRIMARY KEY (`id`),
  KEY `categories` (`categories`),
  KEY `priorities` (`priorities`),
  KEY `statusies` (`statusies`),
  KEY `fname` (`fname`),
  KEY `category` (`category`),
  CONSTRAINT `complaints_ibfk_1` FOREIGN KEY (`categories`) REFERENCES `compcategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `complaints_ibfk_2` FOREIGN KEY (`priorities`) REFERENCES `priority` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `complaints_ibfk_3` FOREIGN KEY (`statusies`) REFERENCES `compstatus` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `complaints_ibfk_4` FOREIGN KEY (`fname`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `complaints_ibfk_5` FOREIGN KEY (`category`) REFERENCES `landlords` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=93 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `complaints`
--

INSERT INTO `complaints` VALUES (85,'field Officers Performance','Good evening Team, Madam  Lahab highlighted on performance issue, that some of the field officers performance is evaluated / calculated by mid month .','2025-10-31 00:00:00.000000',5,NULL,4,'3',176,NULL,'46',2,'','I need your guidance on this',NULL,NULL,'Super Administrator',NULL,'2025-11-17 15:09:07.853063','resolved','landlord');
INSERT INTO `complaints` VALUES (89,'SYSTEM','Failing to access manage landlords for ease of getting details especially contacts','2025-11-05 00:00:00.000000',5,NULL,2,'3',181,NULL,'46',2,'','This was done as part of controls',NULL,NULL,'Aineomugisha Peter',NULL,'2025-11-10 07:34:01.780408','','landlord');

--
-- Table structure for table `components`
--

CREATE TABLE `components` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(250) NOT NULL,
  `description` mediumtext DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `components`
--

INSERT INTO `components` VALUES (1,'Shareholders\' Equity','a company\'s net worth and it is equal to the total amount that would be returned to the shareholders if the company must be liquidated and all its debts are paid off');
INSERT INTO `components` VALUES (2,'Owner Equity','Owner Equity');
INSERT INTO `components` VALUES (3,'KCB','KCB Mbarara Branch ');
INSERT INTO `components` VALUES (4,'EQUITY','Starting capital');

--
-- Table structure for table `compstatus`
--

CREATE TABLE `compstatus` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(200) NOT NULL,
  `description` varchar(2000) DEFAULT NULL,
  `date` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `compstatus`
--

INSERT INTO `compstatus` VALUES (1,'UNRESOLVED','','2025-09-23 18:26:36.797360');
INSERT INTO `compstatus` VALUES (2,'RESOLVED','Already resolved','2025-09-23 14:36:45.398767');
INSERT INTO `compstatus` VALUES (4,'WORK IN PROGRESS','','2023-12-20 08:26:04.833479');

--
-- Table structure for table `confirmation`
--

CREATE TABLE `confirmation` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `model_id` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=108 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `confirmation`
--

INSERT INTO `confirmation` VALUES (1,25);
INSERT INTO `confirmation` VALUES (2,26);
INSERT INTO `confirmation` VALUES (3,27);
INSERT INTO `confirmation` VALUES (4,28);
INSERT INTO `confirmation` VALUES (5,29);
INSERT INTO `confirmation` VALUES (6,30);
INSERT INTO `confirmation` VALUES (7,31);
INSERT INTO `confirmation` VALUES (8,32);
INSERT INTO `confirmation` VALUES (9,33);
INSERT INTO `confirmation` VALUES (10,34);
INSERT INTO `confirmation` VALUES (11,35);
INSERT INTO `confirmation` VALUES (12,36);
INSERT INTO `confirmation` VALUES (13,37);
INSERT INTO `confirmation` VALUES (14,38);
INSERT INTO `confirmation` VALUES (15,39);
INSERT INTO `confirmation` VALUES (16,40);
INSERT INTO `confirmation` VALUES (17,41);
INSERT INTO `confirmation` VALUES (18,42);
INSERT INTO `confirmation` VALUES (19,43);
INSERT INTO `confirmation` VALUES (20,44);
INSERT INTO `confirmation` VALUES (21,45);
INSERT INTO `confirmation` VALUES (22,46);
INSERT INTO `confirmation` VALUES (23,47);
INSERT INTO `confirmation` VALUES (24,48);
INSERT INTO `confirmation` VALUES (25,49);
INSERT INTO `confirmation` VALUES (26,50);
INSERT INTO `confirmation` VALUES (27,51);
INSERT INTO `confirmation` VALUES (28,52);
INSERT INTO `confirmation` VALUES (29,53);
INSERT INTO `confirmation` VALUES (30,54);
INSERT INTO `confirmation` VALUES (31,55);
INSERT INTO `confirmation` VALUES (32,56);
INSERT INTO `confirmation` VALUES (33,57);
INSERT INTO `confirmation` VALUES (34,58);
INSERT INTO `confirmation` VALUES (35,59);
INSERT INTO `confirmation` VALUES (36,60);
INSERT INTO `confirmation` VALUES (37,61);
INSERT INTO `confirmation` VALUES (38,62);
INSERT INTO `confirmation` VALUES (39,63);
INSERT INTO `confirmation` VALUES (40,64);
INSERT INTO `confirmation` VALUES (41,65);
INSERT INTO `confirmation` VALUES (42,66);
INSERT INTO `confirmation` VALUES (43,67);
INSERT INTO `confirmation` VALUES (44,68);
INSERT INTO `confirmation` VALUES (45,69);
INSERT INTO `confirmation` VALUES (46,70);
INSERT INTO `confirmation` VALUES (47,71);
INSERT INTO `confirmation` VALUES (48,72);
INSERT INTO `confirmation` VALUES (49,73);
INSERT INTO `confirmation` VALUES (50,74);
INSERT INTO `confirmation` VALUES (51,75);
INSERT INTO `confirmation` VALUES (52,76);
INSERT INTO `confirmation` VALUES (53,77);
INSERT INTO `confirmation` VALUES (54,78);
INSERT INTO `confirmation` VALUES (55,79);
INSERT INTO `confirmation` VALUES (56,80);
INSERT INTO `confirmation` VALUES (57,81);
INSERT INTO `confirmation` VALUES (58,82);
INSERT INTO `confirmation` VALUES (59,83);
INSERT INTO `confirmation` VALUES (60,84);
INSERT INTO `confirmation` VALUES (61,85);
INSERT INTO `confirmation` VALUES (62,86);
INSERT INTO `confirmation` VALUES (63,87);
INSERT INTO `confirmation` VALUES (64,88);
INSERT INTO `confirmation` VALUES (65,89);
INSERT INTO `confirmation` VALUES (66,90);
INSERT INTO `confirmation` VALUES (67,91);
INSERT INTO `confirmation` VALUES (68,92);
INSERT INTO `confirmation` VALUES (69,93);
INSERT INTO `confirmation` VALUES (70,95);
INSERT INTO `confirmation` VALUES (71,96);
INSERT INTO `confirmation` VALUES (72,97);
INSERT INTO `confirmation` VALUES (73,98);
INSERT INTO `confirmation` VALUES (74,99);
INSERT INTO `confirmation` VALUES (75,100);
INSERT INTO `confirmation` VALUES (76,101);
INSERT INTO `confirmation` VALUES (77,102);
INSERT INTO `confirmation` VALUES (78,103);
INSERT INTO `confirmation` VALUES (79,104);
INSERT INTO `confirmation` VALUES (80,105);
INSERT INTO `confirmation` VALUES (81,106);
INSERT INTO `confirmation` VALUES (82,107);
INSERT INTO `confirmation` VALUES (83,108);
INSERT INTO `confirmation` VALUES (84,109);
INSERT INTO `confirmation` VALUES (85,110);
INSERT INTO `confirmation` VALUES (86,111);
INSERT INTO `confirmation` VALUES (87,112);
INSERT INTO `confirmation` VALUES (88,113);
INSERT INTO `confirmation` VALUES (89,114);
INSERT INTO `confirmation` VALUES (90,115);
INSERT INTO `confirmation` VALUES (91,116);
INSERT INTO `confirmation` VALUES (92,117);
INSERT INTO `confirmation` VALUES (93,118);
INSERT INTO `confirmation` VALUES (94,119);
INSERT INTO `confirmation` VALUES (95,120);
INSERT INTO `confirmation` VALUES (96,121);
INSERT INTO `confirmation` VALUES (97,122);
INSERT INTO `confirmation` VALUES (98,123);
INSERT INTO `confirmation` VALUES (99,124);
INSERT INTO `confirmation` VALUES (100,125);
INSERT INTO `confirmation` VALUES (101,126);
INSERT INTO `confirmation` VALUES (102,127);
INSERT INTO `confirmation` VALUES (103,128);
INSERT INTO `confirmation` VALUES (104,129);
INSERT INTO `confirmation` VALUES (105,130);
INSERT INTO `confirmation` VALUES (106,132);
INSERT INTO `confirmation` VALUES (107,136);

--
-- Table structure for table `contracts`
--

CREATE TABLE `contracts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `landlord_id` int(11) NOT NULL,
  `startdate` date NOT NULL,
  `period` int(11) NOT NULL,
  `enddate` date NOT NULL,
  `date` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
  PRIMARY KEY (`id`),
  KEY `landlord_id` (`landlord_id`),
  CONSTRAINT `contracts_ibfk_1` FOREIGN KEY (`landlord_id`) REFERENCES `landlords` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=264 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `contracts`
--

INSERT INTO `contracts` VALUES (263,627,'2025-10-01',15,'2027-01-01','2025-11-29 20:43:57.193608');

--
-- Table structure for table `country`
--

CREATE TABLE `country` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `number` smallint(3) NOT NULL,
  `alpha` varchar(2) NOT NULL,
  `calling` smallint(3) NOT NULL,
  `name_en` varchar(255) NOT NULL,
  `name_ru` varchar(255) NOT NULL,
  `name_uk` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `alpha` (`alpha`)
) ENGINE=InnoDB AUTO_INCREMENT=250 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

--
-- Dumping data for table `country`
--

INSERT INTO `country` VALUES (1,4,'af',93,'Afghanistan','Афганистан','Афганістан');
INSERT INTO `country` VALUES (2,8,'al',355,'Albania','Албания','Албанія');
INSERT INTO `country` VALUES (3,10,'aq',672,'Antarctica','Антарктика','Антарктика');
INSERT INTO `country` VALUES (4,12,'dz',213,'Algeria','','');
INSERT INTO `country` VALUES (5,16,'as',1,'American Samoa','','');
INSERT INTO `country` VALUES (6,20,'ad',376,'Andorra','Андора','Андора');
INSERT INTO `country` VALUES (7,24,'ao',244,'Angola','Ангола','Ангола');
INSERT INTO `country` VALUES (8,28,'ag',1,'Antigua and Barbuda','','');
INSERT INTO `country` VALUES (9,31,'az',994,'Azerbaijan','','');
INSERT INTO `country` VALUES (10,32,'ar',54,'Argentina','Аргентина','Аргентина');
INSERT INTO `country` VALUES (11,36,'au',61,'Australia','Австралия','Австралія');
INSERT INTO `country` VALUES (12,40,'at',43,'Austria','Австрия','Австрія');
INSERT INTO `country` VALUES (13,44,'bs',1,'The Bahamas','','');
INSERT INTO `country` VALUES (14,48,'bh',973,'Bahrain','','');
INSERT INTO `country` VALUES (15,50,'bd',880,'Bangladesh','','');
INSERT INTO `country` VALUES (16,51,'am',374,'Armenia','Армения','Арменія');
INSERT INTO `country` VALUES (17,52,'bb',1,'Barbados','','');
INSERT INTO `country` VALUES (18,56,'be',32,'Belgium','Белгия','Белгія');
INSERT INTO `country` VALUES (19,60,'bm',1,'Bermuda','','');
INSERT INTO `country` VALUES (20,64,'bt',975,'Bhutan','','');
INSERT INTO `country` VALUES (21,68,'bo',591,'Bolivia','Боливия','Болівія');
INSERT INTO `country` VALUES (22,70,'ba',387,'Bosnia and Herzegovina','','');
INSERT INTO `country` VALUES (23,72,'bw',267,'Botswana','','');
INSERT INTO `country` VALUES (24,74,'bv',47,'Bouvet Island','','');
INSERT INTO `country` VALUES (25,76,'br',55,'Brazil','Бразилия','Бразилія');
INSERT INTO `country` VALUES (26,84,'bz',501,'Belize','','');
INSERT INTO `country` VALUES (27,86,'io',246,'British Indian Ocean Territory','','');
INSERT INTO `country` VALUES (28,90,'sb',677,'Solomon Islands','','');
INSERT INTO `country` VALUES (29,92,'vg',1,'British Virgin Islands','','');
INSERT INTO `country` VALUES (30,96,'bn',673,'Brunei','','');
INSERT INTO `country` VALUES (31,100,'bg',359,'Bulgaria','','');
INSERT INTO `country` VALUES (32,104,'mm',95,'Myanmar','','');
INSERT INTO `country` VALUES (33,108,'bi',257,'Burundi','','');
INSERT INTO `country` VALUES (34,112,'by',375,'Belarus','Белорусия','Білорусія');
INSERT INTO `country` VALUES (35,116,'kh',855,'Cambodia','','');
INSERT INTO `country` VALUES (36,120,'cm',237,'Cameroon','Камерун','Камерун');
INSERT INTO `country` VALUES (37,124,'ca',1,'Canada','','');
INSERT INTO `country` VALUES (38,132,'cv',238,'Cabo Verde','','');
INSERT INTO `country` VALUES (39,136,'ky',1,'Cayman Islands','','');
INSERT INTO `country` VALUES (40,140,'cf',236,'Central African Republic','','');
INSERT INTO `country` VALUES (41,144,'lk',94,'Sri Lanka','','');
INSERT INTO `country` VALUES (42,148,'td',235,'Chad','','');
INSERT INTO `country` VALUES (43,152,'cl',56,'Chile','','');
INSERT INTO `country` VALUES (44,156,'cn',86,'China','','');
INSERT INTO `country` VALUES (45,158,'tw',886,'Taiwan','','');
INSERT INTO `country` VALUES (46,162,'cx',61,'Christmas Island','','');
INSERT INTO `country` VALUES (47,166,'cc',61,'Cocos Islands','','');
INSERT INTO `country` VALUES (48,170,'co',57,'Colombia','','');
INSERT INTO `country` VALUES (49,174,'km',269,'Comoros','','');
INSERT INTO `country` VALUES (50,175,'yt',262,'Mayotte','','');
INSERT INTO `country` VALUES (51,178,'cg',242,'Republic of the Congo','','');
INSERT INTO `country` VALUES (52,180,'cd',243,'Democratic Republic of the Congo','','');
INSERT INTO `country` VALUES (53,184,'ck',682,'Cook Islands','','');
INSERT INTO `country` VALUES (54,188,'cr',506,'Costa Rica','','');
INSERT INTO `country` VALUES (55,191,'hr',385,'Croatia','','');
INSERT INTO `country` VALUES (56,192,'cu',53,'Cuba','','');
INSERT INTO `country` VALUES (57,196,'cy',357,'Cyprus','','');
INSERT INTO `country` VALUES (58,203,'cz',420,'Czech Republic','','');
INSERT INTO `country` VALUES (59,204,'bj',229,'Benin','','');
INSERT INTO `country` VALUES (60,208,'dk',45,'Denmark','','');
INSERT INTO `country` VALUES (61,212,'dm',1,'Dominica','','');
INSERT INTO `country` VALUES (62,214,'do',1,'Dominican Republic','','');
INSERT INTO `country` VALUES (63,218,'ec',593,'Ecuador','','');
INSERT INTO `country` VALUES (64,222,'sv',503,'El Salvador','','');
INSERT INTO `country` VALUES (65,226,'gq',240,'Equatorial Guinea','','');
INSERT INTO `country` VALUES (66,231,'et',251,'Ethiopia','','');
INSERT INTO `country` VALUES (67,232,'er',291,'Eritrea','','');
INSERT INTO `country` VALUES (68,233,'ee',372,'Estonia','','');
INSERT INTO `country` VALUES (69,234,'fo',298,'Faroe Islands','','');
INSERT INTO `country` VALUES (70,238,'fk',500,'Falkland Islands','','');
INSERT INTO `country` VALUES (71,239,'gs',500,'South Georgia and the South Sandwich Islands','','');
INSERT INTO `country` VALUES (72,242,'fj',679,'Fiji','','');
INSERT INTO `country` VALUES (73,246,'fi',358,'Finland','','');
INSERT INTO `country` VALUES (74,248,'ax',358,'?land Islands','','');
INSERT INTO `country` VALUES (75,250,'fr',33,'France','','');
INSERT INTO `country` VALUES (76,254,'gf',594,'French Guiana','','');
INSERT INTO `country` VALUES (77,258,'pf',689,'French Polynesia','','');
INSERT INTO `country` VALUES (78,260,'tf',33,'French Southern and Antarctic Lands','','');
INSERT INTO `country` VALUES (79,262,'dj',253,'Djibouti','','');
INSERT INTO `country` VALUES (80,266,'ga',241,'Gabon','','');
INSERT INTO `country` VALUES (81,268,'ge',995,'Georgia','','');
INSERT INTO `country` VALUES (82,270,'gm',220,'Gambia','','');
INSERT INTO `country` VALUES (83,275,'ps',970,'Palestine','','');
INSERT INTO `country` VALUES (84,276,'de',49,'Germany','','');
INSERT INTO `country` VALUES (85,288,'gh',233,'Ghana','','');
INSERT INTO `country` VALUES (86,292,'gi',350,'Gibraltar','','');
INSERT INTO `country` VALUES (87,296,'ki',686,'Kiribati','','');
INSERT INTO `country` VALUES (88,300,'gr',30,'Greece','','');
INSERT INTO `country` VALUES (89,304,'gl',299,'Greenland','','');
INSERT INTO `country` VALUES (90,308,'gd',1,'Grenada','','');
INSERT INTO `country` VALUES (91,312,'gp',590,'Guadeloupe','','');
INSERT INTO `country` VALUES (92,316,'gu',1,'Guam','','');
INSERT INTO `country` VALUES (93,320,'gt',502,'Guatemala','','');
INSERT INTO `country` VALUES (94,324,'gn',224,'Guinea','','');
INSERT INTO `country` VALUES (95,328,'gy',592,'Guyana','','');
INSERT INTO `country` VALUES (96,332,'ht',509,'Haiti','','');
INSERT INTO `country` VALUES (97,334,'hm',61,'Heard Island and McDonald Islands','','');
INSERT INTO `country` VALUES (98,336,'va',39,'Vatican City','','');
INSERT INTO `country` VALUES (99,340,'hn',504,'Honduras','','');
INSERT INTO `country` VALUES (100,344,'hk',852,'Hong Kong','','');
INSERT INTO `country` VALUES (101,348,'hu',36,'Hungary','','');
INSERT INTO `country` VALUES (102,352,'is',354,'Iceland','','');
INSERT INTO `country` VALUES (103,356,'in',91,'India','','');
INSERT INTO `country` VALUES (104,360,'id',62,'Indonesia','','');
INSERT INTO `country` VALUES (105,364,'ir',98,'Iran','','');
INSERT INTO `country` VALUES (106,368,'iq',964,'Iraq','','');
INSERT INTO `country` VALUES (107,372,'ie',353,'Ireland','','');
INSERT INTO `country` VALUES (108,376,'il',972,'Israel','','');
INSERT INTO `country` VALUES (109,380,'it',39,'Italy','','');
INSERT INTO `country` VALUES (110,384,'ci',225,'Ivory Coast','','');
INSERT INTO `country` VALUES (111,388,'jm',1,'Jamaica','','');
INSERT INTO `country` VALUES (112,392,'jp',81,'Japan','','');
INSERT INTO `country` VALUES (113,398,'kz',7,'Kazakhstan','','');
INSERT INTO `country` VALUES (114,400,'jo',962,'Jordan','','');
INSERT INTO `country` VALUES (115,404,'ke',254,'Kenya','','');
INSERT INTO `country` VALUES (116,408,'kp',850,'North Korea','','');
INSERT INTO `country` VALUES (117,410,'kr',82,'South Korea','','');
INSERT INTO `country` VALUES (118,414,'kw',965,'Kuwait','','');
INSERT INTO `country` VALUES (119,417,'kg',996,'Kyrgyzstan','','');
INSERT INTO `country` VALUES (120,418,'la',856,'Laos','','');
INSERT INTO `country` VALUES (121,422,'lb',961,'Lebanon','','');
INSERT INTO `country` VALUES (122,426,'ls',266,'Lesotho','','');
INSERT INTO `country` VALUES (123,428,'lv',371,'Latvia','','');
INSERT INTO `country` VALUES (124,430,'lr',231,'Liberia','','');
INSERT INTO `country` VALUES (125,434,'ly',218,'Libya','','');
INSERT INTO `country` VALUES (126,438,'li',423,'Liechtenstein','','');
INSERT INTO `country` VALUES (127,440,'lt',370,'Lithuania','','');
INSERT INTO `country` VALUES (128,442,'lu',352,'Luxembourg','','');
INSERT INTO `country` VALUES (129,446,'mo',853,'Macau','','');
INSERT INTO `country` VALUES (130,450,'mg',261,'Madagascar','','');
INSERT INTO `country` VALUES (131,454,'mw',265,'Malawi','','');
INSERT INTO `country` VALUES (132,458,'my',60,'Malaysia','','');
INSERT INTO `country` VALUES (133,462,'mv',960,'Maldives','','');
INSERT INTO `country` VALUES (134,466,'ml',223,'Mali','','');
INSERT INTO `country` VALUES (135,470,'mt',356,'Malta','','');
INSERT INTO `country` VALUES (136,474,'mq',596,'Martinique','','');
INSERT INTO `country` VALUES (137,478,'mr',222,'Mauritania','','');
INSERT INTO `country` VALUES (138,480,'mu',230,'Mauritius','','');
INSERT INTO `country` VALUES (139,484,'mx',52,'Mexico','','');
INSERT INTO `country` VALUES (140,492,'mc',377,'Monaco','','');
INSERT INTO `country` VALUES (141,496,'mn',976,'Mongolia','','');
INSERT INTO `country` VALUES (142,498,'md',373,'Moldova','','');
INSERT INTO `country` VALUES (143,499,'me',382,'Montenegro','','');
INSERT INTO `country` VALUES (144,500,'ms',1,'Montserrat','','');
INSERT INTO `country` VALUES (145,504,'ma',212,'Morocco','','');
INSERT INTO `country` VALUES (146,508,'mz',258,'Mozambique','','');
INSERT INTO `country` VALUES (147,512,'om',968,'Oman','','');
INSERT INTO `country` VALUES (148,516,'na',264,'Namibia','','');
INSERT INTO `country` VALUES (149,520,'nr',674,'Nauru','','');
INSERT INTO `country` VALUES (150,524,'np',977,'Nepal','','');
INSERT INTO `country` VALUES (151,528,'nl',31,'Netherlands','','');
INSERT INTO `country` VALUES (152,531,'cw',599,'Cura?ao','','');
INSERT INTO `country` VALUES (153,533,'aw',297,'Aruba','','');
INSERT INTO `country` VALUES (154,534,'sx',1,'Sint Maarten','','');
INSERT INTO `country` VALUES (155,535,'bq',599,'Caribbean Netherlands','','');
INSERT INTO `country` VALUES (156,540,'nc',687,'New Caledonia','','');
INSERT INTO `country` VALUES (157,548,'vu',678,'Vanuatu','','');
INSERT INTO `country` VALUES (158,554,'nz',64,'New Zealand','','');
INSERT INTO `country` VALUES (159,558,'ni',505,'Nicaragua','','');
INSERT INTO `country` VALUES (160,562,'ne',227,'Niger','','');
INSERT INTO `country` VALUES (161,566,'ng',234,'Nigeria','','');
INSERT INTO `country` VALUES (162,570,'nu',683,'Niue','','');
INSERT INTO `country` VALUES (163,574,'nf',672,'Norfolk Island','','');
INSERT INTO `country` VALUES (164,578,'no',47,'Norway','','');
INSERT INTO `country` VALUES (165,580,'mp',1,'Northern Mariana Islands','','');
INSERT INTO `country` VALUES (166,581,'um',1,'United States Minor Outlying Islands','','');
INSERT INTO `country` VALUES (167,583,'fm',691,'Federated States of Micronesia','','');
INSERT INTO `country` VALUES (168,584,'mh',692,'Marshall Islands','','');
INSERT INTO `country` VALUES (169,585,'pw',680,'Palau','','');
INSERT INTO `country` VALUES (170,586,'pk',92,'Pakistan','','');
INSERT INTO `country` VALUES (171,591,'pa',507,'Panama','','');
INSERT INTO `country` VALUES (172,598,'pg',675,'Papua New Guinea','','');
INSERT INTO `country` VALUES (173,600,'py',595,'Paraguay','','');
INSERT INTO `country` VALUES (174,604,'pe',51,'Peru','','');
INSERT INTO `country` VALUES (175,608,'ph',63,'Philippines','','');
INSERT INTO `country` VALUES (176,612,'pn',64,'Pitcairn Islands','','');
INSERT INTO `country` VALUES (177,616,'pl',48,'Poland','','');
INSERT INTO `country` VALUES (178,620,'pt',351,'Portugal','','');
INSERT INTO `country` VALUES (179,624,'gw',245,'Guinea-Bissau','','');
INSERT INTO `country` VALUES (180,626,'tl',670,'East Timor','','');
INSERT INTO `country` VALUES (181,630,'pr',1,'Puerto Rico','','');
INSERT INTO `country` VALUES (182,634,'qa',974,'Qatar','','');
INSERT INTO `country` VALUES (183,638,'re',262,'R?union','','');
INSERT INTO `country` VALUES (184,642,'ro',40,'Romania','','');
INSERT INTO `country` VALUES (185,643,'ru',7,'Russia','Россия','Росія');
INSERT INTO `country` VALUES (186,646,'rw',250,'Rwanda','','');
INSERT INTO `country` VALUES (187,652,'bl',590,'Saint Barth?lemy','','');
INSERT INTO `country` VALUES (188,654,'sh',290,'Saint Helena, Ascension and Tristan da Cunha','','');
INSERT INTO `country` VALUES (189,659,'kn',1,'Saint Kitts and Nevis','','');
INSERT INTO `country` VALUES (190,660,'ai',1,'Anguilla','','');
INSERT INTO `country` VALUES (191,662,'lc',1,'Saint Lucia','','');
INSERT INTO `country` VALUES (192,663,'mf',590,'Saint Martin','','');
INSERT INTO `country` VALUES (193,666,'pm',508,'Saint Pierre and Miquelon','','');
INSERT INTO `country` VALUES (194,670,'vc',1,'Saint Vincent and the Grenadines','','');
INSERT INTO `country` VALUES (195,674,'sm',378,'San Marino','','');
INSERT INTO `country` VALUES (196,678,'st',239,'S?o Tom? and Pr?ncipe','','');
INSERT INTO `country` VALUES (197,682,'sa',966,'Saudi Arabia','','');
INSERT INTO `country` VALUES (198,686,'sn',221,'Senegal','','');
INSERT INTO `country` VALUES (199,688,'rs',381,'Serbia','','');
INSERT INTO `country` VALUES (200,690,'sc',248,'Seychelles','','');
INSERT INTO `country` VALUES (201,694,'sl',232,'Sierra Leone','','');
INSERT INTO `country` VALUES (202,702,'sg',65,'Singapore','','');
INSERT INTO `country` VALUES (203,703,'sk',421,'Slovakia','','');
INSERT INTO `country` VALUES (204,704,'vn',84,'Vietnam','','');
INSERT INTO `country` VALUES (205,705,'si',386,'Slovenia','','');
INSERT INTO `country` VALUES (206,706,'so',252,'Somalia','','');
INSERT INTO `country` VALUES (207,710,'za',27,'South Africa','','');
INSERT INTO `country` VALUES (208,716,'zw',263,'Zimbabwe','','');
INSERT INTO `country` VALUES (209,724,'es',34,'Spain','','');
INSERT INTO `country` VALUES (210,728,'ss',211,'South Sudan','','');
INSERT INTO `country` VALUES (211,729,'sd',249,'Sudan','','');
INSERT INTO `country` VALUES (212,732,'eh',212,'Western Sahara','','');
INSERT INTO `country` VALUES (213,740,'sr',597,'Suriname','','');
INSERT INTO `country` VALUES (214,744,'sj',47,'Svalbard and Jan Mayen','','');
INSERT INTO `country` VALUES (215,748,'sz',268,'Swaziland','','');
INSERT INTO `country` VALUES (216,752,'se',46,'Sweden','','');
INSERT INTO `country` VALUES (217,756,'ch',41,'Switzerland','','');
INSERT INTO `country` VALUES (218,760,'sy',963,'Syria','','');
INSERT INTO `country` VALUES (219,762,'tj',992,'Tajikistan','','');
INSERT INTO `country` VALUES (220,764,'th',66,'Thailand','','');
INSERT INTO `country` VALUES (221,768,'tg',228,'Togo','','');
INSERT INTO `country` VALUES (222,772,'tk',690,'Tokelau','','');
INSERT INTO `country` VALUES (223,776,'to',676,'Tonga','','');
INSERT INTO `country` VALUES (224,780,'tt',1,'Trinidad and Tobago','','');
INSERT INTO `country` VALUES (225,784,'ae',971,'United Arab Emirates','','');
INSERT INTO `country` VALUES (226,788,'tn',216,'Tunisia','','');
INSERT INTO `country` VALUES (227,792,'tr',90,'Turkey','','');
INSERT INTO `country` VALUES (228,795,'tm',993,'Turkmenistan','','');
INSERT INTO `country` VALUES (229,796,'tc',1,'Turks and Caicos Islands','','');
INSERT INTO `country` VALUES (230,798,'tv',688,'Tuvalu','','');
INSERT INTO `country` VALUES (231,800,'ug',256,'Uganda','','');
INSERT INTO `country` VALUES (232,804,'ua',380,'Ukraine','Украина','Україна');
INSERT INTO `country` VALUES (233,807,'mk',389,'Macedonia','','');
INSERT INTO `country` VALUES (234,818,'eg',20,'Egypt','','');
INSERT INTO `country` VALUES (235,826,'gb',44,'United Kingdom','','');
INSERT INTO `country` VALUES (236,831,'gg',44,'Guernsey','','');
INSERT INTO `country` VALUES (237,832,'je',44,'Jersey','','');
INSERT INTO `country` VALUES (238,833,'im',44,'Isle of Man','','');
INSERT INTO `country` VALUES (239,834,'tz',255,'Tanzania','','');
INSERT INTO `country` VALUES (240,840,'us',1,'United States','','');
INSERT INTO `country` VALUES (241,850,'vi',1,'United States Virgin Islands','','');
INSERT INTO `country` VALUES (242,854,'bf',226,'Burkina Faso','','');
INSERT INTO `country` VALUES (243,858,'uy',598,'Uruguay','','');
INSERT INTO `country` VALUES (244,860,'uz',998,'Uzbekistan','','');
INSERT INTO `country` VALUES (245,862,'ve',58,'Venezuela','','');
INSERT INTO `country` VALUES (246,876,'wf',681,'Wallis and Futuna','','');
INSERT INTO `country` VALUES (247,882,'ws',685,'Samoa','','');
INSERT INTO `country` VALUES (248,887,'ye',967,'Yemen','','');
INSERT INTO `country` VALUES (249,894,'zm',260,'Zambia','','');

--
-- Table structure for table `deduction`
--

CREATE TABLE `deduction` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `percentage` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `deduction`
--

INSERT INTO `deduction` VALUES (1,'NSSF',0);

--
-- Table structure for table `deposit`
--

CREATE TABLE `deposit` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `model_id` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=120 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `deposit`
--

INSERT INTO `deposit` VALUES (1,13);
INSERT INTO `deposit` VALUES (2,14);
INSERT INTO `deposit` VALUES (3,15);
INSERT INTO `deposit` VALUES (4,16);
INSERT INTO `deposit` VALUES (5,17);
INSERT INTO `deposit` VALUES (6,18);
INSERT INTO `deposit` VALUES (7,19);
INSERT INTO `deposit` VALUES (8,20);
INSERT INTO `deposit` VALUES (9,21);
INSERT INTO `deposit` VALUES (10,22);
INSERT INTO `deposit` VALUES (11,23);
INSERT INTO `deposit` VALUES (12,24);
INSERT INTO `deposit` VALUES (13,25);
INSERT INTO `deposit` VALUES (14,26);
INSERT INTO `deposit` VALUES (15,30);
INSERT INTO `deposit` VALUES (16,31);
INSERT INTO `deposit` VALUES (17,32);
INSERT INTO `deposit` VALUES (18,34);
INSERT INTO `deposit` VALUES (19,35);
INSERT INTO `deposit` VALUES (20,36);
INSERT INTO `deposit` VALUES (21,38);
INSERT INTO `deposit` VALUES (22,40);
INSERT INTO `deposit` VALUES (23,44);
INSERT INTO `deposit` VALUES (24,45);
INSERT INTO `deposit` VALUES (25,46);
INSERT INTO `deposit` VALUES (26,48);
INSERT INTO `deposit` VALUES (27,50);
INSERT INTO `deposit` VALUES (28,51);
INSERT INTO `deposit` VALUES (29,53);
INSERT INTO `deposit` VALUES (30,54);
INSERT INTO `deposit` VALUES (31,55);
INSERT INTO `deposit` VALUES (32,56);
INSERT INTO `deposit` VALUES (33,57);
INSERT INTO `deposit` VALUES (34,58);
INSERT INTO `deposit` VALUES (35,59);
INSERT INTO `deposit` VALUES (36,60);
INSERT INTO `deposit` VALUES (37,61);
INSERT INTO `deposit` VALUES (38,62);
INSERT INTO `deposit` VALUES (39,63);
INSERT INTO `deposit` VALUES (40,64);
INSERT INTO `deposit` VALUES (41,65);
INSERT INTO `deposit` VALUES (42,66);
INSERT INTO `deposit` VALUES (43,67);
INSERT INTO `deposit` VALUES (44,68);
INSERT INTO `deposit` VALUES (45,69);
INSERT INTO `deposit` VALUES (46,70);
INSERT INTO `deposit` VALUES (47,71);
INSERT INTO `deposit` VALUES (48,72);
INSERT INTO `deposit` VALUES (49,73);
INSERT INTO `deposit` VALUES (50,74);
INSERT INTO `deposit` VALUES (51,75);
INSERT INTO `deposit` VALUES (52,76);
INSERT INTO `deposit` VALUES (53,77);
INSERT INTO `deposit` VALUES (54,78);
INSERT INTO `deposit` VALUES (55,79);
INSERT INTO `deposit` VALUES (56,80);
INSERT INTO `deposit` VALUES (57,82);
INSERT INTO `deposit` VALUES (58,83);
INSERT INTO `deposit` VALUES (59,84);
INSERT INTO `deposit` VALUES (60,85);
INSERT INTO `deposit` VALUES (61,86);
INSERT INTO `deposit` VALUES (62,87);
INSERT INTO `deposit` VALUES (63,88);
INSERT INTO `deposit` VALUES (64,89);
INSERT INTO `deposit` VALUES (65,90);
INSERT INTO `deposit` VALUES (66,91);
INSERT INTO `deposit` VALUES (67,92);
INSERT INTO `deposit` VALUES (68,93);
INSERT INTO `deposit` VALUES (69,94);
INSERT INTO `deposit` VALUES (70,95);
INSERT INTO `deposit` VALUES (71,96);
INSERT INTO `deposit` VALUES (72,97);
INSERT INTO `deposit` VALUES (73,98);
INSERT INTO `deposit` VALUES (74,99);
INSERT INTO `deposit` VALUES (75,100);
INSERT INTO `deposit` VALUES (76,101);
INSERT INTO `deposit` VALUES (77,102);
INSERT INTO `deposit` VALUES (78,103);
INSERT INTO `deposit` VALUES (79,104);
INSERT INTO `deposit` VALUES (80,105);
INSERT INTO `deposit` VALUES (81,106);
INSERT INTO `deposit` VALUES (82,107);
INSERT INTO `deposit` VALUES (83,108);
INSERT INTO `deposit` VALUES (84,109);
INSERT INTO `deposit` VALUES (85,110);
INSERT INTO `deposit` VALUES (86,111);
INSERT INTO `deposit` VALUES (87,112);
INSERT INTO `deposit` VALUES (88,113);
INSERT INTO `deposit` VALUES (89,114);
INSERT INTO `deposit` VALUES (90,115);
INSERT INTO `deposit` VALUES (91,116);
INSERT INTO `deposit` VALUES (92,117);
INSERT INTO `deposit` VALUES (93,118);
INSERT INTO `deposit` VALUES (94,119);
INSERT INTO `deposit` VALUES (95,120);
INSERT INTO `deposit` VALUES (96,121);
INSERT INTO `deposit` VALUES (97,122);
INSERT INTO `deposit` VALUES (98,123);
INSERT INTO `deposit` VALUES (99,124);
INSERT INTO `deposit` VALUES (100,125);
INSERT INTO `deposit` VALUES (101,126);
INSERT INTO `deposit` VALUES (102,127);
INSERT INTO `deposit` VALUES (103,128);
INSERT INTO `deposit` VALUES (104,129);
INSERT INTO `deposit` VALUES (105,130);
INSERT INTO `deposit` VALUES (106,131);
INSERT INTO `deposit` VALUES (107,132);
INSERT INTO `deposit` VALUES (108,133);
INSERT INTO `deposit` VALUES (109,134);
INSERT INTO `deposit` VALUES (110,135);
INSERT INTO `deposit` VALUES (111,136);
INSERT INTO `deposit` VALUES (112,137);
INSERT INTO `deposit` VALUES (113,138);
INSERT INTO `deposit` VALUES (114,139);
INSERT INTO `deposit` VALUES (115,140);
INSERT INTO `deposit` VALUES (116,141);
INSERT INTO `deposit` VALUES (117,142);
INSERT INTO `deposit` VALUES (118,143);
INSERT INTO `deposit` VALUES (119,144);

--
-- Table structure for table `desgnation`
--

CREATE TABLE `desgnation` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `desg` varchar(65) NOT NULL,
  `details` mediumtext NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `desgnation`
--

INSERT INTO `desgnation` VALUES (1,'HEAD OF FINANCE','Finance management Head');
INSERT INTO `desgnation` VALUES (2,'HUMAN RESOURCE','Human Resource Management\r\n');
INSERT INTO `desgnation` VALUES (8,'ACCOUNTANT','Accountant officer');
INSERT INTO `desgnation` VALUES (9,'HEAD OF OPERATIONS','Overseeing operational functions of a business.');
INSERT INTO `desgnation` VALUES (10,'GENERAL MANAGER','Handles all the duties');
INSERT INTO `desgnation` VALUES (12,'ADMINISTRATOR','Oversees all administrative work.');
INSERT INTO `desgnation` VALUES (13,'OFFICE ATTENDANT','Oversees office duties');
INSERT INTO `desgnation` VALUES (14,'ACCOUNTS ASSISTANT','Receipt entry into system, Ledgers, Cash book, Financial reports');
INSERT INTO `desgnation` VALUES (15,'FIELD OPERATIONS','Rent collection, and debt recoveries ');
INSERT INTO `desgnation` VALUES (17,'JANITOR','Building caretaker');
INSERT INTO `desgnation` VALUES (18,'SECURITY','Gate Security');
INSERT INTO `desgnation` VALUES (19,'FIELD OFFICER','Collect, bank and visit estates');
INSERT INTO `desgnation` VALUES (20,'LANDLORD','LandLord who receives money');
INSERT INTO `desgnation` VALUES (21,'SUPERVISOR','Over sees company activities');

--
-- Table structure for table `duesnotfications`
--

CREATE TABLE `duesnotfications` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `payed_id` int(11) NOT NULL,
  `messages` longtext NOT NULL,
  `date` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
  PRIMARY KEY (`id`),
  KEY `payed_id` (`payed_id`),
  CONSTRAINT `duesnotfications_ibfk_1` FOREIGN KEY (`payed_id`) REFERENCES `payed` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `duesnotfications`
--


--
-- Table structure for table `employees`
--

CREATE TABLE `employees` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fname` varchar(90) NOT NULL,
  `lname` varchar(90) NOT NULL,
  `nationalID` varchar(18) NOT NULL,
  `desgnation` int(11) NOT NULL,
  `desg` varchar(300) NOT NULL,
  `designdet` varchar(300) NOT NULL,
  `phone` varchar(20) NOT NULL,
  `rate` varchar(20) NOT NULL,
  `address` varchar(85) NOT NULL,
  `company` varchar(90) NOT NULL,
  `email` varchar(200) DEFAULT NULL,
  `tin_number` varchar(250) DEFAULT NULL,
  `bank` varchar(250) DEFAULT NULL,
  `acoount` varchar(250) DEFAULT NULL,
  `basic_salaries` int(11) NOT NULL,
  `extra_note` mediumtext DEFAULT NULL,
  `imageFile` varchar(3000) NOT NULL,
  `cover` varchar(800) NOT NULL,
  `status` int(11) NOT NULL DEFAULT 1,
  `user` varchar(50) NOT NULL,
  `date` timestamp(6) NOT NULL DEFAULT current_timestamp(6),
  PRIMARY KEY (`id`),
  KEY `desgnation` (`desgnation`)
) ENGINE=MyISAM AUTO_INCREMENT=56 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `employees`
--

INSERT INTO `employees` VALUES (47,'NABUKENYA ','DAISY','CF90068106GGUL',19,'FIELD OFFICER','','256753971383','salary','Kampala','700000','','','','',700000,'Kampala','','47.jpeg',1,'superadmin','2025-08-28 12:27:47.394940');
INSERT INTO `employees` VALUES (46,'ATUHAIRE',' LAHAB','CF95TESTTTTTTT',19,'FIELD OFFICER','','256759574829','salary','Bushenyi','700000','','','','',700000,'','','46.jpeg',1,'superadmin','2025-08-28 12:22:05.994515');
INSERT INTO `employees` VALUES (45,'Mukisa','Juliet','CF990241083TLG',19,'FIELD OFFICER','','256744607987','salary','Kampala','700000','julietmukisa99@gmail.com','','','',700000,'Kampala','','45.jpeg',1,'superadmin','2025-08-28 12:18:27.681552');
INSERT INTO `employees` VALUES (43,'Murangira','Smith','CM780341006DCD',19,'FIELD OFFICERS','','256787344876','salary','Bushenyi','700000','','','','',700000,'Senior Field Officer','','43.jpeg',1,'superadmin','2025-08-28 11:15:54.742400');
INSERT INTO `employees` VALUES (42,'KWAGALA','GLORIA','CF95068106GAZE',10,'GENERAL MANAGER','','256787089487','salary','Kampala','1700000','Kwagalagloriagift7711@gmail.com','','','',1700000,'General Manager','','42.jpeg',1,'superadmin','2025-08-28 11:11:44.623657');
INSERT INTO `employees` VALUES (41,'TWINOMUGISHA','INNOCENT','CM94004100FE2C',21,'SUPERVISOR','','256777848547','salary','Bushenyi','1400000','innocenttwine56@gmail.com','','','',1400000,'Accountant and Supervsior','','41.jpeg',1,'superadmin','2025-08-28 11:07:58.061470');
INSERT INTO `employees` VALUES (44,'KATUSIIMEBOONA',' SANDRA','CF010100410CDE',19,'FIELD OFFICER','','256770477111','salary','Bushenyi','700000','skatusiimeboona@gmail.com','','','',700000,'Bushenyi','','44.jpeg',1,'superadmin','2025-08-28 12:15:09.421206');
INSERT INTO `employees` VALUES (38,'KANSIIME ','JOAN','CF020041DGEXK',8,'ACCOUNTANT','','256773754472','salary','Bushenyi','1000000','','','','',1000000,'Business Administration','','38.jpeg',1,'superadmin','2025-08-27 12:17:21.584329');
INSERT INTO `employees` VALUES (39,'AHIMBISIBWE ','ARNOLD','CM0300410EHJCF',19,'FIELD OFFICERS','','256748280892','salary','Bushenyi','700000','','','','',700000,'','','39.jpeg',1,'superadmin','2025-08-27 12:28:22.646594');
INSERT INTO `employees` VALUES (40,'Payment','ReceivedBy Landlord','CF752HYUIW282K',20,'LANDLORD','','256','commission','JUST LANDLORD','','','','','',1,'','','',1,'superadmin','2025-08-28 10:39:45.210152');
INSERT INTO `employees` VALUES (48,'Ainebyona','Abigal','CF93004101TZVH',19,'FIELD OFFICER','','256775211056','salary','Bushenyi','700000','','','','',700000,'Bushenyi','','48.jpeg',1,'superadmin','2025-08-28 12:30:28.511942');
INSERT INTO `employees` VALUES (49,'NAMARA ','WICKLIFF','CM95TESSTSTEST',19,'FIELD OFFICER','','256742094728','salary','Mbarara','700000','namarawickliff2000@gmail.com','','','',700000,'','','49.jpeg',0,'superadmin','2025-08-28 12:36:25.597648');
INSERT INTO `employees` VALUES (50,'Kisaalu','Fred','CM03017104JXYA',19,'FIELD OFFICER','Ian','256757661922','salary','Kamapala','700000','Ianklerk@gmail.com','','','',700000,'Kampala','','50.jpeg',1,'superadmin','2025-08-28 12:41:45.131848');
INSERT INTO `employees` VALUES (51,'Atwine','Philip','CM860041018R2E',19,'FIELD OFFICER','','256773946264','salary','Bushenyi','1400000','atwinephilip@gmail.com','','','',1400000,'','','',1,'superadmin','2025-08-28 12:44:59.205801');
INSERT INTO `employees` VALUES (52,'Ainomugisha','Peter','CM8100410051AD',12,'ADMINISTRATOR','','256772881155','commission','Bushenyi','','ainepeter@gmail.com','','','',2000000,'Bushenyi','','52.jpeg',1,'superadmin','2025-08-28 12:48:23.447966');
INSERT INTO `employees` VALUES (53,'ABESIGAMUKAMA','JEMIMAH','CF94068102CTEK',19,'FIELD OFFICER','','256778999158','salary','Mbarara','700000','','','','',700000,'','','53.jpeg',1,'superadmin','2025-08-28 12:52:24.847131');
INSERT INTO `employees` VALUES (54,'OWOYESIGA',' TAREMWA','CM200TESTTSTTE',19,'FIELD OFFICER','','256744130441','salary','Mbarara','700000','owoyesigataremwa55@gmail.com','','','',700000,'','','54.jpeg',1,'superadmin','2025-08-28 12:55:48.976365');

--
-- Table structure for table `equity`
--

CREATE TABLE `equity` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(250) NOT NULL,
  `description` mediumtext DEFAULT NULL,
  `price` int(11) NOT NULL,
  `username` varchar(85) DEFAULT NULL,
  `equitytype` int(11) NOT NULL,
  `date` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
  PRIMARY KEY (`id`),
  KEY `equitytype` (`equitytype`),
  CONSTRAINT `equity_ibfk_1` FOREIGN KEY (`equitytype`) REFERENCES `components` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `equity`
--


--
-- Table structure for table `expenseonpropertycat`
--

CREATE TABLE `expenseonpropertycat` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(300) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `expenseonpropertycat`
--

INSERT INTO `expenseonpropertycat` VALUES (5,'Maintenance & other Technical repairs');
INSERT INTO `expenseonpropertycat` VALUES (6,'Electricity Repairs');
INSERT INTO `expenseonpropertycat` VALUES (7,'Water Repairs');
INSERT INTO `expenseonpropertycat` VALUES (8,'Bathroom Repairs');
INSERT INTO `expenseonpropertycat` VALUES (10,'Property Tax');
INSERT INTO `expenseonpropertycat` VALUES (11,'water bills');
INSERT INTO `expenseonpropertycat` VALUES (12,'electricity bills');
INSERT INTO `expenseonpropertycat` VALUES (13,'cleaning services');
INSERT INTO `expenseonpropertycat` VALUES (14,'gabbage collection');
INSERT INTO `expenseonpropertycat` VALUES (15,'Chairman fee ');
INSERT INTO `expenseonpropertycat` VALUES (16,'Security Guard Fees');
INSERT INTO `expenseonpropertycat` VALUES (17,'Broker Expenses');
INSERT INTO `expenseonpropertycat` VALUES (18,'Renovations');
INSERT INTO `expenseonpropertycat` VALUES (19,'Payment Received By LLD');

--
-- Table structure for table `expenseproperties`
--

CREATE TABLE `expenseproperties` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(275) NOT NULL,
  `amount` int(11) NOT NULL,
  `item_date` datetime(6) NOT NULL,
  `category` int(11) NOT NULL,
  `cat` varchar(100) NOT NULL,
  `property` int(11) NOT NULL,
  `assign` varchar(50) DEFAULT NULL,
  `unitname` int(11) DEFAULT NULL,
  `description` varchar(8000) DEFAULT NULL,
  `user` varchar(275) NOT NULL,
  `landlord_user_id` int(11) DEFAULT NULL,
  `username` int(11) DEFAULT NULL,
  `date` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
  `latitude` decimal(10,8) DEFAULT NULL,
  `longitude` decimal(11,8) DEFAULT NULL,
  `location_address` varchar(255) DEFAULT NULL,
  `client_ip` varchar(45) DEFAULT NULL,
  `client_isp` varchar(255) DEFAULT NULL,
  `client_city` varchar(100) DEFAULT NULL,
  `client_country` varchar(100) DEFAULT NULL,
  `client_user_agent` varchar(255) DEFAULT NULL,
  `client_device` varchar(150) DEFAULT NULL,
  `client_os` varchar(150) DEFAULT NULL,
  `client_browser` varchar(150) DEFAULT NULL,
  `client_network_type` varchar(150) DEFAULT NULL,
  `client_meta_json` varchar(150) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `category` (`category`),
  KEY `property` (`property`),
  KEY `unitname` (`unitname`),
  KEY `user_id` (`landlord_user_id`),
  CONSTRAINT `expenseproperties_ibfk_1` FOREIGN KEY (`category`) REFERENCES `expenseonpropertycat` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `expenseproperties_ibfk_2` FOREIGN KEY (`property`) REFERENCES `property` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `expenseproperties_ibfk_3` FOREIGN KEY (`unitname`) REFERENCES `propertyunit` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `expenseproperties_ibfk_4` FOREIGN KEY (`landlord_user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=634 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `expenseproperties`
--


--
-- Table structure for table `expenses`
--

CREATE TABLE `expenses` (
  `ExpenseID` int(20) NOT NULL AUTO_INCREMENT,
  `item` varchar(2000) NOT NULL,
  `item_date` datetime(6) NOT NULL,
  `amountpay` int(11) NOT NULL,
  `id` int(85) NOT NULL,
  `description` mediumtext NOT NULL,
  `user` varchar(90) NOT NULL,
  `date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `liability` int(11) NOT NULL DEFAULT 7,
  `username` int(11) NOT NULL,
  PRIMARY KEY (`ExpenseID`),
  KEY `expenses_ibfk` (`user`),
  KEY `id` (`id`),
  CONSTRAINT `expenses_ibfk_1` FOREIGN KEY (`id`) REFERENCES `category` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=1252 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `expenses`
--

INSERT INTO `expenses` VALUES (1245,'MM charges','2025-10-23 00:00:00.000000',910235,158,' MBOILE MONEY','Kwagala Gloria','2025-10-23 08:46:16',7,181);
INSERT INTO `expenses` VALUES (1246,'Rent','2025-10-01 00:00:00.000000',1450000,154,'all the four rooms','Kwagala Gloria','2025-10-23 13:05:38',7,181);
INSERT INTO `expenses` VALUES (1247,'NSSF AND TAX','2025-10-16 00:00:00.000000',616000,154,'NSSF AND TAX CLEARANCE','Kwagala Gloria','2025-10-16 09:02:09',7,181);
INSERT INTO `expenses` VALUES (1248,'Airtime','2025-10-16 00:00:00.000000',28000,154,'office line airtime','Kwagala Gloria','2025-10-23 08:40:41',7,181);
INSERT INTO `expenses` VALUES (1249,'EVICTION','2025-10-16 00:00:00.000000',213000,156,'LC, PADLOCK, DEFENCE','Kwagala Gloria','2025-10-23 08:42:48',7,181);
INSERT INTO `expenses` VALUES (1250,'DOOR REPAIR','2025-10-16 00:00:00.000000',108000,156,'REPLACEMENT','Kwagala Gloria','2025-10-16 09:12:42',7,181);
INSERT INTO `expenses` VALUES (1251,'Stationary','2025-10-23 00:00:00.000000',132000,154,'receipt books office book','Kwagala Gloria','2025-10-23 08:53:17',7,181);
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `update_liability` BEFORE INSERT ON `expenses` FOR EACH ROW BEGIN
  IF NEW.liability IS NULL THEN
    SET NEW.liability = 7;
  END IF;
END */;;
DELIMITER ;

--
-- Table structure for table `extra`
--

CREATE TABLE `extra` (
  `id` int(12) NOT NULL AUTO_INCREMENT,
  `name` varchar(85) NOT NULL,
  `description` longtext DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `extra`
--

INSERT INTO `extra` VALUES (3,'Administrative fees','administrative fee when you apply for an apartment, either through a property');
INSERT INTO `extra` VALUES (6,'Toilet Fee','Toilet fee paid monthly');
INSERT INTO `extra` VALUES (7,'Fire insurance','Fire insurance for Buildings');
INSERT INTO `extra` VALUES (8,'Maintenance charge','Maintenance charge ');
INSERT INTO `extra` VALUES (9,'Security Deposit','The security deposit is paid to the landlord to secure a property and it’s refundable when you vacate the property. If you are using a real estate agent, they will hold on to this amount until the deal is finalized.');
INSERT INTO `extra` VALUES (10,'Cooling Services ','Chiller or cooling services are one of the most important amenities that should be offered in a residential unit; this owes to the hot weathe');
INSERT INTO `extra` VALUES (11,'Parking Fees','Parking Fees service');
INSERT INTO `extra` VALUES (12,'Renters Insurance','Renters Insurance');

--
-- Table structure for table `history`
--

CREATE TABLE `history` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `paid` int(11) NOT NULL,
  `tenant_id` int(11) NOT NULL,
  `payment_id` int(11) NOT NULL,
  `startdate` datetime(6) NOT NULL,
  `agreed` int(11) NOT NULL,
  `due` int(11) NOT NULL,
  `enddate` datetime(6) NOT NULL,
  `date` datetime(6) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `payment_id` (`payment_id`),
  CONSTRAINT `history_ibfk_1` FOREIGN KEY (`payment_id`) REFERENCES `payed` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=39830 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `history`
--

INSERT INTO `history` VALUES (39828,750000,6987,19492,'2025-11-01 00:00:00.000000',750000,0,'2025-12-01 00:00:00.000000','2025-11-29 23:47:12.000000');
INSERT INTO `history` VALUES (39829,1000000,6987,19493,'2025-12-01 00:00:00.000000',750000,500000,'2026-02-01 00:00:00.000000','2025-11-29 23:49:16.000000');

--
-- Table structure for table `incomes`
--

CREATE TABLE `incomes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `amount` int(11) NOT NULL,
  `category` int(11) NOT NULL,
  `source` varchar(200) DEFAULT NULL,
  `description` longtext DEFAULT NULL,
  `date` datetime(6) NOT NULL,
  `user` varchar(200) NOT NULL,
  `username` int(11) NOT NULL,
  `asset` int(11) NOT NULL DEFAULT 5,
  `createdat` timestamp(6) NOT NULL DEFAULT current_timestamp(6),
  PRIMARY KEY (`id`),
  KEY `category` (`category`),
  KEY `asset` (`asset`),
  CONSTRAINT `incomes_ibfk_1` FOREIGN KEY (`category`) REFERENCES `incsource` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `incomes_ibfk_2` FOREIGN KEY (`asset`) REFERENCES `assetcategory` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `incomes`
--

INSERT INTO `incomes` VALUES (38,100000,14,'Sale of property','sale of tv from mubiru estate','2025-10-09 00:00:00.000000','Aineomugisha Peter',176,5,'2025-10-09 08:56:11.147162');
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `update_incomes_source` BEFORE INSERT ON `incomes` FOR EACH ROW BEGIN
  IF NEW.asset IS NULL THEN
    SET NEW.asset = 5;
  END IF;
END */;;
DELIMITER ;

--
-- Table structure for table `incomestatements`
--

CREATE TABLE `incomestatements` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `revenue` int(11) DEFAULT NULL,
  `date` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
  `tenant_id` int(11) DEFAULT NULL,
  `property` int(11) NOT NULL,
  `room` int(11) NOT NULL,
  `balance` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `incomestatements_ibfk_1` (`tenant_id`),
  CONSTRAINT `incomestatements_ibfk_1` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4320 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `incomestatements`
--


--
-- Table structure for table `incsource`
--

CREATE TABLE `incsource` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(155) NOT NULL,
  `description` longtext NOT NULL,
  `date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `incsource`
--

INSERT INTO `incsource` VALUES (4,'Donations','Any Donated Amount','2023-11-16 16:54:17');
INSERT INTO `incsource` VALUES (5,'Gifts','Just given amount of money','2023-11-28 05:46:45');
INSERT INTO `incsource` VALUES (7,'Arrears','On acquisition of new property, all moneys owed to the landlord are considered as arrears and are charged 30% on realisation.','2024-01-05 07:42:41');
INSERT INTO `incsource` VALUES (8,'Fines','Charged amount to tenants','2024-05-31 12:22:28');
INSERT INTO `incsource` VALUES (10,'File documentation','Files fee for new Landlords and new properties','2024-06-26 09:23:59');
INSERT INTO `incsource` VALUES (11,'EVICTION FEE ','Charge fee from rent defaulters ','2024-06-28 09:56:57');
INSERT INTO `incsource` VALUES (12,'CLEANING services ','Cleaning fee charged on landlord\'s premise ','2024-06-30 11:22:16');
INSERT INTO `incsource` VALUES (14,'Sale of property','sale of property left by tenants after eviction','2025-10-09 08:54:48');

--
-- Table structure for table `landlords`
--

CREATE TABLE `landlords` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `f_name` varchar(75) NOT NULL,
  `l_name` varchar(75) NOT NULL,
  `midname` varchar(200) DEFAULT NULL,
  `email` varchar(70) NOT NULL,
  `phone` varchar(15) NOT NULL,
  `divsn` varchar(80) DEFAULT NULL,
  `addr` varchar(80) NOT NULL,
  `cities` varchar(80) NOT NULL,
  `divisions` varchar(80) NOT NULL,
  `tin` varchar(20) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `user` varchar(50) NOT NULL,
  `landlord_status` int(11) NOT NULL,
  `resean` varchar(500) DEFAULT NULL,
  `RegDate` datetime(6) NOT NULL,
  `updated_at` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
  `assign` int(11) DEFAULT NULL,
  `latitude` decimal(10,8) NOT NULL,
  `longitude` decimal(11,8) NOT NULL,
  `location_address` varchar(255) DEFAULT NULL,
  `client_ip` varchar(45) DEFAULT NULL,
  `client_isp` varchar(255) DEFAULT NULL,
  `client_city` varchar(100) DEFAULT NULL,
  `client_country` varchar(100) DEFAULT NULL,
  `client_user_agent` varchar(255) DEFAULT NULL,
  `client_device` varchar(150) DEFAULT NULL,
  `client_os` varchar(150) DEFAULT NULL,
  `client_browser` varchar(150) DEFAULT NULL,
  `client_network_type` varchar(150) DEFAULT NULL,
  `client_meta_json` varchar(150) DEFAULT NULL,
  `startdate` date NOT NULL,
  `enddate` date NOT NULL,
  `period` int(11) NOT NULL,
  `note` longtext DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `divsn` (`divsn`),
  KEY `user_id` (`user_id`),
  CONSTRAINT `landlords_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=628 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `landlords`
--

INSERT INTO `landlords` VALUES (500,'Kebirungi','Angella','','','+256781892515','NSEREKO ZONE','NSAMBYA','kampala','','',NULL,'Atuhaire Lahab',1,NULL,'2025-08-29 18:51:52.000000','2025-09-03 03:12:32.950406',173,0.00000000,0.00000000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0000-00-00','0000-00-00',0,NULL);
INSERT INTO `landlords` VALUES (501,'HALUNA','NTAMUTURANO','','','+256708892839','','KIROMBE','kampala','','',NULL,'Atuhaire Lahab',0,'Twic','2025-08-29 18:53:13.000000','2025-09-10 11:00:53.524741',NULL,0.00000000,0.00000000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0000-00-00','0000-00-00',0,NULL);
INSERT INTO `landlords` VALUES (627,'MUSAFIRI','PATRICK','BALODA','softcodes@dev.com','+256788501888','Mbarara city Eazy View','Mbarara city','Mbarara city','CMHFY6TRYGFYRY','',NULL,'Super Administrator',1,NULL,'2025-11-29 23:43:56.000000','2025-11-29 20:43:57.190263',NULL,-0.60560316,30.66348296,'Old Horizon Bus Park, Mbaguta Street, Biafra, Muti, Mbarara City, Western Region, Uganda','102.213.194.66','Cheetahnet Solutions Limited','Kampala','Uganda','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36 Edg/142.0.0.0','Desktop','Windows','Chrome','WiFi/Broadband','{\n    \"status\": \"success\",\n    \"country\": \"Uganda\",\n    \"countryCode\": \"UG\",\n    \"region\": \"C\",\n    \"regionName\": \"Central Region\",\n    \"city\": \"Kampa','2025-10-01','2027-01-01',15,'LANDLORD');
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `Property_status` AFTER UPDATE ON `landlords` FOR EACH ROW BEGIN
    IF NEW.landlord_status != OLD.landlord_status THEN
        -- Update property_status in property table
        UPDATE property
        SET property_status = NEW.landlord_status
        WHERE landlord = NEW.id;
    END IF;
END */;;
DELIMITER ;

--
-- Table structure for table `leads`
--

CREATE TABLE `leads` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `phone` varchar(50) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `lead_type` int(11) NOT NULL,
  `property_interest` varchar(255) DEFAULT NULL,
  `budget` decimal(12,2) DEFAULT NULL,
  `source` varchar(100) DEFAULT NULL,
  `status` enum('new','contacted','follow-up','site_visit','negotiation','converted','lost') DEFAULT 'new',
  `assigned_to` int(11) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `username` varchar(100) DEFAULT NULL,
  `created_at` datetime DEFAULT current_timestamp(),
  `updated_at` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_assigned_to` (`assigned_to`),
  KEY `lead_type` (`lead_type`),
  CONSTRAINT `fk_leads_assigned_to` FOREIGN KEY (`assigned_to`) REFERENCES `user` (`id`) ON DELETE SET NULL,
  CONSTRAINT `leads_ibfk_1` FOREIGN KEY (`lead_type`) REFERENCES `lease` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `leads`
--

INSERT INTO `leads` VALUES (1,'John Bosco ','+256778850913','johnbosco@gmail.com',2,'2 Bedroom Apartment – Kira',85000.00,'Walk-in','new',NULL,'Wants to move in next month','Super Administrator','2025-11-22 12:13:57','2025-11-22 12:13:57');

--
-- Table structure for table `lease`
--

CREATE TABLE `lease` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(250) NOT NULL,
  `description` mediumtext DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `lease`
--

INSERT INTO `lease` VALUES (1,'Agent Referral','Another agent referred for a house');
INSERT INTO `lease` VALUES (2,'Corporate Rental','Company needs apartments for staff');
INSERT INTO `lease` VALUES (3,'Short Stay','Short Stay');
INSERT INTO `lease` VALUES (4,'Commercial Lease','Commercial Lease');
INSERT INTO `lease` VALUES (5,'Rent','Rent');

--
-- Table structure for table `leasesetting`
--

CREATE TABLE `leasesetting` (
  `id` int(12) NOT NULL AUTO_INCREMENT,
  `name` varchar(85) NOT NULL,
  `description` longtext DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `leasesetting`
--

INSERT INTO `leasesetting` VALUES (2,'RSK','Receipt');

--
-- Table structure for table `ledger`
--

CREATE TABLE `ledger` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `payment_id` int(11) NOT NULL,
  `landlord_id` int(11) NOT NULL,
  `property_id` int(11) DEFAULT NULL,
  `balance` float NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `date` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
  `status` int(11) NOT NULL DEFAULT 0,
  `username` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `payment_id` (`payment_id`),
  KEY `landlord_id` (`landlord_id`),
  KEY `property_id` (`property_id`),
  CONSTRAINT `ledger_ibfk_1` FOREIGN KEY (`payment_id`) REFERENCES `payments` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `ledger_ibfk_2` FOREIGN KEY (`landlord_id`) REFERENCES `landlords` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `ledger_ibfk_3` FOREIGN KEY (`property_id`) REFERENCES `property` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `ledger`
--


--
-- Table structure for table `liabilities`
--

CREATE TABLE `liabilities` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(250) NOT NULL,
  `description` mediumtext DEFAULT NULL,
  `price` int(11) NOT NULL,
  `typeLiability` int(11) NOT NULL,
  `typeliab` varchar(150) DEFAULT NULL,
  `Bank` int(11) DEFAULT NULL,
  `Bankname` varchar(150) DEFAULT NULL,
  `AccountName` varchar(75) DEFAULT NULL,
  `username` varchar(150) DEFAULT NULL,
  `date` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
  PRIMARY KEY (`id`),
  KEY `typeLiability` (`typeLiability`),
  CONSTRAINT `liabilities_ibfk_1` FOREIGN KEY (`typeLiability`) REFERENCES `assetstatus` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `liabilities`
--


--
-- Table structure for table `menu`
--

CREATE TABLE `menu` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(128) NOT NULL,
  `parent` int(11) DEFAULT NULL,
  `route` varchar(255) DEFAULT NULL,
  `order` int(11) DEFAULT NULL,
  `data` blob DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `parent` (`parent`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

--
-- Dumping data for table `menu`
--


--
-- Table structure for table `messages`
--

CREATE TABLE `messages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(50) NOT NULL,
  `password` varchar(50) NOT NULL,
  `sender` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `messages`
--

INSERT INTO `messages` VALUES (1,'Akajumbura','Akajumbura@2561','Rocksky');

--
-- Table structure for table `migration`
--

CREATE TABLE `migration` (
  `version` varchar(180) NOT NULL,
  `apply_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `migration`
--

INSERT INTO `migration` VALUES ('m000000_000000_base',1685011871);
INSERT INTO `migration` VALUES ('m140506_102106_rbac_init',1685011877);
INSERT INTO `migration` VALUES ('m140602_111327_create_menu_table',1685013817);
INSERT INTO `migration` VALUES ('m150916_224917_create_country_table',1699598318);
INSERT INTO `migration` VALUES ('m150916_225049_create_post_country_assn_table',1699598318);
INSERT INTO `migration` VALUES ('m160312_050000_create_user',1685013817);
INSERT INTO `migration` VALUES ('m170907_052038_rbac_add_index_on_auth_assignment_user_id',1685011878);
INSERT INTO `migration` VALUES ('m180523_151638_rbac_updates_indexes_without_prefix',1685011878);
INSERT INTO `migration` VALUES ('m180828_154717_backup',1685365087);
INSERT INTO `migration` VALUES ('m200409_110543_rbac_update_mssql_trigger',1685011879);
INSERT INTO `migration` VALUES ('m230412_072119_create_customer_table',1685604314);

--
-- Table structure for table `notification`
--

CREATE TABLE `notification` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `model_id` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9025 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `notification`
--

INSERT INTO `notification` VALUES (8036,9768);
INSERT INTO `notification` VALUES (8037,9774);
INSERT INTO `notification` VALUES (8038,9776);
INSERT INTO `notification` VALUES (8039,9773);
INSERT INTO `notification` VALUES (8040,9786);
INSERT INTO `notification` VALUES (8041,9787);
INSERT INTO `notification` VALUES (8042,9816);
INSERT INTO `notification` VALUES (8043,9817);
INSERT INTO `notification` VALUES (8044,9820);
INSERT INTO `notification` VALUES (8045,9794);
INSERT INTO `notification` VALUES (8046,9828);
INSERT INTO `notification` VALUES (8047,9834);
INSERT INTO `notification` VALUES (8048,9880);
INSERT INTO `notification` VALUES (8049,9839);
INSERT INTO `notification` VALUES (8050,9878);
INSERT INTO `notification` VALUES (8051,9833);
INSERT INTO `notification` VALUES (8052,9898);
INSERT INTO `notification` VALUES (8053,9913);
INSERT INTO `notification` VALUES (8054,10018);
INSERT INTO `notification` VALUES (8055,10013);
INSERT INTO `notification` VALUES (8056,10112);
INSERT INTO `notification` VALUES (8057,10204);
INSERT INTO `notification` VALUES (8058,10310);
INSERT INTO `notification` VALUES (8059,10307);
INSERT INTO `notification` VALUES (8060,10547);
INSERT INTO `notification` VALUES (8061,10555);
INSERT INTO `notification` VALUES (8062,10664);
INSERT INTO `notification` VALUES (8063,10679);
INSERT INTO `notification` VALUES (8064,10719);
INSERT INTO `notification` VALUES (8065,10801);
INSERT INTO `notification` VALUES (8066,10821);
INSERT INTO `notification` VALUES (8067,10740);
INSERT INTO `notification` VALUES (8068,10895);
INSERT INTO `notification` VALUES (8069,10977);
INSERT INTO `notification` VALUES (8070,10887);
INSERT INTO `notification` VALUES (8071,10978);
INSERT INTO `notification` VALUES (8072,10997);
INSERT INTO `notification` VALUES (8073,11131);
INSERT INTO `notification` VALUES (8074,11150);
INSERT INTO `notification` VALUES (8075,11154);
INSERT INTO `notification` VALUES (8076,10281);
INSERT INTO `notification` VALUES (8077,11326);
INSERT INTO `notification` VALUES (8078,9890);
INSERT INTO `notification` VALUES (8079,11373);
INSERT INTO `notification` VALUES (8080,11389);
INSERT INTO `notification` VALUES (8081,11413);
INSERT INTO `notification` VALUES (8082,11396);
INSERT INTO `notification` VALUES (8083,11414);
INSERT INTO `notification` VALUES (8084,11439);
INSERT INTO `notification` VALUES (8085,11456);
INSERT INTO `notification` VALUES (8086,11073);
INSERT INTO `notification` VALUES (8087,11466);
INSERT INTO `notification` VALUES (8088,10868);
INSERT INTO `notification` VALUES (8089,10261);
INSERT INTO `notification` VALUES (8090,11475);
INSERT INTO `notification` VALUES (8091,11500);
INSERT INTO `notification` VALUES (8092,11560);
INSERT INTO `notification` VALUES (8093,10072);
INSERT INTO `notification` VALUES (8094,11471);
INSERT INTO `notification` VALUES (8095,11618);
INSERT INTO `notification` VALUES (8096,10731);
INSERT INTO `notification` VALUES (8097,10612);
INSERT INTO `notification` VALUES (8098,11672);
INSERT INTO `notification` VALUES (8099,11725);
INSERT INTO `notification` VALUES (8100,10758);
INSERT INTO `notification` VALUES (8101,10210);
INSERT INTO `notification` VALUES (8102,11826);
INSERT INTO `notification` VALUES (8103,10611);
INSERT INTO `notification` VALUES (8104,10049);
INSERT INTO `notification` VALUES (8105,11898);
INSERT INTO `notification` VALUES (8106,11936);
INSERT INTO `notification` VALUES (8107,12008);
INSERT INTO `notification` VALUES (8108,12020);
INSERT INTO `notification` VALUES (8109,12225);
INSERT INTO `notification` VALUES (8110,12278);
INSERT INTO `notification` VALUES (8111,12283);
INSERT INTO `notification` VALUES (8112,10088);
INSERT INTO `notification` VALUES (8113,12364);
INSERT INTO `notification` VALUES (8114,12005);
INSERT INTO `notification` VALUES (8115,12526);
INSERT INTO `notification` VALUES (8116,12363);
INSERT INTO `notification` VALUES (8117,12821);
INSERT INTO `notification` VALUES (8118,12822);
INSERT INTO `notification` VALUES (8119,12867);
INSERT INTO `notification` VALUES (8120,12966);
INSERT INTO `notification` VALUES (8121,12974);
INSERT INTO `notification` VALUES (8122,12975);
INSERT INTO `notification` VALUES (8123,12978);
INSERT INTO `notification` VALUES (8124,13006);
INSERT INTO `notification` VALUES (8125,13157);
INSERT INTO `notification` VALUES (8126,13159);
INSERT INTO `notification` VALUES (8127,13195);
INSERT INTO `notification` VALUES (8128,13250);
INSERT INTO `notification` VALUES (8129,13260);
INSERT INTO `notification` VALUES (8130,13320);
INSERT INTO `notification` VALUES (8131,13321);
INSERT INTO `notification` VALUES (8132,13322);
INSERT INTO `notification` VALUES (8133,12022);
INSERT INTO `notification` VALUES (8134,10769);
INSERT INTO `notification` VALUES (8135,10259);
INSERT INTO `notification` VALUES (8136,10709);
INSERT INTO `notification` VALUES (8137,10886);
INSERT INTO `notification` VALUES (8138,13330);
INSERT INTO `notification` VALUES (8139,13344);
INSERT INTO `notification` VALUES (8140,11203);
INSERT INTO `notification` VALUES (8141,12889);
INSERT INTO `notification` VALUES (8142,10686);
INSERT INTO `notification` VALUES (8143,10643);
INSERT INTO `notification` VALUES (8144,13444);
INSERT INTO `notification` VALUES (8145,11974);
INSERT INTO `notification` VALUES (8146,12121);
INSERT INTO `notification` VALUES (8147,10096);
INSERT INTO `notification` VALUES (8148,13247);
INSERT INTO `notification` VALUES (8149,13495);
INSERT INTO `notification` VALUES (8150,13494);
INSERT INTO `notification` VALUES (8151,11767);
INSERT INTO `notification` VALUES (8152,11343);
INSERT INTO `notification` VALUES (8153,11867);
INSERT INTO `notification` VALUES (8154,13547);
INSERT INTO `notification` VALUES (8155,10527);
INSERT INTO `notification` VALUES (8156,12222);
INSERT INTO `notification` VALUES (8157,11998);
INSERT INTO `notification` VALUES (8158,12967);
INSERT INTO `notification` VALUES (8159,11952);
INSERT INTO `notification` VALUES (8160,13602);
INSERT INTO `notification` VALUES (8161,12752);
INSERT INTO `notification` VALUES (8162,13680);
INSERT INTO `notification` VALUES (8163,13707);
INSERT INTO `notification` VALUES (8164,13711);
INSERT INTO `notification` VALUES (8165,13755);
INSERT INTO `notification` VALUES (8166,10077);
INSERT INTO `notification` VALUES (8167,13785);
INSERT INTO `notification` VALUES (8168,13638);
INSERT INTO `notification` VALUES (8169,10368);
INSERT INTO `notification` VALUES (8170,13761);
INSERT INTO `notification` VALUES (8171,11347);
INSERT INTO `notification` VALUES (8172,10633);
INSERT INTO `notification` VALUES (8173,13822);
INSERT INTO `notification` VALUES (8174,13845);
INSERT INTO `notification` VALUES (8175,10829);
INSERT INTO `notification` VALUES (8176,13912);
INSERT INTO `notification` VALUES (8177,10554);
INSERT INTO `notification` VALUES (8178,13923);
INSERT INTO `notification` VALUES (8179,13924);
INSERT INTO `notification` VALUES (8180,11190);
INSERT INTO `notification` VALUES (8181,11398);
INSERT INTO `notification` VALUES (8182,10729);
INSERT INTO `notification` VALUES (8183,11463);
INSERT INTO `notification` VALUES (8184,13343);
INSERT INTO `notification` VALUES (8185,11777);
INSERT INTO `notification` VALUES (8186,13941);
INSERT INTO `notification` VALUES (8187,13706);
INSERT INTO `notification` VALUES (8188,13942);
INSERT INTO `notification` VALUES (8189,13940);
INSERT INTO `notification` VALUES (8190,13944);
INSERT INTO `notification` VALUES (8191,13943);
INSERT INTO `notification` VALUES (8192,11970);
INSERT INTO `notification` VALUES (8193,11313);
INSERT INTO `notification` VALUES (8194,10139);
INSERT INTO `notification` VALUES (8195,12159);
INSERT INTO `notification` VALUES (8196,10236);
INSERT INTO `notification` VALUES (8197,9865);
INSERT INTO `notification` VALUES (8198,13364);
INSERT INTO `notification` VALUES (8199,10234);
INSERT INTO `notification` VALUES (8200,10254);
INSERT INTO `notification` VALUES (8201,13453);
INSERT INTO `notification` VALUES (8202,13950);
INSERT INTO `notification` VALUES (8203,12301);
INSERT INTO `notification` VALUES (8204,11967);
INSERT INTO `notification` VALUES (8205,11733);
INSERT INTO `notification` VALUES (8206,13984);
INSERT INTO `notification` VALUES (8207,13988);
INSERT INTO `notification` VALUES (8208,12150);
INSERT INTO `notification` VALUES (8209,12754);
INSERT INTO `notification` VALUES (8210,13102);
INSERT INTO `notification` VALUES (8211,12813);
INSERT INTO `notification` VALUES (8212,12818);
INSERT INTO `notification` VALUES (8213,12879);
INSERT INTO `notification` VALUES (8214,12671);
INSERT INTO `notification` VALUES (8215,12896);
INSERT INTO `notification` VALUES (8216,13996);
INSERT INTO `notification` VALUES (8217,11207);
INSERT INTO `notification` VALUES (8218,13411);
INSERT INTO `notification` VALUES (8219,12649);
INSERT INTO `notification` VALUES (8220,11873);
INSERT INTO `notification` VALUES (8221,10655);
INSERT INTO `notification` VALUES (8222,14007);
INSERT INTO `notification` VALUES (8223,12074);
INSERT INTO `notification` VALUES (8224,11758);
INSERT INTO `notification` VALUES (8225,11377);
INSERT INTO `notification` VALUES (8226,12543);
INSERT INTO `notification` VALUES (8227,13490);
INSERT INTO `notification` VALUES (8228,12610);
INSERT INTO `notification` VALUES (8229,11566);
INSERT INTO `notification` VALUES (8230,10902);
INSERT INTO `notification` VALUES (8231,11325);
INSERT INTO `notification` VALUES (8232,12049);
INSERT INTO `notification` VALUES (8233,12151);
INSERT INTO `notification` VALUES (8234,11739);
INSERT INTO `notification` VALUES (8235,13269);
INSERT INTO `notification` VALUES (8236,10607);
INSERT INTO `notification` VALUES (8237,11186);
INSERT INTO `notification` VALUES (8238,12831);
INSERT INTO `notification` VALUES (8239,13939);
INSERT INTO `notification` VALUES (8240,14020);
INSERT INTO `notification` VALUES (8241,13464);
INSERT INTO `notification` VALUES (8242,10910);
INSERT INTO `notification` VALUES (8243,11465);
INSERT INTO `notification` VALUES (8244,13116);
INSERT INTO `notification` VALUES (8245,13754);
INSERT INTO `notification` VALUES (8246,13794);
INSERT INTO `notification` VALUES (8247,10280);
INSERT INTO `notification` VALUES (8248,12736);
INSERT INTO `notification` VALUES (8249,14044);
INSERT INTO `notification` VALUES (8250,13738);
INSERT INTO `notification` VALUES (8251,13354);
INSERT INTO `notification` VALUES (8252,14047);
INSERT INTO `notification` VALUES (8253,14073);
INSERT INTO `notification` VALUES (8254,13709);
INSERT INTO `notification` VALUES (8255,14075);
INSERT INTO `notification` VALUES (8256,13713);
INSERT INTO `notification` VALUES (8257,11942);
INSERT INTO `notification` VALUES (8258,14079);
INSERT INTO `notification` VALUES (8259,13129);
INSERT INTO `notification` VALUES (8260,13765);
INSERT INTO `notification` VALUES (8261,11550);
INSERT INTO `notification` VALUES (8262,12153);
INSERT INTO `notification` VALUES (8263,11477);
INSERT INTO `notification` VALUES (8264,12058);
INSERT INTO `notification` VALUES (8265,14086);
INSERT INTO `notification` VALUES (8266,13646);
INSERT INTO `notification` VALUES (8267,11829);
INSERT INTO `notification` VALUES (8268,11521);
INSERT INTO `notification` VALUES (8269,11141);
INSERT INTO `notification` VALUES (8270,14114);
INSERT INTO `notification` VALUES (8271,10973);
INSERT INTO `notification` VALUES (8272,13352);
INSERT INTO `notification` VALUES (8273,13958);
INSERT INTO `notification` VALUES (8274,12838);
INSERT INTO `notification` VALUES (8275,14118);
INSERT INTO `notification` VALUES (8276,11274);
INSERT INTO `notification` VALUES (8277,10564);
INSERT INTO `notification` VALUES (8278,14119);
INSERT INTO `notification` VALUES (8279,11060);
INSERT INTO `notification` VALUES (8280,10836);
INSERT INTO `notification` VALUES (8281,11069);
INSERT INTO `notification` VALUES (8282,13214);
INSERT INTO `notification` VALUES (8283,12625);
INSERT INTO `notification` VALUES (8284,13747);
INSERT INTO `notification` VALUES (8285,13377);
INSERT INTO `notification` VALUES (8286,10271);
INSERT INTO `notification` VALUES (8287,12123);
INSERT INTO `notification` VALUES (8288,13726);
INSERT INTO `notification` VALUES (8289,13719);
INSERT INTO `notification` VALUES (8290,13545);
INSERT INTO `notification` VALUES (8291,14139);
INSERT INTO `notification` VALUES (8292,10677);
INSERT INTO `notification` VALUES (8293,10676);
INSERT INTO `notification` VALUES (8294,11987);
INSERT INTO `notification` VALUES (8295,10170);
INSERT INTO `notification` VALUES (8296,10103);
INSERT INTO `notification` VALUES (8297,11201);
INSERT INTO `notification` VALUES (8298,10083);
INSERT INTO `notification` VALUES (8299,11780);
INSERT INTO `notification` VALUES (8300,14156);
INSERT INTO `notification` VALUES (8301,14157);
INSERT INTO `notification` VALUES (8302,12665);
INSERT INTO `notification` VALUES (8303,13248);
INSERT INTO `notification` VALUES (8304,12023);
INSERT INTO `notification` VALUES (8305,12440);
INSERT INTO `notification` VALUES (8306,13677);
INSERT INTO `notification` VALUES (8307,14066);
INSERT INTO `notification` VALUES (8308,13788);
INSERT INTO `notification` VALUES (8309,14186);
INSERT INTO `notification` VALUES (8310,11643);
INSERT INTO `notification` VALUES (8311,11712);
INSERT INTO `notification` VALUES (8312,10240);
INSERT INTO `notification` VALUES (8313,14198);
INSERT INTO `notification` VALUES (8314,14200);
INSERT INTO `notification` VALUES (8315,10311);
INSERT INTO `notification` VALUES (8316,10589);
INSERT INTO `notification` VALUES (8317,10062);
INSERT INTO `notification` VALUES (8318,11517);
INSERT INTO `notification` VALUES (8319,10352);
INSERT INTO `notification` VALUES (8320,11295);
INSERT INTO `notification` VALUES (8321,13733);
INSERT INTO `notification` VALUES (8322,10846);
INSERT INTO `notification` VALUES (8323,11290);
INSERT INTO `notification` VALUES (8324,14241);
INSERT INTO `notification` VALUES (8325,12631);
INSERT INTO `notification` VALUES (8326,11943);
INSERT INTO `notification` VALUES (8327,14021);
INSERT INTO `notification` VALUES (8328,11411);
INSERT INTO `notification` VALUES (8329,11191);
INSERT INTO `notification` VALUES (8330,14267);
INSERT INTO `notification` VALUES (8331,9937);
INSERT INTO `notification` VALUES (8332,14257);
INSERT INTO `notification` VALUES (8333,14276);
INSERT INTO `notification` VALUES (8334,14284);
INSERT INTO `notification` VALUES (8335,11258);
INSERT INTO `notification` VALUES (8336,12844);
INSERT INTO `notification` VALUES (8337,12454);
INSERT INTO `notification` VALUES (8338,14320);
INSERT INTO `notification` VALUES (8339,14237);
INSERT INTO `notification` VALUES (8340,13268);
INSERT INTO `notification` VALUES (8341,13590);
INSERT INTO `notification` VALUES (8342,14348);
INSERT INTO `notification` VALUES (8343,14349);
INSERT INTO `notification` VALUES (8344,14353);
INSERT INTO `notification` VALUES (8345,12986);
INSERT INTO `notification` VALUES (8346,12073);
INSERT INTO `notification` VALUES (8347,14358);
INSERT INTO `notification` VALUES (8348,9858);
INSERT INTO `notification` VALUES (8349,14364);
INSERT INTO `notification` VALUES (8350,10127);
INSERT INTO `notification` VALUES (8351,12619);
INSERT INTO `notification` VALUES (8352,14369);
INSERT INTO `notification` VALUES (8353,14370);
INSERT INTO `notification` VALUES (8354,11383);
INSERT INTO `notification` VALUES (8355,14371);
INSERT INTO `notification` VALUES (8356,12118);
INSERT INTO `notification` VALUES (8357,12184);
INSERT INTO `notification` VALUES (8358,11450);
INSERT INTO `notification` VALUES (8359,11996);
INSERT INTO `notification` VALUES (8360,13535);
INSERT INTO `notification` VALUES (8361,12152);
INSERT INTO `notification` VALUES (8362,14395);
INSERT INTO `notification` VALUES (8363,14399);
INSERT INTO `notification` VALUES (8364,10903);
INSERT INTO `notification` VALUES (8365,11884);
INSERT INTO `notification` VALUES (8366,12265);
INSERT INTO `notification` VALUES (8367,14439);
INSERT INTO `notification` VALUES (8368,14444);
INSERT INTO `notification` VALUES (8369,13148);
INSERT INTO `notification` VALUES (8370,14460);
INSERT INTO `notification` VALUES (8371,13139);
INSERT INTO `notification` VALUES (8372,14463);
INSERT INTO `notification` VALUES (8373,10907);
INSERT INTO `notification` VALUES (8374,14465);
INSERT INTO `notification` VALUES (8375,11105);
INSERT INTO `notification` VALUES (8376,11935);
INSERT INTO `notification` VALUES (8377,14493);
INSERT INTO `notification` VALUES (8378,14507);
INSERT INTO `notification` VALUES (8379,14509);
INSERT INTO `notification` VALUES (8380,14537);
INSERT INTO `notification` VALUES (8381,11656);
INSERT INTO `notification` VALUES (8382,10950);
INSERT INTO `notification` VALUES (8383,12223);
INSERT INTO `notification` VALUES (8384,14562);
INSERT INTO `notification` VALUES (8385,11821);
INSERT INTO `notification` VALUES (8386,14584);
INSERT INTO `notification` VALUES (8387,14590);
INSERT INTO `notification` VALUES (8388,11874);
INSERT INTO `notification` VALUES (8389,14595);
INSERT INTO `notification` VALUES (8390,14299);
INSERT INTO `notification` VALUES (8391,13528);
INSERT INTO `notification` VALUES (8392,14626);
INSERT INTO `notification` VALUES (8393,14652);
INSERT INTO `notification` VALUES (8394,14661);
INSERT INTO `notification` VALUES (8395,14660);
INSERT INTO `notification` VALUES (8396,14676);
INSERT INTO `notification` VALUES (8397,14697);
INSERT INTO `notification` VALUES (8398,12963);
INSERT INTO `notification` VALUES (8399,12768);
INSERT INTO `notification` VALUES (8400,14582);
INSERT INTO `notification` VALUES (8401,12561);
INSERT INTO `notification` VALUES (8402,13415);
INSERT INTO `notification` VALUES (8403,9877);
INSERT INTO `notification` VALUES (8404,14723);
INSERT INTO `notification` VALUES (8405,14747);
INSERT INTO `notification` VALUES (8406,14760);
INSERT INTO `notification` VALUES (8407,14761);
INSERT INTO `notification` VALUES (8408,11020);
INSERT INTO `notification` VALUES (8409,14786);
INSERT INTO `notification` VALUES (8410,14791);
INSERT INTO `notification` VALUES (8411,12140);
INSERT INTO `notification` VALUES (8412,14832);
INSERT INTO `notification` VALUES (8413,14838);
INSERT INTO `notification` VALUES (8414,14856);
INSERT INTO `notification` VALUES (8415,14857);
INSERT INTO `notification` VALUES (8416,12941);
INSERT INTO `notification` VALUES (8417,14866);
INSERT INTO `notification` VALUES (8418,11689);
INSERT INTO `notification` VALUES (8419,14867);
INSERT INTO `notification` VALUES (8420,13497);
INSERT INTO `notification` VALUES (8421,14869);
INSERT INTO `notification` VALUES (8422,14871);
INSERT INTO `notification` VALUES (8423,14886);
INSERT INTO `notification` VALUES (8424,13380);
INSERT INTO `notification` VALUES (8425,14863);
INSERT INTO `notification` VALUES (8426,13891);
INSERT INTO `notification` VALUES (8427,14894);
INSERT INTO `notification` VALUES (8428,14896);
INSERT INTO `notification` VALUES (8429,14719);
INSERT INTO `notification` VALUES (8430,14930);
INSERT INTO `notification` VALUES (8431,14933);
INSERT INTO `notification` VALUES (8432,14533);
INSERT INTO `notification` VALUES (8433,14934);
INSERT INTO `notification` VALUES (8434,14459);
INSERT INTO `notification` VALUES (8435,14938);
INSERT INTO `notification` VALUES (8436,14947);
INSERT INTO `notification` VALUES (8437,9840);
INSERT INTO `notification` VALUES (8438,14956);
INSERT INTO `notification` VALUES (8439,14959);
INSERT INTO `notification` VALUES (8440,14962);
INSERT INTO `notification` VALUES (8441,14964);
INSERT INTO `notification` VALUES (8442,14975);
INSERT INTO `notification` VALUES (8443,10266);
INSERT INTO `notification` VALUES (8444,14978);
INSERT INTO `notification` VALUES (8445,14982);
INSERT INTO `notification` VALUES (8446,14989);
INSERT INTO `notification` VALUES (8447,10052);
INSERT INTO `notification` VALUES (8448,15004);
INSERT INTO `notification` VALUES (8449,13819);
INSERT INTO `notification` VALUES (8450,11507);
INSERT INTO `notification` VALUES (8451,15024);
INSERT INTO `notification` VALUES (8452,15029);
INSERT INTO `notification` VALUES (8453,15049);
INSERT INTO `notification` VALUES (8454,15050);
INSERT INTO `notification` VALUES (8455,15051);
INSERT INTO `notification` VALUES (8456,15053);
INSERT INTO `notification` VALUES (8457,14052);
INSERT INTO `notification` VALUES (8458,11580);
INSERT INTO `notification` VALUES (8459,15054);
INSERT INTO `notification` VALUES (8460,15062);
INSERT INTO `notification` VALUES (8461,15071);
INSERT INTO `notification` VALUES (8462,15074);
INSERT INTO `notification` VALUES (8463,15081);
INSERT INTO `notification` VALUES (8464,12327);
INSERT INTO `notification` VALUES (8465,15093);
INSERT INTO `notification` VALUES (8466,14335);
INSERT INTO `notification` VALUES (8467,13611);
INSERT INTO `notification` VALUES (8468,15106);
INSERT INTO `notification` VALUES (8469,15116);
INSERT INTO `notification` VALUES (8470,15135);
INSERT INTO `notification` VALUES (8471,15022);
INSERT INTO `notification` VALUES (8472,13582);
INSERT INTO `notification` VALUES (8473,15146);
INSERT INTO `notification` VALUES (8474,13578);
INSERT INTO `notification` VALUES (8475,15166);
INSERT INTO `notification` VALUES (8476,15172);
INSERT INTO `notification` VALUES (8477,15184);
INSERT INTO `notification` VALUES (8478,12669);
INSERT INTO `notification` VALUES (8479,15187);
INSERT INTO `notification` VALUES (8480,15191);
INSERT INTO `notification` VALUES (8481,15198);
INSERT INTO `notification` VALUES (8482,15199);
INSERT INTO `notification` VALUES (8483,13820);
INSERT INTO `notification` VALUES (8484,15218);
INSERT INTO `notification` VALUES (8485,15250);
INSERT INTO `notification` VALUES (8486,15200);
INSERT INTO `notification` VALUES (8487,15266);
INSERT INTO `notification` VALUES (8488,15290);
INSERT INTO `notification` VALUES (8489,10844);
INSERT INTO `notification` VALUES (8490,15301);
INSERT INTO `notification` VALUES (8491,12177);
INSERT INTO `notification` VALUES (8492,15294);
INSERT INTO `notification` VALUES (8493,11787);
INSERT INTO `notification` VALUES (8494,11949);
INSERT INTO `notification` VALUES (8495,12743);
INSERT INTO `notification` VALUES (8496,15331);
INSERT INTO `notification` VALUES (8497,15332);
INSERT INTO `notification` VALUES (8498,15342);
INSERT INTO `notification` VALUES (8499,15355);
INSERT INTO `notification` VALUES (8500,14645);
INSERT INTO `notification` VALUES (8501,14637);
INSERT INTO `notification` VALUES (8502,15369);
INSERT INTO `notification` VALUES (8503,15371);
INSERT INTO `notification` VALUES (8504,12320);
INSERT INTO `notification` VALUES (8505,15378);
INSERT INTO `notification` VALUES (8506,15386);
INSERT INTO `notification` VALUES (8507,14462);
INSERT INTO `notification` VALUES (8508,14062);
INSERT INTO `notification` VALUES (8509,15425);
INSERT INTO `notification` VALUES (8510,15434);
INSERT INTO `notification` VALUES (8511,15474);
INSERT INTO `notification` VALUES (8512,15083);
INSERT INTO `notification` VALUES (8513,14576);
INSERT INTO `notification` VALUES (8514,9841);
INSERT INTO `notification` VALUES (8515,15504);
INSERT INTO `notification` VALUES (8516,15505);
INSERT INTO `notification` VALUES (8517,13682);
INSERT INTO `notification` VALUES (8518,11716);
INSERT INTO `notification` VALUES (8519,15514);
INSERT INTO `notification` VALUES (8520,13960);
INSERT INTO `notification` VALUES (8521,15522);
INSERT INTO `notification` VALUES (8522,15089);
INSERT INTO `notification` VALUES (8523,10093);
INSERT INTO `notification` VALUES (8524,15542);
INSERT INTO `notification` VALUES (8525,15213);
INSERT INTO `notification` VALUES (8526,15566);
INSERT INTO `notification` VALUES (8527,12608);
INSERT INTO `notification` VALUES (8528,15568);
INSERT INTO `notification` VALUES (8529,15572);
INSERT INTO `notification` VALUES (8530,14177);
INSERT INTO `notification` VALUES (8531,15244);
INSERT INTO `notification` VALUES (8532,12778);
INSERT INTO `notification` VALUES (8533,11723);
INSERT INTO `notification` VALUES (8534,14025);
INSERT INTO `notification` VALUES (8535,15575);
INSERT INTO `notification` VALUES (8536,15407);
INSERT INTO `notification` VALUES (8537,15576);
INSERT INTO `notification` VALUES (8538,15577);
INSERT INTO `notification` VALUES (8539,15590);
INSERT INTO `notification` VALUES (8540,15591);
INSERT INTO `notification` VALUES (8541,15593);
INSERT INTO `notification` VALUES (8542,15599);
INSERT INTO `notification` VALUES (8543,15620);
INSERT INTO `notification` VALUES (8544,15483);
INSERT INTO `notification` VALUES (8545,10428);
INSERT INTO `notification` VALUES (8546,15628);
INSERT INTO `notification` VALUES (8547,15635);
INSERT INTO `notification` VALUES (8548,15661);
INSERT INTO `notification` VALUES (8549,15663);
INSERT INTO `notification` VALUES (8550,11406);
INSERT INTO `notification` VALUES (8551,15676);
INSERT INTO `notification` VALUES (8552,13172);
INSERT INTO `notification` VALUES (8553,14574);
INSERT INTO `notification` VALUES (8554,11682);
INSERT INTO `notification` VALUES (8555,15686);
INSERT INTO `notification` VALUES (8556,15698);
INSERT INTO `notification` VALUES (8557,12824);
INSERT INTO `notification` VALUES (8558,12493);
INSERT INTO `notification` VALUES (8559,15726);
INSERT INTO `notification` VALUES (8560,15156);
INSERT INTO `notification` VALUES (8561,13144);
INSERT INTO `notification` VALUES (8562,12623);
INSERT INTO `notification` VALUES (8563,15745);
INSERT INTO `notification` VALUES (8564,15673);
INSERT INTO `notification` VALUES (8565,14048);
INSERT INTO `notification` VALUES (8566,12060);
INSERT INTO `notification` VALUES (8567,15773);
INSERT INTO `notification` VALUES (8568,15777);
INSERT INTO `notification` VALUES (8569,15778);
INSERT INTO `notification` VALUES (8570,13959);
INSERT INTO `notification` VALUES (8571,15787);
INSERT INTO `notification` VALUES (8572,15789);
INSERT INTO `notification` VALUES (8573,15792);
INSERT INTO `notification` VALUES (8574,13104);
INSERT INTO `notification` VALUES (8575,15406);
INSERT INTO `notification` VALUES (8576,15807);
INSERT INTO `notification` VALUES (8577,12156);
INSERT INTO `notification` VALUES (8578,15818);
INSERT INTO `notification` VALUES (8579,15827);
INSERT INTO `notification` VALUES (8580,15828);
INSERT INTO `notification` VALUES (8581,15839);
INSERT INTO `notification` VALUES (8582,15840);
INSERT INTO `notification` VALUES (8583,12087);
INSERT INTO `notification` VALUES (8584,13955);
INSERT INTO `notification` VALUES (8585,15467);
INSERT INTO `notification` VALUES (8586,13925);
INSERT INTO `notification` VALUES (8587,15446);
INSERT INTO `notification` VALUES (8588,13140);
INSERT INTO `notification` VALUES (8589,10467);
INSERT INTO `notification` VALUES (8590,15870);
INSERT INTO `notification` VALUES (8591,9848);
INSERT INTO `notification` VALUES (8592,15873);
INSERT INTO `notification` VALUES (8593,15879);
INSERT INTO `notification` VALUES (8594,10953);
INSERT INTO `notification` VALUES (8595,12951);
INSERT INTO `notification` VALUES (8596,13048);
INSERT INTO `notification` VALUES (8597,10956);
INSERT INTO `notification` VALUES (8598,9836);
INSERT INTO `notification` VALUES (8599,11015);
INSERT INTO `notification` VALUES (8600,10979);
INSERT INTO `notification` VALUES (8601,15884);
INSERT INTO `notification` VALUES (8602,10341);
INSERT INTO `notification` VALUES (8603,15888);
INSERT INTO `notification` VALUES (8604,13825);
INSERT INTO `notification` VALUES (8605,12549);
INSERT INTO `notification` VALUES (8606,10981);
INSERT INTO `notification` VALUES (8607,12112);
INSERT INTO `notification` VALUES (8608,15900);
INSERT INTO `notification` VALUES (8609,15926);
INSERT INTO `notification` VALUES (8610,14128);
INSERT INTO `notification` VALUES (8611,13092);
INSERT INTO `notification` VALUES (8612,15958);
INSERT INTO `notification` VALUES (8613,14724);
INSERT INTO `notification` VALUES (8614,16043);
INSERT INTO `notification` VALUES (8615,16054);
INSERT INTO `notification` VALUES (8616,16065);
INSERT INTO `notification` VALUES (8617,15293);
INSERT INTO `notification` VALUES (8618,16066);
INSERT INTO `notification` VALUES (8619,16072);
INSERT INTO `notification` VALUES (8620,16073);
INSERT INTO `notification` VALUES (8621,11875);
INSERT INTO `notification` VALUES (8622,16093);
INSERT INTO `notification` VALUES (8623,14640);
INSERT INTO `notification` VALUES (8624,16117);
INSERT INTO `notification` VALUES (8625,16124);
INSERT INTO `notification` VALUES (8626,16128);
INSERT INTO `notification` VALUES (8627,16134);
INSERT INTO `notification` VALUES (8628,10085);
INSERT INTO `notification` VALUES (8629,10005);
INSERT INTO `notification` VALUES (8630,16192);
INSERT INTO `notification` VALUES (8631,11705);
INSERT INTO `notification` VALUES (8632,16193);
INSERT INTO `notification` VALUES (8633,13695);
INSERT INTO `notification` VALUES (8634,14028);
INSERT INTO `notification` VALUES (8635,16205);
INSERT INTO `notification` VALUES (8636,11183);
INSERT INTO `notification` VALUES (8637,16218);
INSERT INTO `notification` VALUES (8638,16225);
INSERT INTO `notification` VALUES (8639,14596);
INSERT INTO `notification` VALUES (8640,16227);
INSERT INTO `notification` VALUES (8641,16230);
INSERT INTO `notification` VALUES (8642,16220);
INSERT INTO `notification` VALUES (8643,16025);
INSERT INTO `notification` VALUES (8644,16241);
INSERT INTO `notification` VALUES (8645,16245);
INSERT INTO `notification` VALUES (8646,16269);
INSERT INTO `notification` VALUES (8647,16297);
INSERT INTO `notification` VALUES (8648,16304);
INSERT INTO `notification` VALUES (8649,16311);
INSERT INTO `notification` VALUES (8650,16317);
INSERT INTO `notification` VALUES (8651,16296);
INSERT INTO `notification` VALUES (8652,16324);
INSERT INTO `notification` VALUES (8653,14868);
INSERT INTO `notification` VALUES (8654,16346);
INSERT INTO `notification` VALUES (8655,16353);
INSERT INTO `notification` VALUES (8656,16354);
INSERT INTO `notification` VALUES (8657,16359);
INSERT INTO `notification` VALUES (8658,16362);
INSERT INTO `notification` VALUES (8659,14206);
INSERT INTO `notification` VALUES (8660,16352);
INSERT INTO `notification` VALUES (8661,16371);
INSERT INTO `notification` VALUES (8662,16403);
INSERT INTO `notification` VALUES (8663,16405);
INSERT INTO `notification` VALUES (8664,16425);
INSERT INTO `notification` VALUES (8665,16434);
INSERT INTO `notification` VALUES (8666,14552);
INSERT INTO `notification` VALUES (8667,16440);
INSERT INTO `notification` VALUES (8668,16450);
INSERT INTO `notification` VALUES (8669,14987);
INSERT INTO `notification` VALUES (8670,16459);
INSERT INTO `notification` VALUES (8671,16461);
INSERT INTO `notification` VALUES (8672,14414);
INSERT INTO `notification` VALUES (8673,16468);
INSERT INTO `notification` VALUES (8674,16470);
INSERT INTO `notification` VALUES (8675,16469);
INSERT INTO `notification` VALUES (8676,16482);
INSERT INTO `notification` VALUES (8677,16377);
INSERT INTO `notification` VALUES (8678,16483);
INSERT INTO `notification` VALUES (8679,16485);
INSERT INTO `notification` VALUES (8680,10329);
INSERT INTO `notification` VALUES (8681,16486);
INSERT INTO `notification` VALUES (8682,12921);
INSERT INTO `notification` VALUES (8683,16487);
INSERT INTO `notification` VALUES (8684,11511);
INSERT INTO `notification` VALUES (8685,16492);
INSERT INTO `notification` VALUES (8686,16496);
INSERT INTO `notification` VALUES (8687,16503);
INSERT INTO `notification` VALUES (8688,16198);
INSERT INTO `notification` VALUES (8689,16523);
INSERT INTO `notification` VALUES (8690,13967);
INSERT INTO `notification` VALUES (8691,16536);
INSERT INTO `notification` VALUES (8692,13859);
INSERT INTO `notification` VALUES (8693,16581);
INSERT INTO `notification` VALUES (8694,16588);
INSERT INTO `notification` VALUES (8695,16589);
INSERT INTO `notification` VALUES (8696,15583);
INSERT INTO `notification` VALUES (8697,16590);
INSERT INTO `notification` VALUES (8698,15109);
INSERT INTO `notification` VALUES (8699,16629);
INSERT INTO `notification` VALUES (8700,11035);
INSERT INTO `notification` VALUES (8701,16646);
INSERT INTO `notification` VALUES (8702,16650);
INSERT INTO `notification` VALUES (8703,16656);
INSERT INTO `notification` VALUES (8704,10129);
INSERT INTO `notification` VALUES (8705,16672);
INSERT INTO `notification` VALUES (8706,16688);
INSERT INTO `notification` VALUES (8707,16701);
INSERT INTO `notification` VALUES (8708,16713);
INSERT INTO `notification` VALUES (8709,16730);
INSERT INTO `notification` VALUES (8710,16748);
INSERT INTO `notification` VALUES (8711,16750);
INSERT INTO `notification` VALUES (8712,16765);
INSERT INTO `notification` VALUES (8713,16789);
INSERT INTO `notification` VALUES (8714,16794);
INSERT INTO `notification` VALUES (8715,16805);
INSERT INTO `notification` VALUES (8716,10426);
INSERT INTO `notification` VALUES (8717,16824);
INSERT INTO `notification` VALUES (8718,16832);
INSERT INTO `notification` VALUES (8719,16836);
INSERT INTO `notification` VALUES (8720,15399);
INSERT INTO `notification` VALUES (8721,16838);
INSERT INTO `notification` VALUES (8722,16846);
INSERT INTO `notification` VALUES (8723,16855);
INSERT INTO `notification` VALUES (8724,16911);
INSERT INTO `notification` VALUES (8725,15889);
INSERT INTO `notification` VALUES (8726,16913);
INSERT INTO `notification` VALUES (8727,16915);
INSERT INTO `notification` VALUES (8728,15902);
INSERT INTO `notification` VALUES (8729,16921);
INSERT INTO `notification` VALUES (8730,13436);
INSERT INTO `notification` VALUES (8731,16928);
INSERT INTO `notification` VALUES (8732,15358);
INSERT INTO `notification` VALUES (8733,16949);
INSERT INTO `notification` VALUES (8734,16950);
INSERT INTO `notification` VALUES (8735,16955);
INSERT INTO `notification` VALUES (8736,16966);
INSERT INTO `notification` VALUES (8737,16973);
INSERT INTO `notification` VALUES (8738,16997);
INSERT INTO `notification` VALUES (8739,14635);
INSERT INTO `notification` VALUES (8740,14651);
INSERT INTO `notification` VALUES (8741,17017);
INSERT INTO `notification` VALUES (8742,17018);
INSERT INTO `notification` VALUES (8743,17046);
INSERT INTO `notification` VALUES (8744,17055);
INSERT INTO `notification` VALUES (8745,14249);
INSERT INTO `notification` VALUES (8746,17084);
INSERT INTO `notification` VALUES (8747,13467);
INSERT INTO `notification` VALUES (8748,14848);
INSERT INTO `notification` VALUES (8749,14274);
INSERT INTO `notification` VALUES (8750,13026);
INSERT INTO `notification` VALUES (8751,11983);
INSERT INTO `notification` VALUES (8752,17047);
INSERT INTO `notification` VALUES (8753,17121);
INSERT INTO `notification` VALUES (8754,17114);
INSERT INTO `notification` VALUES (8755,11701);
INSERT INTO `notification` VALUES (8756,17160);
INSERT INTO `notification` VALUES (8757,16417);
INSERT INTO `notification` VALUES (8758,16121);
INSERT INTO `notification` VALUES (8759,15388);
INSERT INTO `notification` VALUES (8760,16224);
INSERT INTO `notification` VALUES (8761,11004);
INSERT INTO `notification` VALUES (8762,14418);
INSERT INTO `notification` VALUES (8763,17201);
INSERT INTO `notification` VALUES (8764,13972);
INSERT INTO `notification` VALUES (8765,17219);
INSERT INTO `notification` VALUES (8766,17220);
INSERT INTO `notification` VALUES (8767,17222);
INSERT INTO `notification` VALUES (8768,17238);
INSERT INTO `notification` VALUES (8769,17254);
INSERT INTO `notification` VALUES (8770,17269);
INSERT INTO `notification` VALUES (8771,11986);
INSERT INTO `notification` VALUES (8772,17274);
INSERT INTO `notification` VALUES (8773,17275);
INSERT INTO `notification` VALUES (8774,17286);
INSERT INTO `notification` VALUES (8775,17320);
INSERT INTO `notification` VALUES (8776,17357);
INSERT INTO `notification` VALUES (8777,17351);
INSERT INTO `notification` VALUES (8778,17353);
INSERT INTO `notification` VALUES (8779,17359);
INSERT INTO `notification` VALUES (8780,17360);
INSERT INTO `notification` VALUES (8781,15582);
INSERT INTO `notification` VALUES (8782,17416);
INSERT INTO `notification` VALUES (8783,17417);
INSERT INTO `notification` VALUES (8784,15707);
INSERT INTO `notification` VALUES (8785,17462);
INSERT INTO `notification` VALUES (8786,17454);
INSERT INTO `notification` VALUES (8787,17470);
INSERT INTO `notification` VALUES (8788,17475);
INSERT INTO `notification` VALUES (8789,12973);
INSERT INTO `notification` VALUES (8790,16340);
INSERT INTO `notification` VALUES (8791,17511);
INSERT INTO `notification` VALUES (8792,14539);
INSERT INTO `notification` VALUES (8793,17555);
INSERT INTO `notification` VALUES (8794,17560);
INSERT INTO `notification` VALUES (8795,17563);
INSERT INTO `notification` VALUES (8796,10239);
INSERT INTO `notification` VALUES (8797,17577);
INSERT INTO `notification` VALUES (8798,17580);
INSERT INTO `notification` VALUES (8799,17582);
INSERT INTO `notification` VALUES (8800,17583);
INSERT INTO `notification` VALUES (8801,17584);
INSERT INTO `notification` VALUES (8802,17585);
INSERT INTO `notification` VALUES (8803,17595);
INSERT INTO `notification` VALUES (8804,17606);
INSERT INTO `notification` VALUES (8805,17610);
INSERT INTO `notification` VALUES (8806,15551);
INSERT INTO `notification` VALUES (8807,15373);
INSERT INTO `notification` VALUES (8808,17643);
INSERT INTO `notification` VALUES (8809,17354);
INSERT INTO `notification` VALUES (8810,17673);
INSERT INTO `notification` VALUES (8811,17672);
INSERT INTO `notification` VALUES (8812,15936);
INSERT INTO `notification` VALUES (8813,17676);
INSERT INTO `notification` VALUES (8814,17694);
INSERT INTO `notification` VALUES (8815,17695);
INSERT INTO `notification` VALUES (8816,17704);
INSERT INTO `notification` VALUES (8817,17708);
INSERT INTO `notification` VALUES (8818,17131);
INSERT INTO `notification` VALUES (8819,17714);
INSERT INTO `notification` VALUES (8820,17712);
INSERT INTO `notification` VALUES (8821,17734);
INSERT INTO `notification` VALUES (8822,17739);
INSERT INTO `notification` VALUES (8823,17740);
INSERT INTO `notification` VALUES (8824,17741);
INSERT INTO `notification` VALUES (8825,17753);
INSERT INTO `notification` VALUES (8826,17759);
INSERT INTO `notification` VALUES (8827,16475);
INSERT INTO `notification` VALUES (8828,17773);
INSERT INTO `notification` VALUES (8829,17775);
INSERT INTO `notification` VALUES (8830,17776);
INSERT INTO `notification` VALUES (8831,17781);
INSERT INTO `notification` VALUES (8832,14995);
INSERT INTO `notification` VALUES (8833,17785);
INSERT INTO `notification` VALUES (8834,16075);
INSERT INTO `notification` VALUES (8835,17788);
INSERT INTO `notification` VALUES (8836,17789);
INSERT INTO `notification` VALUES (8837,17761);
INSERT INTO `notification` VALUES (8838,17796);
INSERT INTO `notification` VALUES (8839,17794);
INSERT INTO `notification` VALUES (8840,17797);
INSERT INTO `notification` VALUES (8841,17103);
INSERT INTO `notification` VALUES (8842,17810);
INSERT INTO `notification` VALUES (8843,17811);
INSERT INTO `notification` VALUES (8844,12645);
INSERT INTO `notification` VALUES (8845,17841);
INSERT INTO `notification` VALUES (8846,17842);
INSERT INTO `notification` VALUES (8847,17849);
INSERT INTO `notification` VALUES (8848,17850);
INSERT INTO `notification` VALUES (8849,17855);
INSERT INTO `notification` VALUES (8850,12670);
INSERT INTO `notification` VALUES (8851,17857);
INSERT INTO `notification` VALUES (8852,11749);
INSERT INTO `notification` VALUES (8853,17906);
INSERT INTO `notification` VALUES (8854,17910);
INSERT INTO `notification` VALUES (8855,15655);
INSERT INTO `notification` VALUES (8856,16762);
INSERT INTO `notification` VALUES (8857,17938);
INSERT INTO `notification` VALUES (8858,17939);
INSERT INTO `notification` VALUES (8859,10440);
INSERT INTO `notification` VALUES (8860,17953);
INSERT INTO `notification` VALUES (8861,17978);
INSERT INTO `notification` VALUES (8862,12105);
INSERT INTO `notification` VALUES (8863,18014);
INSERT INTO `notification` VALUES (8864,11801);
INSERT INTO `notification` VALUES (8865,18044);
INSERT INTO `notification` VALUES (8866,18057);
INSERT INTO `notification` VALUES (8867,10014);
INSERT INTO `notification` VALUES (8868,18081);
INSERT INTO `notification` VALUES (8869,18099);
INSERT INTO `notification` VALUES (8870,18102);
INSERT INTO `notification` VALUES (8871,18107);
INSERT INTO `notification` VALUES (8872,12644);
INSERT INTO `notification` VALUES (8873,18145);
INSERT INTO `notification` VALUES (8874,17184);
INSERT INTO `notification` VALUES (8875,18153);
INSERT INTO `notification` VALUES (8876,18185);
INSERT INTO `notification` VALUES (8877,18186);
INSERT INTO `notification` VALUES (8878,18194);
INSERT INTO `notification` VALUES (8879,18188);
INSERT INTO `notification` VALUES (8880,16238);
INSERT INTO `notification` VALUES (8881,18247);
INSERT INTO `notification` VALUES (8882,18252);
INSERT INTO `notification` VALUES (8883,15991);
INSERT INTO `notification` VALUES (8884,18264);
INSERT INTO `notification` VALUES (8885,18276);
INSERT INTO `notification` VALUES (8886,12585);
INSERT INTO `notification` VALUES (8887,18283);
INSERT INTO `notification` VALUES (8888,18291);
INSERT INTO `notification` VALUES (8889,16210);
INSERT INTO `notification` VALUES (8890,18311);
INSERT INTO `notification` VALUES (8891,18313);
INSERT INTO `notification` VALUES (8892,18319);
INSERT INTO `notification` VALUES (8893,18330);
INSERT INTO `notification` VALUES (8894,16385);
INSERT INTO `notification` VALUES (8895,18342);
INSERT INTO `notification` VALUES (8896,18351);
INSERT INTO `notification` VALUES (8897,18358);
INSERT INTO `notification` VALUES (8898,17194);
INSERT INTO `notification` VALUES (8899,18375);
INSERT INTO `notification` VALUES (8900,18401);
INSERT INTO `notification` VALUES (8901,18403);
INSERT INTO `notification` VALUES (8902,18407);
INSERT INTO `notification` VALUES (8903,17501);
INSERT INTO `notification` VALUES (8904,18421);
INSERT INTO `notification` VALUES (8905,18429);
INSERT INTO `notification` VALUES (8906,18432);
INSERT INTO `notification` VALUES (8907,18418);
INSERT INTO `notification` VALUES (8908,13096);
INSERT INTO `notification` VALUES (8909,18443);
INSERT INTO `notification` VALUES (8910,18478);
INSERT INTO `notification` VALUES (8911,18506);
INSERT INTO `notification` VALUES (8912,18507);
INSERT INTO `notification` VALUES (8913,18080);
INSERT INTO `notification` VALUES (8914,18516);
INSERT INTO `notification` VALUES (8915,18519);
INSERT INTO `notification` VALUES (8916,17371);
INSERT INTO `notification` VALUES (8917,18176);
INSERT INTO `notification` VALUES (8918,18541);
INSERT INTO `notification` VALUES (8919,18550);
INSERT INTO `notification` VALUES (8920,18560);
INSERT INTO `notification` VALUES (8921,18570);
INSERT INTO `notification` VALUES (8922,17666);
INSERT INTO `notification` VALUES (8923,18577);
INSERT INTO `notification` VALUES (8924,18579);
INSERT INTO `notification` VALUES (8925,18250);
INSERT INTO `notification` VALUES (8926,18592);
INSERT INTO `notification` VALUES (8927,18597);
INSERT INTO `notification` VALUES (8928,11385);
INSERT INTO `notification` VALUES (8929,18599);
INSERT INTO `notification` VALUES (8930,18614);
INSERT INTO `notification` VALUES (8931,16363);
INSERT INTO `notification` VALUES (8932,16777);
INSERT INTO `notification` VALUES (8933,18643);
INSERT INTO `notification` VALUES (8934,18656);
INSERT INTO `notification` VALUES (8935,13233);
INSERT INTO `notification` VALUES (8936,18670);
INSERT INTO `notification` VALUES (8937,16952);
INSERT INTO `notification` VALUES (8938,17937);
INSERT INTO `notification` VALUES (8939,18688);
INSERT INTO `notification` VALUES (8940,18691);
INSERT INTO `notification` VALUES (8941,18704);
INSERT INTO `notification` VALUES (8942,18707);
INSERT INTO `notification` VALUES (8943,18714);
INSERT INTO `notification` VALUES (8944,18728);
INSERT INTO `notification` VALUES (8945,18745);
INSERT INTO `notification` VALUES (8946,18692);
INSERT INTO `notification` VALUES (8947,18798);
INSERT INTO `notification` VALUES (8948,13462);
INSERT INTO `notification` VALUES (8949,18461);
INSERT INTO `notification` VALUES (8950,10017);
INSERT INTO `notification` VALUES (8951,18811);
INSERT INTO `notification` VALUES (8952,18778);
INSERT INTO `notification` VALUES (8953,18812);
INSERT INTO `notification` VALUES (8954,18814);
INSERT INTO `notification` VALUES (8955,18821);
INSERT INTO `notification` VALUES (8956,18823);
INSERT INTO `notification` VALUES (8957,12432);
INSERT INTO `notification` VALUES (8958,18881);
INSERT INTO `notification` VALUES (8959,18886);
INSERT INTO `notification` VALUES (8960,18887);
INSERT INTO `notification` VALUES (8961,18895);
INSERT INTO `notification` VALUES (8962,18897);
INSERT INTO `notification` VALUES (8963,18937);
INSERT INTO `notification` VALUES (8964,18963);
INSERT INTO `notification` VALUES (8965,18877);
INSERT INTO `notification` VALUES (8966,19001);
INSERT INTO `notification` VALUES (8967,18907);
INSERT INTO `notification` VALUES (8968,12216);
INSERT INTO `notification` VALUES (8969,19016);
INSERT INTO `notification` VALUES (8970,19022);
INSERT INTO `notification` VALUES (8971,18911);
INSERT INTO `notification` VALUES (8972,18485);
INSERT INTO `notification` VALUES (8973,19032);
INSERT INTO `notification` VALUES (8974,19043);
INSERT INTO `notification` VALUES (8975,19047);
INSERT INTO `notification` VALUES (8976,19050);
INSERT INTO `notification` VALUES (8977,19052);
INSERT INTO `notification` VALUES (8978,16580);
INSERT INTO `notification` VALUES (8979,18424);
INSERT INTO `notification` VALUES (8980,19062);
INSERT INTO `notification` VALUES (8981,19069);
INSERT INTO `notification` VALUES (8982,16695);
INSERT INTO `notification` VALUES (8983,19071);
INSERT INTO `notification` VALUES (8984,19081);
INSERT INTO `notification` VALUES (8985,19091);
INSERT INTO `notification` VALUES (8986,19094);
INSERT INTO `notification` VALUES (8987,17893);
INSERT INTO `notification` VALUES (8988,19100);
INSERT INTO `notification` VALUES (8989,19114);
INSERT INTO `notification` VALUES (8990,19121);
INSERT INTO `notification` VALUES (8991,19128);
INSERT INTO `notification` VALUES (8992,19216);
INSERT INTO `notification` VALUES (8993,15488);
INSERT INTO `notification` VALUES (8994,19235);
INSERT INTO `notification` VALUES (8995,19252);
INSERT INTO `notification` VALUES (8996,18109);
INSERT INTO `notification` VALUES (8997,15866);
INSERT INTO `notification` VALUES (8998,19263);
INSERT INTO `notification` VALUES (8999,19278);
INSERT INTO `notification` VALUES (9000,17249);
INSERT INTO `notification` VALUES (9001,19289);
INSERT INTO `notification` VALUES (9002,19296);
INSERT INTO `notification` VALUES (9003,19317);
INSERT INTO `notification` VALUES (9004,19329);
INSERT INTO `notification` VALUES (9005,17956);
INSERT INTO `notification` VALUES (9006,19335);
INSERT INTO `notification` VALUES (9007,14991);
INSERT INTO `notification` VALUES (9008,19345);
INSERT INTO `notification` VALUES (9009,19344);
INSERT INTO `notification` VALUES (9010,12369);
INSERT INTO `notification` VALUES (9011,19347);
INSERT INTO `notification` VALUES (9012,19366);
INSERT INTO `notification` VALUES (9013,17838);
INSERT INTO `notification` VALUES (9014,19392);
INSERT INTO `notification` VALUES (9015,19402);
INSERT INTO `notification` VALUES (9016,19411);
INSERT INTO `notification` VALUES (9017,19412);
INSERT INTO `notification` VALUES (9018,19414);
INSERT INTO `notification` VALUES (9019,19432);
INSERT INTO `notification` VALUES (9020,18841);
INSERT INTO `notification` VALUES (9021,19447);
INSERT INTO `notification` VALUES (9022,19451);
INSERT INTO `notification` VALUES (9023,18652);
INSERT INTO `notification` VALUES (9024,19493);

--
-- Table structure for table `othersalaries`
--

CREATE TABLE `othersalaries` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(250) NOT NULL,
  `description` longtext DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `othersalaries`
--

INSERT INTO `othersalaries` VALUES (2,'Bonuses','');

--
-- Table structure for table `payed`
--

CREATE TABLE `payed` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `agreed` int(11) DEFAULT NULL,
  `paid` int(11) DEFAULT NULL,
  `periodfor` int(11) DEFAULT NULL,
  `collected` float DEFAULT NULL,
  `commission` int(11) DEFAULT NULL,
  `periodmonth` date DEFAULT NULL,
  `commissionperiod` int(11) DEFAULT NULL,
  `due` int(11) DEFAULT NULL,
  `total` int(11) DEFAULT NULL,
  `balance` int(11) DEFAULT NULL,
  `startdate` datetime(6) DEFAULT NULL,
  `enddate` datetime(6) DEFAULT NULL,
  `latitude` decimal(10,8) DEFAULT NULL,
  `longitude` decimal(11,8) DEFAULT NULL,
  `location_address` varchar(255) DEFAULT NULL,
  `client_ip` varchar(45) DEFAULT NULL,
  `client_isp` varchar(255) DEFAULT NULL,
  `client_city` varchar(100) DEFAULT NULL,
  `client_country` varchar(100) DEFAULT NULL,
  `client_user_agent` varchar(255) DEFAULT NULL,
  `client_device` varchar(150) DEFAULT NULL,
  `client_os` varchar(150) DEFAULT NULL,
  `client_browser` varchar(150) DEFAULT NULL,
  `client_network_type` varchar(150) DEFAULT NULL,
  `client_meta_json` varchar(150) DEFAULT NULL,
  `expect_time` datetime(6) DEFAULT NULL,
  `payment` int(11) DEFAULT NULL,
  `ref` varchar(35) DEFAULT NULL,
  `approved` int(11) DEFAULT NULL,
  `desg` varchar(300) DEFAULT NULL,
  `fname` varchar(300) DEFAULT NULL,
  `lname` varchar(300) DEFAULT NULL,
  `middle` varchar(300) DEFAULT NULL,
  `note` longtext DEFAULT NULL,
  `meth` varchar(300) DEFAULT NULL,
  `property_ID` int(11) DEFAULT NULL,
  `property` varchar(200) DEFAULT NULL,
  `unitmode` varchar(200) DEFAULT NULL,
  `unitname` varchar(200) DEFAULT NULL,
  `tfname` varchar(200) DEFAULT NULL,
  `tlname` varchar(200) DEFAULT NULL,
  `tmiddle` varchar(200) DEFAULT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `whatsappnumber` varchar(20) DEFAULT NULL,
  `utilities` int(11) DEFAULT 0,
  `minimump` int(11) DEFAULT NULL,
  `cover` varchar(8000) DEFAULT NULL,
  `imageFile` longtext DEFAULT NULL,
  `arrears` float DEFAULT NULL,
  `mark` int(11) NOT NULL,
  `arrearscommission` int(11) DEFAULT NULL,
  `user` varchar(200) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `username` int(11) DEFAULT NULL,
  `date` datetime(6) DEFAULT NULL,
  `tenant_id` int(11) NOT NULL,
  `active` int(11) NOT NULL DEFAULT 1,
  `asset` int(11) NOT NULL DEFAULT 0,
  `assign` int(11) NOT NULL,
  `direct` int(11) NOT NULL DEFAULT 0,
  `updated_at` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
  PRIMARY KEY (`id`),
  KEY `tenant_id` (`tenant_id`),
  KEY `property_ID` (`property_ID`),
  KEY `user_id` (`user_id`),
  CONSTRAINT `payed_ibfk_1` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `payed_ibfk_2` FOREIGN KEY (`property_ID`) REFERENCES `property` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `payed_ibfk_3` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=19494 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `payed`
--

INSERT INTO `payed` VALUES (19492,750000,750000,1,15,112500,'2025-11-01',112500,0,750000,0,'2025-11-01 00:00:00.000000','2025-12-01 00:00:00.000000',0.32100000,32.57140000,'Aga Khan School Makerere Playground, Mpabana Road, Bat Valley, Central, Kampala Capital City, Kampala, Central Region, Uganda','102.213.194.66','Cheetahnet Solutions Limited','Kampala','Uganda','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36 Edg/142.0.0.0','Desktop','Windows','Chrome','WiFi/Broadband','{\n    \"status\": \"success\",\n    \"country\": \"Uganda\",\n    \"countryCode\": \"UG\",\n    \"region\": \"C\",\n    \"regionName\": \"Central Region\",\n    \"city\": \"Kampa',NULL,7,'0',54,'FIELD OFFICER','OWOYESIGA',' TAREMWA','','','Cash',2319,'PATRICK MENSION','commercial','R1','SOFTCODES','LTD','','+256785773641','',0,750000,NULL,NULL,0,0,0,'Super Administrator',17,17,'2025-11-29 23:47:12.000000',6987,1,0,0,0,'2025-11-29 20:48:29.762210');
INSERT INTO `payed` VALUES (19493,750000,1000000,2,15,150000,'2025-12-01',75000,500000,1500000,500000,'2025-12-01 00:00:00.000000','2026-02-01 00:00:00.000000',-0.60560049,30.66348763,'Old Horizon Bus Park, Mbaguta Street, Biafra, Muti, Mbarara City, Western Region, Uganda','102.213.194.66','Cheetahnet Solutions Limited','Kampala','Uganda','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36 Edg/142.0.0.0','Desktop','Windows','Chrome','WiFi/Broadband','{\n    \"status\": \"success\",\n    \"country\": \"Uganda\",\n    \"countryCode\": \"UG\",\n    \"region\": \"C\",\n    \"regionName\": \"Central Region\",\n    \"city\": \"Kampa','2025-11-25 00:00:00.000000',7,'0',42,'GENERAL MANAGER','KWAGALA','GLORIA','','','Cash',2319,'PATRICK MENSION','commercial','R1','SOFTCODES','LTD','','+256785773641','',0,750000,NULL,NULL,0,0,0,'Super Administrator',17,17,'2025-11-29 23:49:16.000000',6987,1,0,0,0,'2025-11-29 20:49:35.152425');
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `calculate_commissionperiod` BEFORE INSERT ON `payed` FOR EACH ROW BEGIN
  SET NEW.commissionperiod = NEW.commission / NEW.periodfor;
SET NEW.periodmonth = LAST_DAY(NEW.startdate) + INTERVAL 1 DAY - INTERVAL DAY(LAST_DAY(NEW.startdate)) DAY;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `set_due_equal_to_balance` BEFORE INSERT ON `payed` FOR EACH ROW BEGIN
    -- Set the 'due' column to the value being inserted
    SET NEW.balance = NEW.due;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `InsertCommisionPeriod_Data` AFTER INSERT ON `payed` FOR EACH ROW BEGIN
  IF NEW.mark = 0 THEN
 INSERT INTO agentcommission (paymentID, Agcommision, property_ID, user_id, property, unitmode, unitname, paid, collected, periodfor, username, user, date, assign, startdate, enddate)
    VALUES (NEW.id, NEW.commission, NEW.property_ID, NEW.user_id, NEW.property, NEW.unitmode, NEW.unitname, NEW.paid, NEW.collected, NEW.periodfor, NEW.username, NEW.user, NEW.date, NEW.assign, NEW.startdate, NEW.enddate);
      END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `InsertCommision_Arreas` AFTER INSERT ON `payed` FOR EACH ROW BEGIN
  IF NEW.mark = 1 THEN
 INSERT INTO arreascommission (paymentID, Arcommision, property_ID, user_id, paid, property, unitname, tfname, tlname, tmiddle, username, user)
    VALUES (NEW.id, NEW.arrearscommission, NEW.property_ID, NEW.user_id, NEW.paid, NEW.property, NEW.unitname, NEW.tfname, NEW.tlname, NEW.tmiddle, NEW.username, NEW.user);
      END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `InsertTransactionData` AFTER INSERT ON `payed` FOR EACH ROW BEGIN
 INSERT INTO transhistory (payment_id, paymentMethod, due, paid, property_ID, user_id, total, fname, lname, middle, periodfor, property, unitname, startdate, enddate, tenant_id, desgnation, finame, laname, midname, username, user, phone, unitmode, date, assign)
    VALUES (NEW.id, NEW.meth, NEW.due, NEW.paid, NEW.property_ID, NEW.user_id, NEW.total, NEW.tfname, NEW.tlname, NEW.tmiddle, NEW.periodfor, NEW.property, NEW.unitname, NEW.startdate, NEW.enddate, NEW.tenant_id, NEW.desg, NEW.fname, NEW.lname, NEW.middle, NEW.user, NEW.username, NeW.phone, NEW.unitmode, NEW.date, NEW.assign);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `update_history` AFTER INSERT ON `payed` FOR EACH ROW BEGIN
    -- Check if the payment is made with the same start and end dates
    IF NEW.startdate = NEW.enddate THEN
        -- Update the corresponding record in history with the paid amount
        UPDATE history
        SET paid = NEW.paid
        WHERE payment_id = NEW.id;
    ELSE
        -- Insert into history table when a new payment is made
        INSERT INTO history (payment_id, agreed, paid, tenant_id, startdate, due, enddate, date)
        VALUES (NEW.id, NEW.agreed, NEW.paid, NEW.tenant_id, NEW.startdate, NEW.due, NEW.enddate, NEW.date);
        -- Check if the enddate is over and there was no payment
        IF NEW.enddate < CURDATE() THEN
            -- Insert a record with 0 paid for the next payment period
          INSERT INTO history (payment_id, agreed, paid, tenant_id, date, startdate, due, enddate)
            VALUES (NEW.id, NEW.agreed, 0, NEW.tenant_id, NEW.date, ADDDATE(NEW.enddate, INTERVAL 1 DAY), NEW.agreed, ADDDATE(NEW.enddate, INTERVAL 1 MONTH));
        END IF;
    END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `update_tenants_end_date_trigger` AFTER INSERT ON `payed` FOR EACH ROW BEGIN
    UPDATE tenants
    SET end_date = NEW.enddate
    WHERE id = NEW.tenant_id
    AND NEW.enddate > tenants.end_date; -- Only update if the new enddate is greater
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `update_due_balance_update` BEFORE UPDATE ON `payed` FOR EACH ROW BEGIN
    -- Set the 'due' column to the value being inserted
    SET NEW.balance = NEW.due;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `UpdateCommision_Arreas` AFTER UPDATE ON `payed` FOR EACH ROW BEGIN
    IF NEW.mark = 1 AND NEW.direct = 5 THEN
        INSERT INTO arreascommission (paymentID, Arcommision, property_ID, user_id, paid, property, unitname, tfname, tlname, tmiddle, username, user)
        VALUES (NEW.id, NEW.arrearscommission, NEW.property_ID, NEW.user_id, NEW.paid, NEW.property, NEW.unitname, NEW.tfname, NEW.tlname, NEW.tmiddle, NEW.username, NEW.user);
    END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `UpdateCommissionPeriod_Data` AFTER UPDATE ON `payed` FOR EACH ROW BEGIN
  IF NEW.mark = 0 AND NEW.direct = 5 THEN
 INSERT INTO agentcommission (paymentID, Agcommision, property_ID, user_id, property, unitmode, unitname, paid, collected, periodfor, username, user, date, assign, startdate, enddate)
    VALUES (NEW.id, NEW.commission, NEW.property_ID, NEW.user_id, NEW.property, NEW.unitmode, NEW.unitname, NEW.paid, NEW.collected, NEW.periodfor, NEW.username, NEW.user, NEW.date, NEW.assign, NEW.startdate, NEW.enddate);
      END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `UpdateTransactionData` AFTER UPDATE ON `payed` FOR EACH ROW BEGIN
    IF NEW.direct = 5 THEN
        INSERT INTO transhistory (
            payment_id, paymentMethod, due, paid, property_ID, user_id, total,
            fname, lname, middle, periodfor, property, unitname, startdate, enddate,
            tenant_id, desgnation, finame, laname, midname, username, user, phone,
            unitmode, `date`, assign
        )
        VALUES (
            NEW.id, NEW.meth, NEW.due, NEW.paid, NEW.property_ID, NEW.user_id, NEW.total,
            NEW.tfname, NEW.tlname, NEW.tmiddle, NEW.periodfor, NEW.property, NEW.unitname,
            NEW.startdate, NEW.enddate, NEW.tenant_id, NEW.desg, NEW.fname, NEW.lname,
            NEW.middle, NEW.user, NEW.username, NEW.phone, NEW.unitmode, NEW.date, NEW.assign
        );
    END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `trg_update_transhistory_after_Tenants_remove_payed` AFTER UPDATE ON `payed` FOR EACH ROW BEGIN
    -- Only run if asset = 1
    IF NEW.asset = 1 THEN
        UPDATE transhistory
        SET due = NEW.due
        WHERE payment_id = NEW.id;  -- updates ALL rows linked to this payed.id
    END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `update_history_after_update` AFTER UPDATE ON `payed` FOR EACH ROW BEGIN
    -- Check if the payment is made with the same start and end dates
    IF NEW.startdate = NEW.enddate THEN
        -- Update the corresponding record in history with the paid amount
        UPDATE history
        SET paid = NEW.paid
        WHERE payment_id = NEW.id;
    ELSE
        -- Insert into history table when a new payment is made
        INSERT INTO history (payment_id, agreed, paid, tenant_id, startdate, due, enddate, date)
        VALUES (NEW.id, NEW.agreed, NEW.paid, NEW.tenant_id, NEW.startdate, NEW.due, NEW.enddate, NEW.date);
        -- Check if the enddate is over and there was no payment
        IF NEW.enddate < CURDATE() THEN
            -- Insert a record with 0 paid for the next payment period
          INSERT INTO history (payment_id, agreed, paid, tenant_id, date, startdate, due, enddate)
            VALUES (NEW.id, NEW.agreed, 0, NEW.tenant_id, NEW.date, ADDDATE(NEW.enddate, INTERVAL 1 DAY), NEW.agreed, ADDDATE(NEW.enddate, INTERVAL 1 MONTH));
        END IF;
    END IF;
END */;;
DELIMITER ;

--
-- Table structure for table `payment`
--

CREATE TABLE `payment` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tenat` int(11) NOT NULL,
  `paid` int(11) NOT NULL,
  `due` int(11) NOT NULL,
  `total_due` float DEFAULT NULL,
  `period` int(11) DEFAULT NULL,
  `total` int(11) NOT NULL,
  `startdate` datetime(6) DEFAULT NULL,
  `enddate` datetime(6) DEFAULT NULL,
  `payment_method` int(11) NOT NULL,
  `user` int(11) NOT NULL,
  `user_name` varchar(250) DEFAULT NULL,
  `date` datetime(6) DEFAULT NULL,
  `charge_id` int(11) NOT NULL,
  `status` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `tenat` (`tenat`),
  KEY `payment_method` (`payment_method`),
  KEY `charge_id` (`charge_id`),
  CONSTRAINT `payment_ibfk_1` FOREIGN KEY (`tenat`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `payment_ibfk_3` FOREIGN KEY (`payment_method`) REFERENCES `amenties` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `payment_ibfk_4` FOREIGN KEY (`charge_id`) REFERENCES `charges` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=166 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `payment`
--

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `before_payment_insert` BEFORE INSERT ON `payment` FOR EACH ROW BEGIN
  SET NEW.total_due = NEW.due;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `PAYMENT_HISTORY_FOR ALL` AFTER INSERT ON `payment` FOR EACH ROW BEGIN
    INSERT INTO utilitieshistory (payment_id, tenat, period, paid, due, total, startdate, enddate, payment_method, user, username, charge_id, date)
    VALUES (NEW.id, NEW.tenat, NEW.period, NEW.paid, NEW.due, NEW.total, NEW.startdate, NEW.enddate, NEW.payment_method, NEW.user, NEW.user_name, NEW.charge_id, NEW.date);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `before_payment_update` BEFORE UPDATE ON `payment` FOR EACH ROW BEGIN
  IF NEW.due <> OLD.due THEN
    SET NEW.total_due = NEW.due;
  END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `After_payment_utility_update` AFTER UPDATE ON `payment` FOR EACH ROW BEGIN
    IF NEW.status = 0 THEN
        UPDATE utilitieshistory
        SET
            tenat          = NEW.tenat,
            period         = NEW.period,
            paid           = NEW.paid,
            due            = NEW.due,
            total          = NEW.total,
            startdate      = NEW.startdate,
            enddate        = NEW.enddate,
            payment_method = NEW.payment_method,
            user           = NEW.user,
            username       = NEW.user_name,
            date           = NEW.date
        WHERE payment_id = OLD.id;
    END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `Aftrer_payment_utility` AFTER UPDATE ON `payment` FOR EACH ROW BEGIN
 IF NEW.status = 1 THEN
    INSERT INTO utilitieshistory (payment_id, tenat, period, paid, due, total, startdate, enddate, payment_method, user, username, charge_id, date)
    VALUES (NEW.id, NEW.tenat, NEW.period, NEW.paid, NEW.due, NEW.total, NEW.startdate, NEW.enddate, NEW.payment_method, NEW.user, NEW.user_name, NEW.charge_id, NEW.date);
    END IF;
END */;;
DELIMITER ;

--
-- Table structure for table `payments`
--

CREATE TABLE `payments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `landlord_id` int(11) NOT NULL,
  `property_id` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `employee_id` int(11) DEFAULT NULL,
  `custom_id` varchar(55) NOT NULL,
  `status` int(11) NOT NULL DEFAULT 0,
  `payable` float NOT NULL,
  `paid` float DEFAULT NULL,
  `due` float DEFAULT NULL,
  `balance` float DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `username` varchar(250) DEFAULT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `note` longtext DEFAULT NULL,
  `date` timestamp(6) NOT NULL DEFAULT current_timestamp(6),
  `update_date` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
  PRIMARY KEY (`id`),
  KEY `landlord_id` (`landlord_id`),
  KEY `employee_id` (`employee_id`),
  KEY `user_id` (`user_id`),
  KEY `property_id` (`property_id`),
  CONSTRAINT `payments_ibfk_1` FOREIGN KEY (`landlord_id`) REFERENCES `landlords` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `payments_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `payments_ibfk_3` FOREIGN KEY (`property_id`) REFERENCES `property` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=805 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `payments`
--


--
-- Table structure for table `payroll`
--

CREATE TABLE `payroll` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `allowance` int(11) DEFAULT NULL,
  `firstname` varchar(200) DEFAULT NULL,
  `lastname` varchar(200) DEFAULT NULL,
  `desgnation` varchar(200) DEFAULT NULL,
  `basic` int(11) DEFAULT NULL,
  `allowance1` varchar(200) DEFAULT NULL,
  `allowance2` varchar(200) DEFAULT NULL,
  `allowance3` varchar(200) DEFAULT NULL,
  `allowance4` varchar(200) DEFAULT NULL,
  `allowance5` varchar(200) DEFAULT NULL,
  `allowance6` varchar(200) DEFAULT NULL,
  `allowance7` varchar(200) DEFAULT NULL,
  `amount1` int(11) DEFAULT NULL,
  `amount2` int(11) DEFAULT NULL,
  `amount3` int(11) DEFAULT NULL,
  `amount4` int(11) DEFAULT NULL,
  `amount5` int(11) DEFAULT NULL,
  `amount6` int(11) DEFAULT NULL,
  `amount7` int(11) DEFAULT NULL,
  `total_allowance` int(11) DEFAULT NULL,
  `payee` int(11) NOT NULL,
  `payee_duduction` varchar(200) DEFAULT NULL,
  `payee_percentage` int(11) DEFAULT NULL,
  `nssf` int(11) NOT NULL,
  `advanced_amount` int(11) NOT NULL,
  `request_amount` int(11) NOT NULL,
  `amount_given` int(11) NOT NULL,
  `gross` int(11) NOT NULL,
  `month_date` varchar(7) NOT NULL,
  `saving_amount` int(11) DEFAULT NULL,
  `createdAt` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
  `username` varchar(200) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `allowance` (`allowance`),
  KEY `payee` (`payee`),
  CONSTRAINT `payroll_ibfk_1` FOREIGN KEY (`allowance`) REFERENCES `allowencesemployee` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `payroll_ibfk_3` FOREIGN KEY (`payee`) REFERENCES `deduction` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `payroll`
--

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `calculate_gross_taxable_payroll` BEFORE INSERT ON `payroll` FOR EACH ROW BEGIN
    SET NEW.gross = NEW.basic + NEW.total_allowance;
    SET NEW.nssf = NEW.gross * NEW.payee_percentage / 100;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `update_gross_taxable_calculation_payroll` BEFORE UPDATE ON `payroll` FOR EACH ROW BEGIN
    SET NEW.gross = NEW.basic + NEW.total_allowance;
    SET NEW.nssf = NEW.gross * NEW.payee_percentage / 100;
END */;;
DELIMITER ;

--
-- Table structure for table `post_country_assn`
--

CREATE TABLE `post_country_assn` (
  `post_id` int(11) NOT NULL,
  `country_id` int(11) NOT NULL,
  KEY `FK_post_country` (`post_id`,`country_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `post_country_assn`
--


--
-- Table structure for table `pricing`
--

CREATE TABLE `pricing` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `plan_name` varchar(255) NOT NULL,
  `price` int(11) NOT NULL,
  `duration_months` int(11) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `pricing`
--

INSERT INTO `pricing` VALUES (1,'Basic Plan',50000,1,'2024-09-18 09:07:50','2024-12-14 04:14:32');
INSERT INTO `pricing` VALUES (2,'Standard Plan',125000,3,'2024-09-18 09:45:06','2024-12-14 04:15:34');
INSERT INTO `pricing` VALUES (3,'Premium Plan',250000,6,'2024-09-18 09:45:10','2024-12-14 04:16:08');
INSERT INTO `pricing` VALUES (4,'Professional Plan',480000,12,'2024-09-18 09:48:50','2024-12-14 04:16:45');

--
-- Table structure for table `priority`
--

CREATE TABLE `priority` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(300) DEFAULT NULL,
  `description` varchar(950) DEFAULT NULL,
  `dat` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `priority`
--

INSERT INTO `priority` VALUES (1,'Low','can be worked on any time','2023-12-20 08:47:52.558263');
INSERT INTO `priority` VALUES (2,'VERY HIGH','','2023-12-20 08:25:07.424175');
INSERT INTO `priority` VALUES (3,'HIGH','','2023-12-20 08:25:13.693932');
INSERT INTO `priority` VALUES (4,'MODERATE','','2023-12-20 08:25:21.621137');

--
-- Table structure for table `profile`
--

CREATE TABLE `profile` (
  `user_id` int(11) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `public_email` varchar(255) DEFAULT NULL,
  `gravatar_email` varchar(255) DEFAULT NULL,
  `gravatar_id` varchar(32) DEFAULT NULL,
  `location` varchar(255) DEFAULT NULL,
  `website` varchar(255) DEFAULT NULL,
  `imageFile` varchar(300) DEFAULT NULL,
  `bio` text DEFAULT NULL,
  `timezone` varchar(40) DEFAULT NULL,
  PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `profile`
--

INSERT INTO `profile` VALUES (127,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO `profile` VALUES (128,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO `profile` VALUES (137,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO `profile` VALUES (166,'Abigail Ainebyona','abbyaine2000@gail.com',NULL,NULL,'','166.jpeg',NULL,'',NULL);
INSERT INTO `profile` VALUES (167,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO `profile` VALUES (168,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO `profile` VALUES (169,'LANDLORDD','abdulsadimuhima@gmail.com',NULL,NULL,'Kampala City','169.jpg',NULL,'Psalms 118:26. Blessed is He who comes in the name of the Lord ????',NULL);
INSERT INTO `profile` VALUES (170,'','skatusiimeboona@gmail.com',NULL,NULL,'','170.jpg',NULL,'',NULL);
INSERT INTO `profile` VALUES (171,'Atwine Philip ','atwinephilip@gmail.com',NULL,NULL,'',NULL,NULL,'',NULL);
INSERT INTO `profile` VALUES (172,'Mukisa Juliet','julietmukisa99@gmail.com',NULL,NULL,'Makerere',NULL,NULL,'Field officer ',NULL);
INSERT INTO `profile` VALUES (173,'ATUHAIRE LAHAB','iahabatuhaire2@gmail.com',NULL,NULL,'','173.jpg',NULL,'',NULL);
INSERT INTO `profile` VALUES (174,'Daisy nabukenya ','daisynabukenya10@gmail.com',NULL,NULL,'',NULL,NULL,'',NULL);
INSERT INTO `profile` VALUES (175,'Abesigamukama jemima','jemimaabesigamukama@gmail.com',NULL,NULL,'',NULL,NULL,'',NULL);
INSERT INTO `profile` VALUES (176,'Aineomugisha Peter','ainepeter@gmail.com',NULL,NULL,'Makerere','176.jpg',NULL,'Ttula kawempe',NULL);
INSERT INTO `profile` VALUES (177,'Murangi','murangism20@gmail.com',NULL,NULL,'Wakiso',NULL,NULL,'Born in Ntungamo',NULL);
INSERT INTO `profile` VALUES (178,'Kisaalu ian fred ','Ianklerk@gmail.com',NULL,NULL,'Nankuwadde bulenga ','178.jpg',NULL,'',NULL);
INSERT INTO `profile` VALUES (179,'Ahimbisibwe Arnold','ahimbisibwearnold71@gmail.com',NULL,NULL,'Everywhere','179.jpg',NULL,'????????',NULL);
INSERT INTO `profile` VALUES (180,'','owoyesigataremwa55@gmail.com',NULL,NULL,'','180.jpg',NULL,'',NULL);
INSERT INTO `profile` VALUES (181,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO `profile` VALUES (182,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO `profile` VALUES (183,'TWINOMUGISHA INNOCENT ','twinomugishainnoxent@gmail.com',NULL,NULL,'Kampala','183.jpg',NULL,'Psalms 118:26 Blessed is He who comes in the name of the Lord ????',NULL);
INSERT INTO `profile` VALUES (184,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO `profile` VALUES (185,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO `profile` VALUES (186,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO `profile` VALUES (187,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO `profile` VALUES (188,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);

--
-- Table structure for table `property`
--

CREATE TABLE `property` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(90) DEFAULT NULL,
  `lacation` varchar(100) DEFAULT NULL,
  `landlord` int(11) DEFAULT NULL,
  `proptype` int(11) DEFAULT NULL,
  `propertitypes` varchar(3000) DEFAULT NULL,
  `totalpayment` float DEFAULT NULL,
  `arrears` float DEFAULT NULL,
  `AgComvalue` int(11) DEFAULT NULL,
  `ComType` varchar(80) DEFAULT NULL,
  `payment` float DEFAULT NULL,
  `utility` int(11) DEFAULT NULL,
  `utilityvalue` int(11) DEFAULT NULL,
  `utility1` int(11) DEFAULT NULL,
  `utilityvalue1` int(11) DEFAULT NULL,
  `utility2` int(11) DEFAULT NULL,
  `utilityvalue2` int(11) DEFAULT NULL,
  `utility3` int(11) DEFAULT NULL,
  `utilityvalue3` int(11) DEFAULT NULL,
  `utility4` int(11) DEFAULT NULL,
  `utilityvalue4` int(11) DEFAULT NULL,
  `utility5` int(11) DEFAULT NULL,
  `utilityvalue5` int(11) DEFAULT NULL,
  `utility6` int(11) DEFAULT NULL,
  `utilityvalue6` int(11) DEFAULT NULL,
  `utility7` int(11) DEFAULT NULL,
  `utilityvalue7` int(11) DEFAULT NULL,
  `utility8` int(11) DEFAULT NULL,
  `utilityvalue8` int(11) DEFAULT NULL,
  `utilityname` varchar(300) DEFAULT NULL,
  `utilityname1` varchar(300) DEFAULT NULL,
  `utilityname2` varchar(300) DEFAULT NULL,
  `utilityname3` varchar(300) DEFAULT NULL,
  `utilityname4` varchar(300) DEFAULT NULL,
  `utilityname5` varchar(300) DEFAULT NULL,
  `utilityname6` varchar(300) DEFAULT NULL,
  `utilityname7` varchar(300) DEFAULT NULL,
  `utilityname8` varchar(300) DEFAULT NULL,
  `total` int(11) NOT NULL,
  `chargecoll` float DEFAULT NULL,
  `laterent` float DEFAULT NULL,
  `latecollect` float DEFAULT NULL,
  `fixedFees` float DEFAULT NULL,
  `landFname` varchar(255) DEFAULT NULL,
  `landLname` varchar(255) DEFAULT NULL,
  `landMname` varchar(255) DEFAULT NULL,
  `extraName` int(11) DEFAULT NULL,
  `extraValue` int(11) DEFAULT NULL,
  `lateName` int(11) DEFAULT NULL,
  `latenames` varchar(255) DEFAULT NULL,
  `lateValur` int(11) DEFAULT NULL,
  `lateftype` varchar(255) DEFAULT NULL,
  `gracperiod` int(11) DEFAULT NULL,
  `latepeiod` varchar(255) DEFAULT NULL,
  `description` longtext DEFAULT NULL,
  `cover` varchar(8000) DEFAULT NULL,
  `imageFile` longtext DEFAULT NULL,
  `date` timestamp(6) NULL DEFAULT current_timestamp(6),
  `user_id` int(11) DEFAULT NULL,
  `property_status` int(11) NOT NULL DEFAULT 1,
  `amenties` longtext DEFAULT NULL,
  `user` varchar(70) DEFAULT NULL,
  `assign` int(11) DEFAULT 0,
  `username` varchar(250) DEFAULT NULL,
  `landlord_user_id` int(11) DEFAULT NULL,
  `update_at` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
  `enddate` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `landlord` (`landlord`),
  KEY `proptype` (`proptype`),
  KEY `utility` (`utility`),
  KEY `utility1` (`utility1`),
  KEY `utility2` (`utility2`),
  KEY `utility3` (`utility3`),
  KEY `utility4` (`utility4`),
  KEY `utility5` (`utility5`),
  KEY `utility6` (`utility6`),
  KEY `utility7` (`utility7`),
  KEY `utility8` (`utility8`),
  KEY `extraName` (`extraName`),
  KEY `lateName` (`lateName`),
  KEY `user_id` (`user_id`),
  CONSTRAINT `property_ibfk_1` FOREIGN KEY (`landlord`) REFERENCES `landlords` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `property_ibfk_10` FOREIGN KEY (`utility7`) REFERENCES `utilities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `property_ibfk_11` FOREIGN KEY (`utility8`) REFERENCES `utilities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `property_ibfk_13` FOREIGN KEY (`extraName`) REFERENCES `extra` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `property_ibfk_14` FOREIGN KEY (`lateName`) REFERENCES `unittype` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `property_ibfk_15` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `property_ibfk_2` FOREIGN KEY (`proptype`) REFERENCES `propertytype` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `property_ibfk_3` FOREIGN KEY (`utility`) REFERENCES `utilities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `property_ibfk_4` FOREIGN KEY (`utility1`) REFERENCES `utilities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `property_ibfk_5` FOREIGN KEY (`utility2`) REFERENCES `utilities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `property_ibfk_6` FOREIGN KEY (`utility3`) REFERENCES `utilities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `property_ibfk_7` FOREIGN KEY (`utility4`) REFERENCES `utilities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `property_ibfk_8` FOREIGN KEY (`utility5`) REFERENCES `utilities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `property_ibfk_9` FOREIGN KEY (`utility6`) REFERENCES `utilities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2320 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `property`
--

INSERT INTO `property` VALUES (2319,'PATRICK MENSION','Mbarara city kakoba',627,8,'Mixed Building',NULL,0,NULL,'collected',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'','','','','','','','',0,NULL,NULL,NULL,15,'MUSAFIRI','PATRICK','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'<p>Good Property</p>',NULL,NULL,'2025-11-29 20:46:30.401456',17,1,'Parking','Super Administrator',0,NULL,NULL,'2025-11-29 20:46:30.401456','2027-01-01');
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `Update_tenants` BEFORE UPDATE ON `property` FOR EACH ROW BEGIN
  IF NEW.property_status = 0 AND OLD.property_status <> 0 THEN
        -- Update all related tenants records
       UPDATE tenants
        SET status = 0
         WHERE property = NEW.id;
    END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `after_property_update` AFTER UPDATE ON `property` FOR EACH ROW BEGIN
    -- Check if property_status changed to 0
    IF NEW.property_status = 0 AND OLD.property_status <> 0 THEN
        -- Update all related propertyunit records
        UPDATE propertyunit
        SET unitstatus = 0
        WHERE property_id = NEW.id;
    END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `update_landlord_assign` AFTER UPDATE ON `property` FOR EACH ROW BEGIN
    UPDATE landlords
    SET assign = NEW.assign
    WHERE id = NEW.landlord;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `update_tenants_arrears` AFTER UPDATE ON `property` FOR EACH ROW BEGIN
    IF NEW.arrears <> OLD.arrears THEN
        UPDATE tenants
        SET arrears = NEW.arrears
        WHERE property = NEW.id;
    END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `update_tenants_collection` AFTER UPDATE ON `property` FOR EACH ROW BEGIN
    IF NEW.fixedFees <> OLD.fixedFees THEN
        UPDATE tenants
        SET perccollect = NEW.fixedFees
        WHERE property = NEW.id;
    END IF;
END */;;
DELIMITER ;

--
-- Table structure for table `propertyhouses`
--

CREATE TABLE `propertyhouses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` int(11) NOT NULL,
  `property_name` varchar(200) NOT NULL,
  `location` varchar(200) NOT NULL,
  `type` varchar(200) NOT NULL,
  `description` longtext NOT NULL,
  `cover` varchar(1500) DEFAULT NULL,
  `imageFile` varchar(1500) DEFAULT NULL,
  `unit` varchar(200) NOT NULL,
  `property` int(11) NOT NULL,
  `unityname` int(11) NOT NULL,
  `mode` varchar(200) NOT NULL,
  `bedrooms` varchar(200) DEFAULT NULL,
  `bethrooms` varchar(200) DEFAULT NULL,
  `kithen` varchar(200) DEFAULT NULL,
  `sitting` varchar(200) DEFAULT NULL,
  `dining` varchar(200) DEFAULT NULL,
  `garage` varchar(200) DEFAULT NULL,
  `amenties` mediumtext DEFAULT NULL,
  `date` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
  PRIMARY KEY (`id`),
  KEY `property` (`property`),
  KEY `unityname` (`unityname`),
  CONSTRAINT `propertyhouses_ibfk_1` FOREIGN KEY (`property`) REFERENCES `property` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `propertyhouses_ibfk_2` FOREIGN KEY (`unityname`) REFERENCES `propertyunit` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `propertyhouses`
--


--
-- Table structure for table `propertypes`
--

CREATE TABLE `propertypes` (
  `id` int(12) NOT NULL AUTO_INCREMENT,
  `date` int(6) DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `propertypes`
--


--
-- Table structure for table `propertytype`
--

CREATE TABLE `propertytype` (
  `id` int(15) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `description` longtext DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `propertytype`
--

INSERT INTO `propertytype` VALUES (3,'shop','Shop');
INSERT INTO `propertytype` VALUES (4,'Apartment','Apartment');
INSERT INTO `propertytype` VALUES (8,'Mixed Building','Commercial and Hotel Rooms');
INSERT INTO `propertytype` VALUES (9,'Commercial building','Commercial shops and offices');
INSERT INTO `propertytype` VALUES (10,'Hostel','hostel');
INSERT INTO `propertytype` VALUES (11,'Leisure','Leisure Place');
INSERT INTO `propertytype` VALUES (12,'others','others');
INSERT INTO `propertytype` VALUES (13,'Residential','Residential ');

--
-- Table structure for table `propertyunit`
--

CREATE TABLE `propertyunit` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `seleunit` varchar(255) NOT NULL,
  `unitname` varchar(255) DEFAULT NULL,
  `unitfloor` varchar(80) DEFAULT NULL,
  `rentamount` int(11) DEFAULT NULL,
  `unittype` varchar(300) DEFAULT NULL,
  `bed` int(11) DEFAULT 0,
  `bath` int(11) DEFAULT 0,
  `totalrooms` int(11) NOT NULL DEFAULT 0,
  `squarerooms` varchar(300) DEFAULT NULL,
  `amenties` varchar(2000) DEFAULT NULL,
  `unitstatus` int(11) DEFAULT NULL,
  `active` int(11) NOT NULL DEFAULT 0,
  `property_id` int(11) NOT NULL,
  `date` timestamp(6) NOT NULL DEFAULT current_timestamp(6),
  `user_id` int(11) DEFAULT NULL,
  `assign` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `propertyunit_ibfk_1` (`property_id`),
  KEY `user_id` (`user_id`),
  CONSTRAINT `propertyunit_ibfk_1` FOREIGN KEY (`property_id`) REFERENCES `property` (`id`),
  CONSTRAINT `propertyunit_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8146 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `propertyunit`
--

INSERT INTO `propertyunit` VALUES (8143,'commercial','R1','Double',750000,'',0,0,0,'','',1,1,2319,'2025-11-30 04:46:30.000000',17,0);
INSERT INTO `propertyunit` VALUES (8144,'commercial','R2','Double',750000,'',0,0,0,'','',0,0,2319,'2025-11-30 04:46:30.000000',17,0);
INSERT INTO `propertyunit` VALUES (8145,'commercial','R3','Double',750000,'',0,0,0,'','',0,0,2319,'2025-11-30 04:47:06.000000',17,0);
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `before_inserting_propertyunit` BEFORE INSERT ON `propertyunit` FOR EACH ROW BEGIN
    SET NEW.active = NEW.unitstatus;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `before_update_propertyunit` BEFORE UPDATE ON `propertyunit` FOR EACH ROW BEGIN
    SET NEW.active = NEW.unitstatus;
END */;;
DELIMITER ;

--
-- Table structure for table `received`
--

CREATE TABLE `received` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `landlord_id` int(11) NOT NULL,
  `employee_id` int(11) NOT NULL,
  `amount` float NOT NULL,
  `reason` mediumtext NOT NULL,
  `property_id` int(11) NOT NULL,
  `date` datetime NOT NULL,
  `update_at` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
  `user_id` int(11) NOT NULL,
  `username` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `employee_id` (`employee_id`),
  KEY `landlord_id` (`landlord_id`),
  KEY `user_id` (`user_id`),
  CONSTRAINT `received_ibfk_1` FOREIGN KEY (`landlord_id`) REFERENCES `landlords` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `received_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `received`
--


--
-- Table structure for table `recoveryrent`
--

CREATE TABLE `recoveryrent` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tenant_id` int(11) NOT NULL,
  `amount_recovery` decimal(15,2) NOT NULL,
  `date` date NOT NULL,
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `user_id` int(11) NOT NULL,
  `username` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_recoveryrent_tenant` (`tenant_id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `recoveryrent`
--


--
-- Table structure for table `securitydeposit`
--

CREATE TABLE `securitydeposit` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tenant` int(11) NOT NULL,
  `first` varchar(250) NOT NULL,
  `last` varchar(250) NOT NULL,
  `middle` varchar(250) DEFAULT NULL,
  `phone` varchar(250) NOT NULL,
  `property` varchar(250) NOT NULL,
  `unit` varchar(250) NOT NULL,
  `rent` int(11) NOT NULL,
  `paid` int(11) NOT NULL,
  `payment` int(11) NOT NULL,
  `approved` int(11) NOT NULL,
  `firstname` varchar(250) NOT NULL,
  `lastname` varchar(250) NOT NULL,
  `note` mediumtext DEFAULT NULL,
  `status` int(11) NOT NULL DEFAULT 1,
  `deduction_amount` int(11) DEFAULT 0,
  `deduction_reason` longtext DEFAULT NULL,
  `collection` int(11) NOT NULL,
  `createdat` date DEFAULT NULL,
  `updatedat` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `user` int(11) NOT NULL,
  `user_name` varchar(250) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `tenant` (`tenant`),
  KEY `payment` (`payment`),
  CONSTRAINT `securitydeposit_ibfk_1` FOREIGN KEY (`tenant`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `securitydeposit_ibfk_2` FOREIGN KEY (`payment`) REFERENCES `amenties` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=146 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `securitydeposit`
--


--
-- Table structure for table `setting`
--

CREATE TABLE `setting` (
  `id` int(50) NOT NULL AUTO_INCREMENT,
  `company_name` varchar(200) NOT NULL,
  `contact` varchar(50) NOT NULL,
  `whatsapp` varchar(50) NOT NULL,
  `otherNumb` varchar(50) NOT NULL,
  `logo` varchar(500) NOT NULL,
  `imageFile` varchar(150) NOT NULL,
  `email` varchar(75) NOT NULL,
  `web` varchar(75) NOT NULL,
  `description` mediumtext NOT NULL,
  `adress` varchar(85) NOT NULL,
  `currency` varchar(15) NOT NULL,
  `length` varchar(25) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=258 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `setting`
--

INSERT INTO `setting` VALUES (257,'ABC COMPANY LTD','0772881155','+256772881155','+256772881155','.png','','ainepeter@gmail.com','http://softcodes.dev','You\'re property and financial partner','Desire House, Plot 27, Sir Apollo Kaggwa Road','UGX','P.O BOX 1872,');

--
-- Table structure for table `social_account`
--

CREATE TABLE `social_account` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `provider` varchar(255) NOT NULL,
  `client_id` varchar(255) NOT NULL,
  `data` text DEFAULT NULL,
  `code` varchar(32) DEFAULT NULL,
  `created_at` int(11) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `username` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `account_unique` (`provider`,`client_id`),
  UNIQUE KEY `account_unique_code` (`code`),
  KEY `fk_user_account` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `social_account`
--


--
-- Table structure for table `subcategories`
--

CREATE TABLE `subcategories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(200) NOT NULL,
  `description` varchar(200) DEFAULT NULL,
  `account_name` varchar(200) DEFAULT NULL,
  `bank_branch` varchar(200) DEFAULT NULL,
  `total` int(11) NOT NULL,
  `username` varchar(200) DEFAULT NULL,
  `date` timestamp(6) NOT NULL DEFAULT current_timestamp(6),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `subcategories`
--


--
-- Table structure for table `subdivisions`
--

CREATE TABLE `subdivisions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `city_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `city_id` (`city_id`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `subdivisions`
--

INSERT INTO `subdivisions` VALUES (1,'Kakoba Division',1);
INSERT INTO `subdivisions` VALUES (3,'Kamukuzi Division',1);
INSERT INTO `subdivisions` VALUES (4,'Nyamitanga Division',1);
INSERT INTO `subdivisions` VALUES (5,'Biharwe Division',1);
INSERT INTO `subdivisions` VALUES (6,'Kakiika Division',1);
INSERT INTO `subdivisions` VALUES (8,'Central',5);
INSERT INTO `subdivisions` VALUES (9,'Kawempe',5);
INSERT INTO `subdivisions` VALUES (10,'Makindye',5);
INSERT INTO `subdivisions` VALUES (11,'rukira',7);
INSERT INTO `subdivisions` VALUES (12,'Katwe',6);
INSERT INTO `subdivisions` VALUES (13,'Nyendo',6);
INSERT INTO `subdivisions` VALUES (14,'Ruhengere',8);
INSERT INTO `subdivisions` VALUES (15,'Westlands',10);
INSERT INTO `subdivisions` VALUES (16,'Kilimani',10);
INSERT INTO `subdivisions` VALUES (17,'Omoro',12);
INSERT INTO `subdivisions` VALUES (18,'Kaberebere',13);

--
-- Table structure for table `tax`
--

CREATE TABLE `tax` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(300) DEFAULT NULL,
  `amount` int(11) DEFAULT NULL,
  `category` int(11) DEFAULT NULL,
  `catetax` varchar(6000) DEFAULT NULL,
  `description` mediumtext DEFAULT NULL,
  `date` timestamp(6) NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
  `user` varchar(350) NOT NULL,
  `liability` int(11) NOT NULL DEFAULT 7,
  PRIMARY KEY (`id`),
  KEY `category` (`category`),
  KEY `liability` (`liability`),
  CONSTRAINT `tax_ibfk_1` FOREIGN KEY (`category`) REFERENCES `taxcategory` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `tax_ibfk_2` FOREIGN KEY (`liability`) REFERENCES `assetstatus` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tax`
--

INSERT INTO `tax` VALUES (14,'PAYEE for August 2025',450000,3,'URA PAYEE','Payment for PAYEE 2025','2025-08-28 17:00:34.909176','Gloria',7);
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `update_tax_liability` BEFORE INSERT ON `tax` FOR EACH ROW BEGIN
  IF NEW.liability IS NULL THEN
    SET NEW.liability = 7;
  END IF;
END */;;
DELIMITER ;

--
-- Table structure for table `taxcategory`
--

CREATE TABLE `taxcategory` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `category` varchar(6000) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `taxcategory`
--

INSERT INTO `taxcategory` VALUES (2,'National Social Security Fund (NSSF)');
INSERT INTO `taxcategory` VALUES (3,'URA PAYEE');

--
-- Table structure for table `tenants`
--

CREATE TABLE `tenants` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` int(11) DEFAULT NULL,
  `fname` varchar(80) DEFAULT NULL,
  `lname` varchar(80) DEFAULT NULL,
  `midname` varchar(80) DEFAULT NULL,
  `gender` varchar(15) DEFAULT NULL,
  `birhhDate` date DEFAULT NULL,
  `idtype` varchar(30) DEFAULT NULL,
  `nationalid` varchar(25) DEFAULT NULL,
  `passport` varchar(25) DEFAULT NULL,
  `permitid` varchar(30) DEFAULT NULL,
  `refugid` varchar(25) DEFAULT NULL,
  `otherid` varchar(30) DEFAULT NULL,
  `martial` varchar(25) DEFAULT NULL,
  `commission` float DEFAULT NULL,
  `whatsappnumber` varchar(13) DEFAULT NULL,
  `phone` varchar(25) DEFAULT NULL,
  `email` varchar(80) DEFAULT NULL,
  `city` varchar(80) DEFAULT NULL,
  `notavailableId` mediumtext DEFAULT NULL,
  `physical` varchar(80) DEFAULT NULL,
  `nextkinName` varchar(80) DEFAULT NULL,
  `nextkinPhone` varchar(25) DEFAULT NULL,
  `nextkinRelation` varchar(80) DEFAULT NULL,
  `emgencyName` varchar(80) DEFAULT NULL,
  `emgencyPhone` varchar(25) DEFAULT NULL,
  `emgencyEmail` varchar(80) DEFAULT NULL,
  `emgencyRelation` varchar(80) DEFAULT NULL,
  `emgencyPostAddr` varchar(80) DEFAULT NULL,
  `emgencyPhyAddr` varchar(80) DEFAULT NULL,
  `employStatus` varchar(80) DEFAULT NULL,
  `employPosition` varchar(80) DEFAULT NULL,
  `employContactPh` varchar(25) DEFAULT NULL,
  `employContEmail` varchar(80) DEFAULT NULL,
  `employPostAddr` varchar(80) DEFAULT NULL,
  `employPhsicalAdd` varchar(80) DEFAULT NULL,
  `BusinessName` varchar(80) DEFAULT NULL,
  `licenceNumber` varchar(35) DEFAULT NULL,
  `TaxId` varchar(35) DEFAULT NULL,
  `businessAddress` varchar(100) DEFAULT NULL,
  `businessIndustry` varchar(100) DEFAULT NULL,
  `description` mediumtext DEFAULT NULL,
  `property` int(11) DEFAULT NULL,
  `landlord` int(11) NOT NULL,
  `mode` varchar(100) DEFAULT NULL,
  `unitname` int(11) DEFAULT NULL,
  `minimumrent` int(11) DEFAULT NULL,
  `extraname` varchar(250) DEFAULT NULL,
  `percrent` varchar(300) DEFAULT NULL,
  `perccollect` float DEFAULT NULL,
  `latename` varchar(300) DEFAULT NULL,
  `utility1` varchar(300) DEFAULT NULL,
  `utility2` varchar(300) DEFAULT NULL,
  `utility3` varchar(300) DEFAULT NULL,
  `utility4` varchar(300) DEFAULT NULL,
  `utility5` varchar(300) DEFAULT NULL,
  `utility6` varchar(300) DEFAULT NULL,
  `utility7` varchar(300) DEFAULT NULL,
  `utility8` varchar(300) DEFAULT NULL,
  `utility9` varchar(300) DEFAULT NULL,
  `utilityval1` int(11) DEFAULT NULL,
  `utilityval2` int(11) DEFAULT NULL,
  `utilityval3` int(11) DEFAULT NULL,
  `utilityval4` int(11) DEFAULT NULL,
  `utilityval5` int(11) DEFAULT NULL,
  `utilityval6` int(11) DEFAULT NULL,
  `utilityval7` int(11) DEFAULT NULL,
  `utilityval8` int(11) DEFAULT NULL,
  `utilityval9` int(11) DEFAULT NULL,
  `totalutility` int(11) DEFAULT NULL,
  `extravalue` int(11) DEFAULT NULL,
  `extrarent` float DEFAULT NULL,
  `extracollected` float DEFAULT NULL,
  `frequencyperiod` text DEFAULT NULL,
  `landlordFname` varchar(100) DEFAULT NULL,
  `landlordLname` varchar(100) DEFAULT NULL,
  `landlordMname` varchar(100) DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `arrears` float DEFAULT NULL,
  `resean` mediumtext DEFAULT NULL,
  `cover` varchar(8000) DEFAULT NULL,
  `imageFile` longtext DEFAULT NULL,
  `user` varchar(95) DEFAULT NULL,
  `date` datetime(6) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `end_date` datetime(6) DEFAULT NULL,
  `utility_date` datetime(6) DEFAULT NULL,
  `left_date` timestamp(6) NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
  `security` int(11) NOT NULL,
  `active` int(11) NOT NULL DEFAULT 1,
  `write_off` int(11) NOT NULL DEFAULT 1,
  `assign` int(11) NOT NULL,
  `updated_at` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
  `enddate` date DEFAULT NULL,
  `latitude` decimal(10,8) DEFAULT NULL,
  `longitude` decimal(11,8) DEFAULT NULL,
  `location_address` varchar(255) DEFAULT NULL,
  `client_ip` varchar(45) DEFAULT NULL,
  `client_isp` varchar(255) DEFAULT NULL,
  `client_city` varchar(100) DEFAULT NULL,
  `client_country` varchar(100) DEFAULT NULL,
  `client_user_agent` varchar(255) DEFAULT NULL,
  `client_device` varchar(150) DEFAULT NULL,
  `client_os` varchar(150) DEFAULT NULL,
  `client_browser` varchar(150) DEFAULT NULL,
  `client_network_type` varchar(150) DEFAULT NULL,
  `client_meta_json` varchar(150) DEFAULT NULL,
  `brand` int(11) NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`),
  KEY `type` (`type`),
  KEY `property` (`property`),
  KEY `unitname` (`unitname`),
  KEY `landlord` (`landlord`),
  KEY `user_id` (`user_id`),
  CONSTRAINT `tenants_ibfk_1` FOREIGN KEY (`unitname`) REFERENCES `propertyunit` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `tenants_ibfk_2` FOREIGN KEY (`property`) REFERENCES `property` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `tenants_ibfk_3` FOREIGN KEY (`unitname`) REFERENCES `propertyunit` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `tenants_ibfk_4` FOREIGN KEY (`landlord`) REFERENCES `landlords` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `tenants_ibfk_5` FOREIGN KEY (`type`) REFERENCES `tenanttype` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `tenants_ibfk_6` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6988 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tenants`
--

INSERT INTO `tenants` VALUES (6987,10,'SOFTCODES','LTD','','male',NULL,'no_ID','','','','','','',112500,'','+256785773641','','',NULL,'','','','','','','','','','','','','','','','','','','','','','',2319,627,'commercial',8143,750000,'PATRICK MENSION','Double',15,'R1',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'MUSAFIRI','PATRICK','',1,0,NULL,NULL,NULL,'Super Administrator','2025-11-29 23:48:28.000000',17,'2026-02-01 00:00:00.000000',NULL,'2025-11-29 20:49:35.152425',0,1,1,0,'2025-11-29 20:49:35.152425','2027-01-01',-0.60559681,30.66347255,'Old Horizon Bus Park, Mbaguta Street, Biafra, Muti, Mbarara City, Western Region, Uganda','102.213.194.66','Cheetahnet Solutions Limited','Kampala','Uganda','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36 Edg/142.0.0.0','Desktop','Windows','Chrome','WiFi/Broadband','{\n    \"status\": \"success\",\n    \"country\": \"Uganda\",\n    \"countryCode\": \"UG\",\n    \"region\": \"C\",\n    \"regionName\": \"Central Region\",\n    \"city\": \"Kampa',1);
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `update_minimumrent` BEFORE INSERT ON `tenants` FOR EACH ROW BEGIN
    DECLARE rent_amount INT;
    -- Fetch the rentamount from the propertyunit table where unitname matches the id
    SELECT rentamount INTO rent_amount 
    FROM propertyunit 
    WHERE id = NEW.unitname;
    -- Set the minimumrent in tenants to the fetched rentamount
    SET NEW.minimumrent = rent_amount;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `update_minimumrent_on_update` BEFORE UPDATE ON `tenants` FOR EACH ROW BEGIN
    DECLARE rent_amount INT;
    -- Fetch the rentamount from the propertyunit table where unitname matches the id
    SELECT rentamount INTO rent_amount 
    FROM propertyunit 
    WHERE id = NEW.unitname;
    -- Set the minimumrent in tenants to the fetched rentamount
    SET NEW.minimumrent = rent_amount;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `update_payed_status` AFTER UPDATE ON `tenants` FOR EACH ROW BEGIN
  -- Check if the status in tenants table is updated to 0
  IF NEW.status = 0 THEN
    -- Update the status in the transhistory table to 0 for the corresponding tenant
    UPDATE transhistory
    SET status = 0
    WHERE tenant_id = NEW.id;
  END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `update_unit_status` AFTER UPDATE ON `tenants` FOR EACH ROW BEGIN
    IF NEW.status = 0 THEN
        UPDATE propertyunit
        SET unitstatus = 0
        WHERE id = NEW.unitname;
    END IF;
END */;;
DELIMITER ;

--
-- Table structure for table `tenanttype`
--

CREATE TABLE `tenanttype` (
  `id` int(12) NOT NULL AUTO_INCREMENT,
  `name` varchar(90) NOT NULL,
  `description` longtext NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tenanttype`
--

INSERT INTO `tenanttype` VALUES (4,'Business','busines tenants');
INSERT INTO `tenanttype` VALUES (5,'Individual','Individual Tenants');
INSERT INTO `tenanttype` VALUES (7,'Association','A group of people');
INSERT INTO `tenanttype` VALUES (9,'Family','Family');
INSERT INTO `tenanttype` VALUES (10,'Organization','Profit and Non Profit Organizations');
INSERT INTO `tenanttype` VALUES (11,'Private Company','Private registered');
INSERT INTO `tenanttype` VALUES (12,'Industrial','factories, warehouses');
INSERT INTO `tenanttype` VALUES (13,'Healthcare','hospitals, clinics, pharmacies');

--
-- Table structure for table `token`
--

CREATE TABLE `token` (
  `user_id` int(11) NOT NULL,
  `code` varchar(32) NOT NULL,
  `created_at` int(11) NOT NULL,
  `type` smallint(6) NOT NULL,
  UNIQUE KEY `token_unique` (`user_id`,`code`,`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `token`
--

INSERT INTO `token` VALUES (17,'7ttr5ybfOwc1zNtlDh2QJJI_qymFJB4Q',1695018142,1);
INSERT INTO `token` VALUES (124,'HhPDsV8AxF2_XBQGseENQlcJNiFfi29K',1699786701,1);
INSERT INTO `token` VALUES (133,'tqhgk2wrPzZepokQWIvTywwTwfnGZozG',1702381631,1);
INSERT INTO `token` VALUES (138,'EzjO2BcrNWEP_QS1qLqOvTxcfYwGNRCa',1726231255,1);
INSERT INTO `token` VALUES (169,'t3kHTZ0ZMpK7VAajoR6w9XY29A1YkgBO',1756841631,1);
INSERT INTO `token` VALUES (174,'anNOncrfj5VoVxF08V9Q3d5cemj_lQ8R',1756398869,1);

--
-- Table structure for table `transaction_history`
--

CREATE TABLE `transaction_history` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `transaction_id` varchar(255) NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `date` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
  `status` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `transaction_history`
--


--
-- Table structure for table `transhistory`
--

CREATE TABLE `transhistory` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `date` datetime(6) DEFAULT NULL,
  `payment_id` int(11) NOT NULL,
  `paymentMethod` varchar(500) NOT NULL,
  `due` int(11) NOT NULL,
  `paid` int(11) NOT NULL,
  `property_ID` int(11) DEFAULT NULL,
  `total` int(11) DEFAULT NULL,
  `fname` varchar(200) DEFAULT NULL,
  `lname` varchar(200) DEFAULT NULL,
  `middle` varchar(200) DEFAULT NULL,
  `periodfor` int(11) DEFAULT NULL,
  `property` varchar(200) DEFAULT NULL,
  `unitname` varchar(200) DEFAULT NULL,
  `startdate` datetime(6) DEFAULT NULL,
  `enddate` datetime(6) DEFAULT NULL,
  `tenant_id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `desgnation` varchar(250) DEFAULT NULL,
  `finame` varchar(250) DEFAULT NULL,
  `laname` varchar(250) DEFAULT NULL,
  `midname` varchar(250) DEFAULT NULL,
  `username` varchar(250) DEFAULT NULL,
  `user` int(11) DEFAULT NULL,
  `phone` varchar(25) DEFAULT NULL,
  `unitmode` varchar(50) DEFAULT NULL,
  `status` int(11) NOT NULL DEFAULT 1,
  `assign` int(11) NOT NULL,
  `updated_at` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
  `active` int(11) NOT NULL DEFAULT 1,
  `brand` int(11) NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`),
  KEY `payment_id` (`payment_id`),
  CONSTRAINT `transhistory_ibfk_1` FOREIGN KEY (`payment_id`) REFERENCES `payed` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=27766 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `transhistory`
--

INSERT INTO `transhistory` VALUES (27764,'2025-11-29 23:47:12.000000',19492,'Cash',0,750000,2319,750000,'SOFTCODES','LTD','',1,'PATRICK MENSION','R1','2025-11-01 00:00:00.000000','2025-12-01 00:00:00.000000',6987,17,'FIELD OFFICER','OWOYESIGA',' TAREMWA','','Super Administrator',17,'+256785773641','commercial',1,0,'2025-11-29 20:48:29.762210',1,1);
INSERT INTO `transhistory` VALUES (27765,'2025-11-29 23:49:16.000000',19493,'Cash',500000,1000000,2319,1500000,'SOFTCODES','LTD','',2,'PATRICK MENSION','R1','2025-12-01 00:00:00.000000','2026-02-01 00:00:00.000000',6987,17,'GENERAL MANAGER','KWAGALA','GLORIA','','Super Administrator',17,'+256785773641','commercial',1,0,'2025-11-29 20:49:35.152425',1,1);
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `before_transhistory_insert_assign` BEFORE INSERT ON `transhistory` FOR EACH ROW BEGIN
    DECLARE propertyAssign INT;

    SELECT assign INTO propertyAssign
    FROM property
    WHERE id = NEW.property_ID
    LIMIT 1;

    IF (NEW.assign IS NULL OR NEW.assign = 0) AND propertyAssign IS NOT NULL THEN
        SET NEW.assign = propertyAssign;
    END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `before_transhistory_update_assign` BEFORE UPDATE ON `transhistory` FOR EACH ROW BEGIN
    DECLARE propertyAssign INT;

    SELECT assign INTO propertyAssign
    FROM property
    WHERE id = NEW.property_ID
    LIMIT 1;

    IF (NEW.assign IS NULL OR NEW.assign = 0) AND propertyAssign IS NOT NULL THEN
        SET NEW.assign = propertyAssign;
    END IF;
END */;;
DELIMITER ;

--
-- Table structure for table `unittype`
--

CREATE TABLE `unittype` (
  `id` int(12) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `description` longtext DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `unittype`
--

INSERT INTO `unittype` VALUES (8,'Surcharge','Surcharge');

--
-- Table structure for table `user`
--

CREATE TABLE `user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `role` varchar(55) NOT NULL DEFAULT '2',
  `name` varchar(255) NOT NULL,
  `password_hash` varchar(60) NOT NULL,
  `auth_key` varchar(32) NOT NULL,
  `confirmed_at` int(11) DEFAULT NULL,
  `unconfirmed_email` varchar(255) DEFAULT NULL,
  `blocked_at` int(11) DEFAULT NULL,
  `registration_ip` varchar(45) DEFAULT NULL,
  `created_at` int(11) NOT NULL,
  `updated_at` int(11) NOT NULL,
  `flags` int(11) NOT NULL DEFAULT 0,
  `last_login_at` int(11) DEFAULT NULL,
  `prev_role` varchar(55) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_unique_username` (`username`),
  UNIQUE KEY `user_unique_email` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=189 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `user`
--

INSERT INTO `user` VALUES (17,'superadmin','dev@softcodes.dev','1','Super Administrator','$2y$12$U/Kw15p0aXIELxzLMYcV3u9pF3mnhKgXofjfCim3EVXM9TKgpmf8u','gTGqSxomNAB2nMZyhDRN9u6x43CQ26-T',1686492856,NULL,0,'::1',1686492855,1756732119,0,1764449452,NULL);
INSERT INTO `user` VALUES (166,'Abigail','abbyaine2000@gail.com','2','Ainebyona Abigail','$2y$12$Nb9D.XIXuhogJlQxnlvarONILUTUOjdX6OBEKfvLCZiYzM/rbV4xa','JviBcVaNvSFGkj8U5AJExkoHfbLbdqxr',1756223592,NULL,0,'102.85.123.142',1756223592,1756287886,0,1764333184,NULL);
INSERT INTO `user` VALUES (167,'Joan','jkasiime2002@gmail.com','1','Kansiime Joan','$2y$12$R5lMDolQ.xGTLS5IRmGB0..2nkB1sC0UxsscXIcUQTTOw.UGxkbjq','XiS7zJSePTXNll8NN315TaoHZr-z2rpe',1756223684,NULL,0,'102.85.123.142',1756223684,1756805485,0,1762351547,NULL);
INSERT INTO `user` VALUES (170,'Sandra','skatusiimeboona@gmail.com','2','Katusiimeboona Sandra','$2y$12$NkTrhONJK2XZkLR16Wdgc.V106vhuy.vEDz6vQhiHGECgKlkZQEM2','Pelvqe1uHQgrk8xqTTRkJ6J0PAiX12Du',1756223894,NULL,0,'102.85.123.142',1756223894,1756287759,0,1764346241,NULL);
INSERT INTO `user` VALUES (173,'Atuhaire','iahabatuhaire2@gmail.com','2','Atuhaire Lahab','$2y$12$dXhiAvbk9nzBJxhjrWCjUeV0/gNfyYBG5vnn85YImpgzL0L95EGdW','xtxQGyq_E4O5A1qqgFVd1X--lVu2PvWK',1756224148,NULL,0,'102.85.123.142',1756224148,1760944305,0,1764438015,NULL);
INSERT INTO `user` VALUES (174,'Daisy','daisynabukenya10@gmail.com','2','Nabukenya Daisy','$2y$12$RjETRLpFeBLbTUldDqrYOuxOakvIyKjoJbqfu6RmQ2pGJcloaouQG','Rtea4tamhIEWAZAVcrpeKp7HY6PC0nMZ',1756224225,NULL,0,'102.85.123.142',1756224225,1756287578,0,1764346549,NULL);
INSERT INTO `user` VALUES (176,'Peter','ainepeter@gmail.com','1','Ainomugisha Peter','$2y$12$kdJqgImrMaUSeX2Yc2UoquYXus0JDr9XSh4W1o3qXyJnH5g5vOvcu','ZrLKSL9jQPgNpGNGSA-yYKgB30-Oe9Xb',1756224416,NULL,0,'102.85.123.142',1756224416,1762787017,0,1764421955,NULL);
INSERT INTO `user` VALUES (178,'Fred','Ianklerk@gmail.com','2','Kisaalu Ian Fred','$2y$12$Mf1cvwkPJJQl.K/jlLt1.OgKGsg6LDmWQQRF0CahHejJSGbiOKgVW','cbO0M7jTR9_CjhDFvWP6VNPC5NYWDoUt',1756224912,NULL,NULL,'102.85.123.142',1756224912,1760103727,0,1764339890,NULL);
INSERT INTO `user` VALUES (179,'Arnold','ahimbisibwearnold71@gmail.com','2','Ahimbisibwe Arnold','$2y$12$Zm5sLU/f9rTYQ.waNdUaL.anYOmOTAT3ez3fPm/AxocPUaw2Lpiri','ve4hzvM4E9L6S36ZNX-mUX0AuAjZDJRt',1756225089,NULL,0,'102.85.123.142',1756225089,1756288070,0,1756803462,NULL);
INSERT INTO `user` VALUES (180,'Taremwa','owoyesigataremwa55@gmail.com','2','Owoyesiga Taremwa','$2y$12$tKJmPkhkw61EMwYYzkx4je2htssGIkc5OJoNlq96T3oNO2NKDJSku','Q7LgpepMEqv270SSvhOs2Fmj9WWCpORv',1756225189,NULL,0,'102.85.123.142',1756225189,1756288154,0,1764334971,NULL);
INSERT INTO `user` VALUES (181,'Gloria','Kwagalagloriagift7711@gmail.com','1','Kwagala Gloria','$2y$12$W4a3loAoDoLrPB1a4HDxrejWht95m.G.R79CyEw4.BVvhbT53iAa6','gJD_PmXB_s-Z1SFOVsP-WXunt67B2Irm',1756228271,NULL,0,'102.85.123.142',1756228271,1756288199,0,1764439946,NULL);
INSERT INTO `user` VALUES (183,'Innoxent','twinomugishainnoxent@gmail.com','1','Twinomugisha Innocent','$2y$12$AC00Tj5GdV/Nxt.yKDk4u.sYosydHeKdCfxcbRj69hKoqedUxI0dW','FkO7CTYbzE_cTHs_WMKpojhM3B8B9KWM',1756555733,NULL,0,'41.210.147.114',1756555733,1762550315,0,1764353572,NULL);
INSERT INTO `user` VALUES (186,'ALVIN','alvinaijuka02@gmail.com','2','ALVIN AIJUKA ','$2y$12$sk82OBzLBZI7JgTCrxnSxeNQzYHO02hCcmQD3tSMTs4hANpJHTBfm','vXI0UF0nnR9OYfZFZPnAIEqGHblvMZhm',1762767773,NULL,NULL,'41.210.145.126',1762767773,1762767773,0,1764341429,NULL);
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `user_before_update` BEFORE UPDATE ON `user` FOR EACH ROW BEGIN
    -- Case 1: Blocking the user (blocked_at changes from NULL to a timestamp)
    IF OLD.blocked_at IS NULL AND NEW.blocked_at IS NOT NULL THEN
        SET NEW.prev_role = OLD.role;  -- save current role
        SET NEW.role = '0';            -- set role to 0
    END IF;
    -- Case 2: Unblocking the user (blocked_at changes from a timestamp to NULL)
    IF OLD.blocked_at IS NOT NULL AND NEW.blocked_at IS NULL THEN
        SET NEW.role = OLD.prev_role;  -- restore previous role
        SET NEW.prev_role = NULL;      -- clear previous role
    END IF;
END */;;
DELIMITER ;

--
-- Table structure for table `user_login_history`
--

CREATE TABLE `user_login_history` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `logged_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `ip_address` varchar(45) DEFAULT NULL,
  `country` varchar(100) DEFAULT NULL,
  `city` varchar(100) DEFAULT NULL,
  `browser` varchar(100) NOT NULL,
  `os` varchar(100) NOT NULL,
  `device_type` varchar(50) NOT NULL,
  `device_info` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `user_login_history`
--


--
-- Table structure for table `utilities`
--

CREATE TABLE `utilities` (
  `id` int(12) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `description` longtext DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `utilities`
--

INSERT INTO `utilities` VALUES (3,'Water','water');
INSERT INTO `utilities` VALUES (4,'Electricity','electricity and stand by generator');
INSERT INTO `utilities` VALUES (7,'Internet','wireless Internet service');
INSERT INTO `utilities` VALUES (10,'Fire Protection','Building Fire Protection');
INSERT INTO `utilities` VALUES (11,'Compressed Air','Compressed Air');
INSERT INTO `utilities` VALUES (15,'Garbage collection','Garbage collection fee');
INSERT INTO `utilities` VALUES (16,'Parking Space','Parking Space');
INSERT INTO `utilities` VALUES (18,'Security Services','Security Services, CCTV, guards, alarms');

--
-- Table structure for table `utilitieshistory`
--

CREATE TABLE `utilitieshistory` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `payment_id` int(11) NOT NULL,
  `tenat` int(11) NOT NULL,
  `period` int(11) DEFAULT NULL,
  `charge_id` int(11) DEFAULT NULL,
  `paid` int(11) NOT NULL,
  `due` int(11) NOT NULL,
  `total` int(11) DEFAULT NULL,
  `startdate` datetime(6) DEFAULT NULL,
  `enddate` datetime(6) DEFAULT NULL,
  `payment_method` int(11) NOT NULL,
  `receiver` int(11) NOT NULL,
  `user` int(11) NOT NULL,
  `username` varchar(250) DEFAULT NULL,
  `date` datetime(6) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `property_id` (`charge_id`),
  KEY `payment_method` (`payment_method`),
  KEY `tenat` (`tenat`),
  KEY `payment_id` (`payment_id`),
  CONSTRAINT `utilitieshistory_ibfk_1` FOREIGN KEY (`charge_id`) REFERENCES `charges` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `utilitieshistory_ibfk_2` FOREIGN KEY (`payment_method`) REFERENCES `amenties` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `utilitieshistory_ibfk_3` FOREIGN KEY (`tenat`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `utilitieshistory_ibfk_4` FOREIGN KEY (`payment_id`) REFERENCES `payment` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=181 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `utilitieshistory`
--


--
-- Table structure for table `utilitybalance`
--

CREATE TABLE `utilitybalance` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tenant_id` int(11) NOT NULL,
  `payment_id` int(11) NOT NULL,
  `status` int(11) NOT NULL DEFAULT 0,
  `start_date` datetime NOT NULL,
  `end_date` datetime NOT NULL,
  `balance` float NOT NULL,
  PRIMARY KEY (`id`),
  KEY `tenant_id` (`tenant_id`),
  KEY `payment_id` (`payment_id`),
  CONSTRAINT `utilitybalance_ibfk_1` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `utilitybalance_ibfk_2` FOREIGN KEY (`payment_id`) REFERENCES `payment` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `utilitybalance_ibfk_3` FOREIGN KEY (`payment_id`) REFERENCES `amenties` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `utilitybalance`
--


--
-- Table structure for table `withdrawals`
--

CREATE TABLE `withdrawals` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `bank_id` int(11) NOT NULL,
  `balance` int(11) DEFAULT NULL,
  `amount` int(11) NOT NULL,
  `username` varchar(200) NOT NULL,
  `date` timestamp(6) NOT NULL DEFAULT current_timestamp(6),
  PRIMARY KEY (`id`),
  KEY `bank_id` (`bank_id`),
  CONSTRAINT `withdrawals_ibfk_1` FOREIGN KEY (`bank_id`) REFERENCES `subcategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `withdrawals`
--

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`estatesmanager`@`localhost`*/ /*!50003 TRIGGER `after_insert_withdrawal` AFTER INSERT ON `withdrawals` FOR EACH ROW BEGIN
    -- Reduce the total_savings in the banksavings table when a withdrawal occurs
    UPDATE `banksavings`
    SET `total_savings` = `total_savings` - NEW.amount
    WHERE `bank_id` = NEW.bank_id;
END */;;
DELIMITER ;


