--
-- Host: localhost    Database: DBSUNONE_PROD
-- ------------------------------------------------------


--
-- Table structure for table `accesories`
--

CREATE TABLE `accesories` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cost` double DEFAULT NULL,
  `currency` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `photo` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `company_id` int unsigned DEFAULT NULL,
  `type_accesory_id` int unsigned DEFAULT NULL,
  `type_cost` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `accesories_company_id_foreign` (`company_id`),
  KEY `accesories_type_accesory_id_foreign` (`type_accesory_id`),
  CONSTRAINT `accesories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `accesories_type_accesory_id_foreign` FOREIGN KEY (`type_accesory_id`) REFERENCES `type_accesories` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `accesories`
--


--
-- Table structure for table `addresses`
--

CREATE TABLE `addresses` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `direction` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `latitude` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `longitude` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `addresses`
--


--
-- Table structure for table `advisor_proposals`
--

CREATE TABLE `advisor_proposals` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `proposal_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` int unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `advisor_proposals_proposal_id_foreign` (`proposal_id`),
  KEY `advisor_proposals_user_id_foreign` (`user_id`),
  CONSTRAINT `advisor_proposals_proposal_id_foreign` FOREIGN KEY (`proposal_id`) REFERENCES `proposals` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `advisor_proposals_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `advisor_proposals`
--

INSERT INTO `advisor_proposals` VALUES (1,'9a70f743-05ce-406c-ab65-687fdbd82b8e',1),(2,'9a71001d-9674-40a4-9b06-eaea34f37cb7',1),(4,'9a72f696-42e5-4b82-a9a8-a21049a38501',5),(5,'9a7a842e-f4c8-48cb-aa0c-36acc60f4cc7',3);

--
-- Table structure for table `assigned_tickets`
--

CREATE TABLE `assigned_tickets` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned DEFAULT NULL,
  `ticket_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `assigned_tickets_user_id_foreign` (`user_id`),
  KEY `assigned_tickets_ticket_id_foreign` (`ticket_id`),
  CONSTRAINT `assigned_tickets_ticket_id_foreign` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `assigned_tickets_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `assigned_tickets`
--


--
-- Table structure for table `brands`
--

CREATE TABLE `brands` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `logo` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `slug` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `brands`
--

INSERT INTO `brands` VALUES (1,'Canadian Solar',NULL,NULL,NULL,NULL,NULL,NULL),(2,'EPCOM',NULL,NULL,NULL,NULL,NULL,NULL),(3,'Jinko',NULL,NULL,NULL,NULL,NULL,NULL),(4,'Longi Solar',NULL,NULL,NULL,NULL,NULL,NULL),(5,'Risen',NULL,NULL,NULL,NULL,NULL,NULL),(6,'Solar Ever',NULL,NULL,NULL,NULL,NULL,NULL),(7,'Trina Solar',NULL,NULL,NULL,NULL,NULL,NULL),(8,'APS',NULL,NULL,NULL,NULL,NULL,NULL),(9,'Chint Power',NULL,NULL,NULL,NULL,NULL,NULL),(10,'Fronius',NULL,NULL,NULL,NULL,NULL,NULL),(11,'Goodwe',NULL,NULL,NULL,NULL,NULL,NULL),(12,'Growatt',NULL,NULL,NULL,NULL,NULL,NULL),(13,'Hoymiles',NULL,NULL,NULL,NULL,NULL,NULL),(14,'SMA',NULL,NULL,NULL,NULL,NULL,NULL),(15,'Solar Edge',NULL,NULL,NULL,NULL,NULL,NULL),(16,'Solis',NULL,NULL,NULL,NULL,NULL,NULL),(17,'Sunways',NULL,NULL,NULL,NULL,NULL,NULL),(18,'Huawei',NULL,NULL,NULL,NULL,NULL,NULL),(19,'Enphase',NULL,NULL,NULL,NULL,NULL,NULL),(20,'ApSystems',NULL,NULL,NULL,NULL,NULL,NULL);

--
-- Table structure for table `cfe_zones`
--

CREATE TABLE `cfe_zones` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `legal_representative_interconnection` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `legal_representative_identification_interconnection` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `public_deed_interconnection` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `public_deed_date_interconnection` date DEFAULT NULL,
  `notary_name_interconnection` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `public_notary_number_interconnection` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notary_of_interconnection` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `office_address` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `legal_representative_consideration` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `legal_representative_identification_consideration` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `public_deed_consideration` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `public_deed_date_consideration` date DEFAULT NULL,
  `notary_name_consideration` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `public_notary_number_consideration` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notary_of_consideration` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `state_id` int unsigned DEFAULT NULL,
  `city` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `cfe_zones_state_id_foreign` (`state_id`),
  CONSTRAINT `cfe_zones_state_id_foreign` FOREIGN KEY (`state_id`) REFERENCES `states` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `cfe_zones`
--

INSERT INTO `cfe_zones` VALUES (1,'Zona León','Ing. José Froylan González de Anda','clave de elector: N° GNANFR75060401H300 expedida por el Instituto Nacional Electoral','44386','2017-03-15','Lic. Víctor Rafael Aguilar Molina','174','174','5  de Febrero N° 750. Col Centro. Con  Cp. 37000, Cd. de León, Gto.','Ing. Hugo Elohim Espinosa López','clave de elector N° ESLPHG79081301H000 expedida por el Instituto Nacional Electoral','57908','2023-09-14','Mtro. Víctor Rafael Aguilar Molina','174','la Ciudad de México',11,'León','2023-10-24 02:26:21','2023-10-24 02:26:21');

--
-- Table structure for table `companies`
--

CREATE TABLE `companies` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tradename` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tax_id` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(15) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `logo` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT 'sunone.png',
  `web` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `legal_representative` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `color` varchar(11) COLLATE utf8mb4_unicode_ci DEFAULT '246,139,39',
  `address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `companies`
--

INSERT INTO `companies` VALUES (1,'CCEEA',NULL,NULL,'9511623998','info@connekty.com','6536f90aafeff.png','https://solar.connekty.com/',NULL,'246,139,39','Blvd Adolfo López Mateos #2607 1-A  Colonia Barrio de Guadalupe, León, Guanajuato CP 37280','2023-10-23 22:17:18','2023-10-23 22:51:54',NULL),(2,'CCEEA',NULL,NULL,NULL,NULL,'sunone.png',NULL,NULL,'246,139,39',NULL,'2023-10-24 19:49:43','2023-10-24 19:49:43',NULL),(3,'CCEEA',NULL,NULL,NULL,NULL,'sunone.png',NULL,NULL,'246,139,39',NULL,'2023-10-24 21:15:21','2023-10-24 21:15:21',NULL),(4,NULL,NULL,NULL,NULL,NULL,'sunone.png',NULL,NULL,'246,139,39',NULL,'2023-10-24 21:59:36','2023-10-24 21:59:36',NULL),(5,'CCEEA',NULL,NULL,NULL,NULL,'sunone.png',NULL,NULL,'246,139,39',NULL,'2023-10-24 22:00:12','2023-10-24 22:00:12',NULL),(6,NULL,NULL,NULL,NULL,NULL,'sunone.png',NULL,NULL,'246,139,39',NULL,'2023-10-25 15:25:30','2023-10-25 15:25:30',NULL),(7,'CCEEA',NULL,NULL,NULL,NULL,'sunone.png',NULL,NULL,'246,139,39',NULL,'2023-10-25 15:26:21','2023-10-25 15:26:21',NULL);

--
-- Table structure for table `company_addresses`
--

CREATE TABLE `company_addresses` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned NOT NULL,
  `address_id` int unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `company_addresses_company_id_foreign` (`company_id`),
  KEY `company_addresses_address_id_foreign` (`address_id`),
  CONSTRAINT `company_addresses_address_id_foreign` FOREIGN KEY (`address_id`) REFERENCES `addresses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `company_addresses_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `company_addresses`
--


--
-- Table structure for table `company_product_prices`
--

CREATE TABLE `company_product_prices` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_product_id` int unsigned NOT NULL,
  `since` int unsigned DEFAULT NULL,
  `until` int unsigned DEFAULT NULL,
  `margin` double(5,2) DEFAULT '0.00',
  `cost` double(14,4) unsigned DEFAULT '0.0000',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `company_product_prices_company_product_id_foreign` (`company_product_id`),
  CONSTRAINT `company_product_prices_company_product_id_foreign` FOREIGN KEY (`company_product_id`) REFERENCES `company_products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `company_product_prices`
--

INSERT INTO `company_product_prices` VALUES (1,1,1,50000,0.00,1.3400,'2023-10-23 22:17:19','2023-10-23 22:17:19'),(2,3,1,50000,0.00,1.3400,'2023-10-24 19:49:43','2023-10-24 19:49:43'),(3,5,1,50000,0.00,1.3400,'2023-10-24 21:15:21','2023-10-28 16:45:19'),(4,7,1,50000,0.00,1.3400,'2023-10-24 21:59:36','2023-10-24 21:59:36'),(5,9,1,50000,0.00,1.3400,'2023-10-24 22:00:12','2023-10-24 22:00:12'),(6,14,1,50000,0.00,1.3400,'2023-10-25 15:25:30','2023-10-25 15:25:30'),(7,16,1,50000,0.00,1.3400,'2023-10-25 15:26:21','2023-10-25 15:26:21');

--
-- Table structure for table `company_products`
--

CREATE TABLE `company_products` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `company_id` int unsigned NOT NULL,
  `currency` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT 'USD',
  `cost` double(14,4) unsigned DEFAULT '0.0000',
  `margin` double(5,2) DEFAULT '0.00',
  `unit_costing` varchar(15) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cost_by` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT 'unit',
  `default` tinyint(1) DEFAULT '0',
  `product_id` int unsigned DEFAULT NULL,
  `type_product_id` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `company_products_company_id_foreign` (`company_id`),
  KEY `company_products_product_id_foreign` (`product_id`),
  KEY `company_products_type_product_id_foreign` (`type_product_id`),
  CONSTRAINT `company_products_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `company_products_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `company_products_type_product_id_foreign` FOREIGN KEY (`type_product_id`) REFERENCES `type_products` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `company_products`
--

INSERT INTO `company_products` VALUES (1,NULL,'Mano de obra sistema interconectado (USD)',NULL,1,'USD',0.0000,0.00,'watt','range',0,NULL,6,'2023-10-23 22:17:19','2023-10-23 22:17:19',NULL),(2,NULL,'Canadian Solar PV Module 550W',NULL,1,'USD',0.0000,0.00,NULL,'unit',0,2,1,'2023-10-23 22:17:19','2023-10-23 22:17:19',NULL),(3,NULL,'Mano de obra sistema interconectado (USD)',NULL,2,'USD',0.0000,0.00,'watt','range',0,NULL,6,'2023-10-24 19:49:43','2023-10-24 19:49:43',NULL),(4,NULL,'Canadian Solar PV Module 550W',NULL,2,'USD',0.0000,0.00,NULL,'unit',0,2,1,'2023-10-24 19:49:43','2023-10-24 19:49:43',NULL),(5,NULL,'Mano de obra sistema interconectado (USD)',NULL,3,'MXN',500.0000,10.00,'watt','unit',0,NULL,6,'2023-10-24 21:15:21','2023-10-28 19:23:31',NULL),(6,NULL,'Canadian Solar PV Module 550W',NULL,3,'MXN',3500.0000,10.00,NULL,'unit',0,2,1,'2023-10-24 21:15:21','2023-10-28 18:02:11',NULL),(7,NULL,'Mano de obra sistema interconectado (USD)',NULL,4,'USD',0.0000,0.00,'watt','range',0,NULL,6,'2023-10-24 21:59:36','2023-10-24 21:59:36',NULL),(8,NULL,'Canadian Solar PV Module 550W',NULL,4,'USD',0.0000,0.00,NULL,'unit',0,2,1,'2023-10-24 21:59:36','2023-10-24 21:59:36',NULL),(9,NULL,'Mano de obra sistema interconectado (USD)',NULL,5,'USD',0.0000,0.00,'watt','range',0,NULL,6,'2023-10-24 22:00:12','2023-10-24 22:00:12',NULL),(10,'001','Canadian Solar PV Module 550W',NULL,5,'USD',125.0000,0.00,NULL,'unit',0,2,1,'2023-10-24 22:00:12','2023-10-24 22:40:19',NULL),(11,NULL,'Canadian Solar PV Module 650W',NULL,5,'USD',150.0000,0.00,NULL,'unit',0,4,1,'2023-10-24 22:40:04','2023-10-24 22:40:12',NULL),(12,'HMS2000-4T','Hoymiles  Inverter 2000 W',NULL,5,'USD',74.0000,0.00,NULL,'unit',0,79,3,'2023-10-24 22:47:06','2023-10-25 16:15:08',NULL),(13,'HMS-1000-2T','Hoymiles  Inverter 1000 W',NULL,5,'USD',100.0000,5.00,NULL,'unit',0,77,3,'2023-10-24 22:47:23','2023-10-25 16:14:36',NULL),(14,NULL,'Mano de obra sistema interconectado (USD)',NULL,6,'USD',0.0000,0.00,'watt','range',0,NULL,6,'2023-10-25 15:25:30','2023-10-25 15:25:30',NULL),(15,NULL,'Canadian Solar PV Module 550W',NULL,6,'USD',0.0000,0.00,NULL,'unit',0,2,1,'2023-10-25 15:25:30','2023-10-25 15:25:30',NULL),(16,NULL,'Mano de obra sistema interconectado (USD)',NULL,7,'USD',0.0000,0.00,'watt','range',0,NULL,6,'2023-10-25 15:26:21','2023-10-25 15:26:21',NULL),(17,NULL,'Canadian Solar PV Module 550W',NULL,7,'USD',0.0000,0.00,NULL,'unit',0,2,1,'2023-10-25 15:26:21','2023-10-25 15:26:21',NULL),(18,NULL,'Longi Solar PV 550W',NULL,3,'MXN',3500.0000,5.00,NULL,'unit',0,6,1,'2023-10-28 16:36:57','2023-10-28 16:37:19',NULL),(19,'YC600','ApSystems Inverter 600 W',NULL,3,'MXN',5000.0000,10.00,NULL,'unit',0,66,3,'2023-10-28 16:38:04','2023-10-28 16:39:03',NULL);

--
-- Table structure for table `contact_addresess`
--

CREATE TABLE `contact_addresess` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `contact_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `address_id` int unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `contact_addresess_contact_id_foreign` (`contact_id`),
  KEY `contact_addresess_address_id_foreign` (`address_id`),
  CONSTRAINT `contact_addresess_address_id_foreign` FOREIGN KEY (`address_id`) REFERENCES `addresses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `contact_addresess_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `contact_addresess`
