-- MySQL dump 10.13  Distrib 8.4.7, for Win64 (x86_64)
--
-- Host: 127.0.0.1    Database: HRapp
-- ------------------------------------------------------
-- Server version	8.4.7

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `accounting_period`
--

DROP TABLE IF EXISTS `accounting_period`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `accounting_period` (
  `id` int NOT NULL AUTO_INCREMENT,
  `fiscal_profile_id` int NOT NULL,
  `closed_by_id` int DEFAULT NULL,
  `label` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fiscal_year` int NOT NULL,
  `closed_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_AP_PROFILE_LABEL` (`fiscal_profile_id`,`label`),
  KEY `IDX_4EF6EB2D2492F9BB` (`fiscal_profile_id`),
  KEY `IDX_4EF6EB2DE1FA7797` (`closed_by_id`),
  CONSTRAINT `FK_4EF6EB2D2492F9BB` FOREIGN KEY (`fiscal_profile_id`) REFERENCES `fiscal_profile` (`id`),
  CONSTRAINT `FK_4EF6EB2DE1FA7797` FOREIGN KEY (`closed_by_id`) REFERENCES `user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `accounting_period`
--

LOCK TABLES `accounting_period` WRITE;
/*!40000 ALTER TABLE `accounting_period` DISABLE KEYS */;
/*!40000 ALTER TABLE `accounting_period` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `article`
--

DROP TABLE IF EXISTS `article`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `article` (
  `id` int NOT NULL AUTO_INCREMENT,
  `groupe_article_id` int NOT NULL,
  `supplier_id` int NOT NULL,
  `currency_id` int NOT NULL,
  `unit_id` int NOT NULL,
  `code_reference` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `stock` int NOT NULL DEFAULT '0',
  `stock_rebus` int NOT NULL DEFAULT '0',
  `stock_min` int DEFAULT NULL,
  `price` decimal(10,2) NOT NULL,
  `restrict_cmd` decimal(10,2) DEFAULT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_23A0E662E6312B` (`code_reference`),
  KEY `IDX_article_groupe` (`groupe_article_id`),
  KEY `IDX_article_supplier` (`supplier_id`),
  KEY `IDX_article_currency` (`currency_id`),
  KEY `IDX_article_unit` (`unit_id`),
  CONSTRAINT `FK_23A0E662ADD6D8C` FOREIGN KEY (`supplier_id`) REFERENCES `supplier_info` (`id`),
  CONSTRAINT `FK_23A0E6638248176` FOREIGN KEY (`currency_id`) REFERENCES `currency` (`id`),
  CONSTRAINT `FK_23A0E66CA79B740` FOREIGN KEY (`groupe_article_id`) REFERENCES `groupe_article` (`id`),
  CONSTRAINT `FK_23A0E66F8BD700D` FOREIGN KEY (`unit_id`) REFERENCES `unit` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `article`
--

LOCK TABLES `article` WRITE;
/*!40000 ALTER TABLE `article` DISABLE KEYS */;
/*!40000 ALTER TABLE `article` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `bank_account`
--

DROP TABLE IF EXISTS `bank_account`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `bank_account` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rib` varchar(9) COLLATE utf8mb4_unicode_ci NOT NULL,
  `bank_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `owner` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `initial_balance` decimal(10,2) NOT NULL,
  `current_balance` decimal(10,2) NOT NULL,
  `currency` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `pays` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_enabled` tinyint(1) NOT NULL,
  `account_number` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `account_type` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `bank_account`
--

LOCK TABLES `bank_account` WRITE;
/*!40000 ALTER TABLE `bank_account` DISABLE KEYS */;
/*!40000 ALTER TABLE `bank_account` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `bank_transaction`
--

DROP TABLE IF EXISTS `bank_transaction`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `bank_transaction` (
  `id` int NOT NULL AUTO_INCREMENT,
  `id_cat_id` int NOT NULL,
  `id_account_id` int NOT NULL,
  `created_by_id` int NOT NULL,
  `reference` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `trans_type` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `trans_mode` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `trans_at` date NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `created_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  `is_verified` tinyint(1) NOT NULL,
  `verified_at` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_50BCB3AEC09A1CAE` (`id_cat_id`),
  KEY `IDX_50BCB3AE3EE1DF6D` (`id_account_id`),
  KEY `IDX_50BCB3AEB03A8386` (`created_by_id`),
  KEY `IDX_bank_trans_status` (`status`),
  KEY `IDX_bank_trans_date` (`trans_at`),
  KEY `IDX_bank_trans_type` (`trans_type`),
  CONSTRAINT `FK_50BCB3AE3EE1DF6D` FOREIGN KEY (`id_account_id`) REFERENCES `bank_account` (`id`),
  CONSTRAINT `FK_50BCB3AEB03A8386` FOREIGN KEY (`created_by_id`) REFERENCES `user` (`id`),
  CONSTRAINT `FK_50BCB3AEC09A1CAE` FOREIGN KEY (`id_cat_id`) REFERENCES `invoice_category` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `bank_transaction`
--

LOCK TABLES `bank_transaction` WRITE;
/*!40000 ALTER TABLE `bank_transaction` DISABLE KEYS */;
/*!40000 ALTER TABLE `bank_transaction` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `benefit_plan`
--

DROP TABLE IF EXISTS `benefit_plan`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `benefit_plan` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `tax_treatment` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `provider` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `policy_number` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `employer_contribution` decimal(10,2) NOT NULL,
  `has_employer_match` tinyint(1) NOT NULL,
  `employer_match_percent` decimal(5,4) DEFAULT NULL,
  `employer_match_cap` decimal(10,2) DEFAULT NULL,
  `annual_limit` decimal(10,2) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL,
  `description` longtext COLLATE utf8mb4_unicode_ci,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `benefit_plan`
--

LOCK TABLES `benefit_plan` WRITE;
/*!40000 ALTER TABLE `benefit_plan` DISABLE KEYS */;
/*!40000 ALTER TABLE `benefit_plan` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `category_article`
--

DROP TABLE IF EXISTS `category_article`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `category_article` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_C5E24E185E237E06` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `category_article`
--

LOCK TABLES `category_article` WRITE;
/*!40000 ALTER TABLE `category_article` DISABLE KEYS */;
/*!40000 ALTER TABLE `category_article` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `chart_of_accounts`
--

DROP TABLE IF EXISTS `chart_of_accounts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `chart_of_accounts` (
  `id` int NOT NULL AUTO_INCREMENT,
  `fiscal_profile_id` int NOT NULL,
  `parent_id` int DEFAULT NULL,
  `account_code` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `account_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `account_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_active` tinyint(1) NOT NULL,
  `description` longtext COLLATE utf8mb4_unicode_ci,
  `balance` decimal(15,2) NOT NULL,
  `normal_balance` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_COA_PROFILE_CODE` (`fiscal_profile_id`,`account_code`),
  KEY `IDX_7A700CD82492F9BB` (`fiscal_profile_id`),
  KEY `IDX_7A700CD8727ACA70` (`parent_id`),
  CONSTRAINT `FK_7A700CD82492F9BB` FOREIGN KEY (`fiscal_profile_id`) REFERENCES `fiscal_profile` (`id`),
  CONSTRAINT `FK_7A700CD8727ACA70` FOREIGN KEY (`parent_id`) REFERENCES `chart_of_accounts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `chart_of_accounts`
--

LOCK TABLES `chart_of_accounts` WRITE;
/*!40000 ALTER TABLE `chart_of_accounts` DISABLE KEYS */;
/*!40000 ALTER TABLE `chart_of_accounts` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `clocking_schedule`
--

DROP TABLE IF EXISTS `clocking_schedule`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `clocking_schedule` (
  `id` int NOT NULL AUTO_INCREMENT,
  `shift_id` int NOT NULL,
  `created_by_id` int NOT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date DEFAULT NULL,
  `working_days` json NOT NULL,
  `tolerance_minutes` int DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL,
  `description` longtext COLLATE utf8mb4_unicode_ci,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_6E505E92BB70BC0E` (`shift_id`),
  KEY `IDX_6E505E92B03A8386` (`created_by_id`),
  CONSTRAINT `FK_6E505E92B03A8386` FOREIGN KEY (`created_by_id`) REFERENCES `user` (`id`),
  CONSTRAINT `FK_6E505E92BB70BC0E` FOREIGN KEY (`shift_id`) REFERENCES `personnel_pointage_shift` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `clocking_schedule`
--

LOCK TABLES `clocking_schedule` WRITE;
/*!40000 ALTER TABLE `clocking_schedule` DISABLE KEYS */;
/*!40000 ALTER TABLE `clocking_schedule` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `company`
--

DROP TABLE IF EXISTS `company`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `company` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL,
  `address` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fax` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `website` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `logo` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rc` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `id_fiscale` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `id_douane` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `slug` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `country` varchar(5) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `currency` varchar(5) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `db_env_key` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `state_province` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `postal_code` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_default_branch` tinyint(1) NOT NULL DEFAULT '0',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_COMPANY_NAME` (`name`),
  UNIQUE KEY `UNIQ_COMPANY_CODE` (`code`),
  UNIQUE KEY `UNIQ_4FBF094F989D9B62` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `company`
--

LOCK TABLES `company` WRITE;
/*!40000 ALTER TABLE `company` DISABLE KEYS */;
INSERT INTO `company` VALUES (1,'Starz Electronics Headquarters','HQ001','123 Main Street','contact@starzelectronics.com','+1-555-0100','+1-555-0101','https://starzelectronics.com','logo.png','RC123456','FIS789012','DOU345','headquarters','US','USD','DATABASE_URL','New York','NY','10001',1,1),(2,'Starz Electronics US Branch','US001','456 Tech Avenue','us@starzelectronics.com','+1-555-0200','+1-555-0201','https://starzelectronics.com','logo.png','RC234567','FIS890123','DOU456','us-branch','US','USD','DATABASE_URL_US','San Francisco','CA','94102',0,1),(3,'Starz Electronics Tunisia','TN001','789 Rue de la R├®publique','tn@starzelectronics.com','+216-71-000000','+216-71-000001','https://starzelectronics.com','logo.png','RC345678','FIS901234','DOU567','tunisia','TN','TND','DATABASE_URL_TN','Tunis','Tunis','1000',0,1),(4,'Starz Energies','US','30 N Gould St #37806','','',NULL,'','',NULL,NULL,NULL,'us','US','USD','DATABASE_URL_US','Sheridan','WY','82801',1,1),(5,'Starz Electronics','TN','','','',NULL,'','',NULL,NULL,NULL,'tn','TN','TND','DATABASE_URL_TN',NULL,NULL,NULL,0,1),(6,'Starz Morocco','MA','','','',NULL,'','',NULL,NULL,NULL,'ma','MA','MAD','DATABASE_URL_MA',NULL,NULL,NULL,0,1);
/*!40000 ALTER TABLE `company` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `company_bank`
--

DROP TABLE IF EXISTS `company_bank`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `company_bank` (
  `id` int NOT NULL AUTO_INCREMENT,
  `company_id` int NOT NULL,
  `bank_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `acc_nb` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `routing_nb` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `swift` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_active` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_9B0DA594979B1AD6` (`company_id`),
  CONSTRAINT `FK_9B0DA594979B1AD6` FOREIGN KEY (`company_id`) REFERENCES `company` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `company_bank`
--

LOCK TABLES `company_bank` WRITE;
/*!40000 ALTER TABLE `company_bank` DISABLE KEYS */;
/*!40000 ALTER TABLE `company_bank` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `consumable_req_item`
--

DROP TABLE IF EXISTS `consumable_req_item`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `consumable_req_item` (
  `id` int NOT NULL AUTO_INCREMENT,
  `id_request_id` int NOT NULL,
  `item_id_id` int NOT NULL,
  `req_qty` decimal(15,4) NOT NULL,
  `confirmed_qte` decimal(15,4) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_6D8BB717E7F43872` (`id_request_id`),
  KEY `IDX_6D8BB71755E38587` (`item_id_id`),
  CONSTRAINT `FK_6D8BB71755E38587` FOREIGN KEY (`item_id_id`) REFERENCES `article` (`id`),
  CONSTRAINT `FK_6D8BB717E7F43872` FOREIGN KEY (`id_request_id`) REFERENCES `consumable_request` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `consumable_req_item`
--

LOCK TABLES `consumable_req_item` WRITE;
/*!40000 ALTER TABLE `consumable_req_item` DISABLE KEYS */;
/*!40000 ALTER TABLE `consumable_req_item` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `consumable_request`
--

DROP TABLE IF EXISTS `consumable_request`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `consumable_request` (
  `id` int NOT NULL AUTO_INCREMENT,
  `requested_by_id` int NOT NULL,
  `confirmed_by_id` int DEFAULT NULL,
  `ref` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `requested_at` datetime NOT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `confirmed_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_cons_req_status` (`status`),
  KEY `IDX_cons_req_requested_at` (`requested_at`),
  KEY `IDX_cons_req_requested_by` (`requested_by_id`),
  KEY `IDX_cons_req_confirmed_by` (`confirmed_by_id`),
  CONSTRAINT `FK_BA5D8C554DA1E751` FOREIGN KEY (`requested_by_id`) REFERENCES `user` (`id`),
  CONSTRAINT `FK_BA5D8C556F45385D` FOREIGN KEY (`confirmed_by_id`) REFERENCES `user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `consumable_request`
--

LOCK TABLES `consumable_request` WRITE;
/*!40000 ALTER TABLE `consumable_request` DISABLE KEYS */;
/*!40000 ALTER TABLE `consumable_request` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `currency`
--

DROP TABLE IF EXISTS `currency`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `currency` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(3) COLLATE utf8mb4_unicode_ci NOT NULL,
  `symbol` varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL,
  `active` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_6956883F77153098` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `currency`
--

LOCK TABLES `currency` WRITE;
/*!40000 ALTER TABLE `currency` DISABLE KEYS */;
/*!40000 ALTER TABLE `currency` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `customer_credit_profile`
--

DROP TABLE IF EXISTS `customer_credit_profile`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `customer_credit_profile` (
  `id` int NOT NULL AUTO_INCREMENT,
  `customer_id` int NOT NULL,
  `hold_placed_by_id` int DEFAULT NULL,
  `credit_limit` decimal(15,2) NOT NULL,
  `currency_code` varchar(3) COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_on_credit_hold` tinyint(1) NOT NULL,
  `hold_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `hold_placed_at` datetime DEFAULT NULL COMMENT '(DC2Type:datetime_immutable)',
  `payment_terms_days` int NOT NULL,
  `current_balance` decimal(15,2) NOT NULL,
  `available_credit` decimal(15,2) NOT NULL,
  `days_overdue` int NOT NULL,
  `created_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_22BEF9EA9395C3F3` (`customer_id`),
  KEY `IDX_22BEF9EA451F1D7` (`hold_placed_by_id`),
  CONSTRAINT `FK_22BEF9EA451F1D7` FOREIGN KEY (`hold_placed_by_id`) REFERENCES `user` (`id`),
  CONSTRAINT `FK_22BEF9EA9395C3F3` FOREIGN KEY (`customer_id`) REFERENCES `company` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `customer_credit_profile`
--

LOCK TABLES `customer_credit_profile` WRITE;
/*!40000 ALTER TABLE `customer_credit_profile` DISABLE KEYS */;
/*!40000 ALTER TABLE `customer_credit_profile` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `direct_deposit_config`
--

DROP TABLE IF EXISTS `direct_deposit_config`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `direct_deposit_config` (
  `id` int NOT NULL AUTO_INCREMENT,
  `employee_id` int NOT NULL,
  `routing_number` varchar(9) COLLATE utf8mb4_unicode_ci NOT NULL,
  `account_number` varchar(17) COLLATE utf8mb4_unicode_ci NOT NULL,
  `account_type` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `bank_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `allocation_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `allocation_value` decimal(10,4) DEFAULT NULL,
  `priority` int NOT NULL,
  `is_active` tinyint(1) NOT NULL,
  `is_prenote` tinyint(1) NOT NULL,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_dd_employee` (`employee_id`),
  KEY `IDX_dd_active` (`is_active`),
  CONSTRAINT `FK_DA465C18C03F15C` FOREIGN KEY (`employee_id`) REFERENCES `employee_info` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `direct_deposit_config`
--

LOCK TABLES `direct_deposit_config` WRITE;
/*!40000 ALTER TABLE `direct_deposit_config` DISABLE KEYS */;
/*!40000 ALTER TABLE `direct_deposit_config` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_absence`
--

DROP TABLE IF EXISTS `employee_absence`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employee_absence` (
  `id` int NOT NULL AUTO_INCREMENT,
  `employee_id` int NOT NULL,
  `recorded_by_id` int NOT NULL,
  `investigated_by_id` int DEFAULT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `reason` longtext COLLATE utf8mb4_unicode_ci,
  `is_excused` tinyint(1) NOT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `evidence_document` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` longtext COLLATE utf8mb4_unicode_ci,
  `hours_lost` decimal(5,2) DEFAULT NULL,
  `investigated_date` date DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_F616B6C68C03F15C` (`employee_id`),
  KEY `IDX_F616B6C6D05A957B` (`recorded_by_id`),
  KEY `IDX_F616B6C6728E92D6` (`investigated_by_id`),
  CONSTRAINT `FK_F616B6C6728E92D6` FOREIGN KEY (`investigated_by_id`) REFERENCES `user` (`id`),
  CONSTRAINT `FK_F616B6C68C03F15C` FOREIGN KEY (`employee_id`) REFERENCES `employee_info` (`id`),
  CONSTRAINT `FK_F616B6C6D05A957B` FOREIGN KEY (`recorded_by_id`) REFERENCES `user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `employee_absence`
--

LOCK TABLES `employee_absence` WRITE;
/*!40000 ALTER TABLE `employee_absence` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_absence` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_address`
--

DROP TABLE IF EXISTS `employee_address`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employee_address` (
  `id` int NOT NULL AUTO_INCREMENT,
  `employee_id` int NOT NULL,
  `address` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_8D02398E8C03F15C` (`employee_id`),
  CONSTRAINT `FK_8D02398E8C03F15C` FOREIGN KEY (`employee_id`) REFERENCES `employee_info` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `employee_address`
--

LOCK TABLES `employee_address` WRITE;
/*!40000 ALTER TABLE `employee_address` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_address` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_advance`
--

DROP TABLE IF EXISTS `employee_advance`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employee_advance` (
  `id` int NOT NULL AUTO_INCREMENT,
  `employee_id` int NOT NULL,
  `requested_by_id` int NOT NULL,
  `approved_by_id` int DEFAULT NULL,
  `salary_id` int DEFAULT NULL,
  `amount` decimal(10,2) NOT NULL,
  `request_date` date NOT NULL,
  `approved_date` date DEFAULT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `reason` longtext COLLATE utf8mb4_unicode_ci,
  `notes` longtext COLLATE utf8mb4_unicode_ci,
  `installments` int DEFAULT NULL,
  `remaining_amount` decimal(10,2) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_67CD4DFC4DA1E751` (`requested_by_id`),
  KEY `IDX_67CD4DFC2D234F6A` (`approved_by_id`),
  KEY `IDX_67CD4DFCB0FDF16E` (`salary_id`),
  KEY `IDX_emp_adv_employee` (`employee_id`),
  KEY `IDX_emp_adv_status` (`status`),
  KEY `IDX_emp_adv_request_date` (`request_date`),
  KEY `IDX_emp_adv_approved_date` (`approved_date`),
  CONSTRAINT `FK_67CD4DFC2D234F6A` FOREIGN KEY (`approved_by_id`) REFERENCES `user` (`id`),
  CONSTRAINT `FK_67CD4DFC4DA1E751` FOREIGN KEY (`requested_by_id`) REFERENCES `user` (`id`),
  CONSTRAINT `FK_67CD4DFC8C03F15C` FOREIGN KEY (`employee_id`) REFERENCES `employee_info` (`id`),
  CONSTRAINT `FK_67CD4DFCB0FDF16E` FOREIGN KEY (`salary_id`) REFERENCES `employee_salary` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `employee_advance`
--

LOCK TABLES `employee_advance` WRITE;
/*!40000 ALTER TABLE `employee_advance` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_advance` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_bank_acc`
--

DROP TABLE IF EXISTS `employee_bank_acc`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employee_bank_acc` (
  `id` int NOT NULL AUTO_INCREMENT,
  `employee_id` int NOT NULL,
  `bank_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rib` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_D61EF02A8C03F15C` (`employee_id`),
  CONSTRAINT `FK_D61EF02A8C03F15C` FOREIGN KEY (`employee_id`) REFERENCES `employee_info` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `employee_bank_acc`
--

LOCK TABLES `employee_bank_acc` WRITE;
/*!40000 ALTER TABLE `employee_bank_acc` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_bank_acc` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_benefit`
--

DROP TABLE IF EXISTS `employee_benefit`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employee_benefit` (
  `id` int NOT NULL AUTO_INCREMENT,
  `employee_id` int NOT NULL,
  `benefit_plan_id` int NOT NULL,
  `employee_contribution` decimal(10,2) NOT NULL,
  `coverage_tier` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `enrollment_date` date NOT NULL,
  `termination_date` date DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_empben_employee` (`employee_id`),
  KEY `IDX_empben_plan` (`benefit_plan_id`),
  KEY `IDX_empben_active` (`is_active`),
  CONSTRAINT `FK_DCC756108C03F15C` FOREIGN KEY (`employee_id`) REFERENCES `employee_info` (`id`),
  CONSTRAINT `FK_DCC75610B0DE06B0` FOREIGN KEY (`benefit_plan_id`) REFERENCES `benefit_plan` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `employee_benefit`
--

LOCK TABLES `employee_benefit` WRITE;
/*!40000 ALTER TABLE `employee_benefit` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_benefit` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_clocking`
--

DROP TABLE IF EXISTS `employee_clocking`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employee_clocking` (
  `id` int NOT NULL AUTO_INCREMENT,
  `employee_id` int NOT NULL,
  `schedule_id` int DEFAULT NULL,
  `created_by_id` int DEFAULT NULL,
  `work_date` date NOT NULL,
  `clock_in_time` time DEFAULT NULL,
  `clock_out_time` time DEFAULT NULL,
  `break_start` time DEFAULT NULL,
  `break_end` time DEFAULT NULL,
  `worked_hours` decimal(5,2) DEFAULT NULL,
  `overtime_hours` decimal(5,2) DEFAULT NULL,
  `delay_minutes` decimal(5,2) DEFAULT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `notes` longtext COLLATE utf8mb4_unicode_ci,
  `is_manual` tinyint(1) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_43D68D0A8C03F15C` (`employee_id`),
  KEY `IDX_43D68D0AA40BC2D5` (`schedule_id`),
  KEY `IDX_43D68D0AB03A8386` (`created_by_id`),
  CONSTRAINT `FK_43D68D0A8C03F15C` FOREIGN KEY (`employee_id`) REFERENCES `employee_info` (`id`),
  CONSTRAINT `FK_43D68D0AA40BC2D5` FOREIGN KEY (`schedule_id`) REFERENCES `clocking_schedule` (`id`),
  CONSTRAINT `FK_43D68D0AB03A8386` FOREIGN KEY (`created_by_id`) REFERENCES `user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `employee_clocking`
--

LOCK TABLES `employee_clocking` WRITE;
/*!40000 ALTER TABLE `employee_clocking` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_clocking` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_cnss`
--

DROP TABLE IF EXISTS `employee_cnss`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employee_cnss` (
  `id` int NOT NULL AUTO_INCREMENT,
  `employee_id` int NOT NULL,
  `payroll_id` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `ssn` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `civil_status` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `children_nbr` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_3259212FDBA340EA` (`payroll_id`),
  UNIQUE KEY `UNIQ_3259212F7EE6971` (`ssn`),
  UNIQUE KEY `UNIQ_3259212F8C03F15C` (`employee_id`),
  CONSTRAINT `FK_3259212F8C03F15C` FOREIGN KEY (`employee_id`) REFERENCES `employee_info` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `employee_cnss`
--

LOCK TABLES `employee_cnss` WRITE;
/*!40000 ALTER TABLE `employee_cnss` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_cnss` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_contract`
--

DROP TABLE IF EXISTS `employee_contract`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employee_contract` (
  `id` int NOT NULL AUTO_INCREMENT,
  `employee_id` int NOT NULL,
  `c_nbr` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `started_at` date NOT NULL,
  `ends_at` date NOT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `company` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_79B0799E8C03F15C` (`employee_id`),
  CONSTRAINT `FK_79B0799E8C03F15C` FOREIGN KEY (`employee_id`) REFERENCES `employee_info` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `employee_contract`
--

LOCK TABLES `employee_contract` WRITE;
/*!40000 ALTER TABLE `employee_contract` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_contract` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_diploma`
--

DROP TABLE IF EXISTS `employee_diploma`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employee_diploma` (
  `id` int NOT NULL AUTO_INCREMENT,
  `employee_id` int NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `category` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `obtained_at` date NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_6C6DDF588C03F15C` (`employee_id`),
  CONSTRAINT `FK_6C6DDF588C03F15C` FOREIGN KEY (`employee_id`) REFERENCES `employee_info` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `employee_diploma`
--

LOCK TABLES `employee_diploma` WRITE;
/*!40000 ALTER TABLE `employee_diploma` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_diploma` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_email`
--

DROP TABLE IF EXISTS `employee_email`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employee_email` (
  `id` int NOT NULL AUTO_INCREMENT,
  `employee_id` int NOT NULL,
  `email` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_F9F710D8C03F15C` (`employee_id`),
  CONSTRAINT `FK_F9F710D8C03F15C` FOREIGN KEY (`employee_id`) REFERENCES `employee_info` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `employee_email`
--

LOCK TABLES `employee_email` WRITE;
/*!40000 ALTER TABLE `employee_email` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_email` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_files`
--

DROP TABLE IF EXISTS `employee_files`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employee_files` (
  `id` int NOT NULL AUTO_INCREMENT,
  `employee_id` int NOT NULL,
  `file_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `category` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_EE384D20D7DF1668` (`file_name`),
  KEY `IDX_EE384D208C03F15C` (`employee_id`),
  CONSTRAINT `FK_EE384D208C03F15C` FOREIGN KEY (`employee_id`) REFERENCES `employee_info` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `employee_files`
--

LOCK TABLES `employee_files` WRITE;
/*!40000 ALTER TABLE `employee_files` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_files` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_history`
--

DROP TABLE IF EXISTS `employee_history`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employee_history` (
  `id` int NOT NULL AUTO_INCREMENT,
  `employee_id` int NOT NULL,
  `action_at` datetime NOT NULL,
  `action` varchar(1) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_A7F626448C03F15C` (`employee_id`),
  CONSTRAINT `FK_A7F626448C03F15C` FOREIGN KEY (`employee_id`) REFERENCES `employee_info` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `employee_history`
--

LOCK TABLES `employee_history` WRITE;
/*!40000 ALTER TABLE `employee_history` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_history` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_info`
--

DROP TABLE IF EXISTS `employee_info`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employee_info` (
  `id` int NOT NULL AUTO_INCREMENT,
  `registration_nbr` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `first_name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `birth_date` date NOT NULL,
  `gender` varchar(1) COLLATE utf8mb4_unicode_ci NOT NULL,
  `gov_id_nbr` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `category` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `salary_type` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `salary_base` decimal(10,2) NOT NULL,
  `photo` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL,
  `worker_type` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ein` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_7E507B10D04A633B` (`registration_nbr`),
  UNIQUE KEY `UNIQ_7E507B10976757B7` (`gov_id_nbr`),
  UNIQUE KEY `UNIQ_7E507B1014B78418` (`photo`),
  KEY `IDX_emp_is_active` (`is_active`),
  KEY `IDX_emp_birth_date` (`birth_date`),
  KEY `IDX_emp_last_name` (`last_name`),
  KEY `IDX_emp_first_name` (`first_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `employee_info`
--

LOCK TABLES `employee_info` WRITE;
/*!40000 ALTER TABLE `employee_info` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_info` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_leave`
--

DROP TABLE IF EXISTS `employee_leave`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employee_leave` (
  `id` int NOT NULL AUTO_INCREMENT,
  `employee_id` int NOT NULL,
  `start_at` date NOT NULL,
  `end_at` date NOT NULL,
  `is_payed` tinyint(1) NOT NULL,
  `type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `nbr_h` int NOT NULL,
  `is_afternoon` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_emp_leave_employee` (`employee_id`),
  KEY `IDX_emp_leave_start_date` (`start_at`),
  KEY `IDX_emp_leave_end_date` (`end_at`),
  KEY `IDX_emp_leave_type` (`type`),
  KEY `IDX_emp_leave_is_payed` (`is_payed`),
  CONSTRAINT `FK_73BD8DA98C03F15C` FOREIGN KEY (`employee_id`) REFERENCES `employee_info` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `employee_leave`
--

LOCK TABLES `employee_leave` WRITE;
/*!40000 ALTER TABLE `employee_leave` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_leave` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_leave_annual`
--

DROP TABLE IF EXISTS `employee_leave_annual`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employee_leave_annual` (
  `id` int NOT NULL AUTO_INCREMENT,
  `employee_id` int NOT NULL,
  `year` smallint NOT NULL,
  `acc_leave_h` smallint NOT NULL,
  `remain_leave_h` smallint NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_FDBA5C818C03F15C` (`employee_id`),
  CONSTRAINT `FK_FDBA5C818C03F15C` FOREIGN KEY (`employee_id`) REFERENCES `employee_info` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `employee_leave_annual`
--

LOCK TABLES `employee_leave_annual` WRITE;
/*!40000 ALTER TABLE `employee_leave_annual` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_leave_annual` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_note`
--

DROP TABLE IF EXISTS `employee_note`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employee_note` (
  `id` int NOT NULL AUTO_INCREMENT,
  `employee_id` int NOT NULL,
  `note` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_7A64B0538C03F15C` (`employee_id`),
  CONSTRAINT `FK_7A64B0538C03F15C` FOREIGN KEY (`employee_id`) REFERENCES `employee_info` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `employee_note`
--

LOCK TABLES `employee_note` WRITE;
/*!40000 ALTER TABLE `employee_note` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_note` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_permission`
--

DROP TABLE IF EXISTS `employee_permission`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employee_permission` (
  `id` int NOT NULL AUTO_INCREMENT,
  `employee_id` int NOT NULL,
  `start_at` date NOT NULL,
  `end_at` date NOT NULL,
  `hours_nbr` int NOT NULL,
  `type` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  `note` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_789E227E8C03F15C` (`employee_id`),
  CONSTRAINT `FK_789E227E8C03F15C` FOREIGN KEY (`employee_id`) REFERENCES `employee_info` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `employee_permission`
--

LOCK TABLES `employee_permission` WRITE;
/*!40000 ALTER TABLE `employee_permission` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_permission` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_phone`
--

DROP TABLE IF EXISTS `employee_phone`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employee_phone` (
  `id` int NOT NULL AUTO_INCREMENT,
  `employee_id` int NOT NULL,
  `number` varchar(8) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_AC429AA48C03F15C` (`employee_id`),
  CONSTRAINT `FK_AC429AA48C03F15C` FOREIGN KEY (`employee_id`) REFERENCES `employee_info` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `employee_phone`
--

LOCK TABLES `employee_phone` WRITE;
/*!40000 ALTER TABLE `employee_phone` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_phone` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_public_holiday`
--

DROP TABLE IF EXISTS `employee_public_holiday`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employee_public_holiday` (
  `id` int NOT NULL AUTO_INCREMENT,
  `holiday_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `start_at` date NOT NULL,
  `end_at` date NOT NULL,
  `is_payed` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `employee_public_holiday`
--

LOCK TABLES `employee_public_holiday` WRITE;
/*!40000 ALTER TABLE `employee_public_holiday` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_public_holiday` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_salary`
--

DROP TABLE IF EXISTS `employee_salary`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employee_salary` (
  `id` int NOT NULL AUTO_INCREMENT,
  `employee_id` int NOT NULL,
  `payroll_run_id` int DEFAULT NULL,
  `created_by_id` int NOT NULL,
  `payroll_date` date NOT NULL,
  `payroll_month` int NOT NULL,
  `payroll_year` int NOT NULL,
  `base_salary` decimal(10,2) NOT NULL,
  `overtime_hours` decimal(10,2) DEFAULT NULL,
  `overtime_amount` decimal(10,2) DEFAULT NULL,
  `bonuses` decimal(10,2) DEFAULT NULL,
  `allowances` decimal(10,2) DEFAULT NULL,
  `gross_salary` decimal(10,2) NOT NULL,
  `fica_deduction` decimal(10,2) DEFAULT NULL,
  `tax_deduction` decimal(10,2) DEFAULT NULL,
  `advance_deduction` decimal(10,2) DEFAULT NULL,
  `other_deductions` decimal(10,2) DEFAULT NULL,
  `benefit_deduction_pre_tax` decimal(10,2) DEFAULT NULL,
  `benefit_deduction_post_tax` decimal(10,2) DEFAULT NULL,
  `garnishment_deduction` decimal(10,2) DEFAULT NULL,
  `additional_medicare_tax` decimal(10,2) DEFAULT NULL,
  `employer_fica_amount` decimal(10,2) DEFAULT NULL,
  `employer_futa_amount` decimal(10,2) DEFAULT NULL,
  `net_salary` decimal(10,2) NOT NULL,
  `worked_days` int NOT NULL,
  `absence_days` int DEFAULT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `notes` longtext COLLATE utf8mb4_unicode_ci,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_BD227FE4A5FC78E` (`payroll_run_id`),
  KEY `IDX_emp_salary_employee` (`employee_id`),
  KEY `IDX_emp_salary_period` (`payroll_year`,`payroll_month`),
  KEY `IDX_emp_salary_status` (`status`),
  KEY `IDX_emp_salary_created_at` (`created_at`),
  KEY `IDX_emp_salary_created_by` (`created_by_id`),
  CONSTRAINT `FK_BD227FE48C03F15C` FOREIGN KEY (`employee_id`) REFERENCES `employee_info` (`id`),
  CONSTRAINT `FK_BD227FE4A5FC78E` FOREIGN KEY (`payroll_run_id`) REFERENCES `payroll_run` (`id`),
  CONSTRAINT `FK_BD227FE4B03A8386` FOREIGN KEY (`created_by_id`) REFERENCES `user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `employee_salary`
--

LOCK TABLES `employee_salary` WRITE;
/*!40000 ALTER TABLE `employee_salary` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_salary` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_schedule_assignment`
--

DROP TABLE IF EXISTS `employee_schedule_assignment`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employee_schedule_assignment` (
  `clocking_schedule_id` int NOT NULL,
  `employee_info_id` int NOT NULL,
  PRIMARY KEY (`clocking_schedule_id`,`employee_info_id`),
  KEY `IDX_60435C8FD78588EE` (`clocking_schedule_id`),
  KEY `IDX_60435C8FDDC797F7` (`employee_info_id`),
  CONSTRAINT `FK_60435C8FD78588EE` FOREIGN KEY (`clocking_schedule_id`) REFERENCES `clocking_schedule` (`id`) ON DELETE CASCADE,
  CONSTRAINT `FK_60435C8FDDC797F7` FOREIGN KEY (`employee_info_id`) REFERENCES `employee_info` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `employee_schedule_assignment`
--

LOCK TABLES `employee_schedule_assignment` WRITE;
/*!40000 ALTER TABLE `employee_schedule_assignment` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_schedule_assignment` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_suspension`
--

DROP TABLE IF EXISTS `employee_suspension`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employee_suspension` (
  `id` int NOT NULL AUTO_INCREMENT,
  `employee_id` int NOT NULL,
  `issued_by_id` int NOT NULL,
  `approved_by_id` int DEFAULT NULL,
  `start_date` date NOT NULL,
  `end_date` date DEFAULT NULL,
  `type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `reason` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_paid` tinyint(1) NOT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `notes` longtext COLLATE utf8mb4_unicode_ci,
  `document_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `approved_date` date DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_1A78B5D48C03F15C` (`employee_id`),
  KEY `IDX_1A78B5D4784BB717` (`issued_by_id`),
  KEY `IDX_1A78B5D42D234F6A` (`approved_by_id`),
  CONSTRAINT `FK_1A78B5D42D234F6A` FOREIGN KEY (`approved_by_id`) REFERENCES `user` (`id`),
  CONSTRAINT `FK_1A78B5D4784BB717` FOREIGN KEY (`issued_by_id`) REFERENCES `user` (`id`),
  CONSTRAINT `FK_1A78B5D48C03F15C` FOREIGN KEY (`employee_id`) REFERENCES `employee_info` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `employee_suspension`
--

LOCK TABLES `employee_suspension` WRITE;
/*!40000 ALTER TABLE `employee_suspension` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_suspension` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_training`
--

DROP TABLE IF EXISTS `employee_training`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employee_training` (
  `id` int NOT NULL AUTO_INCREMENT,
  `employee_id` int NOT NULL,
  `training_program_id` int NOT NULL,
  `enrolled_by_id` int NOT NULL,
  `evaluated_by_id` int DEFAULT NULL,
  `enrollment_date` date NOT NULL,
  `start_date` date DEFAULT NULL,
  `completion_date` date DEFAULT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `score` decimal(5,2) DEFAULT NULL,
  `grade` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `feedback` longtext COLLATE utf8mb4_unicode_ci,
  `certificate_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_mandatory` tinyint(1) NOT NULL,
  `notes` longtext COLLATE utf8mb4_unicode_ci,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_452DDB488C03F15C` (`employee_id`),
  KEY `IDX_452DDB488406BD6C` (`training_program_id`),
  KEY `IDX_452DDB4821EE0EA4` (`enrolled_by_id`),
  KEY `IDX_452DDB48200A8A1A` (`evaluated_by_id`),
  CONSTRAINT `FK_452DDB48200A8A1A` FOREIGN KEY (`evaluated_by_id`) REFERENCES `user` (`id`),
  CONSTRAINT `FK_452DDB4821EE0EA4` FOREIGN KEY (`enrolled_by_id`) REFERENCES `user` (`id`),
  CONSTRAINT `FK_452DDB488406BD6C` FOREIGN KEY (`training_program_id`) REFERENCES `training_program` (`id`),
  CONSTRAINT `FK_452DDB488C03F15C` FOREIGN KEY (`employee_id`) REFERENCES `employee_info` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `employee_training`
--

LOCK TABLES `employee_training` WRITE;
/*!40000 ALTER TABLE `employee_training` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_training` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee_w4`
--

DROP TABLE IF EXISTS `employee_w4`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employee_w4` (
  `id` int NOT NULL AUTO_INCREMENT,
  `employee_id` int NOT NULL,
  `filing_status` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `multiple_jobs` tinyint(1) NOT NULL,
  `dependents_amount` decimal(10,2) NOT NULL,
  `other_income` decimal(10,2) NOT NULL,
  `deductions` decimal(10,2) NOT NULL,
  `extra_withholding` decimal(10,2) NOT NULL,
  `is_exempt` tinyint(1) NOT NULL,
  `effective_date` date NOT NULL,
  `tax_year` int NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_w4_employee` (`employee_id`),
  KEY `IDX_w4_effective_date` (`effective_date`),
  CONSTRAINT `FK_33299F778C03F15C` FOREIGN KEY (`employee_id`) REFERENCES `employee_info` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `employee_w4`
--

LOCK TABLES `employee_w4` WRITE;
/*!40000 ALTER TABLE `employee_w4` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee_w4` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employer_tax_liability`
--

DROP TABLE IF EXISTS `employer_tax_liability`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employer_tax_liability` (
  `id` int NOT NULL AUTO_INCREMENT,
  `salary_id` int NOT NULL,
  `employee_id` int NOT NULL,
  `employer_ss` decimal(10,2) NOT NULL,
  `employer_medicare` decimal(10,2) NOT NULL,
  `employer_futa` decimal(10,2) NOT NULL,
  `employer_suta` decimal(10,2) NOT NULL,
  `year` int NOT NULL,
  `month` int NOT NULL,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_BEF10208B0FDF16E` (`salary_id`),
  KEY `IDX_etl_salary` (`salary_id`),
  KEY `IDX_etl_employee` (`employee_id`),
  CONSTRAINT `FK_BEF102088C03F15C` FOREIGN KEY (`employee_id`) REFERENCES `employee_info` (`id`),
  CONSTRAINT `FK_BEF10208B0FDF16E` FOREIGN KEY (`salary_id`) REFERENCES `employee_salary` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `employer_tax_liability`
--

LOCK TABLES `employer_tax_liability` WRITE;
/*!40000 ALTER TABLE `employer_tax_liability` DISABLE KEYS */;
/*!40000 ALTER TABLE `employer_tax_liability` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `fiscal_profile`
--

DROP TABLE IF EXISTS `fiscal_profile`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `fiscal_profile` (
  `id` int NOT NULL AUTO_INCREMENT,
  `code` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `company_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `address` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `city` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `state_province` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `postal_code` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `country_code` varchar(2) COLLATE utf8mb4_unicode_ci NOT NULL,
  `tax_id_label` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tax_id_value` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `secondary_tax_id_label` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `secondary_tax_id_value` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `default_currency` varchar(3) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fiscal_year_start` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `website` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `logo_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL,
  `is_default` tinyint(1) NOT NULL,
  `metadata` json DEFAULT NULL,
  `created_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_FISCAL_CODE` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `fiscal_profile`
--

LOCK TABLES `fiscal_profile` WRITE;
/*!40000 ALTER TABLE `fiscal_profile` DISABLE KEYS */;
INSERT INTO `fiscal_profile` VALUES (1,'US','Starz Energies','30 N Gould St #37806','Sheridan','WY','82801','US','EIN','82-3001004','WY SOS ID',NULL,'USD','01-01',NULL,'finance@starzenergies.com',NULL,NULL,1,1,'{\"timezone\": \"America/Denver\", \"state_income_tax\": \"0.00\", \"wyoming_sales_tax\": \"4.00\", \"federal_corporate_tax\": \"21.00\"}','2026-02-27 15:01:25',NULL),(2,'TN','Starz Electronics Tunisia','Rue de l\'Industrie, Zone A','Tunis','Tunis','1000','TN','Matricule Fiscal','TN1234567','CNSS','CNSS-998877','TND','01-01','+216-71-000000','finance.tn@starzelectronics.com','https://starzelectronics.com',NULL,1,0,'{\"timezone\": \"Africa/Tunis\", \"vat_rate\": 19}','2026-02-28 11:23:22','2026-02-28 11:23:22');
/*!40000 ALTER TABLE `fiscal_profile` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `fx_rates`
--

DROP TABLE IF EXISTS `fx_rates`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `fx_rates` (
  `id` int NOT NULL AUTO_INCREMENT,
  `from_currency` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `to_currency` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rate` decimal(12,6) NOT NULL,
  `asof` datetime NOT NULL,
  `version_id` varchar(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_active` tinyint(1) NOT NULL,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_currencies` (`from_currency`,`to_currency`),
  KEY `idx_asof` (`asof`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `fx_rates`
--

LOCK TABLES `fx_rates` WRITE;
/*!40000 ALTER TABLE `fx_rates` DISABLE KEYS */;
/*!40000 ALTER TABLE `fx_rates` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `garnishment`
--

DROP TABLE IF EXISTS `garnishment`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `garnishment` (
  `id` int NOT NULL AUTO_INCREMENT,
  `employee_id` int NOT NULL,
  `type` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `case_number` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `issuing_agency` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `amount_per_period` decimal(10,2) DEFAULT NULL,
  `percentage` decimal(5,4) DEFAULT NULL,
  `total_owed` decimal(12,2) DEFAULT NULL,
  `total_collected` decimal(12,2) NOT NULL,
  `priority` int NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL,
  `notes` longtext COLLATE utf8mb4_unicode_ci,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_garn_employee` (`employee_id`),
  KEY `IDX_garn_active` (`is_active`),
  CONSTRAINT `FK_26E59B0F8C03F15C` FOREIGN KEY (`employee_id`) REFERENCES `employee_info` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `garnishment`
--

LOCK TABLES `garnishment` WRITE;
/*!40000 ALTER TABLE `garnishment` DISABLE KEYS */;
/*!40000 ALTER TABLE `garnishment` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `groupe_article`
--

DROP TABLE IF EXISTS `groupe_article`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `groupe_article` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type_article_id` int NOT NULL,
  `code_reference` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_C45DE9282E6312B` (`code_reference`),
  KEY `IDX_C45DE9286F9750B9` (`type_article_id`),
  CONSTRAINT `FK_C45DE9286F9750B9` FOREIGN KEY (`type_article_id`) REFERENCES `type_article` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `groupe_article`
--

LOCK TABLES `groupe_article` WRITE;
/*!40000 ALTER TABLE `groupe_article` DISABLE KEYS */;
/*!40000 ALTER TABLE `groupe_article` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `hypercare_snapshot`
--

DROP TABLE IF EXISTS `hypercare_snapshot`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `hypercare_snapshot` (
  `id` int NOT NULL AUTO_INCREMENT,
  `snapshot_day` date NOT NULL COMMENT '(DC2Type:date_immutable)',
  `p1_sla_met` tinyint(1) NOT NULL,
  `inventory_accuracy` decimal(5,4) NOT NULL,
  `inventory_accuracy_met` tinyint(1) NOT NULL,
  `created_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_HC_DAY` (`snapshot_day`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `hypercare_snapshot`
--

LOCK TABLES `hypercare_snapshot` WRITE;
/*!40000 ALTER TABLE `hypercare_snapshot` DISABLE KEYS */;
/*!40000 ALTER TABLE `hypercare_snapshot` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `invoice`
--

DROP TABLE IF EXISTS `invoice`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `invoice` (
  `id` int NOT NULL AUTO_INCREMENT,
  `fiscal_profile_id` int NOT NULL,
  `client_id` int DEFAULT NULL,
  `sales_order_id` int DEFAULT NULL,
  `created_by_id` int NOT NULL,
  `invoice_number` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `invoice_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `client_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `client_address` longtext COLLATE utf8mb4_unicode_ci,
  `client_tax_id` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `issue_date` date NOT NULL,
  `due_date` date NOT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `currency_code` varchar(3) COLLATE utf8mb4_unicode_ci NOT NULL,
  `subtotal` decimal(15,4) NOT NULL,
  `tax_total` decimal(15,4) NOT NULL,
  `discount_total` decimal(15,4) NOT NULL,
  `grand_total` decimal(15,4) NOT NULL,
  `amount_paid` decimal(15,4) NOT NULL,
  `amount_due` decimal(15,4) NOT NULL,
  `notes` longtext COLLATE utf8mb4_unicode_ci,
  `terms_and_conditions` longtext COLLATE utf8mb4_unicode_ci,
  `tax_breakdown` json DEFAULT NULL,
  `created_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  `updated_at` datetime DEFAULT NULL,
  `paid_at` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_906517442DA68207` (`invoice_number`),
  UNIQUE KEY `UNIQ_INVOICE_NUMBER_PER_PROFILE` (`invoice_number`,`fiscal_profile_id`),
  KEY `IDX_9065174419EB6921` (`client_id`),
  KEY `IDX_90651744C023F51C` (`sales_order_id`),
  KEY `IDX_90651744B03A8386` (`created_by_id`),
  KEY `IDX_invoice_status` (`status`),
  KEY `IDX_invoice_issue_date` (`issue_date`),
  KEY `IDX_invoice_due_date` (`due_date`),
  KEY `IDX_invoice_fiscal_profile` (`fiscal_profile_id`),
  CONSTRAINT `FK_9065174419EB6921` FOREIGN KEY (`client_id`) REFERENCES `company` (`id`),
  CONSTRAINT `FK_906517442492F9BB` FOREIGN KEY (`fiscal_profile_id`) REFERENCES `fiscal_profile` (`id`),
  CONSTRAINT `FK_90651744B03A8386` FOREIGN KEY (`created_by_id`) REFERENCES `user` (`id`),
  CONSTRAINT `FK_90651744C023F51C` FOREIGN KEY (`sales_order_id`) REFERENCES `sales_order` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `invoice`
--

LOCK TABLES `invoice` WRITE;
/*!40000 ALTER TABLE `invoice` DISABLE KEYS */;
/*!40000 ALTER TABLE `invoice` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `invoice_category`
--

DROP TABLE IF EXISTS `invoice_category`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `invoice_category` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `invoice_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `financial_classification` varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `invoice_category`
--

LOCK TABLES `invoice_category` WRITE;
/*!40000 ALTER TABLE `invoice_category` DISABLE KEYS */;
/*!40000 ALTER TABLE `invoice_category` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `invoice_dispute`
--

DROP TABLE IF EXISTS `invoice_dispute`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `invoice_dispute` (
  `id` int NOT NULL AUTO_INCREMENT,
  `invoice_id` int NOT NULL,
  `opened_by_id` int NOT NULL,
  `resolved_by_id` int DEFAULT NULL,
  `opened_at` datetime NOT NULL,
  `reason` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `resolved_at` datetime DEFAULT NULL,
  `resolution` longtext COLLATE utf8mb4_unicode_ci,
  `disputed_amount` decimal(15,2) DEFAULT NULL,
  `adjustment_amount` decimal(15,2) DEFAULT NULL,
  `internal_notes` longtext COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `IDX_CE4B66D4AB159F5` (`opened_by_id`),
  KEY `IDX_CE4B66D46713A32B` (`resolved_by_id`),
  KEY `IDX_dispute_invoice` (`invoice_id`),
  KEY `IDX_dispute_status` (`status`),
  CONSTRAINT `FK_CE4B66D42989F1FD` FOREIGN KEY (`invoice_id`) REFERENCES `invoice` (`id`),
  CONSTRAINT `FK_CE4B66D46713A32B` FOREIGN KEY (`resolved_by_id`) REFERENCES `user` (`id`),
  CONSTRAINT `FK_CE4B66D4AB159F5` FOREIGN KEY (`opened_by_id`) REFERENCES `user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `invoice_dispute`
--

LOCK TABLES `invoice_dispute` WRITE;
/*!40000 ALTER TABLE `invoice_dispute` DISABLE KEYS */;
/*!40000 ALTER TABLE `invoice_dispute` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `invoice_line`
--

DROP TABLE IF EXISTS `invoice_line`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `invoice_line` (
  `id` int NOT NULL AUTO_INCREMENT,
  `invoice_id` int NOT NULL,
  `article_id` int DEFAULT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `quantity` decimal(15,4) NOT NULL,
  `unit` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `unit_price` decimal(15,2) NOT NULL,
  `tax_rate` decimal(8,4) NOT NULL,
  `tax_label` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tax_amount` decimal(15,2) NOT NULL,
  `discount_rate` decimal(8,4) NOT NULL,
  `discount_amount` decimal(15,2) NOT NULL,
  `line_total` decimal(15,2) NOT NULL,
  `sort_order` int NOT NULL,
  `account_code` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_D3D1D6932989F1FD` (`invoice_id`),
  KEY `IDX_D3D1D6937294869C` (`article_id`),
  CONSTRAINT `FK_D3D1D6932989F1FD` FOREIGN KEY (`invoice_id`) REFERENCES `invoice` (`id`),
  CONSTRAINT `FK_D3D1D6937294869C` FOREIGN KEY (`article_id`) REFERENCES `article` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `invoice_line`
--

LOCK TABLES `invoice_line` WRITE;
/*!40000 ALTER TABLE `invoice_line` DISABLE KEYS */;
/*!40000 ALTER TABLE `invoice_line` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `journal_entry`
--

DROP TABLE IF EXISTS `journal_entry`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `journal_entry` (
  `id` int NOT NULL AUTO_INCREMENT,
  `fiscal_profile_id` int NOT NULL,
  `accounting_period_id` int DEFAULT NULL,
  `invoice_id` int DEFAULT NULL,
  `created_by_id` int NOT NULL,
  `reference` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `entry_date` date NOT NULL,
  `description` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  `posted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_C8FAAE5A2492F9BB` (`fiscal_profile_id`),
  KEY `IDX_C8FAAE5ABF806DC3` (`accounting_period_id`),
  KEY `IDX_C8FAAE5A2989F1FD` (`invoice_id`),
  KEY `IDX_C8FAAE5AB03A8386` (`created_by_id`),
  CONSTRAINT `FK_C8FAAE5A2492F9BB` FOREIGN KEY (`fiscal_profile_id`) REFERENCES `fiscal_profile` (`id`),
  CONSTRAINT `FK_C8FAAE5A2989F1FD` FOREIGN KEY (`invoice_id`) REFERENCES `invoice` (`id`),
  CONSTRAINT `FK_C8FAAE5AB03A8386` FOREIGN KEY (`created_by_id`) REFERENCES `user` (`id`),
  CONSTRAINT `FK_C8FAAE5ABF806DC3` FOREIGN KEY (`accounting_period_id`) REFERENCES `accounting_period` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `journal_entry`
--

LOCK TABLES `journal_entry` WRITE;
/*!40000 ALTER TABLE `journal_entry` DISABLE KEYS */;
/*!40000 ALTER TABLE `journal_entry` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `journal_entry_line`
--

DROP TABLE IF EXISTS `journal_entry_line`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `journal_entry_line` (
  `id` int NOT NULL AUTO_INCREMENT,
  `journal_entry_id` int NOT NULL,
  `account_id` int NOT NULL,
  `debit_amount` decimal(15,2) NOT NULL,
  `credit_amount` decimal(15,2) NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sort_order` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_E856D6F16A86E4FB` (`journal_entry_id`),
  KEY `IDX_E856D6F19B6B5FBA` (`account_id`),
  CONSTRAINT `FK_E856D6F16A86E4FB` FOREIGN KEY (`journal_entry_id`) REFERENCES `journal_entry` (`id`),
  CONSTRAINT `FK_E856D6F19B6B5FBA` FOREIGN KEY (`account_id`) REFERENCES `chart_of_accounts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `journal_entry_line`
--

LOCK TABLES `journal_entry_line` WRITE;
/*!40000 ALTER TABLE `journal_entry_line` DISABLE KEYS */;
/*!40000 ALTER TABLE `journal_entry_line` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `ma_customs_declaration`
--

DROP TABLE IF EXISTS `ma_customs_declaration`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `ma_customs_declaration` (
  `id` int NOT NULL AUTO_INCREMENT,
  `dum_number` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `direction` varchar(6) COLLATE utf8mb4_unicode_ci NOT NULL,
  `regime_code` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `filing_date` date NOT NULL,
  `clearance_date` date DEFAULT NULL,
  `status` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,
  `customs_office` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL,
  `hs_codes` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `goods_description` longtext COLLATE utf8mb4_unicode_ci,
  `country_code` varchar(2) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `gross_weight_kg` decimal(12,3) DEFAULT NULL,
  `number_of_packages` int DEFAULT NULL,
  `declared_value_fob` decimal(15,4) NOT NULL,
  `currency_code` varchar(3) COLLATE utf8mb4_unicode_ci NOT NULL,
  `exchange_rate_to_mad` decimal(12,4) NOT NULL,
  `value_in_mad` decimal(15,4) NOT NULL,
  `customs_duties` decimal(15,4) NOT NULL,
  `import_tva` decimal(15,4) NOT NULL,
  `acquit_acaution_ref` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `apurement_deadline` date DEFAULT NULL,
  `is_apure` tinyint(1) NOT NULL,
  `related_dum_number` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `transitaire` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `incoterm` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `transport_mode` varchar(15) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `transport_document_number` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` longtext COLLATE utf8mb4_unicode_ci,
  `created_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  `updated_at` datetime DEFAULT NULL COMMENT '(DC2Type:datetime_immutable)',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_E13505C73893D825` (`dum_number`),
  KEY `idx_ma_cust_dum` (`dum_number`),
  KEY `idx_ma_cust_regime` (`regime_code`),
  KEY `idx_ma_cust_status` (`status`),
  KEY `idx_ma_cust_direction` (`direction`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `ma_customs_declaration`
--

LOCK TABLES `ma_customs_declaration` WRITE;
/*!40000 ALTER TABLE `ma_customs_declaration` DISABLE KEYS */;
/*!40000 ALTER TABLE `ma_customs_declaration` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `ma_employee_extension`
--

DROP TABLE IF EXISTS `ma_employee_extension`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `ma_employee_extension` (
  `id` int NOT NULL AUTO_INCREMENT,
  `employee_id` int NOT NULL,
  `cin_number` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cnss_number` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `number_of_dependents` int NOT NULL,
  `marital_status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `seniority_date` date DEFAULT NULL,
  `cimr_opt_in` tinyint(1) NOT NULL,
  `cimr_rate` decimal(5,4) NOT NULL,
  `mutuelle_amount` decimal(10,2) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_2076333E8C03F15C` (`employee_id`),
  CONSTRAINT `FK_2076333E8C03F15C` FOREIGN KEY (`employee_id`) REFERENCES `employee_info` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `ma_employee_extension`
--

LOCK TABLES `ma_employee_extension` WRITE;
/*!40000 ALTER TABLE `ma_employee_extension` DISABLE KEYS */;
/*!40000 ALTER TABLE `ma_employee_extension` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `ma_invoice_extension`
--

DROP TABLE IF EXISTS `ma_invoice_extension`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `ma_invoice_extension` (
  `id` int NOT NULL AUTO_INCREMENT,
  `invoice_id` int NOT NULL,
  `is_export` tinyint(1) NOT NULL,
  `tva_exonerated` tinyint(1) NOT NULL,
  `tva_exoneration_basis` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `client_ice` varchar(15) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `client_if` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `client_foreign_tax_id` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `customs_declaration_number` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `customs_regime_code` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `destination_country` varchar(2) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `incoterm` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `transport_mode` varchar(15) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `customs_office` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `export_declaration_date` date DEFAULT NULL,
  `hs_code` varchar(60) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `invoice_currency` varchar(3) COLLATE utf8mb4_unicode_ci NOT NULL,
  `exchange_rate_to_mad` decimal(12,4) NOT NULL,
  `total_in_mad` decimal(15,4) NOT NULL,
  `retenue_source` decimal(15,4) NOT NULL,
  `cotisation_minimale` decimal(15,4) NOT NULL,
  `timbre_fiscal` decimal(15,4) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_7B48C21F2989F1FD` (`invoice_id`),
  KEY `idx_ma_inv_customs_decl` (`customs_declaration_number`),
  KEY `idx_ma_inv_regime` (`customs_regime_code`),
  KEY `idx_ma_inv_dest` (`destination_country`),
  CONSTRAINT `FK_7B48C21F2989F1FD` FOREIGN KEY (`invoice_id`) REFERENCES `invoice` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `ma_invoice_extension`
--

LOCK TABLES `ma_invoice_extension` WRITE;
/*!40000 ALTER TABLE `ma_invoice_extension` DISABLE KEYS */;
/*!40000 ALTER TABLE `ma_invoice_extension` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `ma_payroll_extension`
--

DROP TABLE IF EXISTS `ma_payroll_extension`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `ma_payroll_extension` (
  `id` int NOT NULL AUTO_INCREMENT,
  `salary_id` int NOT NULL,
  `prime_anciennete` decimal(10,2) NOT NULL,
  `anciennete_rate` decimal(5,4) NOT NULL,
  `frais_professionnels` decimal(10,2) NOT NULL,
  `cnss_employee` decimal(10,2) NOT NULL,
  `cnss_employer` decimal(10,2) NOT NULL,
  `amo_employee` decimal(10,2) NOT NULL,
  `amo_employer` decimal(10,2) NOT NULL,
  `ir_amount` decimal(10,2) NOT NULL,
  `charges_famille` decimal(10,2) NOT NULL,
  `number_of_dependents` int NOT NULL,
  `cimr_employee` decimal(10,2) NOT NULL,
  `cimr_employer` decimal(10,2) NOT NULL,
  `mutuelle_deduction` decimal(10,2) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_AFB94906B0FDF16E` (`salary_id`),
  CONSTRAINT `FK_AFB94906B0FDF16E` FOREIGN KEY (`salary_id`) REFERENCES `employee_salary` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `ma_payroll_extension`
--

LOCK TABLES `ma_payroll_extension` WRITE;
/*!40000 ALTER TABLE `ma_payroll_extension` DISABLE KEYS */;
/*!40000 ALTER TABLE `ma_payroll_extension` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `messenger_messages`
--

DROP TABLE IF EXISTS `messenger_messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `messenger_messages` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `body` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `headers` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `queue_name` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL,
  `available_at` datetime NOT NULL,
  `delivered_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_75EA56E0FB7336F0` (`queue_name`),
  KEY `IDX_75EA56E0E3BD61CE` (`available_at`),
  KEY `IDX_75EA56E016BA31DB` (`delivered_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `messenger_messages`
--

LOCK TABLES `messenger_messages` WRITE;
/*!40000 ALTER TABLE `messenger_messages` DISABLE KEYS */;
/*!40000 ALTER TABLE `messenger_messages` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `password_reset`
--

DROP TABLE IF EXISTS `password_reset`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `password_reset` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  `expires_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  `is_used` tinyint(1) NOT NULL DEFAULT '0',
  `used_at` datetime DEFAULT NULL COMMENT '(DC2Type:datetime_immutable)',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_B10172525F37A13B` (`token`),
  KEY `IDX_B1017252A76ED395` (`user_id`),
  CONSTRAINT `FK_B1017252A76ED395` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `password_reset`
--

LOCK TABLES `password_reset` WRITE;
/*!40000 ALTER TABLE `password_reset` DISABLE KEYS */;
/*!40000 ALTER TABLE `password_reset` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `pay_period`
--

DROP TABLE IF EXISTS `pay_period`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `pay_period` (
  `id` int NOT NULL AUTO_INCREMENT,
  `frequency` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `pay_date` date NOT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `year` int NOT NULL,
  `period_number` int NOT NULL,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_pp_frequency` (`frequency`),
  KEY `IDX_pp_status` (`status`),
  KEY `IDX_pp_start` (`start_date`),
  KEY `IDX_pp_end` (`end_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `pay_period`
--

LOCK TABLES `pay_period` WRITE;
/*!40000 ALTER TABLE `pay_period` DISABLE KEYS */;
/*!40000 ALTER TABLE `pay_period` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `pay_term`
--

DROP TABLE IF EXISTS `pay_term`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `pay_term` (
  `id` int NOT NULL AUTO_INCREMENT,
  `ref` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_F696352A146F3EA3` (`ref`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `pay_term`
--

LOCK TABLES `pay_term` WRITE;
/*!40000 ALTER TABLE `pay_term` DISABLE KEYS */;
/*!40000 ALTER TABLE `pay_term` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `payment_allocation`
--

DROP TABLE IF EXISTS `payment_allocation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `payment_allocation` (
  `id` int NOT NULL AUTO_INCREMENT,
  `payment_receipt_id` int NOT NULL,
  `invoice_id` int NOT NULL,
  `allocated_by_id` int NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `allocated_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  `notes` longtext COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `IDX_69B2A2FF6802B588` (`allocated_by_id`),
  KEY `IDX_payment_alloc_receipt` (`payment_receipt_id`),
  KEY `IDX_payment_alloc_invoice` (`invoice_id`),
  CONSTRAINT `FK_69B2A2FF1EAA2943` FOREIGN KEY (`payment_receipt_id`) REFERENCES `payment_receipt` (`id`) ON DELETE CASCADE,
  CONSTRAINT `FK_69B2A2FF2989F1FD` FOREIGN KEY (`invoice_id`) REFERENCES `invoice` (`id`),
  CONSTRAINT `FK_69B2A2FF6802B588` FOREIGN KEY (`allocated_by_id`) REFERENCES `user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `payment_allocation`
--

LOCK TABLES `payment_allocation` WRITE;
/*!40000 ALTER TABLE `payment_allocation` DISABLE KEYS */;
/*!40000 ALTER TABLE `payment_allocation` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `payment_receipt`
--

DROP TABLE IF EXISTS `payment_receipt`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `payment_receipt` (
  `id` int NOT NULL AUTO_INCREMENT,
  `customer_id` int NOT NULL,
  `fiscal_profile_id` int NOT NULL,
  `received_by_id` int NOT NULL,
  `deposited_to_id` int DEFAULT NULL,
  `received_at` datetime NOT NULL,
  `currency_code` varchar(3) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payment_method` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `reference` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `check_number` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` longtext COLLATE utf8mb4_unicode_ci,
  `allocated_amount` decimal(15,2) NOT NULL,
  `unallocated_amount` decimal(15,2) NOT NULL,
  `created_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_4AD0B8AF2492F9BB` (`fiscal_profile_id`),
  KEY `IDX_4AD0B8AF6F8DDD17` (`received_by_id`),
  KEY `IDX_4AD0B8AFFC9D053C` (`deposited_to_id`),
  KEY `IDX_payment_receipt_customer` (`customer_id`),
  KEY `IDX_payment_receipt_date` (`received_at`),
  KEY `IDX_payment_receipt_reference` (`reference`),
  CONSTRAINT `FK_4AD0B8AF2492F9BB` FOREIGN KEY (`fiscal_profile_id`) REFERENCES `fiscal_profile` (`id`),
  CONSTRAINT `FK_4AD0B8AF6F8DDD17` FOREIGN KEY (`received_by_id`) REFERENCES `user` (`id`),
  CONSTRAINT `FK_4AD0B8AF9395C3F3` FOREIGN KEY (`customer_id`) REFERENCES `company` (`id`),
  CONSTRAINT `FK_4AD0B8AFFC9D053C` FOREIGN KEY (`deposited_to_id`) REFERENCES `bank_account` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `payment_receipt`
--

LOCK TABLES `payment_receipt` WRITE;
/*!40000 ALTER TABLE `payment_receipt` DISABLE KEYS */;
/*!40000 ALTER TABLE `payment_receipt` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `payroll_bank_config`
--

DROP TABLE IF EXISTS `payroll_bank_config`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `payroll_bank_config` (
  `id` int NOT NULL AUTO_INCREMENT,
  `fiscal_profile_id` int NOT NULL,
  `bank_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `routing_number` varchar(9) COLLATE utf8mb4_unicode_ci NOT NULL,
  `account_number` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `account_type` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'checking',
  `nacha_immediate_origin` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nacha_immediate_destination` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nacha_company_id` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nacha_originating_dfi` varchar(8) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nacha_destination_name` varchar(23) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ach_submission_method` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'sftp',
  `ach_sftp_host` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ach_sftp_port` int DEFAULT '22',
  `ach_sftp_username` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ach_sftp_password` longtext COLLATE utf8mb4_unicode_ci,
  `ach_sftp_key_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ach_sftp_remote_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `eftps_ein` varchar(9) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `eftps_pin` longtext COLLATE utf8mb4_unicode_ci,
  `eftps_password` longtext COLLATE utf8mb4_unicode_ci,
  `tax_deposit_schedule` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'semiweekly',
  `irs_routing_number` varchar(9) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `irs_account_number` longtext COLLATE utf8mb4_unicode_ci,
  `state_tax_payment_config` json DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '0',
  `auto_submit_ach` tinyint(1) NOT NULL DEFAULT '0',
  `auto_submit_tax_deposits` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_2CB45732492F9BB` (`fiscal_profile_id`),
  CONSTRAINT `FK_2CB45732492F9BB` FOREIGN KEY (`fiscal_profile_id`) REFERENCES `fiscal_profile` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `payroll_bank_config`
--

LOCK TABLES `payroll_bank_config` WRITE;
/*!40000 ALTER TABLE `payroll_bank_config` DISABLE KEYS */;
/*!40000 ALTER TABLE `payroll_bank_config` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `payroll_payment`
--

DROP TABLE IF EXISTS `payroll_payment`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `payroll_payment` (
  `id` int NOT NULL AUTO_INCREMENT,
  `payroll_run_id` int NOT NULL,
  `submitted_by_id` int DEFAULT NULL,
  `payment_type` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(14,2) NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nacha_file_path` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nacha_batch_number` int DEFAULT NULL,
  `ach_entry_count` int DEFAULT NULL,
  `ach_batch_reference` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ach_effective_date` date DEFAULT NULL,
  `eftps_confirmation` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `eftps_tax_type_code` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `eftps_tax_period` date DEFAULT NULL,
  `settlement_date` date DEFAULT NULL,
  `submitted_at` datetime DEFAULT NULL,
  `error_message` longtext COLLATE utf8mb4_unicode_ci,
  `raw_response` longtext COLLATE utf8mb4_unicode_ci,
  `retry_count` int NOT NULL DEFAULT '0',
  `created_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_FBAF90BA79F7D87D` (`submitted_by_id`),
  KEY `IDX_pp_run` (`payroll_run_id`),
  KEY `IDX_pp_type` (`payment_type`),
  KEY `IDX_pp_status` (`status`),
  CONSTRAINT `FK_FBAF90BA79F7D87D` FOREIGN KEY (`submitted_by_id`) REFERENCES `user` (`id`),
  CONSTRAINT `FK_FBAF90BAA5FC78E` FOREIGN KEY (`payroll_run_id`) REFERENCES `payroll_run` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `payroll_payment`
--

LOCK TABLES `payroll_payment` WRITE;
/*!40000 ALTER TABLE `payroll_payment` DISABLE KEYS */;
/*!40000 ALTER TABLE `payroll_payment` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `payroll_run`
--

DROP TABLE IF EXISTS `payroll_run`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `payroll_run` (
  `id` int NOT NULL AUTO_INCREMENT,
  `pay_period_id` int NOT NULL,
  `created_by_id` int NOT NULL,
  `approved_by_id` int DEFAULT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `employee_count` int NOT NULL,
  `total_gross` decimal(14,2) NOT NULL,
  `total_net` decimal(14,2) NOT NULL,
  `total_employee_fica` decimal(14,2) NOT NULL,
  `total_employer_fica` decimal(14,2) NOT NULL,
  `total_employer_futa` decimal(14,2) NOT NULL,
  `total_fit` decimal(14,2) NOT NULL,
  `total_benefit_deductions` decimal(14,2) NOT NULL,
  `total_garnishments` decimal(14,2) NOT NULL,
  `ach_batch_reference` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `eftps_confirmation941` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `eftps_confirmation940` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `disbursement_status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'none',
  `nacha_file_path` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `approved_at` datetime DEFAULT NULL,
  `paid_at` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `notes` longtext COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `IDX_7BA66475B03A8386` (`created_by_id`),
  KEY `IDX_7BA664752D234F6A` (`approved_by_id`),
  KEY `IDX_pr_pay_period` (`pay_period_id`),
  KEY `IDX_pr_status` (`status`),
  CONSTRAINT `FK_7BA664752D234F6A` FOREIGN KEY (`approved_by_id`) REFERENCES `user` (`id`),
  CONSTRAINT `FK_7BA66475B03A8386` FOREIGN KEY (`created_by_id`) REFERENCES `user` (`id`),
  CONSTRAINT `FK_7BA66475C185C5A2` FOREIGN KEY (`pay_period_id`) REFERENCES `pay_period` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `payroll_run`
--

LOCK TABLES `payroll_run` WRITE;
/*!40000 ALTER TABLE `payroll_run` DISABLE KEYS */;
/*!40000 ALTER TABLE `payroll_run` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `personnel_pointage_shift`
--

DROP TABLE IF EXISTS `personnel_pointage_shift`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `personnel_pointage_shift` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `daily_start_time` time NOT NULL,
  `daily_end_time` time NOT NULL,
  `daily_pause` int NOT NULL,
  `saturday_start_time` time DEFAULT NULL,
  `saturday_end_time` time DEFAULT NULL,
  `saturday_pause` int DEFAULT NULL,
  `night_start_time` time DEFAULT NULL,
  `night_end_time` time DEFAULT NULL,
  `type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_active` tinyint(1) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `personnel_pointage_shift`
--

LOCK TABLES `personnel_pointage_shift` WRITE;
/*!40000 ALTER TABLE `personnel_pointage_shift` DISABLE KEYS */;
/*!40000 ALTER TABLE `personnel_pointage_shift` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `pick_list`
--

DROP TABLE IF EXISTS `pick_list`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `pick_list` (
  `id` int NOT NULL AUTO_INCREMENT,
  `warehouse_id` int NOT NULL,
  `pick_list_code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `order_reference` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `priority` int NOT NULL,
  `assigned_to` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `started_at` datetime DEFAULT NULL,
  `completed_at` datetime DEFAULT NULL,
  `notes` longtext COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_DEACBA1424693AA` (`pick_list_code`),
  KEY `IDX_pick_list_warehouse` (`warehouse_id`),
  KEY `IDX_pick_list_status` (`status`),
  KEY `IDX_pick_list_priority` (`priority`),
  KEY `IDX_pick_list_created_at` (`created_at`),
  KEY `IDX_pick_list_assigned_to` (`assigned_to`),
  CONSTRAINT `FK_DEACBA145080ECDE` FOREIGN KEY (`warehouse_id`) REFERENCES `wms_warehouse` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `pick_list`
--

LOCK TABLES `pick_list` WRITE;
/*!40000 ALTER TABLE `pick_list` DISABLE KEYS */;
/*!40000 ALTER TABLE `pick_list` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `pick_list_item`
--

DROP TABLE IF EXISTS `pick_list_item`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `pick_list_item` (
  `id` int NOT NULL AUTO_INCREMENT,
  `pick_list_id` int NOT NULL,
  `article_id` int NOT NULL,
  `from_location_id` int DEFAULT NULL,
  `quantity_requested` decimal(15,4) NOT NULL,
  `quantity_picked` decimal(15,4) NOT NULL,
  `lpn_code` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sequence_number` int NOT NULL,
  `picked_at` datetime DEFAULT NULL,
  `picked_by` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` longtext COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `IDX_6A48862CBC2467B3` (`pick_list_id`),
  KEY `IDX_6A48862C7294869C` (`article_id`),
  KEY `IDX_6A48862C980210EB` (`from_location_id`),
  CONSTRAINT `FK_6A48862C7294869C` FOREIGN KEY (`article_id`) REFERENCES `article` (`id`),
  CONSTRAINT `FK_6A48862C980210EB` FOREIGN KEY (`from_location_id`) REFERENCES `wms_stock_location` (`id`),
  CONSTRAINT `FK_6A48862CBC2467B3` FOREIGN KEY (`pick_list_id`) REFERENCES `pick_list` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `pick_list_item`
--

LOCK TABLES `pick_list_item` WRITE;
/*!40000 ALTER TABLE `pick_list_item` DISABLE KEYS */;
/*!40000 ALTER TABLE `pick_list_item` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `po_reception`
--

DROP TABLE IF EXISTS `po_reception`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `po_reception` (
  `id` int NOT NULL AUTO_INCREMENT,
  `operator_id` int NOT NULL,
  `storekeeper_id` int NOT NULL,
  `supplier_id` int NOT NULL,
  `recep_code` varchar(15) COLLATE utf8mb4_unicode_ci NOT NULL,
  `supplier_ship_id` varchar(15) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL,
  `received_at` date DEFAULT NULL,
  `stored_at` date DEFAULT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_62736921584598A3` (`operator_id`),
  KEY `IDX_627369216BCB7D19` (`storekeeper_id`),
  KEY `IDX_627369212ADD6D8C` (`supplier_id`),
  CONSTRAINT `FK_627369212ADD6D8C` FOREIGN KEY (`supplier_id`) REFERENCES `supplier_info` (`id`),
  CONSTRAINT `FK_62736921584598A3` FOREIGN KEY (`operator_id`) REFERENCES `user` (`id`),
  CONSTRAINT `FK_627369216BCB7D19` FOREIGN KEY (`storekeeper_id`) REFERENCES `user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `po_reception`
--

LOCK TABLES `po_reception` WRITE;
/*!40000 ALTER TABLE `po_reception` DISABLE KEYS */;
/*!40000 ALTER TABLE `po_reception` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `purchase_order`
--

DROP TABLE IF EXISTS `purchase_order`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `purchase_order` (
  `id` int NOT NULL AUTO_INCREMENT,
  `currency_id` int DEFAULT NULL,
  `pay_term_id` int DEFAULT NULL,
  `supplier_id` int DEFAULT NULL,
  `company_id` int DEFAULT NULL,
  `po` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL,
  `request_date` date NOT NULL,
  `prediction_date` date NOT NULL,
  `amount` decimal(15,4) NOT NULL,
  `transport_fee` decimal(15,4) NOT NULL,
  `tax_fee` decimal(15,4) NOT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_21E210B2B3EB17C0` (`po`),
  KEY `IDX_21E210B238248176` (`currency_id`),
  KEY `IDX_21E210B2E8C6F237` (`pay_term_id`),
  KEY `IDX_po_status` (`status`),
  KEY `IDX_po_created_at` (`created_at`),
  KEY `IDX_po_request_date` (`request_date`),
  KEY `IDX_po_company_id` (`company_id`),
  KEY `IDX_po_supplier_id` (`supplier_id`),
  CONSTRAINT `FK_21E210B22ADD6D8C` FOREIGN KEY (`supplier_id`) REFERENCES `supplier_info` (`id`),
  CONSTRAINT `FK_21E210B238248176` FOREIGN KEY (`currency_id`) REFERENCES `currency` (`id`),
  CONSTRAINT `FK_21E210B2979B1AD6` FOREIGN KEY (`company_id`) REFERENCES `company` (`id`),
  CONSTRAINT `FK_21E210B2E8C6F237` FOREIGN KEY (`pay_term_id`) REFERENCES `pay_term` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `purchase_order`
--

LOCK TABLES `purchase_order` WRITE;
/*!40000 ALTER TABLE `purchase_order` DISABLE KEYS */;
/*!40000 ALTER TABLE `purchase_order` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `purchase_order_item`
--

DROP TABLE IF EXISTS `purchase_order_item`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `purchase_order_item` (
  `id` int NOT NULL AUTO_INCREMENT,
  `purchase_order_id` int NOT NULL,
  `article_id` int DEFAULT NULL,
  `requested_qty` decimal(15,4) NOT NULL,
  `received_qty` decimal(15,4) NOT NULL,
  `unit_price` decimal(15,4) NOT NULL,
  `amount` decimal(15,4) NOT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_5ED948C3A45D7E6A` (`purchase_order_id`),
  KEY `IDX_5ED948C37294869C` (`article_id`),
  CONSTRAINT `FK_5ED948C37294869C` FOREIGN KEY (`article_id`) REFERENCES `article` (`id`),
  CONSTRAINT `FK_5ED948C3A45D7E6A` FOREIGN KEY (`purchase_order_id`) REFERENCES `purchase_order` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `purchase_order_item`
--

LOCK TABLES `purchase_order_item` WRITE;
/*!40000 ALTER TABLE `purchase_order_item` DISABLE KEYS */;
/*!40000 ALTER TABLE `purchase_order_item` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `quotation`
--

DROP TABLE IF EXISTS `quotation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `quotation` (
  `id` int NOT NULL AUTO_INCREMENT,
  `created_by_id` int NOT NULL,
  `customer_id` int NOT NULL,
  `company_id` int NOT NULL,
  `offer_id` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL,
  `validity` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `shipping_term` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `pay_term` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `leadtime` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `min_order_qty` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `currency` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `total` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_474A8DB953C674EE` (`offer_id`),
  KEY `IDX_quotation_created_at` (`created_at`),
  KEY `IDX_quotation_company_id` (`company_id`),
  KEY `IDX_quotation_customer_id` (`customer_id`),
  KEY `IDX_quotation_created_by` (`created_by_id`),
  CONSTRAINT `FK_474A8DB99395C3F3` FOREIGN KEY (`customer_id`) REFERENCES `quotation_customer` (`id`),
  CONSTRAINT `FK_474A8DB9979B1AD6` FOREIGN KEY (`company_id`) REFERENCES `company` (`id`),
  CONSTRAINT `FK_474A8DB9B03A8386` FOREIGN KEY (`created_by_id`) REFERENCES `user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `quotation`
--

LOCK TABLES `quotation` WRITE;
/*!40000 ALTER TABLE `quotation` DISABLE KEYS */;
/*!40000 ALTER TABLE `quotation` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `quotation_customer`
--

DROP TABLE IF EXISTS `quotation_customer`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `quotation_customer` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `address` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `contact_name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `quotation_customer`
--

LOCK TABLES `quotation_customer` WRITE;
/*!40000 ALTER TABLE `quotation_customer` DISABLE KEYS */;
INSERT INTO `quotation_customer` VALUES (1,'ABC Corporation','500 Business Plaza, Los Angeles, CA 90001','Olivia Parker','purchasing@abccorp.com','+1-555-3001'),(2,'XYZ Industries','600 Industrial Park, Houston, TX 77001','Liam Scott','orders@xyzind.com','+1-555-3002'),(3,'Tech Solutions Inc','700 Tech Center, Seattle, WA 98101','Emma Turner','procurement@techsol.com','+1-555-3003');
/*!40000 ALTER TABLE `quotation_customer` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `quotation_items`
--

DROP TABLE IF EXISTS `quotation_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `quotation_items` (
  `id` int NOT NULL AUTO_INCREMENT,
  `quotation_id` int NOT NULL,
  `product_desc` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `unit_price` decimal(10,2) NOT NULL,
  `quantity` decimal(10,2) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_9EE91053B4EA4E60` (`quotation_id`),
  CONSTRAINT `FK_9EE91053B4EA4E60` FOREIGN KEY (`quotation_id`) REFERENCES `quotation` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `quotation_items`
--

LOCK TABLES `quotation_items` WRITE;
/*!40000 ALTER TABLE `quotation_items` DISABLE KEYS */;
/*!40000 ALTER TABLE `quotation_items` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `sales_order`
--

DROP TABLE IF EXISTS `sales_order`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `sales_order` (
  `id` int NOT NULL AUTO_INCREMENT,
  `customer_id` int NOT NULL,
  `fiscal_profile_id` int NOT NULL,
  `approved_by_id` int DEFAULT NULL,
  `released_by_id` int DEFAULT NULL,
  `source_quotation_id` int DEFAULT NULL,
  `payment_terms_id` int DEFAULT NULL,
  `created_by_id` int NOT NULL,
  `so_number` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `currency_code` varchar(3) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `approved_at` datetime DEFAULT NULL COMMENT '(DC2Type:datetime_immutable)',
  `released_at` datetime DEFAULT NULL COMMENT '(DC2Type:datetime_immutable)',
  `payment_terms_days` int DEFAULT NULL,
  `requested_delivery_date` date DEFAULT NULL,
  `customer_ponumber` longtext COLLATE utf8mb4_unicode_ci,
  `notes` longtext COLLATE utf8mb4_unicode_ci,
  `metadata_json` json DEFAULT NULL,
  `subtotal` decimal(15,4) NOT NULL,
  `tax_total` decimal(15,4) NOT NULL,
  `grand_total` decimal(15,4) NOT NULL,
  `created_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_36D222ED4237E00` (`so_number`),
  KEY `IDX_36D222E2D234F6A` (`approved_by_id`),
  KEY `IDX_36D222E445947DD` (`released_by_id`),
  KEY `IDX_36D222E620092D8` (`source_quotation_id`),
  KEY `IDX_36D222E13B26D4F` (`payment_terms_id`),
  KEY `IDX_36D222EB03A8386` (`created_by_id`),
  KEY `IDX_sales_order_number` (`so_number`),
  KEY `IDX_sales_order_status` (`status`),
  KEY `IDX_sales_order_customer` (`customer_id`),
  KEY `IDX_sales_order_fiscal` (`fiscal_profile_id`),
  CONSTRAINT `FK_36D222E13B26D4F` FOREIGN KEY (`payment_terms_id`) REFERENCES `pay_term` (`id`),
  CONSTRAINT `FK_36D222E2492F9BB` FOREIGN KEY (`fiscal_profile_id`) REFERENCES `fiscal_profile` (`id`),
  CONSTRAINT `FK_36D222E2D234F6A` FOREIGN KEY (`approved_by_id`) REFERENCES `user` (`id`),
  CONSTRAINT `FK_36D222E445947DD` FOREIGN KEY (`released_by_id`) REFERENCES `user` (`id`),
  CONSTRAINT `FK_36D222E620092D8` FOREIGN KEY (`source_quotation_id`) REFERENCES `quotation` (`id`),
  CONSTRAINT `FK_36D222E9395C3F3` FOREIGN KEY (`customer_id`) REFERENCES `company` (`id`),
  CONSTRAINT `FK_36D222EB03A8386` FOREIGN KEY (`created_by_id`) REFERENCES `user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `sales_order`
--

LOCK TABLES `sales_order` WRITE;
/*!40000 ALTER TABLE `sales_order` DISABLE KEYS */;
/*!40000 ALTER TABLE `sales_order` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `sales_order_line`
--

DROP TABLE IF EXISTS `sales_order_line`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `sales_order_line` (
  `id` int NOT NULL AUTO_INCREMENT,
  `sales_order_id` int NOT NULL,
  `article_id` int DEFAULT NULL,
  `sku` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `quantity` decimal(15,4) NOT NULL,
  `unit_price` decimal(15,4) NOT NULL,
  `discount_percent` decimal(15,4) DEFAULT NULL,
  `discount_amount` decimal(15,4) DEFAULT NULL,
  `tax_rate` decimal(15,4) DEFAULT NULL,
  `tax_amount` decimal(15,4) DEFAULT NULL,
  `line_total` decimal(15,4) DEFAULT NULL,
  `line_number` int DEFAULT NULL,
  `notes` longtext COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `IDX_93D9398DC023F51C` (`sales_order_id`),
  KEY `IDX_93D9398D7294869C` (`article_id`),
  CONSTRAINT `FK_93D9398D7294869C` FOREIGN KEY (`article_id`) REFERENCES `article` (`id`),
  CONSTRAINT `FK_93D9398DC023F51C` FOREIGN KEY (`sales_order_id`) REFERENCES `sales_order` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `sales_order_line`
--

LOCK TABLES `sales_order_line` WRITE;
/*!40000 ALTER TABLE `sales_order_line` DISABLE KEYS */;
/*!40000 ALTER TABLE `sales_order_line` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `shipment`
--

DROP TABLE IF EXISTS `shipment`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `shipment` (
  `id` int NOT NULL AUTO_INCREMENT,
  `sales_order_id` int DEFAULT NULL,
  `warehouse_id` int NOT NULL,
  `shipment_code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `order_reference` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `customer_name` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `shipping_address` longtext COLLATE utf8mb4_unicode_ci,
  `carrier` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tracking_number` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL,
  `packed_at` datetime DEFAULT NULL,
  `shipped_at` datetime DEFAULT NULL,
  `delivered_at` datetime DEFAULT NULL,
  `packed_by` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `shipped_by` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `total_weight` decimal(10,2) DEFAULT NULL,
  `number_of_boxes` int DEFAULT NULL,
  `notes` longtext COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_2CB20DC69CB66C6` (`shipment_code`),
  KEY `IDX_2CB20DCC023F51C` (`sales_order_id`),
  KEY `IDX_shipment_warehouse` (`warehouse_id`),
  KEY `IDX_shipment_status` (`status`),
  KEY `IDX_shipment_created_at` (`created_at`),
  KEY `IDX_shipment_shipped_at` (`shipped_at`),
  KEY `IDX_shipment_tracking_number` (`tracking_number`),
  CONSTRAINT `FK_2CB20DC5080ECDE` FOREIGN KEY (`warehouse_id`) REFERENCES `wms_warehouse` (`id`),
  CONSTRAINT `FK_2CB20DCC023F51C` FOREIGN KEY (`sales_order_id`) REFERENCES `sales_order` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `shipment`
--

LOCK TABLES `shipment` WRITE;
/*!40000 ALTER TABLE `shipment` DISABLE KEYS */;
/*!40000 ALTER TABLE `shipment` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `shipment_item`
--

DROP TABLE IF EXISTS `shipment_item`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `shipment_item` (
  `id` int NOT NULL AUTO_INCREMENT,
  `shipment_id` int NOT NULL,
  `article_id` int NOT NULL,
  `quantity` decimal(15,4) NOT NULL,
  `lpn_codes` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `lot_number` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `serial_number` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` longtext COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `IDX_1C573407BE036FC` (`shipment_id`),
  KEY `IDX_1C573407294869C` (`article_id`),
  CONSTRAINT `FK_1C573407294869C` FOREIGN KEY (`article_id`) REFERENCES `article` (`id`),
  CONSTRAINT `FK_1C573407BE036FC` FOREIGN KEY (`shipment_id`) REFERENCES `shipment` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `shipment_item`
--

LOCK TABLES `shipment_item` WRITE;
/*!40000 ALTER TABLE `shipment_item` DISABLE KEYS */;
/*!40000 ALTER TABLE `shipment_item` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `supplier_contact`
--

DROP TABLE IF EXISTS `supplier_contact`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `supplier_contact` (
  `id` int NOT NULL AUTO_INCREMENT,
  `supplier_id` int DEFAULT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_CD0792272ADD6D8C` (`supplier_id`),
  CONSTRAINT `FK_CD0792272ADD6D8C` FOREIGN KEY (`supplier_id`) REFERENCES `supplier_info` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `supplier_contact`
--

LOCK TABLES `supplier_contact` WRITE;
/*!40000 ALTER TABLE `supplier_contact` DISABLE KEYS */;
/*!40000 ALTER TABLE `supplier_contact` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `supplier_info`
--

DROP TABLE IF EXISTS `supplier_info`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `supplier_info` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type_id` int NOT NULL,
  `name` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  `billing_address` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `shipping_address` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `city` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_active` tinyint(1) NOT NULL,
  `tax_id` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is1099_contractor` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_6D1C7BE5E237E06` (`name`),
  KEY `IDX_6D1C7BEC54C8C93` (`type_id`),
  CONSTRAINT `FK_6D1C7BEC54C8C93` FOREIGN KEY (`type_id`) REFERENCES `supplier_type` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `supplier_info`
--

LOCK TABLES `supplier_info` WRITE;
/*!40000 ALTER TABLE `supplier_info` DISABLE KEYS */;
/*!40000 ALTER TABLE `supplier_info` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `supplier_invoice`
--

DROP TABLE IF EXISTS `supplier_invoice`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `supplier_invoice` (
  `id` int NOT NULL AUTO_INCREMENT,
  `supplier_id` int NOT NULL,
  `fiscal_profile_id` int NOT NULL,
  `purchase_order_id` int DEFAULT NULL,
  `approved_by_id` int DEFAULT NULL,
  `posted_by_id` int DEFAULT NULL,
  `paid_by_id` int DEFAULT NULL,
  `created_by_id` int NOT NULL,
  `supplier_invoice_number` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `invoice_date` date NOT NULL,
  `due_date` date NOT NULL,
  `currency_code` varchar(3) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `memo` longtext COLLATE utf8mb4_unicode_ci,
  `subtotal` decimal(15,4) NOT NULL,
  `tax_total` decimal(15,4) NOT NULL,
  `grand_total` decimal(15,4) NOT NULL,
  `amount_paid` decimal(15,4) NOT NULL,
  `amount_due` decimal(15,4) NOT NULL,
  `approved_at` datetime DEFAULT NULL COMMENT '(DC2Type:datetime_immutable)',
  `posted_at` datetime DEFAULT NULL COMMENT '(DC2Type:datetime_immutable)',
  `paid_at` datetime DEFAULT NULL COMMENT '(DC2Type:datetime_immutable)',
  `metadata_json` json DEFAULT NULL,
  `created_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_1100635B2492F9BB` (`fiscal_profile_id`),
  KEY `IDX_1100635BA45D7E6A` (`purchase_order_id`),
  KEY `IDX_1100635B2D234F6A` (`approved_by_id`),
  KEY `IDX_1100635B5A6D2235` (`posted_by_id`),
  KEY `IDX_1100635B7F9BC654` (`paid_by_id`),
  KEY `IDX_1100635BB03A8386` (`created_by_id`),
  KEY `IDX_supplier_invoice_number` (`supplier_invoice_number`),
  KEY `IDX_supplier_invoice_supplier` (`supplier_id`),
  KEY `IDX_supplier_invoice_status` (`status`),
  KEY `IDX_supplier_invoice_due_date` (`due_date`),
  CONSTRAINT `FK_1100635B2492F9BB` FOREIGN KEY (`fiscal_profile_id`) REFERENCES `fiscal_profile` (`id`),
  CONSTRAINT `FK_1100635B2ADD6D8C` FOREIGN KEY (`supplier_id`) REFERENCES `supplier_info` (`id`),
  CONSTRAINT `FK_1100635B2D234F6A` FOREIGN KEY (`approved_by_id`) REFERENCES `user` (`id`),
  CONSTRAINT `FK_1100635B5A6D2235` FOREIGN KEY (`posted_by_id`) REFERENCES `user` (`id`),
  CONSTRAINT `FK_1100635B7F9BC654` FOREIGN KEY (`paid_by_id`) REFERENCES `user` (`id`),
  CONSTRAINT `FK_1100635BA45D7E6A` FOREIGN KEY (`purchase_order_id`) REFERENCES `purchase_order` (`id`),
  CONSTRAINT `FK_1100635BB03A8386` FOREIGN KEY (`created_by_id`) REFERENCES `user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `supplier_invoice`
--

LOCK TABLES `supplier_invoice` WRITE;
/*!40000 ALTER TABLE `supplier_invoice` DISABLE KEYS */;
/*!40000 ALTER TABLE `supplier_invoice` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `supplier_invoice_line`
--

DROP TABLE IF EXISTS `supplier_invoice_line`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `supplier_invoice_line` (
  `id` int NOT NULL AUTO_INCREMENT,
  `supplier_invoice_id` int NOT NULL,
  `article_id` int DEFAULT NULL,
  `sku` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `quantity` decimal(15,4) NOT NULL,
  `unit_price` decimal(15,4) NOT NULL,
  `tax_amount` decimal(15,4) DEFAULT NULL,
  `line_number` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_B9B841CA48783C14` (`supplier_invoice_id`),
  KEY `IDX_B9B841CA7294869C` (`article_id`),
  CONSTRAINT `FK_B9B841CA48783C14` FOREIGN KEY (`supplier_invoice_id`) REFERENCES `supplier_invoice` (`id`) ON DELETE CASCADE,
  CONSTRAINT `FK_B9B841CA7294869C` FOREIGN KEY (`article_id`) REFERENCES `article` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `supplier_invoice_line`
--

LOCK TABLES `supplier_invoice_line` WRITE;
/*!40000 ALTER TABLE `supplier_invoice_line` DISABLE KEYS */;
/*!40000 ALTER TABLE `supplier_invoice_line` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `supplier_price_request`
--

DROP TABLE IF EXISTS `supplier_price_request`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `supplier_price_request` (
  `id` int NOT NULL AUTO_INCREMENT,
  `supplier_id` int DEFAULT NULL,
  `currency_id` int NOT NULL,
  `pay_term_id` int NOT NULL,
  `request_date` date NOT NULL,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_426CC7042ADD6D8C` (`supplier_id`),
  KEY `IDX_426CC70438248176` (`currency_id`),
  KEY `IDX_426CC704E8C6F237` (`pay_term_id`),
  CONSTRAINT `FK_426CC7042ADD6D8C` FOREIGN KEY (`supplier_id`) REFERENCES `supplier_info` (`id`),
  CONSTRAINT `FK_426CC70438248176` FOREIGN KEY (`currency_id`) REFERENCES `currency` (`id`),
  CONSTRAINT `FK_426CC704E8C6F237` FOREIGN KEY (`pay_term_id`) REFERENCES `pay_term` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `supplier_price_request`
--

LOCK TABLES `supplier_price_request` WRITE;
/*!40000 ALTER TABLE `supplier_price_request` DISABLE KEYS */;
/*!40000 ALTER TABLE `supplier_price_request` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `supplier_type`
--

DROP TABLE IF EXISTS `supplier_type`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `supplier_type` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_4186A1C08CDE5729` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `supplier_type`
--

LOCK TABLES `supplier_type` WRITE;
/*!40000 ALTER TABLE `supplier_type` DISABLE KEYS */;
/*!40000 ALTER TABLE `supplier_type` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `tax_rule`
--

DROP TABLE IF EXISTS `tax_rule`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tax_rule` (
  `id` int NOT NULL AUTO_INCREMENT,
  `fiscal_profile_id` int NOT NULL,
  `tax_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `scope` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rate` decimal(8,4) NOT NULL,
  `threshold_min` decimal(15,2) DEFAULT NULL,
  `threshold_max` decimal(15,2) DEFAULT NULL,
  `wage_base` decimal(15,2) DEFAULT NULL,
  `is_employer_portion` tinyint(1) NOT NULL,
  `is_active` tinyint(1) NOT NULL,
  `effective_year` int NOT NULL,
  `sort_order` int DEFAULT NULL,
  `notes` longtext COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `IDX_5A57A3342492F9BB` (`fiscal_profile_id`),
  CONSTRAINT `FK_5A57A3342492F9BB` FOREIGN KEY (`fiscal_profile_id`) REFERENCES `fiscal_profile` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `tax_rule`
--

LOCK TABLES `tax_rule` WRITE;
/*!40000 ALTER TABLE `tax_rule` DISABLE KEYS */;
/*!40000 ALTER TABLE `tax_rule` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `tn_invoice_extension`
--

DROP TABLE IF EXISTS `tn_invoice_extension`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tn_invoice_extension` (
  `id` int NOT NULL AUTO_INCREMENT,
  `invoice_id` int NOT NULL,
  `is_export` tinyint(1) NOT NULL,
  `stamp_duty` decimal(15,4) NOT NULL,
  `fodec_total` decimal(15,4) NOT NULL,
  `withholding_tax` decimal(15,4) NOT NULL,
  `droit_consommation` decimal(15,4) NOT NULL,
  `tcl_amount` decimal(15,4) NOT NULL,
  `efacture_status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `efacture_reference` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `efacture_qr_code` longtext COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_20AD12002989F1FD` (`invoice_id`),
  CONSTRAINT `FK_20AD12002989F1FD` FOREIGN KEY (`invoice_id`) REFERENCES `invoice` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `tn_invoice_extension`
--

LOCK TABLES `tn_invoice_extension` WRITE;
/*!40000 ALTER TABLE `tn_invoice_extension` DISABLE KEYS */;
/*!40000 ALTER TABLE `tn_invoice_extension` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `tn_invoice_line_extension`
--

DROP TABLE IF EXISTS `tn_invoice_line_extension`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tn_invoice_line_extension` (
  `id` int NOT NULL AUTO_INCREMENT,
  `invoice_line_id` int NOT NULL,
  `fodec_amount` decimal(15,2) NOT NULL,
  `droit_consommation` decimal(15,2) NOT NULL,
  `is_fodec_applicable` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_EEFBD163BFA24391` (`invoice_line_id`),
  CONSTRAINT `FK_EEFBD163BFA24391` FOREIGN KEY (`invoice_line_id`) REFERENCES `invoice_line` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `tn_invoice_line_extension`
--

LOCK TABLES `tn_invoice_line_extension` WRITE;
/*!40000 ALTER TABLE `tn_invoice_line_extension` DISABLE KEYS */;
/*!40000 ALTER TABLE `tn_invoice_line_extension` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `training_program`
--

DROP TABLE IF EXISTS `training_program`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `training_program` (
  `id` int NOT NULL AUTO_INCREMENT,
  `created_by_id` int NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` longtext COLLATE utf8mb4_unicode_ci,
  `type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `category` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `duration_hours` int DEFAULT NULL,
  `cost` decimal(10,2) DEFAULT NULL,
  `provider` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `location` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `max_participants` int DEFAULT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `requires_certification` tinyint(1) NOT NULL,
  `validity_months` int DEFAULT NULL,
  `prerequisites` longtext COLLATE utf8mb4_unicode_ci,
  `objectives` longtext COLLATE utf8mb4_unicode_ci,
  `material_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_4FD3E78AB03A8386` (`created_by_id`),
  CONSTRAINT `FK_4FD3E78AB03A8386` FOREIGN KEY (`created_by_id`) REFERENCES `user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `training_program`
--

LOCK TABLES `training_program` WRITE;
/*!40000 ALTER TABLE `training_program` DISABLE KEYS */;
/*!40000 ALTER TABLE `training_program` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `type_article`
--

DROP TABLE IF EXISTS `type_article`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `type_article` (
  `id` int NOT NULL AUTO_INCREMENT,
  `category_article_id` int NOT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_2A1B61935E237E06` (`name`),
  KEY `IDX_2A1B6193548AD6E2` (`category_article_id`),
  CONSTRAINT `FK_2A1B6193548AD6E2` FOREIGN KEY (`category_article_id`) REFERENCES `category_article` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `type_article`
--

LOCK TABLES `type_article` WRITE;
/*!40000 ALTER TABLE `type_article` DISABLE KEYS */;
/*!40000 ALTER TABLE `type_article` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `unit`
--

DROP TABLE IF EXISTS `unit`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `unit` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `abbreviation` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `active` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_DCBB0C535E237E06` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `unit`
--

LOCK TABLES `unit` WRITE;
/*!40000 ALTER TABLE `unit` DISABLE KEYS */;
/*!40000 ALTER TABLE `unit` ENABLE KEYS */;
UNLOCK TABLES;

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

DROP TABLE IF EXISTS `user`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `user` (
  `id` int NOT NULL AUTO_INCREMENT,
  `email` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `roles` json NOT NULL,
  `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `email_auth_code` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email_auth_code_generated_at` datetime DEFAULT NULL,
  `backup_codes` json DEFAULT NULL,
  `ui_preferences` json DEFAULT NULL COMMENT 'Deprecated: use typed columns ui_theme/ui_dark_mode/ui_table_density instead',
  `ui_theme` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'default',
  `ui_dark_mode` tinyint(1) NOT NULL DEFAULT '0',
  `ui_table_density` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'comfortable',
  `company_slug` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Primary company slug for multi-tenant scoping',
  `display_currency` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'User''s preferred display currency (e.g., USD, EUR, MAD)',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_8D93D649E7927C74` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

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

LOCK TABLES `user` WRITE;
/*!40000 ALTER TABLE `user` DISABLE KEYS */;
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `web_vitals_measurement`
--

DROP TABLE IF EXISTS `web_vitals_measurement`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `web_vitals_measurement` (
  `id` int NOT NULL AUTO_INCREMENT,
  `metric` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` double NOT NULL,
  `delta` double DEFAULT NULL,
  `rating` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `measurement_id` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `navigation_type` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `url` varchar(2048) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `environment` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `recorded_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  PRIMARY KEY (`id`),
  KEY `idx_wv_metric_recorded` (`metric`,`recorded_at`),
  KEY `idx_wv_recorded` (`recorded_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `web_vitals_measurement`
--

LOCK TABLES `web_vitals_measurement` WRITE;
/*!40000 ALTER TABLE `web_vitals_measurement` DISABLE KEYS */;
/*!40000 ALTER TABLE `web_vitals_measurement` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `web_vitals_weekly_report`
--

DROP TABLE IF EXISTS `web_vitals_weekly_report`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `web_vitals_weekly_report` (
  `id` int NOT NULL AUTO_INCREMENT,
  `week_label` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `metrics` json NOT NULL,
  `generated_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_WV_WEEK` (`week_label`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `web_vitals_weekly_report`
--

LOCK TABLES `web_vitals_weekly_report` WRITE;
/*!40000 ALTER TABLE `web_vitals_weekly_report` DISABLE KEYS */;
/*!40000 ALTER TABLE `web_vitals_weekly_report` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `wms_device`
--

DROP TABLE IF EXISTS `wms_device`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `wms_device` (
  `id` int NOT NULL AUTO_INCREMENT,
  `warehouse_id` int NOT NULL,
  `device_identifier` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `device_type` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `registered_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  `last_seen_at` datetime DEFAULT NULL,
  `capabilities` json DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_159C8864F01DC0AC` (`device_identifier`),
  KEY `IDX_159C88645080ECDE` (`warehouse_id`),
  CONSTRAINT `FK_159C88645080ECDE` FOREIGN KEY (`warehouse_id`) REFERENCES `wms_warehouse` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `wms_device`
--

LOCK TABLES `wms_device` WRITE;
/*!40000 ALTER TABLE `wms_device` DISABLE KEYS */;
/*!40000 ALTER TABLE `wms_device` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `wms_inventory_count`
--

DROP TABLE IF EXISTS `wms_inventory_count`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `wms_inventory_count` (
  `id` int NOT NULL AUTO_INCREMENT,
  `warehouse_id` int NOT NULL,
  `location_id` int DEFAULT NULL,
  `license_plate_id` int DEFAULT NULL,
  `created_by_id` int DEFAULT NULL,
  `scheduled_at` datetime NOT NULL,
  `counted_at` datetime DEFAULT NULL,
  `expected_qty` decimal(10,2) DEFAULT NULL,
  `counted_qty` decimal(10,2) DEFAULT NULL,
  `variance_qty` decimal(10,2) DEFAULT NULL,
  `status` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `notes` longtext COLLATE utf8mb4_unicode_ci,
  `created_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  PRIMARY KEY (`id`),
  KEY `IDX_39332855080ECDE` (`warehouse_id`),
  KEY `IDX_393328564D218E` (`location_id`),
  KEY `IDX_3933285233678BC` (`license_plate_id`),
  KEY `IDX_3933285B03A8386` (`created_by_id`),
  CONSTRAINT `FK_3933285233678BC` FOREIGN KEY (`license_plate_id`) REFERENCES `wms_license_plate` (`id`) ON DELETE SET NULL,
  CONSTRAINT `FK_39332855080ECDE` FOREIGN KEY (`warehouse_id`) REFERENCES `wms_warehouse` (`id`),
  CONSTRAINT `FK_393328564D218E` FOREIGN KEY (`location_id`) REFERENCES `wms_stock_location` (`id`) ON DELETE SET NULL,
  CONSTRAINT `FK_3933285B03A8386` FOREIGN KEY (`created_by_id`) REFERENCES `user` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `wms_inventory_count`
--

LOCK TABLES `wms_inventory_count` WRITE;
/*!40000 ALTER TABLE `wms_inventory_count` DISABLE KEYS */;
/*!40000 ALTER TABLE `wms_inventory_count` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `wms_license_plate`
--

DROP TABLE IF EXISTS `wms_license_plate`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `wms_license_plate` (
  `id` int NOT NULL AUTO_INCREMENT,
  `article_id` int DEFAULT NULL,
  `warehouse_id` int NOT NULL,
  `location_id` int DEFAULT NULL,
  `code` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `item_sku` varchar(120) COLLATE utf8mb4_unicode_ci NOT NULL,
  `quantity` decimal(10,2) NOT NULL,
  `uom` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `lot_number` varchar(60) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `expires_at` datetime DEFAULT NULL,
  `quarantined_at` datetime DEFAULT NULL,
  `high_value` tinyint(1) NOT NULL DEFAULT '0',
  `metadata` json DEFAULT NULL,
  `created_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_21A27CB777153098` (`code`),
  KEY `IDX_21A27CB77294869C` (`article_id`),
  KEY `IDX_21A27CB75080ECDE` (`warehouse_id`),
  KEY `IDX_21A27CB764D218E` (`location_id`),
  CONSTRAINT `FK_21A27CB75080ECDE` FOREIGN KEY (`warehouse_id`) REFERENCES `wms_warehouse` (`id`),
  CONSTRAINT `FK_21A27CB764D218E` FOREIGN KEY (`location_id`) REFERENCES `wms_stock_location` (`id`),
  CONSTRAINT `FK_21A27CB77294869C` FOREIGN KEY (`article_id`) REFERENCES `article` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `wms_license_plate`
--

LOCK TABLES `wms_license_plate` WRITE;
/*!40000 ALTER TABLE `wms_license_plate` DISABLE KEYS */;
/*!40000 ALTER TABLE `wms_license_plate` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `wms_relance`
--

DROP TABLE IF EXISTS `wms_relance`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `wms_relance` (
  `id` int NOT NULL AUTO_INCREMENT,
  `license_plate_id` int DEFAULT NULL,
  `assigned_to_id` int DEFAULT NULL,
  `reason` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  `due_at` datetime NOT NULL,
  `status` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_1078797E233678BC` (`license_plate_id`),
  KEY `IDX_1078797EF4BD7827` (`assigned_to_id`),
  CONSTRAINT `FK_1078797E233678BC` FOREIGN KEY (`license_plate_id`) REFERENCES `wms_license_plate` (`id`) ON DELETE SET NULL,
  CONSTRAINT `FK_1078797EF4BD7827` FOREIGN KEY (`assigned_to_id`) REFERENCES `user` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `wms_relance`
--

LOCK TABLES `wms_relance` WRITE;
/*!40000 ALTER TABLE `wms_relance` DISABLE KEYS */;
/*!40000 ALTER TABLE `wms_relance` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `wms_scrap_rebut`
--

DROP TABLE IF EXISTS `wms_scrap_rebut`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `wms_scrap_rebut` (
  `id` int NOT NULL AUTO_INCREMENT,
  `license_plate_id` int NOT NULL,
  `requested_by_id` int NOT NULL,
  `approved_by_id` int DEFAULT NULL,
  `quantity` decimal(10,2) NOT NULL,
  `status` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
  `reason` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `attachments` json DEFAULT NULL,
  `requires_dual_approval` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  `approved_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_7755C5AC233678BC` (`license_plate_id`),
  KEY `IDX_7755C5AC4DA1E751` (`requested_by_id`),
  KEY `IDX_7755C5AC2D234F6A` (`approved_by_id`),
  CONSTRAINT `FK_7755C5AC233678BC` FOREIGN KEY (`license_plate_id`) REFERENCES `wms_license_plate` (`id`),
  CONSTRAINT `FK_7755C5AC2D234F6A` FOREIGN KEY (`approved_by_id`) REFERENCES `user` (`id`) ON DELETE SET NULL,
  CONSTRAINT `FK_7755C5AC4DA1E751` FOREIGN KEY (`requested_by_id`) REFERENCES `user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `wms_scrap_rebut`
--

LOCK TABLES `wms_scrap_rebut` WRITE;
/*!40000 ALTER TABLE `wms_scrap_rebut` DISABLE KEYS */;
/*!40000 ALTER TABLE `wms_scrap_rebut` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `wms_stock_location`
--

DROP TABLE IF EXISTS `wms_stock_location`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `wms_stock_location` (
  `id` int NOT NULL AUTO_INCREMENT,
  `warehouse_id` int NOT NULL,
  `code` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
  `label` varchar(120) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
  `capacity` int NOT NULL,
  `occupied` int NOT NULL,
  `is_quarantine` tinyint(1) NOT NULL DEFAULT '0',
  `is_restricted` tinyint(1) NOT NULL DEFAULT '0',
  `is_secure` tinyint(1) NOT NULL DEFAULT '0',
  `attributes` json DEFAULT NULL,
  `created_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_C25A21775080ECDE` (`warehouse_id`),
  CONSTRAINT `FK_C25A21775080ECDE` FOREIGN KEY (`warehouse_id`) REFERENCES `wms_warehouse` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `wms_stock_location`
--

LOCK TABLES `wms_stock_location` WRITE;
/*!40000 ALTER TABLE `wms_stock_location` DISABLE KEYS */;
/*!40000 ALTER TABLE `wms_stock_location` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `wms_transaction`
--

DROP TABLE IF EXISTS `wms_transaction`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `wms_transaction` (
  `id` int NOT NULL AUTO_INCREMENT,
  `license_plate_id` int DEFAULT NULL,
  `source_location_id` int DEFAULT NULL,
  `target_location_id` int DEFAULT NULL,
  `performed_by_id` int DEFAULT NULL,
  `type` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
  `quantity` decimal(10,2) NOT NULL,
  `correlation_id` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,
  `metadata` json DEFAULT NULL,
  `created_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_21C848299924E382` (`correlation_id`),
  KEY `IDX_21C84829233678BC` (`license_plate_id`),
  KEY `IDX_21C848293A32712E` (`source_location_id`),
  KEY `IDX_21C8482981776E84` (`target_location_id`),
  KEY `IDX_21C848292E65C292` (`performed_by_id`),
  CONSTRAINT `FK_21C84829233678BC` FOREIGN KEY (`license_plate_id`) REFERENCES `wms_license_plate` (`id`) ON DELETE SET NULL,
  CONSTRAINT `FK_21C848292E65C292` FOREIGN KEY (`performed_by_id`) REFERENCES `user` (`id`) ON DELETE SET NULL,
  CONSTRAINT `FK_21C848293A32712E` FOREIGN KEY (`source_location_id`) REFERENCES `wms_stock_location` (`id`) ON DELETE SET NULL,
  CONSTRAINT `FK_21C8482981776E84` FOREIGN KEY (`target_location_id`) REFERENCES `wms_stock_location` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `wms_transaction`
--

LOCK TABLES `wms_transaction` WRITE;
/*!40000 ALTER TABLE `wms_transaction` DISABLE KEYS */;
/*!40000 ALTER TABLE `wms_transaction` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `wms_warehouse`
--

DROP TABLE IF EXISTS `wms_warehouse`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `wms_warehouse` (
  `id` int NOT NULL AUTO_INCREMENT,
  `code` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(120) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` longtext COLLATE utf8mb4_unicode_ci,
  `timezone` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'UTC',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_5B6B27DD77153098` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `wms_warehouse`
--

LOCK TABLES `wms_warehouse` WRITE;
/*!40000 ALTER TABLE `wms_warehouse` DISABLE KEYS */;
/*!40000 ALTER TABLE `wms_warehouse` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `wms_workstation`
--

DROP TABLE IF EXISTS `wms_workstation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `wms_workstation` (
  `id` int NOT NULL AUTO_INCREMENT,
  `warehouse_id` int NOT NULL,
  `workstation_code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `station_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `scanner_model` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `scanner_serial` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `connection_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `pc_hostname` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `current_user` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL,
  `registered_at` datetime NOT NULL,
  `last_activity` datetime NOT NULL,
  `api_token_hash` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `token_expires_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_9E0C94E8D85A4598` (`workstation_code`),
  UNIQUE KEY `UNIQ_9E0C94E874162BCB` (`api_token_hash`),
  KEY `IDX_9E0C94E85080ECDE` (`warehouse_id`),
  CONSTRAINT `FK_9E0C94E85080ECDE` FOREIGN KEY (`warehouse_id`) REFERENCES `wms_warehouse` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `wms_workstation`
--

LOCK TABLES `wms_workstation` WRITE;
/*!40000 ALTER TABLE `wms_workstation` DISABLE KEYS */;
/*!40000 ALTER TABLE `wms_workstation` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Dumping routines for database 'HRapp'
--
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2026-03-02 22:10:33