--


--
-- Table structure for table `contact_documents`
--

CREATE TABLE `contact_documents` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `contact_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` int unsigned DEFAULT NULL,
  `file` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `contact_documents_contact_id_foreign` (`contact_id`),
  KEY `contact_documents_user_id_foreign` (`user_id`),
  CONSTRAINT `contact_documents_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `contact_documents_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `contact_documents`
--


--
-- Table structure for table `contact_mediums`
--

CREATE TABLE `contact_mediums` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `company_id` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `contact_mediums_company_id_foreign` (`company_id`),
  CONSTRAINT `contact_mediums_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `contact_mediums`
--

INSERT INTO `contact_mediums` VALUES (1,'Facebook',NULL,NULL,NULL),(2,'Instagram',NULL,NULL,NULL),(3,'Otra red social',NULL,NULL,NULL),(4,'Sitio web',NULL,NULL,NULL),(5,'Ads',NULL,NULL,NULL),(6,'Flyers',NULL,NULL,NULL),(7,'Otro',NULL,NULL,NULL);

--
-- Table structure for table `contact_notes`
--

CREATE TABLE `contact_notes` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `contact_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` int unsigned DEFAULT NULL,
  `note` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `contact_notes_contact_id_foreign` (`contact_id`),
  KEY `contact_notes_user_id_foreign` (`user_id`),
  CONSTRAINT `contact_notes_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `contact_notes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `contact_notes`
--


--
-- Table structure for table `contacts`
--

CREATE TABLE `contacts` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name_business` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `position` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `company_id` int unsigned DEFAULT NULL,
  `status_contact_id` int unsigned DEFAULT NULL,
  `person_id` int unsigned NOT NULL,
  `contact_medium_id` int unsigned DEFAULT NULL,
  `user_id` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `contacts_company_id_foreign` (`company_id`),
  KEY `contacts_status_contact_id_foreign` (`status_contact_id`),
  KEY `contacts_person_id_foreign` (`person_id`),
  KEY `contacts_contact_medium_id_foreign` (`contact_medium_id`),
  KEY `contacts_user_id_foreign` (`user_id`),
  CONSTRAINT `contacts_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `contacts_contact_medium_id_foreign` FOREIGN KEY (`contact_medium_id`) REFERENCES `contact_mediums` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `contacts_person_id_foreign` FOREIGN KEY (`person_id`) REFERENCES `people` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `contacts_status_contact_id_foreign` FOREIGN KEY (`status_contact_id`) REFERENCES `status_contacts` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `contacts_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `contacts`
--

INSERT INTO `contacts` VALUES ('9a70f742-f666-41eb-ae94-93846a6f5a06',NULL,NULL,1,1,2,NULL,1,'2023-10-23 22:22:33','2023-10-23 22:22:33',NULL),('9a71001d-8a3d-42ba-b513-4949902e190b',NULL,NULL,1,1,3,NULL,1,'2023-10-23 22:47:19','2023-10-23 22:47:19',NULL),('9a72ec68-ce65-4dec-aaee-2f9b07d29b7c',NULL,NULL,3,1,6,NULL,3,'2023-10-24 21:43:52','2023-10-24 21:43:52',NULL),('9a72f696-397f-4d7b-a96e-a60e2d96241b',NULL,NULL,5,1,9,NULL,5,'2023-10-24 22:12:19','2023-10-24 22:12:19',NULL),('9a7a842e-e403-400f-88c6-929679209ebb','CCEEA','Ingeniero de proyectos',3,1,12,7,3,'2023-10-28 16:19:03','2023-10-28 16:48:45',NULL);

--
-- Table structure for table `converter_currencies`
--

CREATE TABLE `converter_currencies` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `currency` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `price` double(8,4) DEFAULT '0.0000',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `converter_currencies`
--

INSERT INTO `converter_currencies` VALUES (1,'usd_mxn',17.5377,NULL,'2023-11-07 06:00:02'),(2,'mxn_usd',0.0570,NULL,'2023-11-07 06:00:02');

--
-- Table structure for table `cost_proposals`
--

CREATE TABLE `cost_proposals` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `quantity` mediumint unsigned DEFAULT NULL,
  `unit_price` double(14,4) unsigned DEFAULT '0.0000',
  `currency` varchar(4) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `company_product_id` int unsigned DEFAULT NULL,
  `proposal_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `cost_proposals_company_product_id_foreign` (`company_product_id`),
  KEY `cost_proposals_proposal_id_foreign` (`proposal_id`),
  CONSTRAINT `cost_proposals_company_product_id_foreign` FOREIGN KEY (`company_product_id`) REFERENCES `company_products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `cost_proposals_proposal_id_foreign` FOREIGN KEY (`proposal_id`) REFERENCES `proposals` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `cost_proposals`
--

INSERT INTO `cost_proposals` VALUES (1,1,0.0000,'USD',2,'9a70f743-05ce-406c-ab65-687fdbd82b8e'),(2,550,1.3400,'USD',1,'9a70f743-05ce-406c-ab65-687fdbd82b8e'),(3,14,0.0000,'USD',2,'9a71001d-9674-40a4-9b06-eaea34f37cb7'),(4,7700,1.3400,'USD',1,'9a71001d-9674-40a4-9b06-eaea34f37cb7'),(5,0,0.0000,'USD',6,'9a72ec68-dee3-483d-8097-7fa14121cd15'),(9,11,125.0000,'USD',10,'9a72f696-42e5-4b82-a9a8-a21049a38501'),(14,3,74.0000,'USD',12,'9a72f696-42e5-4b82-a9a8-a21049a38501'),(15,6,105.0000,'USD',13,'9a72f696-42e5-4b82-a9a8-a21049a38501'),(18,2,5500.0000,'MXN',19,'9a7a842e-f4c8-48cb-aa0c-36acc60f4cc7'),(19,2,3850.0000,'MXN',6,'9a7a842e-f4c8-48cb-aa0c-36acc60f4cc7');

--
-- Table structure for table `cost_rates`
--

CREATE TABLE `cost_rates` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `rate_id` int unsigned DEFAULT NULL,
  `type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `minimum_range` int DEFAULT NULL,
  `maximum_range` int DEFAULT NULL,
  `cost` double(8,3) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `cost_rates_rate_id_foreign` (`rate_id`),
  CONSTRAINT `cost_rates_rate_id_foreign` FOREIGN KEY (`rate_id`) REFERENCES `rates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `cost_rates`
--

INSERT INTO `cost_rates` VALUES (1,1,'basico',1,75,0.877,NULL,NULL),(2,1,'intermedio',76,125,1.067,NULL,NULL),(3,1,'excedente',126,NULL,3.115,NULL,NULL),(4,2,'basico',1,75,0.877,NULL,NULL),(5,2,'intermedio',76,150,1.067,NULL,NULL),(6,2,'excedente',151,NULL,3.115,NULL,NULL),(7,3,'basico',1,75,0.877,NULL,NULL),(8,3,'intermedio',76,150,1.067,NULL,NULL),(9,3,'excedente',151,NULL,3.115,NULL,NULL),(10,4,'basico',1,75,0.877,NULL,NULL),(11,4,'intermedio',76,150,1.067,NULL,NULL),(12,4,'excedente',151,NULL,3.115,NULL,NULL),(13,5,'basico',1,75,0.877,NULL,NULL),(14,5,'intermedio',76,175,1.067,NULL,NULL),(15,5,'excedente',176,NULL,3.115,NULL,NULL),(16,6,'basico',1,75,0.877,NULL,NULL),(17,6,'intermedio',76,200,1.067,NULL,NULL),(18,6,'excedente',201,NULL,3.115,NULL,NULL);

--
-- Table structure for table `crm`
--

CREATE TABLE `crm` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `proposal_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `crm_process_id` int unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `crm_proposal_id_foreign` (`proposal_id`),
  KEY `crm_crm_process_id_foreign` (`crm_process_id`),
  CONSTRAINT `crm_crm_process_id_foreign` FOREIGN KEY (`crm_process_id`) REFERENCES `crm_process` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `crm_proposal_id_foreign` FOREIGN KEY (`proposal_id`) REFERENCES `proposals` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `crm`
--

INSERT INTO `crm` VALUES ('9a70f743-0add-48f4-97d6-1f9c6d27b634','9a70f743-05ce-406c-ab65-687fdbd82b8e',1,'2023-10-23 22:22:33','2023-10-23 22:22:33'),('9a71001d-992b-4c2a-ab22-18beb7605130','9a71001d-9674-40a4-9b06-eaea34f37cb7',6,'2023-10-23 22:47:19','2023-10-23 22:55:12'),('9a72ec68-e26d-4145-be62-204d14d16e17','9a72ec68-dee3-483d-8097-7fa14121cd15',1,'2023-10-24 21:43:52','2023-10-24 21:43:52'),('9a72f696-45bb-44a4-9a30-92bfcd2eaad6','9a72f696-42e5-4b82-a9a8-a21049a38501',7,'2023-10-24 22:12:19','2023-11-07 22:41:56'),('9a7a842e-f8e6-4b10-bdd8-4f6e8a53d25e','9a7a842e-f4c8-48cb-aa0c-36acc60f4cc7',1,'2023-10-28 16:19:03','2023-10-28 16:19:03');

--
-- Table structure for table `crm_process`
--

CREATE TABLE `crm_process` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `color` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `crm_process`
--

INSERT INTO `crm_process` VALUES (1,'Prospectos','default'),(2,'Proyectos vendidos','success'),(3,'Ingeniería','info'),(4,'Inventario','primary'),(5,'Instalación','warning'),(6,'Gestoría','dark'),(7,'Puesta en marca','success');

--
-- Table structure for table `employee_roles`
--

CREATE TABLE `employee_roles` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `company_id` int unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `employee_roles_company_id_foreign` (`company_id`),
  CONSTRAINT `employee_roles_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `employee_roles`
--


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

CREATE TABLE `employees` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `employee_rol_id` int unsigned DEFAULT NULL,
  `person_id` int unsigned NOT NULL,
  `company_id` int unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `employees_employee_rol_id_foreign` (`employee_rol_id`),
  KEY `employees_person_id_foreign` (`person_id`),
  KEY `employees_company_id_foreign` (`company_id`),
  CONSTRAINT `employees_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `employees_employee_rol_id_foreign` FOREIGN KEY (`employee_rol_id`) REFERENCES `employee_roles` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `employees_person_id_foreign` FOREIGN KEY (`person_id`) REFERENCES `people` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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


--
-- Table structure for table `failed_jobs`
--

CREATE TABLE `failed_jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `failed_jobs`
--


--
-- Table structure for table `inventory`
--

CREATE TABLE `inventory` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `proposal_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `inventory_proposal_id_foreign` (`proposal_id`),
  CONSTRAINT `inventory_proposal_id_foreign` FOREIGN KEY (`proposal_id`) REFERENCES `proposals` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `inventory`
--

INSERT INTO `inventory` VALUES (1,'9a72f696-42e5-4b82-a9a8-a21049a38501','COT','654a92fbafdd9.pdf','quote','2023-11-07 19:41:47','2023-11-07 19:41:47'),(2,'9a72f696-42e5-4b82-a9a8-a21049a38501','HTML','654a930a9aabd.pdf','invoice','2023-11-07 19:42:02','2023-11-07 19:42:02');

--
-- Table structure for table `kind_tickets`
--

CREATE TABLE `kind_tickets` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `color` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `company_id` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `kind_tickets_company_id_foreign` (`company_id`),
  CONSTRAINT `kind_tickets_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `kind_tickets`
--

INSERT INTO `kind_tickets` VALUES (1,'Mantenimiento','warning',NULL,NULL,NULL,NULL),(2,'Instalación','danger',NULL,NULL,NULL,NULL),(3,'Incidencia','success',NULL,NULL,NULL,NULL),(4,'Prospección','info',NULL,NULL,NULL,NULL),(5,'Reunión','info',NULL,NULL,NULL,NULL),(6,'Levantamiento técnico','info',NULL,NULL,NULL,NULL),(7,'Seguimiento','primary',NULL,NULL,NULL,NULL),(8,'Otro','default',NULL,NULL,NULL,NULL);

--
-- Table structure for table `managers`
--

CREATE TABLE `managers` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `street` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `external_number` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `internal_number` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cp` varchar(15) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `colony` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `municipality` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `state_id` int unsigned DEFAULT NULL,
  `phone` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fax` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `company_id` int unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `managers_state_id_foreign` (`state_id`),
  KEY `managers_company_id_foreign` (`company_id`),
  CONSTRAINT `managers_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `managers_state_id_foreign` FOREIGN KEY (`state_id`) REFERENCES `states` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `managers`
--

INSERT INTO `managers` VALUES (1,'Alfredo  Martínez','cosijoeza','123',NULL,'470123','Las torres','León',11,'477128382','alfredo@gmail.com',NULL,1,'2023-10-24 02:15:02','2023-10-24 02:15:02',NULL),(2,'ANTONIE','NIÑOS HEROES DE CHAPULTEPEC','405','1','68040','Xochimilco','Oaxaca de juarez',1,'9511111111','asesor5.cceea@gmail.com','12121212',5,'2023-11-07 20:57:19','2023-11-07 20:57:19',NULL);

--
-- Table structure for table `migrations`
--

CREATE TABLE `migrations` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=74 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `migrations`
--

INSERT INTO `migrations` VALUES (1,'2014_10_12_100000_create_password_resets_table',1),(2,'2019_08_19_000000_create_failed_jobs_table',1),(3,'2019_12_14_000001_create_personal_access_tokens_table',1),(4,'2022_08_08_002759_create_table_countries',1),(5,'2022_08_08_002759_create_table_states',1),(6,'2022_08_09_002760_create_table_people',1),(7,'2022_08_09_005339_create_table_users',1),(8,'2022_08_10_002534_create_table_addresses',1),(9,'2022_08_10_002715_create_companies',1),(10,'2022_08_10_002833_create_table_type_tasks',1),(11,'2022_08_10_002834_create_table_templates',1),(12,'2022_08_10_002835_create_table_rates',1),(13,'2022_08_10_002836_create_table_contact_mediums',1),(14,'2022_08_10_002836_create_table_payment_methods',1),(15,'2022_08_10_002943_create_table_status_contacts',1),(16,'2022_08_10_003607_create_table_contacts',1),(17,'2022_08_10_003848_create_table_contact_addresses',1),(18,'2022_08_10_004259_create_table_type_emails_phones',1),(19,'2022_08_10_004259_create_table_type_panels',1),(20,'2022_08_10_004427_create_table_brands',1),(21,'2022_08_10_004502_create_table_status_tickets',1),(22,'2022_08_10_004506_create_table_type_documents',1),(23,'2022_08_10_004615_create_person_emails',1),(24,'2022_08_10_004620_create_person_phones',1),(25,'2022_08_10_004622_create_table_status_proposals',1),(26,'2022_08_10_004623_create_table_type_accesories',1),(27,'2022_08_10_004624_create_table_accesories',1),(28,'2022_08_10_004625_create_table_type_products',1),(29,'2022_08_10_004626_create_table_products',1),(30,'2022_08_10_004701_create_table_projects',1),(31,'2022_08_10_004737_create_table_project_consumptions',1),(32,'2022_08_10_004738_create_table_project_documents',1),(33,'2022_08_10_012955_create_table_proposals',1),(34,'2022_08_10_012956_create_table_company_products',1),(35,'2022_08_10_012957_create_table_taxes_proposals',1),(36,'2022_08_10_020724_create_table_rate_states',1),(37,'2022_08_10_020747_create_table_cost_rates',1),(38,'2022_08_10_021351_create_table_cost_proposals',1),(39,'2022_08_10_174731_create_table_settings',1),(40,'2022_08_10_185018_create_table_status_payments',1),(41,'2022_08_10_193634_create_table_proposal_payments',1),(42,'2022_08_10_203259_create_table_company_addresses',1),(43,'2022_08_10_224423_create_table_roles',1),(44,'2022_08_10_224644_create_table_permissions',1),(45,'2022_08_10_224829_create_table_role_permissions',1),(46,'2022_08_10_225435_create_table_user_roles',1),(47,'2022_08_11_004006_create_table_advisor_proposals',1),(48,'2022_08_20_163625_create_table_prority_tickets',1),(49,'2022_08_20_213557_create_table_kind_tickets',1),(50,'2022_09_09_003849_create_table_task_contacts',1),(51,'2022_10_11_193808_create_table_user_companies',1),(52,'2022_12_17_045441_create_table_company_product_prices',1),(53,'2023_01_20_161926_create_table_contact_documents',1),(54,'2023_01_20_162955_create_table_tickets',1),(55,'2023_01_20_163209_create_table_contact_notes',1),(56,'2023_02_03_005420_create_table_converter_currencies',1),(57,'2023_03_31_213749_create_table_observation_tickets',1),(58,'2023_04_05_021139_create_table_employee_roles',1),(59,'2023_04_05_021152_create_table_employees',1),(60,'2023_04_06_213914_create_table_assigned_tickets',1),(61,'2023_06_26_191934_create_table_crm_process',1),(62,'2023_06_26_192340_create_table_crm',1),(63,'2023_06_29_192750_create_table_proposal_notes',1),(64,'2023_07_06_141001_create_table_managers',1),(65,'2023_07_07_084818_create_table_cfe_zones',1),(66,'2023_08_17_221229_create_table_project_requirement_status',1),(67,'2023_08_18_133449_create_table_status_cfe',1),(68,'2023_08_18_143439_create_table_status_opinion',1),(69,'2023_08_18_153439_create_table_sales_contracts',1),(70,'2023_08_23_122405_create_table_inventory',1),(71,'2023_08_24_125618_create_table_proposal_installers',1),(72,'2023_09_09_134244_create_table_type_photos_requirements',1),(73,'2023_09_09_134408_create_table_photos_requirements_projects',1);

--
-- Table structure for table `observation_tickets`
--

CREATE TABLE `observation_tickets` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned DEFAULT NULL,
  `ticket_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `observations` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `observation_tickets_user_id_foreign` (`user_id`),
  KEY `observation_tickets_ticket_id_foreign` (`ticket_id`),
  CONSTRAINT `observation_tickets_ticket_id_foreign` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `observation_tickets_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `observation_tickets`
--


--
-- Table structure for table `payment_methods`
--

CREATE TABLE `payment_methods` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payment_methods`
--


--
-- Table structure for table `people`
--

CREATE TABLE `people` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mothers_last_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `photo` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'avatar.png',
  `gender` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT 'M',
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `people`
--

INSERT INTO `people` VALUES (1,'Mario',NULL,NULL,'avatar.png','M',NULL,'2023-10-23 22:17:19','2023-10-23 22:17:19'),(2,'MORA SANDOVAL RAUL',NULL,NULL,'avatar.png','M',NULL,'2023-10-23 22:22:33','2023-10-23 22:22:33'),(3,'HERNANDEZ VALENTIN CIRILO',NULL,NULL,'avatar.png','M',NULL,'2023-10-23 22:47:19','2023-10-23 22:47:19'),(4,'Salvador  Hernández',NULL,NULL,'avatar.png','M',NULL,'2023-10-24 19:49:43','2023-10-24 19:49:43'),(5,'Salvador Hernández',NULL,NULL,'avatar.png','M',NULL,'2023-10-24 21:15:21','2023-10-24 21:15:21'),(6,'TARIFA: 01 NO.',NULL,NULL,'avatar.png','M',NULL,'2023-10-24 21:43:52','2023-10-24 21:43:52'),(7,NULL,NULL,NULL,'avatar.png','M',NULL,'2023-10-24 21:59:36','2023-10-24 21:59:36'),(8,'ANTONIE',NULL,NULL,'avatar.png','M',NULL,'2023-10-24 22:00:12','2023-10-24 22:00:12'),(9,'PRUEBA',NULL,NULL,'avatar.png','M',NULL,'2023-10-24 22:12:19','2023-10-24 22:12:19'),(10,NULL,NULL,NULL,'avatar.png','M',NULL,'2023-10-25 15:25:30','2023-10-25 15:25:30'),(11,'DANIA',NULL,NULL,'avatar.png','M',NULL,'2023-10-25 15:26:21','2023-10-25 15:26:21'),(12,'Salvador','Hernández','Ramos','avatar.png','M',NULL,'2023-10-28 16:19:03','2023-10-28 16:48:45');

--
-- Table structure for table `permissions`
--

CREATE TABLE `permissions` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `slug` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `permissions`
--

INSERT INTO `permissions` VALUES (1,'Dashboard',NULL,'dashboard',NULL,NULL),(2,'Propuestas',NULL,'proposals',NULL,NULL),(3,'Productos',NULL,'products',NULL,NULL),(4,'Crm',NULL,'crm',NULL,NULL),(5,'Usuarios',NULL,'users',NULL,NULL),(6,'Tickets',NULL,'tickets',NULL,NULL);

--
-- Table structure for table `person_emails`
--

CREATE TABLE `person_emails` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `email` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type_email_id` int unsigned DEFAULT NULL,
  `person_id` int unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `person_emails_type_email_id_foreign` (`type_email_id`),
  KEY `person_emails_person_id_foreign` (`person_id`),
  CONSTRAINT `person_emails_person_id_foreign` FOREIGN KEY (`person_id`) REFERENCES `people` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `person_emails_type_email_id_foreign` FOREIGN KEY (`type_email_id`) REFERENCES `type_emails_phones` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `person_emails`
--

INSERT INTO `person_emails` VALUES (1,'mora@gmail.com',NULL,2),(2,'cirilo@gmail.com',NULL,3),(3,'aeroshir@gmail.com',NULL,6),(4,'asesor5.cceea@gmail.com',NULL,9),(5,'aeroshir@gmail.com',NULL,12);

--
-- Table structure for table `person_phones`
--

CREATE TABLE `person_phones` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `phone` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type_phone_id` int unsigned DEFAULT NULL,
  `person_id` int unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `person_phones_type_phone_id_foreign` (`type_phone_id`),
  KEY `person_phones_person_id_foreign` (`person_id`),
  CONSTRAINT `person_phones_person_id_foreign` FOREIGN KEY (`person_id`) REFERENCES `people` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `person_phones_type_phone_id_foreign` FOREIGN KEY (`type_phone_id`) REFERENCES `type_emails_phones` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `person_phones`
--

INSERT INTO `person_phones` VALUES (1,'4771293213',NULL,3),(2,'9515890437',NULL,6),(3,'9511111111',NULL,9),(4,'9515890437',NULL,12);

--
-- Table structure for table `photos_requirements_projects`
--

CREATE TABLE `photos_requirements_projects` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `proposal_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `photo` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type_photo_id` int unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `photos_requirements_projects_proposal_id_foreign` (`proposal_id`),
  KEY `photos_requirements_projects_type_photo_id_foreign` (`type_photo_id`),
  CONSTRAINT `photos_requirements_projects_proposal_id_foreign` FOREIGN KEY (`proposal_id`) REFERENCES `proposals` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `photos_requirements_projects_type_photo_id_foreign` FOREIGN KEY (`type_photo_id`) REFERENCES `type_photos_requirements` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `photos_requirements_projects`
--


--
-- Table structure for table `priority_tickets`
--

CREATE TABLE `priority_tickets` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `color` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `company_id` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `priority_tickets_company_id_foreign` (`company_id`),
  CONSTRAINT `priority_tickets_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `priority_tickets`
--

INSERT INTO `priority_tickets` VALUES (1,'Baja','info',NULL,NULL,NULL,NULL),(2,'Media','primary',NULL,NULL,NULL,NULL),(3,'Alta','warning',NULL,NULL,NULL,NULL),(4,'Urgente','danger',NULL,NULL,NULL,NULL);

--
-- Table structure for table `products`
--

CREATE TABLE `products` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `technical_datasheet` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `potency` double(8,2) DEFAULT '0.00',
  `photo` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type_accesory` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mppt` tinyint DEFAULT NULL,
  `tension` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type_panel_id` int unsigned DEFAULT NULL,
  `brand_id` int unsigned DEFAULT NULL,
  `type_product_id` int unsigned DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `products_type_panel_id_foreign` (`type_panel_id`),
  KEY `products_brand_id_foreign` (`brand_id`),
  KEY `products_type_product_id_foreign` (`type_product_id`),
  CONSTRAINT `products_brand_id_foreign` FOREIGN KEY (`brand_id`) REFERENCES `brands` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `products_type_panel_id_foreign` FOREIGN KEY (`type_panel_id`) REFERENCES `type_panels` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `products_type_product_id_foreign` FOREIGN KEY (`type_product_id`) REFERENCES `type_products` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=87 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `products`
--

INSERT INTO `products` VALUES (1,'Canadian Solar PV Module 545 Mono Half Cell',NULL,NULL,NULL,545.00,NULL,NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL),(2,'Canadian Solar PV Module 550W',NULL,NULL,NULL,550.00,NULL,NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL),(3,'Canadian Solar PV Module 490W CS3Y Mono Half Cell',NULL,NULL,NULL,490.00,NULL,NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL),(4,'Canadian Solar PV Module 650W',NULL,NULL,NULL,650.00,NULL,NULL,NULL,NULL,NULL,1,1,NULL,NULL,'2023-10-27 17:33:42'),(5,'Canadian Solar PV Module 660W',NULL,NULL,NULL,490.00,NULL,NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL),(6,'Longi Solar PV 550W',NULL,NULL,NULL,550.00,NULL,NULL,NULL,NULL,NULL,4,1,NULL,NULL,NULL),(7,'Longi Solar PV 570W',NULL,NULL,NULL,570.00,NULL,NULL,NULL,NULL,NULL,4,1,NULL,NULL,NULL),(8,'SMA SPD ProTec T2 DC PVS',NULL,NULL,NULL,NULL,NULL,'Connector',NULL,NULL,NULL,14,4,NULL,NULL,NULL),(9,'SMA Cluster Controller',NULL,NULL,NULL,NULL,NULL,'Monitoring',NULL,NULL,NULL,14,4,NULL,NULL,NULL),(10,'Growatt Inverter 15 kW','MAC 15KTL3-XL ',NULL,NULL,15.00,NULL,NULL,4,'3F-220V',NULL,12,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(11,'Growatt Inverter 36 kW','MAC 36KTL3-XL',NULL,NULL,36.00,NULL,NULL,3,'3F-220V',NULL,12,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(12,'Growatt Inverter 70 kW','MAC 70KTL3-X MV',NULL,NULL,70.00,NULL,NULL,3,'3F-480V',NULL,12,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(13,'Growatt Inverter 125 kW','MAX 125KTL3-X MV',NULL,NULL,125.00,NULL,NULL,10,'3F-480V',NULL,12,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(14,'Growatt Inverter 75 kW','MAX 75KTL3-XL2',NULL,NULL,75.00,NULL,NULL,8,'3F-220V',NULL,12,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(15,'Growatt Inverter 3.3 kW','MIC 3300TL-X',NULL,NULL,3.30,NULL,NULL,1,'2F-240V',NULL,12,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(16,'Growatt Inverter 5 kW','MIC-5000TL-X',NULL,NULL,5.00,NULL,NULL,2,'2F-240V',NULL,12,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(17,'Growatt Inverter 6 kW','MIN 6000TL-X',NULL,NULL,6.00,NULL,NULL,2,'2F-240V',NULL,12,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(18,'Growatt Inverter 9 kW','MIN 9000TL-X',NULL,NULL,9.00,NULL,NULL,3,'2F-240V',NULL,12,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(19,'Huawei Inverter 20 kW','SUN-2000-20KTL-M3',NULL,NULL,20.00,NULL,NULL,4,'3F-220V',NULL,18,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(20,'Huawei Inverter 40 kW','SUN-2000-40KTL-M3',NULL,NULL,40.00,NULL,NULL,4,'3F-220V',NULL,18,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(21,'Fronius  Inverter 10 kW','Primo 10.0-1 208-240',NULL,NULL,10.00,NULL,NULL,2,'2F-240V',NULL,10,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(22,'Fronius  Inverter 3.8 kW','Primo 3.8-1 208-240',NULL,NULL,3.80,NULL,NULL,2,'2F-240V',NULL,10,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(23,'Fronius  Inverter 7.6 kW','Primo 7.6-1 208-240',NULL,NULL,7.60,NULL,NULL,2,'2F-240V',NULL,10,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(24,'Fronius  Inverter 8.2 kW','Primo 8.2-1 208-240',NULL,NULL,8.20,NULL,NULL,2,'2F-240V',NULL,10,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(25,'Fronius  Inverter 11.4 kW','Primo 11.4-1 208-240',NULL,NULL,11.40,NULL,NULL,2,'2F-240V',NULL,10,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(26,'Fronius  Inverter 12.5 kW','Primo 12.5-1 208-240',NULL,NULL,12.50,NULL,NULL,2,'2F-240V',NULL,10,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(27,'Fronius  Inverter 15 kW ','Primo 15.0-1 208-240',NULL,NULL,15.00,NULL,NULL,2,'2F-240V',NULL,10,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(28,'SMA  Inverter 3 kW','Suny Boy 3.0 US',NULL,NULL,3.00,NULL,NULL,2,'2F-240V',NULL,14,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(29,'SMA  Inverter 3.8 kW','Suny Boy 3.8 US',NULL,NULL,3.80,NULL,NULL,2,'2F-240V',NULL,14,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(30,'SMA  Inverter 5.0 kW','Suny Boy 5.0 US',NULL,NULL,5.00,NULL,NULL,3,'2F-240V',NULL,14,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(31,'SMA  Inverter 6.0 kW','Suny Boy 6.0 US',NULL,NULL,6.00,NULL,NULL,3,'2F-240V',NULL,14,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(32,'SMA  Inverter 7.0 kW','Suny Boy 7.0 US',NULL,NULL,7.00,NULL,NULL,3,'2F-240V',NULL,14,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(33,'SMA  Inverter 7.7 kW','Suny Boy 7.7 US',NULL,NULL,7.70,NULL,NULL,3,'2F-240V',NULL,14,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(34,'Solis  Inverter 100 kW','Solis-100K-5G-US ',NULL,NULL,100.00,NULL,NULL,10,'3F-480V',NULL,16,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(35,'Solis  Inverter 124 kW','Solis-125K-HV-5G ',NULL,NULL,124.00,NULL,NULL,10,'3F-480V',NULL,16,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(36,'Solis  Inverter 5 kW','Solis-1P5K-4G ',NULL,NULL,5.00,NULL,NULL,2,'2F-220V',NULL,16,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(37,'Solis  Inverter 8 kW','Solis-1P8K-4G ',NULL,NULL,8.00,NULL,NULL,3,'2F-220V',NULL,16,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(38,'Solis  Inverter 30 kW','Solis-30K-LV ',NULL,NULL,30.00,NULL,NULL,2,'3F-220V',NULL,16,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(39,'Solis  Inverter 10 kW','Solis-3P10K-4G-LV ',NULL,NULL,10.00,NULL,NULL,2,'3F-220V',NULL,16,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(40,'Solis  Inverter 50 kW','Solis-50K-LV-5G ',NULL,NULL,50.00,NULL,NULL,6,'3F-220V',NULL,16,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(41,'Solis  Inverter 60 kW','Solis-60K-LV-5G ',NULL,NULL,60.00,NULL,NULL,8,'3F-220V',NULL,16,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(42,'Solis  Inverter 60 kW','Solis-60K-HV ',NULL,NULL,60.00,NULL,NULL,4,'3F-480V',NULL,16,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(43,'Solis  Inverter 15 kW','S5-GC15K-LV ',NULL,NULL,15.00,NULL,NULL,3,'3F-220V',NULL,16,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(44,'Solis  Inverter 20 kW','S5-GC20K-LV',NULL,NULL,20.00,NULL,NULL,3,'3F-220V',NULL,16,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(45,'Solis  Inverter 40 kW','S5-GC40K-HV ',NULL,NULL,40.00,NULL,NULL,4,'3F-480V',NULL,16,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(46,'Solis  Inverter 10 kW','S5-GR1P10K',NULL,NULL,10.00,NULL,NULL,3,'2F-220V',NULL,16,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(47,'Solis  Inverter 1 kW','S6-GR1P1K-M',NULL,NULL,1.00,NULL,NULL,1,'2F-220V',NULL,16,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(48,'Solis  Inverter 2 kW','S6-GR1P2K-M',NULL,NULL,2.00,NULL,NULL,1,'2F-220V',NULL,16,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(49,'Solis  Inverter 3.6 kW','S6-GR1P3.6K-M',NULL,NULL,3.60,NULL,NULL,1,'2F-220V',NULL,16,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(50,'Solis  Inverter 5 kW','S6-GR1P5K ',NULL,NULL,5.00,NULL,NULL,2,'2F-220V',NULL,16,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(51,'Solis  Inverter 6 kW','S6-GR1P6K ',NULL,NULL,6.00,NULL,NULL,2,'2F-220V',NULL,16,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(52,'Solis  Inverter 8 kW','S5-GR1P8K ',NULL,NULL,8.00,NULL,NULL,2,'2F-220V',NULL,16,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(53,'Solis  Inverter 10 kW','S5-GR1P10K ',NULL,NULL,10.00,NULL,NULL,2,'2F-220V',NULL,16,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(54,'Solis  Inverter 20 kW','S5-GR3P20K-HV ',NULL,NULL,20.00,NULL,NULL,2,'3F-480V',NULL,16,2,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(55,'Enphase Inverter 350 W','IQ7A-72-2-US ',NULL,NULL,0.35,NULL,NULL,1,'2F-220V',NULL,19,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(56,'Enphase Inverter 330 W','IQ7AM-72-2-US ',NULL,NULL,0.33,NULL,NULL,1,'2F-220V',NULL,19,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(57,'Enphase Inverter 240 W','IQ7-60-2-US ',NULL,NULL,0.24,NULL,NULL,1,'2F-220V',NULL,19,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(58,'Enphase Inverter 290 W','IQ7PLUS-72-2-US ',NULL,NULL,0.29,NULL,NULL,1,'2F-220V',NULL,19,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(59,'Enphase Inverter 380 W','IQ8H-240-72-2-US ',NULL,NULL,0.38,NULL,NULL,1,'2F-220V',NULL,19,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(60,'Enpahse Inverter 240 W','IQ8-60-2-US ',NULL,NULL,0.24,NULL,NULL,1,'2F-220V',NULL,19,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(61,'Enpahse Inverter 290 W','IQ8PLUS-72-2-US ',NULL,NULL,0.29,NULL,NULL,1,'2F-220V',NULL,19,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(62,'Enpahse Inverter 325 W','IQ8M-72-2-US ',NULL,NULL,0.32,NULL,NULL,1,'2F-220V',NULL,19,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(63,'Enpahse Inverter 349 W','IQ8A-72-2-US ',NULL,NULL,0.35,NULL,NULL,1,'2F-220V',NULL,19,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(64,'Enpahse Inverter 380 W','IQ8H-240-72-2-US ',NULL,NULL,0.38,NULL,NULL,1,'2F-220V',NULL,19,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(65,'ApSystems Inverter 2000 W','DS3D',NULL,NULL,2.00,NULL,NULL,4,'2F-220V',NULL,20,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(66,'ApSystems Inverter 600 W','YC600',NULL,NULL,0.60,NULL,NULL,2,'2F-220V',NULL,20,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(67,'ApSystems Inverter 600 W','YC600B',NULL,NULL,0.60,NULL,NULL,2,'1F-127V',NULL,20,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(68,'ApSystems Inverter 750 W','YC600 Boosted',NULL,NULL,0.75,NULL,NULL,2,'1F-127V',NULL,20,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(69,'Hoymiles  Inverter 1000 W','HM-1000 ',NULL,NULL,1.00,NULL,NULL,4,'2F-220V',NULL,13,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(70,'Hoymiles  Inverter 1200 W','HM-1200',NULL,NULL,1.20,NULL,NULL,4,'2F-220V',NULL,13,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(71,'Hoymiles  Inverter 1500 W','HM-1500',NULL,NULL,1.50,NULL,NULL,4,'2F-220V',NULL,13,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(72,'Hoymiles  Inverter 600 W','HM-600',NULL,NULL,0.60,NULL,NULL,2,'2F-220V',NULL,13,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(73,'Hoymiles  Inverter 700 W','HM-700',NULL,NULL,0.70,NULL,NULL,2,'2F-220V',NULL,13,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(74,'Hoymiles  Inverter 800 W','HM-800',NULL,NULL,0.80,NULL,NULL,2,'2F-220V',NULL,13,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(75,'Hoymiles  Inverter 800 W','HMS-800-2T ',NULL,NULL,0.80,NULL,NULL,2,'2F-220V',NULL,13,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(76,'Hoymiles  Inverter 900 W','HMS-900-2T ',NULL,NULL,0.90,NULL,NULL,2,'2F-220V',NULL,13,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(77,'Hoymiles  Inverter 1000 W','HMS-1000-2T ',NULL,NULL,1.00,NULL,NULL,2,'2F-220V',NULL,13,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(78,'Hoymiles  Inverter 1800 W','HMS-1800-4T ',NULL,NULL,1.80,NULL,NULL,4,'2F-220V',NULL,13,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(79,'Hoymiles  Inverter 2000 W','HMS2000-4T ',NULL,NULL,2.00,NULL,NULL,4,'2F-220V',NULL,13,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(80,'Hoymiles  Inverter 800 W','HMS-800-2T-LV',NULL,NULL,0.80,NULL,NULL,2,'1F-120V',NULL,13,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(81,'Hoymiles  Inverter 1000 W','MI-1000',NULL,NULL,1.00,NULL,NULL,4,'2F-240V',NULL,13,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(82,'Hoymiles  Inverter 1200 W','MI-1200',NULL,NULL,1.20,NULL,NULL,4,'2F-240V',NULL,13,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(83,'Hoymiles  Inverter 1500 W','MI-1500',NULL,NULL,1.50,NULL,NULL,4,'2F-220V',NULL,13,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(84,'Hoymiles  Inverter 600 W','MI-600',NULL,NULL,0.60,NULL,NULL,2,'2F-220V',NULL,13,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(85,'Hoymiles  Inverter 700 W','MI-700',NULL,NULL,0.70,NULL,NULL,2,'2F-220V',NULL,13,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35'),(86,'Hoymiles  Inverter 800 W','MI-800',NULL,NULL,0.80,NULL,NULL,2,'2F-220V',NULL,13,3,NULL,'2023-10-23 22:19:35','2023-10-23 22:19:35');

--
-- Table structure for table `project_consumptions`
--

CREATE TABLE `project_consumptions` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `period` smallint DEFAULT NULL,
  `consumption` decimal(12,2) DEFAULT NULL,
  `demand` decimal(12,2) DEFAULT NULL,
  `power_factor` decimal(12,2) DEFAULT NULL,
  `project_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `project_consumptions_project_id_foreign` (`project_id`),
  CONSTRAINT `project_consumptions_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `project_consumptions`
--

INSERT INTO `project_consumptions` VALUES (1,1,116.00,NULL,NULL,'9a70f742-fdd1-4803-92a2-1d56d0a6e490'),(2,2,22.00,NULL,NULL,'9a70f742-fdd1-4803-92a2-1d56d0a6e490'),(3,3,12.00,NULL,NULL,'9a70f742-fdd1-4803-92a2-1d56d0a6e490'),(4,4,1.00,NULL,NULL,'9a70f742-fdd1-4803-92a2-1d56d0a6e490'),(5,5,0.00,NULL,NULL,'9a70f742-fdd1-4803-92a2-1d56d0a6e490'),(6,6,73.00,NULL,NULL,'9a70f742-fdd1-4803-92a2-1d56d0a6e490'),(7,1,1540.00,NULL,NULL,'9a71001d-8d72-4f5b-baa2-bf505328622e'),(8,2,1838.00,NULL,NULL,'9a71001d-8d72-4f5b-baa2-bf505328622e'),(9,3,2172.00,NULL,NULL,'9a71001d-8d72-4f5b-baa2-bf505328622e'),(10,4,1927.00,NULL,NULL,'9a71001d-8d72-4f5b-baa2-bf505328622e'),(11,5,2269.00,NULL,NULL,'9a71001d-8d72-4f5b-baa2-bf505328622e'),(12,6,2071.00,NULL,NULL,'9a71001d-8d72-4f5b-baa2-bf505328622e'),(13,1,216.00,NULL,NULL,'9a72ec68-d502-4a4c-8443-6575e4efaf87'),(14,2,223.00,NULL,NULL,'9a72ec68-d502-4a4c-8443-6575e4efaf87'),(15,3,175.00,NULL,NULL,'9a72ec68-d502-4a4c-8443-6575e4efaf87'),(16,4,180.00,NULL,NULL,'9a72ec68-d502-4a4c-8443-6575e4efaf87'),(17,5,182.00,NULL,NULL,'9a72ec68-d502-4a4c-8443-6575e4efaf87'),(18,6,176.00,NULL,NULL,'9a72ec68-d502-4a4c-8443-6575e4efaf87'),(19,1,2360.00,NULL,NULL,'9a72f696-3b2c-4b15-957d-a6e8c865c4a2'),(20,2,3149.00,NULL,NULL,'9a72f696-3b2c-4b15-957d-a6e8c865c4a2'),(21,3,1410.00,NULL,NULL,'9a72f696-3b2c-4b15-957d-a6e8c865c4a2'),(22,4,952.00,NULL,NULL,'9a72f696-3b2c-4b15-957d-a6e8c865c4a2'),(23,5,1522.00,NULL,NULL,'9a72f696-3b2c-4b15-957d-a6e8c865c4a2'),(24,6,833.00,NULL,NULL,'9a72f696-3b2c-4b15-957d-a6e8c865c4a2'),(25,1,216.00,NULL,NULL,'9a7a842e-ea1f-4777-89ea-224b8c84ce36'),(26,2,223.00,NULL,NULL,'9a7a842e-ea1f-4777-89ea-224b8c84ce36'),(27,3,175.00,NULL,NULL,'9a7a842e-ea1f-4777-89ea-224b8c84ce36'),(28,4,180.00,NULL,NULL,'9a7a842e-ea1f-4777-89ea-224b8c84ce36'),(29,5,182.00,NULL,NULL,'9a7a842e-ea1f-4777-89ea-224b8c84ce36'),(30,6,176.00,NULL,NULL,'9a7a842e-ea1f-4777-89ea-224b8c84ce36');

--
-- Table structure for table `project_documents`
--

CREATE TABLE `project_documents` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `project_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `document` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `project_documents_project_id_foreign` (`project_id`),
  CONSTRAINT `project_documents_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `project_documents`
--


--
-- Table structure for table `project_requirement_status`
--

CREATE TABLE `project_requirement_status` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `color` varchar(13) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `project_requirement_status`
--

INSERT INTO `project_requirement_status` VALUES (1,'Por confirmar','default',NULL,NULL),(2,'Confirmado','success',NULL,NULL),(3,'Cancelado','danger',NULL,NULL),(4,'Pospuesto','warning',NULL,NULL);

--
-- Table structure for table `projects`
--

CREATE TABLE `projects` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `service_number` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cfe_pdf_receipt` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `average_daily_consumption` decimal(12,2) unsigned DEFAULT '0.00',
  `average_consumption` decimal(12,2) unsigned DEFAULT '0.00',
  `contracted_demand` decimal(12,2) unsigned DEFAULT '0.00',
  `average_demand` decimal(12,2) unsigned DEFAULT '0.00',
  `payment_cfe` double(8,2) DEFAULT '0.00',
  `threads` tinyint DEFAULT '2',
  `company_id` int unsigned NOT NULL,
  `contact_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_id` int unsigned DEFAULT NULL,
  `state_id` int unsigned DEFAULT NULL,
  `rate_id` int unsigned DEFAULT NULL,
  `invoice_type` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `latitude` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `longitude` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `projects_company_id_foreign` (`company_id`),
  KEY `projects_contact_id_foreign` (`contact_id`),
  KEY `projects_user_id_foreign` (`user_id`),
  KEY `projects_state_id_foreign` (`state_id`),
  KEY `projects_rate_id_foreign` (`rate_id`),
  CONSTRAINT `projects_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `projects_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `projects_rate_id_foreign` FOREIGN KEY (`rate_id`) REFERENCES `rates` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `projects_state_id_foreign` FOREIGN KEY (`state_id`) REFERENCES `states` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `projects_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `projects`
--

INSERT INTO `projects` VALUES ('9a70f742-fdd1-4803-92a2-1d56d0a6e490','Proyecto 1','062200754943',NULL,0.74,44.80,0.00,0.00,0.00,2,1,'9a70f742-f666-41eb-ae94-93846a6f5a06','interconectados',1,11,8,'bimestral',NULL,NULL,NULL,'2023-10-23 22:22:33','2023-10-23 22:22:33',NULL),('9a71001d-8d72-4f5b-baa2-bf505328622e','Proyecto 1','062100203397',NULL,32.38,1969.50,0.00,0.00,0.00,2,1,'9a71001d-8a3d-42ba-b513-4949902e190b','interconectados',1,11,8,'bimestral','Fray Daniel Mireles 408, El Coecillo, León, Gto., México','21.1254982','-101.6675401','2023-10-23 22:47:19','2023-10-23 22:52:40',NULL),('9a72ec68-d502-4a4c-8443-6575e4efaf87','Proyecto 1','693990400143',NULL,3.16,192.00,0.00,0.00,0.00,2,3,'9a72ec68-ce65-4dec-aaee-2f9b07d29b7c','interconectados',3,1,1,'bimestral',NULL,NULL,NULL,'2023-10-24 21:43:52','2023-10-24 21:43:52',NULL),('9a72f696-3b2c-4b15-957d-a6e8c865c4a2','Proyecto 1','585210352366',NULL,28.02,1704.33,0.00,0.00,0.00,2,5,'9a72f696-397f-4d7b-a96e-a60e2d96241b','interconectados',5,6,8,'bimestral','Montes Americanos 7505, Cumbres 5ta etapa, Chihuahua, México',NULL,NULL,'2023-10-24 22:12:19','2023-11-07 18:07:36',NULL),('9a7a842e-ea1f-4777-89ea-224b8c84ce36','Proyecto 1','693990400143',NULL,3.16,192.00,0.00,0.00,0.00,2,3,'9a7a842e-e403-400f-88c6-929679209ebb','interconectados',3,20,1,'bimestral',NULL,NULL,NULL,'2023-10-28 16:19:03','2023-10-28 16:19:03',NULL);

--
-- Table structure for table `proposal_installers`
--

CREATE TABLE `proposal_installers` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `proposal_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` int unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `proposal_installers_proposal_id_foreign` (`proposal_id`),
  KEY `proposal_installers_user_id_foreign` (`user_id`),
  CONSTRAINT `proposal_installers_proposal_id_foreign` FOREIGN KEY (`proposal_id`) REFERENCES `proposals` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `proposal_installers_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `proposal_installers`
--

INSERT INTO `proposal_installers` VALUES (1,'9a72f696-42e5-4b82-a9a8-a21049a38501',5);

--
-- Table structure for table `proposal_notes`
--

CREATE TABLE `proposal_notes` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `proposal_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` int unsigned DEFAULT NULL,
  `note` text COLLATE utf8mb4_unicode_ci,
  `crm_process_id` int unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `proposal_notes_proposal_id_foreign` (`proposal_id`),
  KEY `proposal_notes_user_id_foreign` (`user_id`),
  KEY `proposal_notes_crm_process_id_foreign` (`crm_process_id`),
  CONSTRAINT `proposal_notes_crm_process_id_foreign` FOREIGN KEY (`crm_process_id`) REFERENCES `crm_process` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `proposal_notes_proposal_id_foreign` FOREIGN KEY (`proposal_id`) REFERENCES `proposals` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `proposal_notes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `proposal_notes`
--

INSERT INTO `proposal_notes` VALUES (1,'9a71001d-9674-40a4-9b06-eaea34f37cb7',1,'Solicita cambio de medidor',1,'2023-10-23 22:49:02','2023-10-23 22:49:02',NULL);

--
-- Table structure for table `proposal_payments`
--

CREATE TABLE `proposal_payments` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `proposal_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `date` date DEFAULT NULL,
  `concept` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `observations` text COLLATE utf8mb4_unicode_ci,
  `payment_method_id` int unsigned DEFAULT NULL,
  `amount` double(14,2) DEFAULT NULL,
  `currency` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type` tinyint NOT NULL DEFAULT '0',
  `status_id` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `proposal_payments_proposal_id_foreign` (`proposal_id`),
  KEY `proposal_payments_payment_method_id_foreign` (`payment_method_id`),
  KEY `proposal_payments_status_id_foreign` (`status_id`),
  CONSTRAINT `proposal_payments_payment_method_id_foreign` FOREIGN KEY (`payment_method_id`) REFERENCES `payment_methods` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `proposal_payments_proposal_id_foreign` FOREIGN KEY (`proposal_id`) REFERENCES `proposals` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `proposal_payments_status_id_foreign` FOREIGN KEY (`status_id`) REFERENCES `status_payments` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `proposal_payments`
--

INSERT INTO `proposal_payments` VALUES (1,'9a71001d-9674-40a4-9b06-eaea34f37cb7','2023-10-23','Enganche',NULL,NULL,NULL,50000.00,NULL,0,NULL,'2023-10-23 22:50:40','2023-10-23 22:50:40',NULL),(2,'9a71001d-9674-40a4-9b06-eaea34f37cb7','2023-10-23','Pago final',NULL,NULL,NULL,133316.91,NULL,0,NULL,'2023-10-23 22:50:53','2023-10-23 22:50:53',NULL),(3,'9a72f696-42e5-4b82-a9a8-a21049a38501','2023-11-07','Enganche',NULL,NULL,NULL,1000.00,NULL,0,NULL,'2023-11-07 17:11:18','2023-11-07 17:11:18',NULL),(4,'9a72f696-42e5-4b82-a9a8-a21049a38501','2023-11-07','Liquidación',NULL,NULL,NULL,1454.15,NULL,0,NULL,'2023-11-07 17:11:39','2023-11-07 17:11:39',NULL);

--
-- Table structure for table `proposals`
--

CREATE TABLE `proposals` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `folio` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `date` date DEFAULT NULL,
  `due_date` date DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `system_size` double(12,2) DEFAULT NULL,
  `price_per_watt` double(14,4) DEFAULT NULL,
  `return_on_investment` double DEFAULT NULL,
  `system_generation` double(12,2) DEFAULT NULL,
  `energy_saving` double(12,2) DEFAULT NULL,
  `cfes_new_consumption` double(12,2) DEFAULT NULL,
  `new_payment_cfe` double(12,2) DEFAULT NULL,
  `current_payment_cfe` double(12,2) DEFAULT NULL,
  `discount` double(5,2) DEFAULT '0.00',
  `tax_incentive` tinyint(1) DEFAULT '0',
  `tax_incentive_percentage` double(5,2) DEFAULT '30.00',
  `loss_factor` double(5,2) DEFAULT '23.00',
  `break_down_amounts` tinyint(1) DEFAULT '0',
  `currency` varchar(4) COLLATE utf8mb4_unicode_ci DEFAULT 'USD',
  `project_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `template_id` int unsigned DEFAULT NULL,
  `status_proposal_id` int unsigned DEFAULT NULL,
  `exchange_rate_mxn` double(8,4) DEFAULT '0.0000',
  `exchange_rate_usd` double(8,4) DEFAULT '0.0000',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `proposals_project_id_foreign` (`project_id`),
  KEY `proposals_template_id_foreign` (`template_id`),
  KEY `proposals_status_proposal_id_foreign` (`status_proposal_id`),
  CONSTRAINT `proposals_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `proposals_status_proposal_id_foreign` FOREIGN KEY (`status_proposal_id`) REFERENCES `status_proposals` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `proposals_template_id_foreign` FOREIGN KEY (`template_id`) REFERENCES `templates` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `proposals`
--

INSERT INTO `proposals` VALUES ('9a70f743-05ce-406c-ab65-687fdbd82b8e','Propuesta 1','20230001','2023-10-23','2023-11-07',NULL,0.55,NULL,NULL,149.16,332.95,0.00,68.96,269.42,0.00,0,30.00,23.00,0,'USD','9a70f742-fdd1-4803-92a2-1d56d0a6e490',1,2,18.2513,0.0548,'2023-10-23 22:22:33','2023-10-23 22:32:34',NULL),('9a71001d-9674-40a4-9b06-eaea34f37cb7','Propuesta 1','20230002','2023-10-23','2023-11-07',NULL,7.70,NULL,NULL,2088.19,106.03,0.00,68.96,8881.54,0.00,0,30.00,23.00,0,'MXN','9a71001d-8d72-4f5b-baa2-bf505328622e',1,2,18.2513,0.0548,'2023-10-23 22:47:19','2023-10-23 22:47:39',NULL),('9a72ec68-dee3-483d-8097-7fa14121cd15','Propuesta 1','20230001','2023-10-24','2023-11-08',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00,0,30.00,23.00,0,'USD','9a72ec68-d502-4a4c-8443-6575e4efaf87',1,1,18.1642,0.0551,'2023-10-24 21:43:52','2023-10-28 16:46:10','2023-10-28 16:46:10'),('9a72f696-42e5-4b82-a9a8-a21049a38501','Propuesta 1','20230001','2023-10-24','2023-11-08','PROYECTO IMPORTANTE',6.05,NULL,NULL,1763.71,103.48,0.00,142.84,7584.87,5.00,0,30.00,23.00,1,'USD','9a72f696-3b2c-4b15-957d-a6e8c865c4a2',1,5,18.1642,0.0551,'2023-10-24 22:12:19','2023-11-07 16:15:24',NULL),('9a7a842e-f4c8-48cb-aa0c-36acc60f4cc7','Propuesta 1','20230002','2023-10-28','2023-11-12',NULL,1.10,NULL,NULL,259.18,134.99,0.00,54.43,406.90,0.00,0,30.00,23.00,0,'USD','9a7a842e-ea1f-4777-89ea-224b8c84ce36',1,1,18.1141,0.0552,'2023-10-28 16:19:03','2023-10-28 19:33:31',NULL);

--
-- Table structure for table `rate_states`
--

CREATE TABLE `rate_states` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `state_id` int unsigned DEFAULT NULL,
  `rate_id` int unsigned DEFAULT NULL,
  `fixed_charge` double(8,2) DEFAULT NULL,
  `variable_charge` double(8,3) DEFAULT NULL,
  `distribution` double(8,3) DEFAULT NULL,
  `capacity` double(8,3) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `rate_states_state_id_foreign` (`state_id`),
  KEY `rate_states_rate_id_foreign` (`rate_id`),
  CONSTRAINT `rate_states_rate_id_foreign` FOREIGN KEY (`rate_id`) REFERENCES `rates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `rate_states_state_id_foreign` FOREIGN KEY (`state_id`) REFERENCES `states` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=97 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rate_states`
--

INSERT INTO `rate_states` VALUES (1,1,8,27.78,3.605,NULL,NULL,NULL,NULL),(2,2,8,53.58,2.388,NULL,NULL,NULL,NULL),(3,3,8,53.58,3.637,NULL,NULL,NULL,NULL),(4,4,8,41.06,3.757,NULL,NULL,NULL,NULL),(5,5,8,58.51,3.620,NULL,NULL,NULL,NULL),(6,6,8,57.54,3.518,NULL,NULL,NULL,NULL),(7,7,8,50.59,3.409,NULL,NULL,NULL,NULL),(8,8,8,37.22,3.318,NULL,NULL,NULL,NULL),(9,9,8,27.44,3.609,NULL,NULL,NULL,NULL),(10,10,8,57.54,3.518,NULL,NULL,NULL,NULL),(11,11,8,27.78,3.605,NULL,NULL,NULL,NULL),(12,12,8,31.43,3.587,NULL,NULL,NULL,NULL),(13,13,8,31.39,3.512,NULL,NULL,NULL,NULL),(14,14,8,33.34,4.172,NULL,NULL,NULL,NULL),(15,15,8,31.43,3.580,NULL,NULL,NULL,NULL),(16,16,8,27.44,3.609,NULL,NULL,NULL,NULL),(17,17,8,31.43,3.587,NULL,NULL,NULL,NULL),(18,18,8,33.44,4.172,NULL,NULL,NULL,NULL),(19,19,8,37.22,3.318,NULL,NULL,NULL,NULL),(20,20,8,58.51,3.620,NULL,NULL,NULL,NULL),(21,21,8,31.39,3.512,NULL,NULL,NULL,NULL),(22,22,8,27.78,3.605,NULL,NULL,NULL,NULL),(23,23,8,41.06,3.757,NULL,NULL,NULL,NULL),(24,24,8,34.10,3.751,NULL,NULL,NULL,NULL),(25,25,8,55.18,3.148,NULL,NULL,NULL,NULL),(26,26,8,55.18,3.148,NULL,NULL,NULL,NULL),(27,27,8,58.51,3.620,NULL,NULL,NULL,NULL),(28,28,8,34.10,3.751,NULL,NULL,NULL,NULL),(29,29,8,31.39,3.512,NULL,NULL,NULL,NULL),(30,30,8,35.97,3.637,NULL,NULL,NULL,NULL),(31,31,8,41.06,3.757,NULL,NULL,NULL,NULL),(32,32,8,41.06,3.757,NULL,NULL,NULL,NULL),(33,1,10,277.76,1.383,107.450,299.890,NULL,NULL),(34,2,10,535.80,0.650,98.610,302.910,NULL,NULL),(35,3,10,535.80,2.092,98.610,232.910,NULL,NULL),(36,4,10,410.63,1.558,99.600,294.330,NULL,NULL),(37,5,10,585.06,1.152,155.020,229.800,NULL,NULL),(38,6,10,575.38,1.119,80.020,276.700,NULL,NULL),(39,7,10,505.90,1.433,66.650,308.920,NULL,NULL),(40,8,10,277.00,1.383,107.450,299.890,NULL,NULL),(41,9,10,274.38,1.256,170.400,264.260,NULL,NULL),(42,10,10,575.38,1.119,80.020,276.700,NULL,NULL),(43,11,10,277.76,1.383,107.450,299.890,NULL,NULL),(44,12,10,314.31,1.141,242.430,233.220,NULL,NULL),(45,13,10,313.90,1.365,163.940,297.390,NULL,NULL),(46,14,10,333.35,1.273,175.880,276.700,NULL,NULL),(47,15,10,505.90,1.433,66.650,308.920,NULL,NULL),(48,16,10,274.38,1.256,170.400,264.260,NULL,NULL),(49,17,10,314.31,1.141,242.430,233.220,NULL,NULL),(50,18,10,335.35,1.273,175.880,276.700,NULL,NULL),(51,19,10,372.22,1.141,63.390,302.910,NULL,NULL),(52,20,10,585.06,1.152,155.020,229.800,NULL,NULL),(53,21,10,313.90,1.365,163.940,297.390,NULL,NULL),(54,22,10,277.76,1.383,107.450,299.890,NULL,NULL),(55,23,10,410.63,1.558,99.600,294.330,NULL,NULL),(56,24,10,340.95,1.221,136.360,285.150,NULL,NULL),(57,25,10,551.76,1.173,99.490,302.910,NULL,NULL),(58,26,10,551.76,1.173,99.490,302.910,NULL,NULL),(59,27,10,585.06,1.152,155.020,229.800,NULL,NULL),(60,28,10,340.00,1.221,136.360,285.150,NULL,NULL),(61,29,10,313.90,1.365,163.940,297.390,NULL,NULL),(62,30,10,359.72,1.193,222.090,258.560,NULL,NULL),(63,31,10,410.63,1.558,99.600,294.330,NULL,NULL),(64,32,10,277.76,1.383,107.450,299.890,NULL,NULL),(65,1,9,277.76,1.751,405.390,286.880,NULL,NULL),(66,2,9,535.80,0.816,211.950,293.910,NULL,NULL),(67,3,9,535.80,2.860,211.950,249.660,NULL,NULL),(68,4,9,410.63,1.975,324.900,286.880,NULL,NULL),(69,5,9,277.76,1.659,405.390,270.040,NULL,NULL),(70,6,9,575.38,1.506,376.240,286.880,NULL,NULL),(71,7,9,668.11,2.021,341.110,281.980,NULL,NULL),(72,8,9,575.38,1.506,376.240,286.880,NULL,NULL),(73,9,9,274.38,1.374,544.970,245.430,NULL,NULL),(74,10,9,575.38,1.506,376.240,286.880,NULL,NULL),(75,11,9,277.76,1.751,405.390,286.880,NULL,NULL),(76,12,9,314.31,1.461,572.210,228.090,NULL,NULL),(77,13,9,313.90,1.596,507.180,258.210,NULL,NULL),(78,14,9,333.35,1.418,581.690,230.390,NULL,NULL),(79,15,9,668.11,2.021,341.110,281.980,NULL,NULL),(80,16,9,274.38,1.374,544.970,245.430,NULL,NULL),(81,17,9,314.31,1.461,572.210,228.090,NULL,NULL),(82,18,9,333.35,1.418,581.690,230.390,NULL,NULL),(83,19,9,372.22,1.312,300.020,251.880,NULL,NULL),(84,20,9,585.06,1.415,482.440,234.350,NULL,NULL),(85,21,9,313.90,1.596,507.180,258.210,NULL,NULL),(86,22,9,277.76,1.751,405.390,286.880,NULL,NULL),(87,23,9,410.63,1.975,324.900,286.880,NULL,NULL),(88,24,9,340.95,1.579,412.400,286.880,NULL,NULL),(89,25,9,551.76,1.445,233.260,293.910,NULL,NULL),(90,26,9,551.76,1.445,233.260,293.910,NULL,NULL),(91,27,9,585.06,1.415,482.440,234.350,NULL,NULL),(92,28,9,372.22,1.312,300.020,251.810,NULL,NULL),(93,29,9,313.90,1.596,507.180,258.210,NULL,NULL),(94,30,9,359.72,1.278,553.500,213.110,NULL,NULL),(95,31,9,410.63,1.975,324.900,286.880,NULL,NULL),(96,32,9,277.76,1.751,405.390,286.880,NULL,NULL);

--
-- Table structure for table `rates`
--

CREATE TABLE `rates` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `limit_dac` int DEFAULT NULL,
  `dap` smallint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rates`
--

INSERT INTO `rates` VALUES (1,'01',250,7,NULL,NULL),(2,'1A',300,7,NULL,NULL),(3,'1B',400,7,NULL,NULL),(4,'1C',850,7,NULL,NULL),(5,'1D',1000,7,NULL,NULL),(6,'1E',2000,7,NULL,NULL),(7,'DAC',NULL,7,NULL,NULL),(8,'PDBT',NULL,7,NULL,NULL),(9,'GDBT',NULL,8,NULL,NULL),(10,'GDMTO',NULL,8,NULL,NULL);

--
-- Table structure for table `roles`
--

CREATE TABLE `roles` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `special` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `company_id` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `roles_company_id_foreign` (`company_id`),
  CONSTRAINT `roles_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `roles`
--

INSERT INTO `roles` VALUES (1,'Admin',NULL,'1',NULL,NULL,NULL,NULL),(2,'Asesor de ventas',NULL,NULL,1,'2023-10-23 22:17:19','2023-10-23 22:17:19',NULL),(3,'Asesor de ventas',NULL,NULL,2,'2023-10-24 19:49:43','2023-10-24 19:49:43',NULL),(4,'Asesor de ventas',NULL,NULL,3,'2023-10-24 21:15:21','2023-10-24 21:15:21',NULL),(5,'Asesor de ventas',NULL,NULL,4,'2023-10-24 21:59:36','2023-10-24 21:59:36',NULL),(6,'Asesor de ventas',NULL,NULL,5,'2023-10-24 22:00:12','2023-10-24 22:00:12',NULL),(7,'Asesor de ventas',NULL,NULL,6,'2023-10-25 15:25:30','2023-10-25 15:25:30',NULL),(8,'Asesor de ventas',NULL,NULL,7,'2023-10-25 15:26:21','2023-10-25 15:26:21',NULL);

--
-- Table structure for table `sales_contracts`
--

CREATE TABLE `sales_contracts` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `proposal_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `date_signature` date DEFAULT NULL,
  `cfe_appointment_date` date DEFAULT NULL,
  `ine` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `customer` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `rpu` varchar(70) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `rmu` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cfe_account_number` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address_receipt_cfe` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `voltage` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT '220',
  `number_phases` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `number_threads` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `meter_number` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `supply_voltage` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `total_load_installed` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `contracted_demand` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `meter_type` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tension_type` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT 'baja',
  `person_type` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT 'física',
  `utilization_energy_produced` tinyint NOT NULL DEFAULT '1',
  `legal_representative` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `public_deed` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `public_deed_date` date DEFAULT NULL,
  `notary_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `public_notary_number` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notary_of` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `applicant_street` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `applicant_external_number` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `applicant_internal_number` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `applicant_cp` varchar(15) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `applicant_colony` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `applicant_municipality` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `applicant_fax` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `manager_id` int unsigned DEFAULT NULL,
  `signed_contract` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `drawings` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `technical_memory` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `installation_date` date DEFAULT NULL,
  `installation_completion_date` date DEFAULT NULL,
  `uvie` tinyint(1) NOT NULL DEFAULT '0',
  `uiie` tinyint(1) NOT NULL DEFAULT '0',
  `status_uvie_id` int unsigned DEFAULT NULL,
  `status_uiie_id` int unsigned DEFAULT NULL,
  `status_cfe` int unsigned DEFAULT NULL,
  `responsible_project_requirements` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `project_requirement_date` date DEFAULT NULL,
  `requirement_status_id` int unsigned DEFAULT '1',
  `cfe_zone_id` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sales_contracts_proposal_id_foreign` (`proposal_id`),
  KEY `sales_contracts_manager_id_foreign` (`manager_id`),
  KEY `sales_contracts_status_uvie_id_foreign` (`status_uvie_id`),
  KEY `sales_contracts_status_uiie_id_foreign` (`status_uiie_id`),
  KEY `sales_contracts_status_cfe_foreign` (`status_cfe`),
  KEY `sales_contracts_requirement_status_id_foreign` (`requirement_status_id`),
  KEY `sales_contracts_cfe_zone_id_foreign` (`cfe_zone_id`),
  CONSTRAINT `sales_contracts_cfe_zone_id_foreign` FOREIGN KEY (`cfe_zone_id`) REFERENCES `cfe_zones` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `sales_contracts_manager_id_foreign` FOREIGN KEY (`manager_id`) REFERENCES `managers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `sales_contracts_proposal_id_foreign` FOREIGN KEY (`proposal_id`) REFERENCES `proposals` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `sales_contracts_requirement_status_id_foreign` FOREIGN KEY (`requirement_status_id`) REFERENCES `project_requirement_status` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `sales_contracts_status_cfe_foreign` FOREIGN KEY (`status_cfe`) REFERENCES `status_cfe` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `sales_contracts_status_uiie_id_foreign` FOREIGN KEY (`status_uiie_id`) REFERENCES `status_opinion` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `sales_contracts_status_uvie_id_foreign` FOREIGN KEY (`status_uvie_id`) REFERENCES `status_opinion` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sales_contracts`
--

INSERT INTO `sales_contracts` VALUES (1,'9a71001d-9674-40a4-9b06-eaea34f37cb7','2023-10-23','2023-10-23','CMMRJN65013114H000','HERNANDEZ VALENTIN CIRILO','062100203397','37570 20-12-04 XAXX-010101 005 CFE','28182318',NULL,'220','2','2','232323',NULL,'3','3',NULL,'baja','física',1,NULL,NULL,NULL,NULL,NULL,NULL,'Mar de china','202',NULL,'68010','santa María del Grangero','León','cirilo@gmail.com','4771293213',NULL,1,NULL,NULL,NULL,'2023-10-21','2023-10-23',0,0,NULL,NULL,NULL,NULL,NULL,1,1,'2023-10-23 22:49:04','2023-10-24 02:26:36',NULL),(2,'9a72f696-42e5-4b82-a9a8-a21049a38501','2023-11-07','2023-11-07','123456789','PRUEBA','585210352366','123456789','1212121212',NULL,'220','3','4','a1s2d33321',NULL,'50','50',NULL,'baja','física',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'asesor5.cceea@gmail.com','9511111111',NULL,2,'654a8023a36d2.pdf','654a92d69f5e7.pdf','654a92cabb51c.pdf','2023-11-28',NULL,1,1,NULL,NULL,NULL,NULL,NULL,1,NULL,'2023-10-25 16:17:34','2023-11-07 22:44:38',NULL);

--
-- Table structure for table `settings`
--

CREATE TABLE `settings` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned DEFAULT NULL,
  `bag` double(5,2) DEFAULT '2.00',
  `rate_increase` double(5,2) DEFAULT '3.00',
  `cfe_tax` double(5,2) DEFAULT '16.00',
  `loss_factor` double(5,2) DEFAULT '23.00',
  `relation_cd_ca` double(5,2) DEFAULT '1.20',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `settings_company_id_foreign` (`company_id`),
  CONSTRAINT `settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `settings`
--

INSERT INTO `settings` VALUES (1,1,2.00,3.00,16.00,23.00,1.20,'2023-10-23 22:17:19','2023-10-23 22:47:39'),(2,2,2.00,3.00,16.00,23.00,1.20,'2023-10-24 19:49:43','2023-10-24 19:49:43'),(3,3,NULL,3.00,16.00,23.00,1.50,'2023-10-24 21:15:21','2023-10-28 19:33:31'),(4,4,2.00,3.00,16.00,23.00,1.20,'2023-10-24 21:59:36','2023-10-24 21:59:36'),(5,5,NULL,3.00,16.00,23.00,1.20,'2023-10-24 22:00:12','2023-11-07 16:15:24'),(6,6,2.00,3.00,16.00,23.00,1.20,'2023-10-25 15:25:30','2023-10-25 15:25:30'),(7,7,2.00,3.00,16.00,23.00,1.20,'2023-10-25 15:26:21','2023-10-25 15:26:21');

--
-- Table structure for table `states`
--

CREATE TABLE `states` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `degree_inclination` int DEFAULT NULL,
  `peak_solar_time` double(8,2) DEFAULT NULL,
  `country_id` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `states_country_id_foreign` (`country_id`),
  CONSTRAINT `states_country_id_foreign` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `states`
--

INSERT INTO `states` VALUES (1,'Aguascalientes',21,6.27,1,NULL,NULL,NULL),(2,'Baja California',32,6.50,1,NULL,NULL,NULL),(3,'Baja California Sur',24,5.92,1,NULL,NULL,NULL),(4,'Campeche',19,5.51,1,NULL,NULL,NULL),(5,'Chiapas',16,5.40,1,NULL,NULL,NULL),(6,'Chihuahua',28,6.31,1,NULL,NULL,NULL),(7,'Ciudad de México',19,5.64,1,NULL,NULL,NULL),(8,'Coahuila',25,5.67,1,NULL,NULL,NULL),(9,'Colima',19,5.87,1,NULL,NULL,NULL),(10,'Durango',19,5.87,1,NULL,NULL,NULL),(11,'Guanajuato',19,5.87,1,NULL,NULL,NULL),(12,'Guerrero',17,5.94,1,NULL,NULL,NULL),(13,'Hidalgo',20,5.12,1,NULL,NULL,NULL),(14,'Jalisco',20,6.06,1,NULL,NULL,NULL),(15,'México',19,5.64,1,NULL,NULL,NULL),(16,'Michoacán',19,5.82,1,NULL,NULL,NULL),(17,'Morelos',18,6.14,1,NULL,NULL,NULL),(18,'Nayarit',21,6.16,1,NULL,NULL,NULL),(19,'Nuevo León',25,5.68,1,NULL,NULL,NULL),(20,'Oaxaca',17,5.10,1,NULL,NULL,NULL),(21,'Puebla',19,5.69,1,NULL,NULL,NULL),(22,'Querétaro',20,6.05,1,NULL,NULL,NULL),(23,'Quintana Roo',18,5.14,1,NULL,NULL,NULL),(24,'San Luis Potosí',22,5.82,1,NULL,NULL,NULL),(25,'Sinaloa',24,6.12,1,NULL,NULL,NULL),(26,'Sonora',29,6.42,1,NULL,NULL,NULL),(27,'Tabasco',17,5.18,1,NULL,NULL,NULL),(28,'Tamaulipas',23,5.54,1,NULL,NULL,NULL),(29,'Tlaxcala',19,5.70,1,NULL,NULL,NULL),(30,'Veracruz',19,4.91,1,NULL,NULL,NULL),(31,'Yucatán',20,5.44,1,NULL,NULL,NULL),(32,'Zacatecas',22,6.25,1,NULL,NULL,NULL);

--
-- Table structure for table `status_cfe`
--

CREATE TABLE `status_cfe` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `color` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT 'secondary',
  `company_id` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `status_cfe_company_id_foreign` (`company_id`),
  CONSTRAINT `status_cfe_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `status_cfe`
--

INSERT INTO `status_cfe` VALUES (1,'Pendiente','warning',NULL,NULL,NULL),(2,'En proceso de recopilación','default',NULL,NULL,NULL),(3,'Ingresado a CFE','info',NULL,NULL,NULL),(4,'Interconexión realizada','success',NULL,NULL,NULL);

--
-- Table structure for table `status_contacts`
--

CREATE TABLE `status_contacts` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `color` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT 'secondary',
  `company_id` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `status_contacts_company_id_foreign` (`company_id`),
  CONSTRAINT `status_contacts_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `status_contacts`
--

INSERT INTO `status_contacts` VALUES (1,'Prospecto','warning',NULL,NULL,NULL),(2,'Cliente','success',NULL,NULL,NULL),(3,'Pérdido','danger',NULL,NULL,NULL);

--
-- Table structure for table `status_opinion`
--

CREATE TABLE `status_opinion` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `color` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT 'secondary',
  `company_id` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `status_opinion_company_id_foreign` (`company_id`),
  CONSTRAINT `status_opinion_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `status_opinion`
--

INSERT INTO `status_opinion` VALUES (1,'No solicitado','default',NULL,NULL,NULL),(2,'Dictamen aprobado','success',NULL,NULL,NULL),(3,'Pendiente de emitir','warning',NULL,NULL,NULL),(4,'Dictamen no aprobado','danger',NULL,NULL,NULL),(5,'Solicitud','danger',NULL,NULL,NULL);

--
-- Table structure for table `status_payments`
--

CREATE TABLE `status_payments` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `color` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT 'secondary',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `status_payments`
--

INSERT INTO `status_payments` VALUES (1,'Pagado','success',NULL,NULL),(2,'Pendiente','warning',NULL,NULL),(3,'Reembolsado','danger',NULL,NULL),(4,'Vencido','danger',NULL,NULL);

--
-- Table structure for table `status_proposals`
--

CREATE TABLE `status_proposals` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `color` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT 'secondary',
  `company_id` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `status_proposals_company_id_foreign` (`company_id`),
  CONSTRAINT `status_proposals_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `status_proposals`
--

INSERT INTO `status_proposals` VALUES (1,'Borrador','secondary',NULL,NULL,NULL),(2,'Emitida','info',NULL,NULL,NULL),(3,'Cancelada','danger',NULL,NULL,NULL),(4,'Enviada/presentada','primary',NULL,NULL,NULL),(5,'En negociación','warning',NULL,NULL,NULL),(6,'Rechazada','dark',NULL,NULL,NULL),(7,'Aceptada','success',NULL,NULL,NULL);

--
-- Table structure for table `status_tickets`
--

CREATE TABLE `status_tickets` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `color` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `company_id` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `status_tickets_company_id_foreign` (`company_id`),
  CONSTRAINT `status_tickets_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `status_tickets`
--

INSERT INTO `status_tickets` VALUES (1,'Abierta','warning',NULL,NULL,NULL,NULL),(2,'Pendiente','danger',NULL,NULL,NULL,NULL),(3,'Resuelto','success',NULL,NULL,NULL,NULL),(4,'Cerrada','primary',NULL,NULL,NULL,NULL);

--
-- Table structure for table `task_contacts`
--

CREATE TABLE `task_contacts` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `contact_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type_task_id` int unsigned NOT NULL,
  `user_id` int unsigned DEFAULT NULL,
  `proposal_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `date` timestamp NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `task_contacts_contact_id_foreign` (`contact_id`),
  KEY `task_contacts_type_task_id_foreign` (`type_task_id`),
  KEY `task_contacts_user_id_foreign` (`user_id`),
  KEY `task_contacts_proposal_id_foreign` (`proposal_id`),
  CONSTRAINT `task_contacts_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `task_contacts_proposal_id_foreign` FOREIGN KEY (`proposal_id`) REFERENCES `proposals` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `task_contacts_type_task_id_foreign` FOREIGN KEY (`type_task_id`) REFERENCES `type_tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `task_contacts_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `task_contacts`
--


--
-- Table structure for table `tax_proposals`
--

CREATE TABLE `tax_proposals` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `proposal_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT 'IVA',
  `amount` double(8,3) DEFAULT '0.000',
  PRIMARY KEY (`id`),
  KEY `tax_proposals_proposal_id_foreign` (`proposal_id`),
  CONSTRAINT `tax_proposals_proposal_id_foreign` FOREIGN KEY (`proposal_id`) REFERENCES `proposals` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tax_proposals`
--

INSERT INTO `tax_proposals` VALUES (1,'9a72f696-42e5-4b82-a9a8-a21049a38501','IVA',16.000);

--
-- Table structure for table `templates`
--

CREATE TABLE `templates` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `class` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `company_id` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `templates_company_id_foreign` (`company_id`),
  CONSTRAINT `templates_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `templates`
--

INSERT INTO `templates` VALUES (1,'Clásica','Classic',NULL,NULL,NULL);

--
-- Table structure for table `tickets`
--

CREATE TABLE `tickets` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `folio` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `contact_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` int unsigned DEFAULT NULL,
  `priority_id` int unsigned DEFAULT NULL,
  `status_id` int unsigned DEFAULT NULL,
  `kind_id` int unsigned DEFAULT NULL,
  `company_id` int unsigned DEFAULT NULL,
  `date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `subject` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `tickets_contact_id_foreign` (`contact_id`),
  KEY `tickets_user_id_foreign` (`user_id`),
  KEY `tickets_priority_id_foreign` (`priority_id`),
  KEY `tickets_status_id_foreign` (`status_id`),
  KEY `tickets_kind_id_foreign` (`kind_id`),
  KEY `tickets_company_id_foreign` (`company_id`),
  CONSTRAINT `tickets_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `tickets_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `tickets_kind_id_foreign` FOREIGN KEY (`kind_id`) REFERENCES `kind_tickets` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `tickets_priority_id_foreign` FOREIGN KEY (`priority_id`) REFERENCES `priority_tickets` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `tickets_status_id_foreign` FOREIGN KEY (`status_id`) REFERENCES `status_tickets` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `tickets_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tickets`
--


--
-- Table structure for table `type_accesories`
--

CREATE TABLE `type_accesories` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `type_accesories`
--


--
-- Table structure for table `type_documents`
--

CREATE TABLE `type_documents` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `type_documents`
--


--
-- Table structure for table `type_emails_phones`
--

CREATE TABLE `type_emails_phones` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `type_emails_phones`
--


--
-- Table structure for table `type_panels`
--

CREATE TABLE `type_panels` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `type_panels`
--


--
-- Table structure for table `type_photos_requirements`
--

CREATE TABLE `type_photos_requirements` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `type_photos_requirements`
--

INSERT INTO `type_photos_requirements` VALUES (1,'Fachada',NULL,NULL),(2,'Azotea',NULL,NULL),(3,'Obstáculo de azotea',NULL,NULL),(4,'líneas de distribución de CFE',NULL,NULL),(5,'Centro de carga de distribución',NULL,NULL),(6,'Tablero General',NULL,NULL),(7,'Medidor',NULL,NULL),(8,'Puesta a tierra del Medidor',NULL,NULL);

--
-- Table structure for table `type_products`
--

CREATE TABLE `type_products` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `type_products`
--

INSERT INTO `type_products` VALUES (1,'panel'),(2,'inverter'),(3,'microinverter'),(4,'accesory'),(5,'structure'),(6,'workforce'),(7,'additional');

--
-- Table structure for table `type_tasks`
--

CREATE TABLE `type_tasks` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `type_tasks`
--


--
-- Table structure for table `user_companies`
--

CREATE TABLE `user_companies` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned NOT NULL,
  `company_id` int unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_companies_user_id_foreign` (`user_id`),
  KEY `user_companies_company_id_foreign` (`company_id`),
  CONSTRAINT `user_companies_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `user_companies_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `user_companies`
--

INSERT INTO `user_companies` VALUES (1,1,1,'2023-10-23 22:17:19','2023-10-23 22:17:19'),(2,2,2,'2023-10-24 19:49:43','2023-10-24 19:49:43'),(3,3,3,'2023-10-24 21:15:21','2023-10-24 21:15:21'),(4,4,4,'2023-10-24 21:59:36','2023-10-24 21:59:36'),(5,5,5,'2023-10-24 22:00:12','2023-10-24 22:00:12'),(6,6,6,'2023-10-25 15:25:30','2023-10-25 15:25:30'),(7,7,7,'2023-10-25 15:26:21','2023-10-25 15:26:21');

--
-- Table structure for table `user_permissions`
--

CREATE TABLE `user_permissions` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int unsigned NOT NULL,
  `permission_id` int unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_permissions_user_id_foreign` (`user_id`),
  KEY `user_permissions_permission_id_foreign` (`permission_id`),
  CONSTRAINT `user_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `user_permissions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `user_permissions`
--


--
-- Table structure for table `user_roles`
--

CREATE TABLE `user_roles` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `rol_id` int unsigned NOT NULL,
  `user_id` int unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_roles_rol_id_foreign` (`rol_id`),
  KEY `user_roles_user_id_foreign` (`user_id`),
  CONSTRAINT `user_roles_rol_id_foreign` FOREIGN KEY (`rol_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `user_roles_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `user_roles`
--

INSERT INTO `user_roles` VALUES (1,1,1,'2023-10-23 22:17:19','2023-10-23 22:17:19'),(2,1,2,'2023-10-24 19:49:43','2023-10-24 19:49:43'),(3,1,3,'2023-10-24 21:15:21','2023-10-24 21:15:21'),(4,1,4,'2023-10-24 21:59:36','2023-10-24 21:59:36'),(5,1,5,'2023-10-24 22:00:12','2023-10-24 22:00:12'),(6,1,6,'2023-10-25 15:25:30','2023-10-25 15:25:30'),(7,1,7,'2023-10-25 15:26:21','2023-10-25 15:26:21');


