-- MariaDB dump 10.19  Distrib 10.4.32-MariaDB, for Win64 (AMD64)
--
-- Host: localhost    Database: fleetnora
-- ------------------------------------------------------
-- Server version	10.4.32-MariaDB

/*!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 */;
/*!40101 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 `announcements`
--

DROP TABLE IF EXISTS `announcements`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `announcements` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `title` varchar(255) DEFAULT NULL,
  `body` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `announcements_tenant_id_index` (`tenant_id`),
  CONSTRAINT `announcements_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `announcements`
--

LOCK TABLES `announcements` WRITE;
/*!40000 ALTER TABLE `announcements` DISABLE KEYS */;
INSERT INTO `announcements` VALUES (1,1,'2026 izin dönemi','2026 yılı için izin talepleri açılmıştır.',1,'2026-09-20 14:39:04');
/*!40000 ALTER TABLE `announcements` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `audit_logs`
--

DROP TABLE IF EXISTS `audit_logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `audit_logs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `action` varchar(255) DEFAULT NULL,
  `entity` varchar(255) DEFAULT NULL,
  `entity_id` varchar(255) DEFAULT NULL,
  `meta` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`meta`)),
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `audit_logs_tenant_id_index` (`tenant_id`),
  KEY `audit_logs_user_id_index` (`user_id`),
  CONSTRAINT `audit_logs_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`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 `audit_logs`
--

LOCK TABLES `audit_logs` WRITE;
/*!40000 ALTER TABLE `audit_logs` DISABLE KEYS */;
/*!40000 ALTER TABLE `audit_logs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `cache`
--

DROP TABLE IF EXISTS `cache`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cache` (
  `key` varchar(255) NOT NULL,
  `value` mediumtext NOT NULL,
  `expiration` int(11) NOT NULL,
  PRIMARY KEY (`key`),
  KEY `cache_expiration_index` (`expiration`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `cache`
--

LOCK TABLES `cache` WRITE;
/*!40000 ALTER TABLE `cache` DISABLE KEYS */;
/*!40000 ALTER TABLE `cache` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `cache_locks`
--

DROP TABLE IF EXISTS `cache_locks`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cache_locks` (
  `key` varchar(255) NOT NULL,
  `owner` varchar(255) NOT NULL,
  `expiration` int(11) NOT NULL,
  PRIMARY KEY (`key`),
  KEY `cache_locks_expiration_index` (`expiration`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `cache_locks`
--

LOCK TABLES `cache_locks` WRITE;
/*!40000 ALTER TABLE `cache_locks` DISABLE KEYS */;
/*!40000 ALTER TABLE `cache_locks` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `cmr_scans`
--

DROP TABLE IF EXISTS `cmr_scans`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cmr_scans` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `job_id` bigint(20) unsigned DEFAULT NULL,
  `ecmr_id` bigint(20) unsigned DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `raw_path` varchar(255) DEFAULT NULL,
  `cropped_path` varchar(255) DEFAULT NULL,
  `corners` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`corners`)),
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `cmr_scans_tenant_id_index` (`tenant_id`),
  KEY `cmr_scans_job_id_index` (`job_id`),
  KEY `cmr_scans_ecmr_id_index` (`ecmr_id`),
  KEY `cmr_scans_user_id_index` (`user_id`),
  CONSTRAINT `cmr_scans_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `cmr_scans`
--

LOCK TABLES `cmr_scans` WRITE;
/*!40000 ALTER TABLE `cmr_scans` DISABLE KEYS */;
INSERT INTO `cmr_scans` VALUES (1,1,NULL,NULL,2,'cmr-taramalar/1/NaEi52y2U863Juf20qEmCy4GRu2iov7F4WEEOHps.jpg','cmr-taramalar/1/kirpilmis-PzbUcMLJEbsr.jpg','{\"topLeftCorner\":{\"x\":48.543,\"y\":26.47800323217813},\"topRightCorner\":{\"x\":1428.341,\"y\":0},\"bottomLeftCorner\":{\"x\":0,\"y\":2048},\"bottomRightCorner\":{\"x\":1471,\"y\":2048}}','2026-09-26 19:13:20');
/*!40000 ALTER TABLE `cmr_scans` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `company_documents`
--

DROP TABLE IF EXISTS `company_documents`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `company_documents` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `doc_type` varchar(255) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `expires_on` date DEFAULT NULL,
  `file_path` varchar(255) DEFAULT NULL,
  `note` text DEFAULT NULL,
  `alerted_for` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `company_documents_tenant_id_index` (`tenant_id`),
  CONSTRAINT `company_documents_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `company_documents`
--

LOCK TABLES `company_documents` WRITE;
/*!40000 ALTER TABLE `company_documents` DISABLE KEYS */;
INSERT INTO `company_documents` VALUES (1,1,'cemt','CEMT belgesi','2026-12-31',NULL,NULL,NULL),(2,1,'topluluk','Topluluk belgesi','2027-03-01',NULL,NULL,NULL);
/*!40000 ALTER TABLE `company_documents` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `company_events`
--

DROP TABLE IF EXISTS `company_events`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `company_events` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `title` varchar(255) DEFAULT NULL,
  `event_date` date DEFAULT NULL,
  `body` text DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `company_events_tenant_id_index` (`tenant_id`),
  CONSTRAINT `company_events_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`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 `company_events`
--

LOCK TABLES `company_events` WRITE;
/*!40000 ALTER TABLE `company_events` DISABLE KEYS */;
/*!40000 ALTER TABLE `company_events` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `customers`
--

DROP TABLE IF EXISTS `customers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `customers` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `vat` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `kind` varchar(255) NOT NULL DEFAULT 'customer',
  `tracking_token` varchar(40) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `customers_tracking_token_unique` (`tracking_token`),
  KEY `customers_tenant_id_index` (`tenant_id`),
  CONSTRAINT `customers_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `customers`
--

LOCK TABLES `customers` WRITE;
/*!40000 ALTER TABLE `customers` DISABLE KEYS */;
INSERT INTO `customers` VALUES (1,1,'Rhein Cargo GmbH','DE111','+49 211 111',NULL,'customer','OOLZoevtXwayq44a5OG7B28Ao9sLrJGS'),(2,1,'Benelux Freight BV','NL222','+31 10 222',NULL,'customer',NULL),(3,1,'Nordic Trans AS','NO333','+47 22 333',NULL,'customer',NULL),(4,4,'Marmara Tekstil Ltd.',NULL,'+90 212 555 00 00','info@marmaratekstil-demo.local','customer',NULL);
/*!40000 ALTER TABLE `customers` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `ecmr_custom_field_defs`
--

DROP TABLE IF EXISTS `ecmr_custom_field_defs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ecmr_custom_field_defs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `key` varchar(255) NOT NULL,
  `label` varchar(255) NOT NULL,
  `type` varchar(255) NOT NULL DEFAULT 'text',
  `section` varchar(255) NOT NULL DEFAULT 'ek',
  `sort_order` int(10) unsigned NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ecmr_custom_field_defs_tenant_id_key_unique` (`tenant_id`,`key`),
  KEY `ecmr_custom_field_defs_tenant_id_index` (`tenant_id`),
  CONSTRAINT `ecmr_custom_field_defs_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `ecmr_custom_field_defs`
--

LOCK TABLES `ecmr_custom_field_defs` WRITE;
/*!40000 ALTER TABLE `ecmr_custom_field_defs` DISABLE KEYS */;
INSERT INTO `ecmr_custom_field_defs` VALUES (1,1,'siparis_numarasi','Sipariş Numarası','text','ek',0,'2026-09-25 20:28:05','2026-09-25 20:28:05'),(2,4,'siparis_no','Sipariş No','text','yuk',0,'2026-09-26 16:52:00','2026-09-26 17:05:47'),(3,1,'gumruk_no','Gümrük Beyan No','text','talimat',1,'2026-09-26 17:05:47','2026-09-26 17:05:47');
/*!40000 ALTER TABLE `ecmr_custom_field_defs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `ecmr_events`
--

DROP TABLE IF EXISTS `ecmr_events`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ecmr_events` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `ecmr_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `event_type` varchar(255) DEFAULT NULL,
  `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`payload`)),
  `hash` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ecmr_events_tenant_id_index` (`tenant_id`),
  KEY `ecmr_events_ecmr_id_index` (`ecmr_id`),
  KEY `ecmr_events_user_id_index` (`user_id`),
  CONSTRAINT `ecmr_events_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`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 `ecmr_events`
--

LOCK TABLES `ecmr_events` WRITE;
/*!40000 ALTER TABLE `ecmr_events` DISABLE KEYS */;
/*!40000 ALTER TABLE `ecmr_events` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `ecmr_goods_lines`
--

DROP TABLE IF EXISTS `ecmr_goods_lines`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ecmr_goods_lines` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `ecmr_id` bigint(20) unsigned NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  `qty` int(10) unsigned DEFAULT NULL,
  `weight` decimal(10,2) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ecmr_goods_lines_tenant_id_index` (`tenant_id`),
  KEY `ecmr_goods_lines_ecmr_id_index` (`ecmr_id`),
  CONSTRAINT `ecmr_goods_lines_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `ecmr_goods_lines`
--

LOCK TABLES `ecmr_goods_lines` WRITE;
/*!40000 ALTER TABLE `ecmr_goods_lines` DISABLE KEYS */;
INSERT INTO `ecmr_goods_lines` VALUES (1,1,1,'Genel kargo (paletli)',22,22000.00);
/*!40000 ALTER TABLE `ecmr_goods_lines` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `ecmr_signatures`
--

DROP TABLE IF EXISTS `ecmr_signatures`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ecmr_signatures` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `ecmr_id` bigint(20) unsigned NOT NULL,
  `party` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `token` varchar(255) DEFAULT NULL,
  `image_path` varchar(255) DEFAULT NULL,
  `signed_at` timestamp NULL DEFAULT NULL,
  `ip` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ecmr_signatures_tenant_id_index` (`tenant_id`),
  KEY `ecmr_signatures_ecmr_id_index` (`ecmr_id`),
  CONSTRAINT `ecmr_signatures_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`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 `ecmr_signatures`
--

LOCK TABLES `ecmr_signatures` WRITE;
/*!40000 ALTER TABLE `ecmr_signatures` DISABLE KEYS */;
/*!40000 ALTER TABLE `ecmr_signatures` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `ecmrs`
--

DROP TABLE IF EXISTS `ecmrs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ecmrs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `job_id` bigint(20) unsigned NOT NULL,
  `ecmr_no` varchar(255) DEFAULT NULL,
  `version` smallint(5) unsigned NOT NULL DEFAULT 1,
  `place` varchar(255) DEFAULT NULL,
  `issue_date` date DEFAULT NULL,
  `sender_name` varchar(255) DEFAULT NULL,
  `sender_addr` varchar(255) DEFAULT NULL,
  `consignee_name` varchar(255) DEFAULT NULL,
  `consignee_addr` varchar(255) DEFAULT NULL,
  `carrier_name` varchar(255) DEFAULT NULL,
  `carrier_addr` varchar(255) DEFAULT NULL,
  `take_place` varchar(255) DEFAULT NULL,
  `take_date` date DEFAULT NULL,
  `delivery_place` varchar(255) DEFAULT NULL,
  `packages` int(10) unsigned DEFAULT NULL,
  `packing` varchar(255) DEFAULT NULL,
  `goods` text DEFAULT NULL,
  `marks` varchar(255) DEFAULT NULL,
  `weight` decimal(10,2) DEFAULT NULL,
  `volume` decimal(10,2) DEFAULT NULL,
  `sender_instructions` text DEFAULT NULL,
  `payment_inst` varchar(255) DEFAULT NULL,
  `reservations` text DEFAULT NULL,
  `special` text DEFAULT NULL,
  `custom_fields` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`custom_fields`)),
  `status` varchar(255) NOT NULL DEFAULT 'draft',
  `locked` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ecmrs_tenant_id_index` (`tenant_id`),
  KEY `ecmrs_job_id_index` (`job_id`),
  CONSTRAINT `ecmrs_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `ecmrs`
--

LOCK TABLES `ecmrs` WRITE;
/*!40000 ALTER TABLE `ecmrs` DISABLE KEYS */;
INSERT INTO `ecmrs` VALUES (1,1,1,'CMR-2026-0001',1,'Duisburg','2026-08-28','Rhein Cargo GmbH','Hafen 1, 47119 Duisburg, Almanya','Antwerp Distribution NV','Haven 200, 2000 Antwerpen, Belçika','Örnek Lojistik GmbH','Hafenstr. 12, 47119 Duisburg, Almanya','Duisburg','2026-08-28','Antwerpen',22,'Palet','Genel kargo, paletli','BK-8891',22000.00,64.50,'Kuru, sızdırmaz taşıma.','Navlun: alıcı öder',NULL,NULL,NULL,'issued',0,'2026-09-20 14:39:04'),(6,4,4,'000001',1,NULL,NULL,'Aydın Nakliyat A.Ş.','Organize Sanayi Bölgesi, İstanbul','Marmara Tekstil Ltd.','Nilüfer OSB, Bursa',NULL,NULL,'İstanbul',NULL,'Bursa',NULL,NULL,'Tekstil ürünleri, paletli',NULL,1800.00,NULL,NULL,NULL,NULL,NULL,NULL,'draft',0,'2026-09-26 11:50:48');
/*!40000 ALTER TABLE `ecmrs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `equipment_items`
--

DROP TABLE IF EXISTS `equipment_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `equipment_items` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `sort_order` int(10) unsigned NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `equipment_items_tenant_id_index` (`tenant_id`),
  CONSTRAINT `equipment_items_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `equipment_items`
--

LOCK TABLES `equipment_items` WRITE;
/*!40000 ALTER TABLE `equipment_items` DISABLE KEYS */;
INSERT INTO `equipment_items` VALUES (1,1,'Baret',0),(2,1,'Çekiç',1),(3,1,'Gerdirme/kolon',2),(4,1,'Kemer',3),(5,1,'Zincir',4),(6,1,'Takoz',5),(7,1,'Üçgen',6),(8,1,'Yangın söndürücü',7),(9,1,'İlk yardım',8),(10,1,'Yelek',9),(11,1,'Eldiven',10),(12,1,'Fener',11),(13,1,'ADR çantası',12),(14,1,'Branda/kilit',13),(15,4,'Kırık zincir',0),(16,4,'Yedek lastik',1),(17,4,'İlk yardım çantası',2);
/*!40000 ALTER TABLE `equipment_items` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `expense_photos`
--

DROP TABLE IF EXISTS `expense_photos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `expense_photos` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `expense_id` bigint(20) unsigned NOT NULL,
  `path` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `expense_photos_tenant_id_index` (`tenant_id`),
  KEY `expense_photos_expense_id_index` (`expense_id`),
  CONSTRAINT `expense_photos_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`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 `expense_photos`
--

LOCK TABLES `expense_photos` WRITE;
/*!40000 ALTER TABLE `expense_photos` DISABLE KEYS */;
/*!40000 ALTER TABLE `expense_photos` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `expenses`
--

DROP TABLE IF EXISTS `expenses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `expenses` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned NOT NULL,
  `job_id` bigint(20) unsigned DEFAULT NULL,
  `vehicle_id` bigint(20) unsigned DEFAULT NULL,
  `fuel_log_id` bigint(20) unsigned DEFAULT NULL,
  `kind` varchar(255) DEFAULT NULL,
  `amount` decimal(10,2) DEFAULT NULL,
  `currency` varchar(3) NOT NULL DEFAULT 'EUR',
  `status` varchar(255) NOT NULL DEFAULT 'submitted',
  `note` text DEFAULT NULL,
  `decided_by` bigint(20) unsigned DEFAULT NULL,
  `decided_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `expenses_tenant_id_index` (`tenant_id`),
  KEY `expenses_user_id_index` (`user_id`),
  KEY `expenses_job_id_index` (`job_id`),
  KEY `expenses_vehicle_id_index` (`vehicle_id`),
  KEY `expenses_fuel_log_id_index` (`fuel_log_id`),
  KEY `expenses_decided_by_index` (`decided_by`),
  CONSTRAINT `expenses_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `expenses`
--

LOCK TABLES `expenses` WRITE;
/*!40000 ALTER TABLE `expenses` DISABLE KEYS */;
INSERT INTO `expenses` VALUES (1,1,4,NULL,NULL,NULL,'otoyol',84.50,'EUR','submitted','A12 otoyol geçişi',NULL,NULL,'2026-09-20 14:39:04'),(2,1,4,NULL,NULL,NULL,'park',22.00,'EUR','approved','Venlo gecelik park',2,'2026-09-24 16:14:15','2026-09-20 14:39:04'),(3,1,5,NULL,NULL,NULL,'yemek',15.90,'EUR','approved','Yol yemeği',2,'2026-09-18 14:39:04','2026-09-20 14:39:04'),(4,1,5,NULL,NULL,NULL,'diger',120.00,'EUR','rejected','Fatura eksik',2,'2026-09-19 14:39:04','2026-09-20 14:39:04'),(5,4,11,NULL,4,NULL,'Yakıt',850.00,'EUR','approved','Otoyol + yakıt',NULL,NULL,'2026-09-26 16:52:00'),(6,4,11,NULL,NULL,NULL,'Konaklama',65.00,'EUR','submitted','Gece konaklaması',NULL,NULL,'2026-09-26 16:52:00');
/*!40000 ALTER TABLE `expenses` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `expiry_notifications_log`
--

DROP TABLE IF EXISTS `expiry_notifications_log`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `expiry_notifications_log` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `subject_type` varchar(255) NOT NULL,
  `subject_id` bigint(20) unsigned NOT NULL,
  `doc_type` varchar(255) NOT NULL,
  `threshold_days` smallint(6) NOT NULL,
  `notified_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `expiry_notif_unique` (`subject_type`,`subject_id`,`doc_type`,`threshold_days`),
  KEY `expiry_notifications_log_tenant_id_index` (`tenant_id`),
  CONSTRAINT `expiry_notifications_log_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `expiry_notifications_log`
--

LOCK TABLES `expiry_notifications_log` WRITE;
/*!40000 ALTER TABLE `expiry_notifications_log` DISABLE KEYS */;
INSERT INTO `expiry_notifications_log` VALUES (1,1,'vehicle',3,'inspection_exp',7,'2026-09-20 15:07:03'),(2,1,'vehicle',3,'tacho_cal_exp',15,'2026-09-20 15:07:04');
/*!40000 ALTER TABLE `expiry_notifications_log` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `failed_jobs`
--

DROP TABLE IF EXISTS `failed_jobs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `failed_jobs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) NOT NULL,
  `connection` text NOT NULL,
  `queue` text NOT NULL,
  `payload` longtext NOT NULL,
  `exception` longtext NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `failed_jobs`
--

LOCK TABLES `failed_jobs` WRITE;
/*!40000 ALTER TABLE `failed_jobs` DISABLE KEYS */;
/*!40000 ALTER TABLE `failed_jobs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `fuel_logs`
--

DROP TABLE IF EXISTS `fuel_logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `fuel_logs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned NOT NULL,
  `vehicle_id` bigint(20) unsigned NOT NULL,
  `job_id` bigint(20) unsigned DEFAULT NULL,
  `fuel_type` varchar(255) DEFAULT NULL,
  `source` varchar(255) DEFAULT NULL,
  `liters` decimal(8,2) DEFAULT NULL,
  `unit_price` decimal(8,3) DEFAULT NULL,
  `currency` varchar(3) NOT NULL DEFAULT 'EUR',
  `total` decimal(10,2) DEFAULT NULL,
  `km` int(10) unsigned DEFAULT NULL,
  `tank_pct` tinyint(3) unsigned DEFAULT NULL,
  `is_full` tinyint(1) NOT NULL DEFAULT 0,
  `station` varchar(255) DEFAULT NULL,
  `country` varchar(2) DEFAULT NULL,
  `lat` decimal(10,7) DEFAULT NULL,
  `lng` decimal(10,7) DEFAULT NULL,
  `pay_method` varchar(255) DEFAULT NULL,
  `card_last4` varchar(4) DEFAULT NULL,
  `receipt_path` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fuel_logs_tenant_id_index` (`tenant_id`),
  KEY `fuel_logs_user_id_index` (`user_id`),
  KEY `fuel_logs_vehicle_id_index` (`vehicle_id`),
  KEY `fuel_logs_job_id_index` (`job_id`),
  CONSTRAINT `fuel_logs_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `fuel_logs`
--

LOCK TABLES `fuel_logs` WRITE;
/*!40000 ALTER TABLE `fuel_logs` DISABLE KEYS */;
INSERT INTO `fuel_logs` VALUES (1,1,4,1,NULL,'dizel','istasyon',420.00,1.620,'EUR',680.40,182340,95,1,'Shell Duisburg','DE',NULL,NULL,NULL,NULL,NULL,'2026-09-20 14:39:04'),(2,1,4,1,NULL,'adblue','istasyon',40.00,0.750,'EUR',30.00,182340,NULL,0,'Shell Duisburg','DE',NULL,NULL,NULL,NULL,NULL,'2026-09-20 14:39:04'),(3,1,5,2,NULL,'dizel','istasyon',380.00,1.580,'EUR',600.40,96210,90,1,'Total Venlo','NL',NULL,NULL,NULL,NULL,NULL,'2026-09-20 14:39:04'),(4,4,8,4,NULL,NULL,'manual',150.00,23.330,'TRY',3500.00,85200,NULL,0,'Shell İkitelli',NULL,NULL,NULL,NULL,NULL,NULL,'2026-09-26 11:50:48');
/*!40000 ALTER TABLE `fuel_logs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `geofence_zones`
--

DROP TABLE IF EXISTS `geofence_zones`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `geofence_zones` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `kind` varchar(255) NOT NULL DEFAULT 'custom',
  `yard_id` bigint(20) unsigned DEFAULT NULL,
  `customer_id` bigint(20) unsigned DEFAULT NULL,
  `lat` decimal(10,7) NOT NULL,
  `lng` decimal(10,7) NOT NULL,
  `radius_m` int(10) unsigned NOT NULL DEFAULT 500,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`),
  KEY `geofence_zones_tenant_id_index` (`tenant_id`),
  CONSTRAINT `geofence_zones_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `geofence_zones`
--

LOCK TABLES `geofence_zones` WRITE;
/*!40000 ALTER TABLE `geofence_zones` DISABLE KEYS */;
INSERT INTO `geofence_zones` VALUES (1,1,'Duisburg Depo Sahası','yard',NULL,NULL,51.4344000,6.7623000,300,1),(2,1,'Rotterdam Liman Bölgesi','custom',NULL,NULL,51.9244000,4.4777000,500,1),(3,4,'İstanbul Ana Depo Bölgesi','yard',3,NULL,41.1244000,28.6172000,250,1);
/*!40000 ALTER TABLE `geofence_zones` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `handbook_files`
--

DROP TABLE IF EXISTS `handbook_files`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `handbook_files` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `title` varchar(255) DEFAULT NULL,
  `path` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `handbook_files_tenant_id_index` (`tenant_id`),
  CONSTRAINT `handbook_files_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`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 `handbook_files`
--

LOCK TABLES `handbook_files` WRITE;
/*!40000 ALTER TABLE `handbook_files` DISABLE KEYS */;
/*!40000 ALTER TABLE `handbook_files` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `handover_checklist`
--

DROP TABLE IF EXISTS `handover_checklist`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `handover_checklist` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `handover_id` bigint(20) unsigned NOT NULL,
  `item_id` bigint(20) unsigned NOT NULL,
  `state` varchar(255) DEFAULT NULL,
  `photo_path` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `handover_checklist_tenant_id_index` (`tenant_id`),
  KEY `handover_checklist_handover_id_index` (`handover_id`),
  KEY `handover_checklist_item_id_index` (`item_id`),
  CONSTRAINT `handover_checklist_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`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 `handover_checklist`
--

LOCK TABLES `handover_checklist` WRITE;
/*!40000 ALTER TABLE `handover_checklist` DISABLE KEYS */;
/*!40000 ALTER TABLE `handover_checklist` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `handover_photos`
--

DROP TABLE IF EXISTS `handover_photos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `handover_photos` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `vehicle_handover_id` bigint(20) unsigned DEFAULT NULL,
  `trailer_handover_id` bigint(20) unsigned DEFAULT NULL,
  `slot` varchar(255) DEFAULT NULL,
  `path` varchar(255) DEFAULT NULL,
  `note` text DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `handover_photos_tenant_id_index` (`tenant_id`),
  KEY `handover_photos_vehicle_handover_id_index` (`vehicle_handover_id`),
  KEY `handover_photos_trailer_handover_id_index` (`trailer_handover_id`),
  CONSTRAINT `handover_photos_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`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 `handover_photos`
--

LOCK TABLES `handover_photos` WRITE;
/*!40000 ALTER TABLE `handover_photos` DISABLE KEYS */;
/*!40000 ALTER TABLE `handover_photos` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `invoices`
--

DROP TABLE IF EXISTS `invoices`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `invoices` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `subscription_id` bigint(20) unsigned DEFAULT NULL,
  `plan_id` bigint(20) unsigned DEFAULT NULL,
  `amount` decimal(10,2) NOT NULL,
  `currency` varchar(3) NOT NULL DEFAULT 'TRY',
  `status` varchar(255) NOT NULL DEFAULT 'pending',
  `period_start` date DEFAULT NULL,
  `period_end` date DEFAULT NULL,
  `due_at` timestamp NULL DEFAULT NULL,
  `paid_at` timestamp NULL DEFAULT NULL,
  `pdf_path` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `invoices_tenant_id_index` (`tenant_id`),
  CONSTRAINT `invoices_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `invoices`
--

LOCK TABLES `invoices` WRITE;
/*!40000 ALTER TABLE `invoices` DISABLE KEYS */;
INSERT INTO `invoices` VALUES (1,1,1,3,129.00,'EUR','pending','2026-09-22','2026-10-22','2026-09-25 16:20:29',NULL,NULL,'2026-09-22 16:20:29','2026-09-22 16:20:29');
/*!40000 ALTER TABLE `invoices` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `job_attachments`
--

DROP TABLE IF EXISTS `job_attachments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `job_attachments` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `job_id` bigint(20) unsigned NOT NULL,
  `path` varchar(255) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `job_attachments_tenant_id_index` (`tenant_id`),
  KEY `job_attachments_job_id_index` (`job_id`),
  CONSTRAINT `job_attachments_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`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 `job_attachments`
--

LOCK TABLES `job_attachments` WRITE;
/*!40000 ALTER TABLE `job_attachments` DISABLE KEYS */;
/*!40000 ALTER TABLE `job_attachments` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `job_batches`
--

DROP TABLE IF EXISTS `job_batches`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `job_batches` (
  `id` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `total_jobs` int(11) NOT NULL,
  `pending_jobs` int(11) NOT NULL,
  `failed_jobs` int(11) NOT NULL,
  `failed_job_ids` longtext NOT NULL,
  `options` mediumtext DEFAULT NULL,
  `cancelled_at` int(11) DEFAULT NULL,
  `created_at` int(11) NOT NULL,
  `finished_at` int(11) 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 `job_batches`
--

LOCK TABLES `job_batches` WRITE;
/*!40000 ALTER TABLE `job_batches` DISABLE KEYS */;
/*!40000 ALTER TABLE `job_batches` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `job_events`
--

DROP TABLE IF EXISTS `job_events`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `job_events` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `job_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `lat` decimal(10,7) DEFAULT NULL,
  `lng` decimal(10,7) DEFAULT NULL,
  `note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `job_events_tenant_id_index` (`tenant_id`),
  KEY `job_events_job_id_index` (`job_id`),
  KEY `job_events_user_id_index` (`user_id`),
  CONSTRAINT `job_events_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `job_events`
--

LOCK TABLES `job_events` WRITE;
/*!40000 ALTER TABLE `job_events` DISABLE KEYS */;
INSERT INTO `job_events` VALUES (1,1,1,2,'in_progress',NULL,NULL,'Kanban: Şoföre atandı → Yolda','2026-09-22 15:51:21'),(2,1,1,2,'assigned',NULL,NULL,'Kanban: Yolda → Şoföre atandı','2026-09-22 15:51:22'),(3,1,1,3,'in_progress',NULL,NULL,'Kanban: Şoföre atandı → Yolda','2026-09-22 18:00:19'),(4,1,1,3,'assigned',NULL,NULL,'Kanban: Yolda → Şoföre atandı','2026-09-22 18:00:21'),(5,1,2,2,'in_progress',NULL,NULL,'Kanban: Şoföre atandı → Yolda','2026-09-24 16:13:20'),(6,1,2,2,'assigned',NULL,NULL,'Kanban: Yolda → Şoföre atandı','2026-09-26 16:50:02');
/*!40000 ALTER TABLE `job_events` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `job_messages`
--

DROP TABLE IF EXISTS `job_messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `job_messages` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `job_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned NOT NULL,
  `body` text NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `job_messages_tenant_id_index` (`tenant_id`),
  KEY `job_messages_job_id_index` (`job_id`),
  KEY `job_messages_user_id_index` (`user_id`),
  CONSTRAINT `job_messages_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`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 `job_messages`
--

LOCK TABLES `job_messages` WRITE;
/*!40000 ALTER TABLE `job_messages` DISABLE KEYS */;
/*!40000 ALTER TABLE `job_messages` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `job_stop_photos`
--

DROP TABLE IF EXISTS `job_stop_photos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `job_stop_photos` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `stop_id` bigint(20) unsigned NOT NULL,
  `task_id` bigint(20) unsigned DEFAULT NULL,
  `slot` varchar(255) DEFAULT NULL,
  `path` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `job_stop_photos_tenant_id_index` (`tenant_id`),
  KEY `job_stop_photos_stop_id_index` (`stop_id`),
  KEY `job_stop_photos_task_id_index` (`task_id`),
  CONSTRAINT `job_stop_photos_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`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 `job_stop_photos`
--

LOCK TABLES `job_stop_photos` WRITE;
/*!40000 ALTER TABLE `job_stop_photos` DISABLE KEYS */;
/*!40000 ALTER TABLE `job_stop_photos` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `job_stop_tasks`
--

DROP TABLE IF EXISTS `job_stop_tasks`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `job_stop_tasks` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `stop_id` bigint(20) unsigned NOT NULL,
  `seq` smallint(5) unsigned NOT NULL DEFAULT 1,
  `title` varchar(255) DEFAULT NULL,
  `kind` varchar(255) NOT NULL DEFAULT 'check',
  `required` tinyint(1) NOT NULL DEFAULT 1,
  `is_done` tinyint(1) NOT NULL DEFAULT 0,
  `form_total` smallint(5) unsigned NOT NULL DEFAULT 0,
  `form_answered` smallint(5) unsigned NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `job_stop_tasks_tenant_id_index` (`tenant_id`),
  KEY `job_stop_tasks_stop_id_index` (`stop_id`),
  CONSTRAINT `job_stop_tasks_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `job_stop_tasks`
--

LOCK TABLES `job_stop_tasks` WRITE;
/*!40000 ALTER TABLE `job_stop_tasks` DISABLE KEYS */;
INSERT INTO `job_stop_tasks` VALUES (1,1,3,1,'Boş konteyner yerleştir','form',1,0,6,0),(2,1,4,1,'Yükleme','form',1,0,5,0),(3,1,4,2,'Yükü al','check',1,0,0,0),(4,1,5,1,'İndirme','form',1,0,4,0),(5,1,5,2,'Dolu konteyner bırak','check',1,0,0,0);
/*!40000 ALTER TABLE `job_stop_tasks` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `job_stops`
--

DROP TABLE IF EXISTS `job_stops`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `job_stops` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `job_id` bigint(20) unsigned NOT NULL,
  `seq` smallint(5) unsigned NOT NULL DEFAULT 1,
  `stop_kind` varchar(255) DEFAULT NULL,
  `location_id` bigint(20) unsigned DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `street` varchar(255) DEFAULT NULL,
  `zip` varchar(255) DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `country` varchar(2) DEFAULT NULL,
  `lat` decimal(10,7) DEFAULT NULL,
  `lng` decimal(10,7) DEFAULT NULL,
  `window_from` timestamp NULL DEFAULT NULL,
  `window_to` timestamp NULL DEFAULT NULL,
  `contact_name` varchar(255) DEFAULT NULL,
  `contact_phone` varchar(255) DEFAULT NULL,
  `gate_code` varchar(255) DEFAULT NULL,
  `dispatcher_note` text DEFAULT NULL,
  `action_code` varchar(255) DEFAULT NULL,
  `action_label` varchar(255) DEFAULT NULL,
  `instructions` text DEFAULT NULL,
  `product_note` varchar(255) DEFAULT NULL,
  `container_note` varchar(255) DEFAULT NULL,
  `stop_status` varchar(255) NOT NULL DEFAULT 'pending',
  `wait_started_at` timestamp NULL DEFAULT NULL,
  `wait_ended_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `job_stops_tenant_id_index` (`tenant_id`),
  KEY `job_stops_job_id_index` (`job_id`),
  KEY `job_stops_location_id_index` (`location_id`),
  CONSTRAINT `job_stops_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `job_stops`
--

LOCK TABLES `job_stops` WRITE;
/*!40000 ALTER TABLE `job_stops` DISABLE KEYS */;
INSERT INTO `job_stops` VALUES (1,1,1,1,'yukleme',1,'Yükleme Duisburg',NULL,NULL,'Duisburg','DE',51.4500000,6.7500000,NULL,NULL,'Hans','+49 170 1','R4','Branda kontrol',NULL,NULL,NULL,NULL,NULL,'pending',NULL,NULL),(2,1,1,2,'indirme',2,'Boşaltma Antwerp',NULL,NULL,'Antwerpen','BE',51.2410000,4.4030000,NULL,NULL,'Piet','+32 470 1',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'pending',NULL,NULL),(3,1,2,1,'yukleme',NULL,'BECOMAR','Antwerpsebaan 1','2040','Antwerpen','BE',51.3210000,4.3120000,NULL,NULL,'Depo','+32 3 000',NULL,NULL,'bos_al','Boş konteyner al','Kuru, temiz, kokusuz',NULL,'40\' HC Container','pending',NULL,NULL),(4,1,2,2,'yukleme',NULL,'KATOENNATIE KAAI 1998','Oude Dijk 1','9130','Kallo','BE',51.2710000,4.2640000,'2026-08-31 06:00:00',NULL,'Rampa','+32 3 111',NULL,NULL,'yukle','Yükle',NULL,'STP101-87 · TAR/TAS 37840837','40\' HC Container','pending',NULL,NULL),(5,1,2,3,'indirme',NULL,'KAAI DP WORLD 1700','Kaai 1700','9130','Beveren-Kruibeke-Zwijndrecht','BE',51.2790000,4.2620000,'2026-08-31 08:00:00','2026-08-31 10:00:00','Gate','+32 3 222',NULL,NULL,'dolu_birak','Dolu konteyner bırak',NULL,'STP101-87 · 24.991 kg','40\' HC Container','pending',NULL,NULL);
/*!40000 ALTER TABLE `job_stops` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `jobs`
--

DROP TABLE IF EXISTS `jobs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `jobs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `job_no` varchar(255) DEFAULT NULL,
  `job_type` varchar(255) DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'draft',
  `customer_id` bigint(20) unsigned DEFAULT NULL,
  `driver_id` bigint(20) unsigned DEFAULT NULL,
  `co_driver_id` bigint(20) unsigned DEFAULT NULL,
  `vehicle_id` bigint(20) unsigned DEFAULT NULL,
  `trailer_id` bigint(20) unsigned DEFAULT NULL,
  `weight` decimal(10,2) DEFAULT NULL,
  `volume` decimal(10,2) DEFAULT NULL,
  `adr` tinyint(1) NOT NULL DEFAULT 0,
  `reference` varchar(255) DEFAULT NULL,
  `container_size` varchar(255) DEFAULT NULL,
  `container_load` varchar(255) DEFAULT NULL,
  `seal_no` varchar(255) DEFAULT NULL,
  `reefer_temp` varchar(255) DEFAULT NULL,
  `curtain_ok` tinyint(1) DEFAULT NULL,
  `strap_count` smallint(5) unsigned DEFAULT NULL,
  `reject_reason` text DEFAULT NULL,
  `cancel_reason` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `jobs_tenant_id_index` (`tenant_id`),
  KEY `jobs_customer_id_index` (`customer_id`),
  KEY `jobs_driver_id_index` (`driver_id`),
  KEY `jobs_co_driver_id_index` (`co_driver_id`),
  KEY `jobs_vehicle_id_index` (`vehicle_id`),
  KEY `jobs_trailer_id_index` (`trailer_id`),
  CONSTRAINT `jobs_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `jobs`
--

LOCK TABLES `jobs` WRITE;
/*!40000 ALTER TABLE `jobs` DISABLE KEYS */;
INSERT INTO `jobs` VALUES (1,1,'JOB-2026-0001','tenteli','assigned',1,4,NULL,1,1,22000.00,NULL,0,'BK-8891',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-09-20 14:39:04'),(2,1,'JOB-2026-0002','konteyner','assigned',1,4,NULL,1,2,24991.00,NULL,0,'2173021970','40\' HC','dolu',NULL,NULL,NULL,NULL,NULL,NULL,'2026-09-20 14:39:04'),(4,4,'AYD-2026-0001',NULL,'assigned',4,11,NULL,4,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-09-26 11:48:40'),(5,4,'AYD-2026-0002',NULL,'in_progress',4,12,NULL,4,4,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-09-26 16:52:00'),(6,2,'ANK-2026-0001',NULL,'assigned',NULL,13,NULL,5,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-09-26 16:52:00'),(7,6,'TRA-2026-0001',NULL,'assigned',NULL,14,NULL,6,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-09-26 16:52:00'),(8,9,'234234',NULL,'assigned',NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-09-26 19:08:23');
/*!40000 ALTER TABLE `jobs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `leave_requests`
--

DROP TABLE IF EXISTS `leave_requests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `leave_requests` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned NOT NULL,
  `leave_type` varchar(255) DEFAULT NULL,
  `date_from` date DEFAULT NULL,
  `date_to` date DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'pending',
  `reason` text DEFAULT NULL,
  `decided_by` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `leave_requests_tenant_id_index` (`tenant_id`),
  KEY `leave_requests_user_id_index` (`user_id`),
  CONSTRAINT `leave_requests_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `leave_requests`
--

LOCK TABLES `leave_requests` WRITE;
/*!40000 ALTER TABLE `leave_requests` DISABLE KEYS */;
INSERT INTO `leave_requests` VALUES (1,1,4,'yillik','2026-09-30','2026-10-03','pending','Aile ziyareti',NULL,'2026-09-20 14:39:04'),(2,1,5,'hastalik','2026-09-15','2026-09-16','approved','Grip',2,'2026-09-20 14:39:04'),(3,4,11,'yillik','2026-10-06','2026-10-11','submitted','Yıllık izin',NULL,'2026-09-26 16:52:00');
/*!40000 ALTER TABLE `leave_requests` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `locations`
--

DROP TABLE IF EXISTS `locations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `locations` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `customer_id` bigint(20) unsigned DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `street` varchar(255) DEFAULT NULL,
  `zip` varchar(255) DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `country` varchar(2) DEFAULT NULL,
  `lat` decimal(10,7) DEFAULT NULL,
  `lng` decimal(10,7) DEFAULT NULL,
  `note` text DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `locations_tenant_id_index` (`tenant_id`),
  KEY `locations_customer_id_index` (`customer_id`),
  CONSTRAINT `locations_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `locations`
--

LOCK TABLES `locations` WRITE;
/*!40000 ALTER TABLE `locations` DISABLE KEYS */;
INSERT INTO `locations` VALUES (1,1,1,'Yükleme Duisburg','Hafen 1','47119','Duisburg','DE',51.4500000,6.7500000,NULL),(2,1,1,'Boşaltma Antwerp','Haven 200','2000','Antwerpen','BE',51.2410000,4.4030000,NULL);
/*!40000 ALTER TABLE `locations` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `login_sessions`
--

DROP TABLE IF EXISTS `login_sessions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `login_sessions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `device_name` varchar(255) DEFAULT NULL,
  `user_agent` varchar(255) DEFAULT NULL,
  `ip` varchar(255) DEFAULT NULL,
  `last_seen` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `is_current` tinyint(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `login_sessions_user_id_index` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `login_sessions`
--

LOCK TABLES `login_sessions` WRITE;
/*!40000 ALTER TABLE `login_sessions` DISABLE KEYS */;
/*!40000 ALTER TABLE `login_sessions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `migrations`
--

DROP TABLE IF EXISTS `migrations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `migrations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) NOT NULL,
  `batch` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `migrations`
--

LOCK TABLES `migrations` WRITE;
/*!40000 ALTER TABLE `migrations` DISABLE KEYS */;
INSERT INTO `migrations` VALUES (1,'0001_01_01_000000_create_users_table',1),(2,'0001_01_01_000001_create_cache_table',1),(3,'0001_01_01_000002_create_jobs_table',1),(4,'2026_09_04_023546_create_tenants_table',1),(5,'2026_09_04_030000_create_fleet_tables',1),(6,'2026_09_04_030100_create_hr_tables',1),(7,'2026_09_04_030200_create_crm_and_jobs_tables',1),(8,'2026_09_04_030300_create_finance_tables',1),(9,'2026_09_04_030400_create_ecmr_tables',1),(10,'2026_09_04_030500_create_misc_tables',1),(11,'2026_09_04_031528_create_notifications_table',1),(12,'2026_09_11_114710_create_plans_table',1),(13,'2026_09_11_114725_add_plan_id_to_tenants_table',1),(14,'2026_09_12_004418_add_theme_preferences_to_users_table',1),(15,'2026_09_12_012132_add_note_to_handover_photos_table',1),(16,'2026_09_12_111248_add_cmr_settings_to_tenants_table',1),(17,'2026_09_12_150925_create_fleet_documents_tables',1),(18,'2026_09_12_151007_add_stamp_text_to_tenants_table',1),(19,'2026_09_20_190000_create_expiry_notifications_log_table',2),(20,'2026_09_20_190100_add_maintenance_fields_to_vehicles_table',2),(21,'2026_09_20_190200_create_vehicle_odometer_logs_table',2),(22,'2026_09_20_200000_create_vehicle_location_pings_table',3),(23,'2026_09_20_200100_create_geofence_zones_table',3),(24,'2026_09_20_200200_add_currently_inside_zone_id_to_vehicles_table',3),(25,'2026_09_20_210000_add_tracking_token_to_customers_table',4),(26,'2026_09_22_180000_create_billing_tables',5),(27,'2026_09_22_190000_add_residency_status_to_users_table',6),(28,'2026_09_22_200000_create_support_tickets_tables',7),(29,'2026_09_23_100000_create_notes_table',8),(30,'2026_09_23_200000_create_ecmr_customization_tables',9),(31,'2026_09_26_210100_add_cmr_theme_and_custom_field_sections',10),(32,'2026_09_26_220000_add_tenant_id_cascade_foreign_keys',11);
/*!40000 ALTER TABLE `migrations` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `notes`
--

DROP TABLE IF EXISTS `notes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `notes` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned NOT NULL,
  `job_id` bigint(20) unsigned DEFAULT NULL,
  `body` text NOT NULL,
  `remind_at` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `notes_tenant_id_index` (`tenant_id`),
  KEY `notes_user_id_index` (`user_id`),
  KEY `notes_job_id_index` (`job_id`),
  CONSTRAINT `notes_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `notes`
--

LOCK TABLES `notes` WRITE;
/*!40000 ALTER TABLE `notes` DISABLE KEYS */;
INSERT INTO `notes` VALUES (1,1,3,NULL,'Deneme',NULL,'2026-09-22 18:00:15','2026-09-22 18:00:15');
/*!40000 ALTER TABLE `notes` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `notifications`
--

DROP TABLE IF EXISTS `notifications`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `notifications` (
  `id` char(36) NOT NULL,
  `type` varchar(255) NOT NULL,
  `notifiable_type` varchar(255) NOT NULL,
  `notifiable_id` bigint(20) unsigned NOT NULL,
  `data` text NOT NULL,
  `read_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `notifications_notifiable_type_notifiable_id_index` (`notifiable_type`,`notifiable_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `notifications`
--

LOCK TABLES `notifications` WRITE;
/*!40000 ALTER TABLE `notifications` DISABLE KEYS */;
INSERT INTO `notifications` VALUES ('05fcc3c4-271d-481f-b302-cbe37834b789','App\\Notifications\\GenericNotification','App\\Models\\User',2,'{\"title\":\"Bak\\u0131m zaman\\u0131 geldi\",\"body\":\"DU-EX 2087 \\u00b7 96,210 km (hedef: 15,000 km)\",\"link\":\"\"}',NULL,'2026-09-20 15:06:50','2026-09-20 15:06:50'),('10ea3c00-3c1f-4169-a3f3-a678b7db3fcc','App\\Notifications\\GenericNotification','App\\Models\\User',1,'{\"title\":\"Yeni destek mesaj\\u0131: Bay Speed Services\",\"body\":\"Fatura d\\u00fczeltme talebi\",\"link\":\"\"}',NULL,'2026-09-26 16:51:59','2026-09-26 16:51:59'),('52ddda7e-a16a-41a5-a166-c1568c597cb3','App\\Notifications\\GenericNotification','App\\Models\\User',1,'{\"title\":\"Yeni destek mesaj\\u0131: Bay Speed Services\",\"body\":\"Mazot kart\\u0131 entegrasyonu hakk\\u0131nda soru\",\"link\":\"\"}',NULL,'2026-09-26 16:51:52','2026-09-26 16:51:52'),('6bc96126-ceef-4bf5-8d3a-9b13b44515f8','App\\Notifications\\GenericNotification','App\\Models\\User',4,'{\"title\":\"Masraf onayland\\u0131\",\"body\":\"park \\u00b7 22.00 EUR\",\"link\":\"masraflar\"}',NULL,'2026-09-24 16:14:15','2026-09-24 16:14:15'),('8227c823-bc06-49ae-8e5f-c5d44186ee3c','App\\Notifications\\GenericNotification','App\\Models\\User',1,'{\"title\":\"Yeni destek mesaj\\u0131: Ayd\\u0131n Nakliyat A.\\u015e.\",\"body\":\"Demo destek talebi - test\",\"link\":\"\"}',NULL,'2026-09-26 11:50:48','2026-09-26 11:50:48'),('88a20089-7c2d-427a-9e6a-daff94306de0','App\\Notifications\\GenericNotification','App\\Models\\User',2,'{\"title\":\"Bak\\u0131m zaman\\u0131 geldi\",\"body\":\"DU-EX 1044 \\u00b7 182,340 km (hedef: 15,000 km)\",\"link\":\"\"}',NULL,'2026-09-20 15:06:48','2026-09-20 15:06:48'),('95e026cc-a07c-46f3-a8c5-17adc50e350c','App\\Notifications\\GenericNotification','App\\Models\\User',2,'{\"title\":\"Evrak s\\u00fcresi 7 g\\u00fcn i\\u00e7inde doluyor\",\"body\":\"Muayene: DU-EX 3311\",\"link\":\"\"}',NULL,'2026-09-20 15:07:04','2026-09-20 15:07:04'),('b60b1489-7402-4b62-b410-307c61fff8c1','App\\Notifications\\GenericNotification','App\\Models\\User',1,'{\"title\":\"Yeni destek mesaj\\u0131: Ayd\\u0131n Nakliyat A.\\u015e.\",\"body\":\"Demo destek talebi - test\",\"link\":\"\"}',NULL,'2026-09-26 11:01:35','2026-09-26 11:01:35'),('ca885aeb-cc1e-42e5-949d-085ae7a2f79a','App\\Notifications\\GenericNotification','App\\Models\\User',2,'{\"title\":\"Yeni fatura kesildi\",\"body\":\"Fatura #1 \\u00b7 129.00 EUR\",\"link\":\"\"}',NULL,'2026-09-22 16:20:29','2026-09-22 16:20:29'),('e21c70cd-f00e-4926-b152-e1a2460dd6a2','App\\Notifications\\GenericNotification','App\\Models\\User',2,'{\"title\":\"Evrak s\\u00fcresi 15 g\\u00fcn i\\u00e7inde doluyor\",\"body\":\"Takograf kalibrasyon: DU-EX 3311\",\"link\":\"\"}',NULL,'2026-09-20 15:07:04','2026-09-20 15:07:04'),('f448ec46-6fe0-408b-aa56-c8716e4e1181','App\\Notifications\\GenericNotification','App\\Models\\User',4,'{\"title\":\"Yeni i\\u015f atand\\u0131\",\"body\":\"JOB-2026-0001 Duisburg \\u2192 Antwerp\",\"link\":\"isler\"}',NULL,'2026-09-20 14:39:04','2026-09-20 14:39:04');
/*!40000 ALTER TABLE `notifications` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `password_reset_tokens`
--

DROP TABLE IF EXISTS `password_reset_tokens`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `password_reset_tokens` (
  `email` varchar(255) NOT NULL,
  `token` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `password_reset_tokens`
--

LOCK TABLES `password_reset_tokens` WRITE;
/*!40000 ALTER TABLE `password_reset_tokens` DISABLE KEYS */;
/*!40000 ALTER TABLE `password_reset_tokens` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `payments`
--

DROP TABLE IF EXISTS `payments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `payments` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `invoice_id` bigint(20) unsigned DEFAULT NULL,
  `gateway` varchar(255) NOT NULL DEFAULT 'iyzico',
  `gateway_payment_id` varchar(255) DEFAULT NULL,
  `amount` decimal(10,2) NOT NULL,
  `currency` varchar(3) NOT NULL DEFAULT 'TRY',
  `status` varchar(255) NOT NULL,
  `raw_response` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`raw_response`)),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `payments_tenant_id_index` (`tenant_id`),
  CONSTRAINT `payments_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`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 `payments`
--

LOCK TABLES `payments` WRITE;
/*!40000 ALTER TABLE `payments` DISABLE KEYS */;
/*!40000 ALTER TABLE `payments` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `plans`
--

DROP TABLE IF EXISTS `plans`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `plans` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `key` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `price` decimal(10,2) DEFAULT NULL,
  `currency` varchar(3) NOT NULL DEFAULT 'EUR',
  `billing_period` varchar(255) NOT NULL DEFAULT 'monthly',
  `max_users` int(10) unsigned DEFAULT NULL,
  `max_vehicles` int(10) unsigned DEFAULT NULL,
  `features` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`features`)),
  `sort_order` smallint(5) unsigned NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `plans_key_unique` (`key`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `plans`
--

LOCK TABLES `plans` WRITE;
/*!40000 ALTER TABLE `plans` DISABLE KEYS */;
INSERT INTO `plans` VALUES (2,'temel','Temel',49.00,'EUR','monthly',5,5,'[\"customers\",\"kanban\",\"fleet_edit\"]',1,1,'2026-09-20 14:39:03','2026-09-20 14:39:03'),(3,'pro','Pro',129.00,'EUR','monthly',20,20,'[\"customers\",\"kanban\",\"ecmr\",\"handovers\",\"fleet_edit\",\"live_map\",\"geofencing\",\"analytics\"]',2,1,'2026-09-20 14:39:03','2026-09-27 00:38:01'),(4,'kurumsal','Kurumsal',299.00,'EUR','monthly',NULL,NULL,'[\"customers\",\"kanban\",\"ecmr\",\"handovers\",\"resources\",\"fleet_edit\",\"live_map\",\"geofencing\",\"analytics\"]',3,1,'2026-09-20 14:39:03','2026-09-27 00:38:01'),(5,'ucretsiz','Ücretsiz',0.00,'EUR','monthly',1,1,'[\"fleet_edit\"]',0,1,'2026-09-22 18:26:29','2026-09-26 16:41:32'),(6,'est-recusandae-eum','magni tenetur',99.00,'EUR','monthly',NULL,NULL,'[\"customers\",\"kanban\",\"ecmr\",\"handovers\",\"resources\",\"fleet_edit\"]',0,1,'2026-09-23 12:04:26','2026-09-23 12:04:26'),(7,'autem-minus-temporibus','repellat nobis',99.00,'EUR','monthly',NULL,NULL,'[\"customers\",\"kanban\",\"ecmr\",\"handovers\",\"resources\",\"fleet_edit\"]',0,1,'2026-09-26 17:18:38','2026-09-26 17:18:38'),(8,'sed-voluptas','explicabo sed',99.00,'EUR','monthly',NULL,NULL,'[\"customers\",\"kanban\",\"ecmr\",\"handovers\",\"resources\",\"fleet_edit\"]',0,1,'2026-09-26 17:26:58','2026-09-26 17:26:58');
/*!40000 ALTER TABLE `plans` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `queue_jobs`
--

DROP TABLE IF EXISTS `queue_jobs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `queue_jobs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `queue` varchar(255) NOT NULL,
  `payload` longtext NOT NULL,
  `attempts` tinyint(3) unsigned NOT NULL,
  `reserved_at` int(10) unsigned DEFAULT NULL,
  `available_at` int(10) unsigned NOT NULL,
  `created_at` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `queue_jobs_queue_index` (`queue`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `queue_jobs`
--

LOCK TABLES `queue_jobs` WRITE;
/*!40000 ALTER TABLE `queue_jobs` DISABLE KEYS */;
/*!40000 ALTER TABLE `queue_jobs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `sessions`
--

DROP TABLE IF EXISTS `sessions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sessions` (
  `id` varchar(255) NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text DEFAULT NULL,
  `payload` longtext NOT NULL,
  `last_activity` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sessions_user_id_index` (`user_id`),
  KEY `sessions_last_activity_index` (`last_activity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `sessions`
--

LOCK TABLES `sessions` WRITE;
/*!40000 ALTER TABLE `sessions` DISABLE KEYS */;
INSERT INTO `sessions` VALUES ('A7VBVreu6cE5PycWmKabB6amSJHIP8tFqhHVtWjb',2,'192.168.129.45','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','YTo1OntzOjY6Il90b2tlbiI7czo0MDoicWpJa1h0NG5mWjhOZkYyNkJNb3hTakd6V1ZPaUdYeDRLc3dtWTZ6cSI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6NDY6Imh0dHA6Ly8xOTIuMTY4LjEyOS40NTo4MDkwL2FkbWluL29ybmVrbG9qaXN0aWsiO3M6NToicm91dGUiO3M6MzA6ImZpbGFtZW50LmFkbWluLnBhZ2VzLmRhc2hib2FyZCI7fXM6NjoiX2ZsYXNoIjthOjI6e3M6Mzoib2xkIjthOjA6e31zOjM6Im5ldyI7YTowOnt9fXM6NTA6ImxvZ2luX3dlYl81OWJhMzZhZGRjMmIyZjk0MDE1ODBmMDE0YzdmNThlYTRlMzA5ODlkIjtpOjI7czoxNzoicGFzc3dvcmRfaGFzaF93ZWIiO3M6NjQ6IjI2MDU1NTRmOWU2NzJiZjc5ZTc1YjA2MWYzMmU5N2RmNGU5NmViOWU5ZDE2YTlhMmQzZGNlMjVhMWI5NDM2MjEiO30=',1790531935),('ANl1g7IcomJWtjojkc0HsWdD3VnHrS35VtOivVjp',NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','YTozOntzOjY6Il90b2tlbiI7czo0MDoiZUlPbXcwcTV5b0M2cG1JdEsxcG1wQWR4WFg0WDMzQm14MFhLMktpNCI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6NDY6Imh0dHA6Ly9sb2NhbGhvc3QvY2loYW5zZXZlbi5jb20udHIlMjB2Mi9wdWJsaWMiO3M6NToicm91dGUiO3M6NDoiaG9tZSI7fXM6NjoiX2ZsYXNoIjthOjI6e3M6Mzoib2xkIjthOjA6e31zOjM6Im5ldyI7YTowOnt9fX0=',1791038730),('aThaBFFLO4ZkBzass26E6rFAaxDTGjZxXOFDCAII',NULL,'192.168.129.45','curl/8.21.0','YTozOntzOjY6Il90b2tlbiI7czo0MDoiM2trZjlpeEN1NU5JVEdla2lKTGNtV25HOHkzb3JNQlJRdDJhQlQwZiI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6MjY6Imh0dHA6Ly8xOTIuMTY4LjEyOS40NTo4MDkwIjtzOjU6InJvdXRlIjtzOjI3OiJnZW5lcmF0ZWQ6OktKZmJ5cDAwZ3NHV1hSTUUiO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX19',1790535659),('eUoKmdHQroSUAWCJRf419KcDqCrJA8pKePmqL4hb',2,'192.168.129.45','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','YTo1OntzOjY6Il90b2tlbiI7czo0MDoidjZ2UHZzT04xNFBvdm4yOURNT2t5R3dTek1DYWRGUkd1ekFKVDJYMCI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6NTE6Imh0dHA6Ly8xOTIuMTY4LjEyOS40NTo4MDkwL2FkbWluL29ybmVrbG9qaXN0aWsvam9icyI7czo1OiJyb3V0ZSI7czozNToiZmlsYW1lbnQuYWRtaW4ucmVzb3VyY2VzLmpvYnMuaW5kZXgiO31zOjUwOiJsb2dpbl93ZWJfNTliYTM2YWRkYzJiMmY5NDAxNTgwZjAxNGM3ZjU4ZWE0ZTMwOTg5ZCI7aToyO3M6MTc6InBhc3N3b3JkX2hhc2hfd2ViIjtzOjY0OiIyNjA1NTU0ZjllNjcyYmY3OWU3NWIwNjFmMzJlOTdkZjRlOTZlYjllOWQxNmE5YTJkM2RjZTI1YTFiOTQzNjIxIjt9',1790476667),('LBgOdwSzokBZ54X2VnNsHeAb27viJvSLVoVOUfun',NULL,'192.168.129.45','curl/8.21.0','YTozOntzOjY6Il90b2tlbiI7czo0MDoiWWtXMDdCU0NTVFc1ZGNmSjh4dkI0TlR3dWlQOXUxZ0E0TkN2djhpTCI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6MjY6Imh0dHA6Ly8xOTIuMTY4LjEyOS40NTo4MDkwIjtzOjU6InJvdXRlIjtOO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX19',1791038745);
/*!40000 ALTER TABLE `sessions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `staff_documents`
--

DROP TABLE IF EXISTS `staff_documents`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `staff_documents` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned NOT NULL,
  `doc_type` varchar(255) DEFAULT NULL,
  `expires_on` date DEFAULT NULL,
  `file_path` varchar(255) DEFAULT NULL,
  `alerted_for` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `staff_documents_tenant_id_index` (`tenant_id`),
  KEY `staff_documents_user_id_index` (`user_id`),
  CONSTRAINT `staff_documents_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`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 `staff_documents`
--

LOCK TABLES `staff_documents` WRITE;
/*!40000 ALTER TABLE `staff_documents` DISABLE KEYS */;
/*!40000 ALTER TABLE `staff_documents` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `subscriptions`
--

DROP TABLE IF EXISTS `subscriptions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `subscriptions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `plan_id` bigint(20) unsigned DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'trialing',
  `started_at` timestamp NULL DEFAULT NULL,
  `current_period_start` timestamp NULL DEFAULT NULL,
  `current_period_end` timestamp NULL DEFAULT NULL,
  `cancel_at` timestamp NULL DEFAULT NULL,
  `gateway` varchar(255) NOT NULL DEFAULT 'iyzico',
  `gateway_customer_id` varchar(255) DEFAULT NULL,
  `gateway_subscription_id` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `subscriptions_tenant_id_index` (`tenant_id`),
  CONSTRAINT `subscriptions_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `subscriptions`
--

LOCK TABLES `subscriptions` WRITE;
/*!40000 ALTER TABLE `subscriptions` DISABLE KEYS */;
INSERT INTO `subscriptions` VALUES (1,1,3,'active','2026-09-22 16:20:29','2026-09-22 16:20:29','2026-10-22 16:20:29',NULL,'iyzico',NULL,NULL,'2026-09-22 16:20:29','2026-09-22 16:20:29');
/*!40000 ALTER TABLE `subscriptions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `support_ticket_messages`
--

DROP TABLE IF EXISTS `support_ticket_messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `support_ticket_messages` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `support_ticket_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `body` text NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `support_ticket_messages_tenant_id_index` (`tenant_id`),
  KEY `support_ticket_messages_support_ticket_id_index` (`support_ticket_id`),
  CONSTRAINT `support_ticket_messages_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `support_ticket_messages`
--

LOCK TABLES `support_ticket_messages` WRITE;
/*!40000 ALTER TABLE `support_ticket_messages` DISABLE KEYS */;
INSERT INTO `support_ticket_messages` VALUES (1,4,1,8,'Bu bir demo/test destek talebidir.','2026-09-26 11:01:35'),(2,4,2,8,'Bu bir demo/test destek talebidir.','2026-09-26 11:50:48'),(3,1,3,2,'DKV kartımızı sisteme nasıl tanımlayabiliriz?','2026-09-26 16:51:52'),(4,1,4,2,'Geçen ayki faturamızda vergi numarası eksik görünüyor.','2026-09-26 16:51:59');
/*!40000 ALTER TABLE `support_ticket_messages` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `support_tickets`
--

DROP TABLE IF EXISTS `support_tickets`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `support_tickets` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `created_by` bigint(20) unsigned DEFAULT NULL,
  `subject` varchar(255) NOT NULL,
  `category` varchar(255) NOT NULL DEFAULT 'other',
  `status` varchar(255) NOT NULL DEFAULT 'open',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `support_tickets_tenant_id_index` (`tenant_id`),
  CONSTRAINT `support_tickets_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `support_tickets`
--

LOCK TABLES `support_tickets` WRITE;
/*!40000 ALTER TABLE `support_tickets` DISABLE KEYS */;
INSERT INTO `support_tickets` VALUES (1,4,8,'Demo destek talebi - test','other','open','2026-09-26 11:01:35','2026-09-26 11:01:35'),(2,4,8,'Demo destek talebi - test','other','open','2026-09-26 11:50:48','2026-09-26 11:50:48'),(3,1,2,'Mazot kartı entegrasyonu hakkında soru','other','open','2026-09-26 16:51:52','2026-09-26 16:51:52'),(4,1,2,'Fatura düzeltme talebi','other','resolved','2026-09-26 16:51:59','2026-09-26 16:51:59');
/*!40000 ALTER TABLE `support_tickets` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `tenant_sequences`
--

DROP TABLE IF EXISTS `tenant_sequences`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tenant_sequences` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `seq_key` varchar(255) NOT NULL,
  `year` smallint(5) unsigned NOT NULL,
  `current_no` int(10) unsigned NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `tenant_sequences_tenant_id_index` (`tenant_id`),
  CONSTRAINT `tenant_sequences_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `tenant_sequences`
--

LOCK TABLES `tenant_sequences` WRITE;
/*!40000 ALTER TABLE `tenant_sequences` DISABLE KEYS */;
INSERT INTO `tenant_sequences` VALUES (1,1,'job',2026,2),(2,1,'cmr',2026,3),(3,4,'cmr',2026,1);
/*!40000 ALTER TABLE `tenant_sequences` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `tenants`
--

DROP TABLE IF EXISTS `tenants`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tenants` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `plan_id` bigint(20) unsigned DEFAULT NULL,
  `slug` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `tax_no` varchar(255) DEFAULT NULL,
  `address` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `logo_path` varchar(255) DEFAULT NULL,
  `stamp_path` varchar(255) DEFAULT NULL,
  `stamp_text` text DEFAULT NULL,
  `primary_color` varchar(255) NOT NULL DEFAULT '#EA580C',
  `accent_color` varchar(255) NOT NULL DEFAULT '#F97316',
  `cmr_languages` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`cmr_languages`)),
  `cmr_theme` varchar(255) NOT NULL DEFAULT 'classic',
  `timezone` varchar(255) NOT NULL DEFAULT 'Europe/Istanbul',
  `currency` varchar(3) NOT NULL DEFAULT 'EUR',
  `plate_country` varchar(2) NOT NULL DEFAULT 'TR',
  `working_countries` varchar(255) NOT NULL DEFAULT 'TR,DE,NL,BE,FR,PL',
  `cmr_insurance` varchar(255) DEFAULT NULL,
  `cmr_insurance_exp` date DEFAULT NULL,
  `cmr_prefix` varchar(10) DEFAULT NULL,
  `cmr_copies` tinyint(3) unsigned NOT NULL DEFAULT 4,
  `trailer_radius_strict` tinyint(1) NOT NULL DEFAULT 0,
  `status` varchar(255) NOT NULL DEFAULT 'active',
  `trial_until` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `tenants_slug_unique` (`slug`),
  KEY `tenants_plan_id_index` (`plan_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `tenants`
--

LOCK TABLES `tenants` WRITE;
/*!40000 ALTER TABLE `tenants` DISABLE KEYS */;
INSERT INTO `tenants` VALUES (1,3,'orneklojistik','Bay Speed Services','DE123456789','Hafenstr. 12, 47119 Duisburg','+49 203 00000',NULL,NULL,NULL,'#ff0303','#f50a0a','[\"tr\",\"en\"]','modern','Europe/Istanbul','EUR','TR','TR,DE,NL,BE,FR,PL',NULL,NULL,NULL,4,0,'active',NULL,'2026-09-20 14:39:03','2026-09-26 17:05:41'),(2,NULL,'yeni-baslayan-nakliyat','Yeni Başlayan Nakliyat Ltd.',NULL,NULL,'+90 532 000 00 00',NULL,NULL,NULL,'#EA580C','#F97316','[\"tr\"]','classic','Europe/Istanbul','EUR','TR','TR,DE,NL,BE,FR,PL',NULL,NULL,NULL,4,0,'pending','2026-10-04','2026-09-20 14:39:04','2026-09-20 14:39:04'),(4,3,'aydin-nakliyat-as-rqze','Aydın Nakliyat A.Ş.',NULL,NULL,'+90 532 111 22 33',NULL,NULL,NULL,'#EA580C','#F97316',NULL,'minimal','Europe/Istanbul','EUR','TR','TR,DE,NL,BE,FR,PL',NULL,NULL,NULL,4,0,'active','2026-10-10','2026-09-26 10:39:58','2026-09-26 17:05:41'),(6,5,'karadeniz-lojistik-ltd-fqzq','Karadeniz Lojistik Ltd.',NULL,NULL,'+90 533 444 55 66',NULL,NULL,NULL,'#EA580C','#F97316',NULL,'classic','Europe/Istanbul','EUR','TR','TR,DE,NL,BE,FR,PL',NULL,NULL,NULL,4,0,'active','2026-10-10','2026-09-26 10:40:52','2026-09-26 10:40:52'),(8,8,'pariatur-et','Shanahan, Bergnaum and Abshire',NULL,NULL,NULL,NULL,NULL,NULL,'#EA580C','#F97316',NULL,'classic','Europe/Istanbul','EUR','TR','TR,DE,NL,BE,FR,PL',NULL,NULL,NULL,4,0,'active',NULL,'2026-09-26 17:26:58','2026-09-26 17:26:58'),(9,5,'mk-prefabrik-konteyner-xaon','MK Prefabrik & Konteyner',NULL,NULL,'05432319847',NULL,NULL,NULL,'#EA580C','#F97316',NULL,'classic','Europe/Istanbul','EUR','TR','TR,DE,NL,BE,FR,PL',NULL,NULL,NULL,4,0,'active','2026-10-10','2026-09-26 19:07:47','2026-09-26 19:07:47');
/*!40000 ALTER TABLE `tenants` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `traffic_alerts`
--

DROP TABLE IF EXISTS `traffic_alerts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `traffic_alerts` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `scope` varchar(255) DEFAULT NULL,
  `job_id` bigint(20) unsigned DEFAULT NULL,
  `yard_id` bigint(20) unsigned DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `body` text DEFAULT NULL,
  `severity` varchar(255) NOT NULL DEFAULT 'info',
  `lat` decimal(10,7) DEFAULT NULL,
  `lng` decimal(10,7) DEFAULT NULL,
  `starts_at` timestamp NULL DEFAULT NULL,
  `ends_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `traffic_alerts_tenant_id_index` (`tenant_id`),
  KEY `traffic_alerts_user_id_index` (`user_id`),
  KEY `traffic_alerts_job_id_index` (`job_id`),
  KEY `traffic_alerts_yard_id_index` (`yard_id`),
  CONSTRAINT `traffic_alerts_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `traffic_alerts`
--

LOCK TABLES `traffic_alerts` WRITE;
/*!40000 ALTER TABLE `traffic_alerts` DISABLE KEYS */;
INSERT INTO `traffic_alerts` VALUES (1,1,NULL,'job',NULL,NULL,'Antwerp liman yoğun','A12 çıkışında 4.8 km yavaşlama. Kaynak: ofis bildirimi.','warn',51.2410000,4.4030000,NULL,NULL,'2026-09-20 14:39:04');
/*!40000 ALTER TABLE `traffic_alerts` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `trailer_documents`
--

DROP TABLE IF EXISTS `trailer_documents`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `trailer_documents` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `trailer_id` bigint(20) unsigned NOT NULL,
  `doc_type` varchar(255) NOT NULL,
  `expires_on` date DEFAULT NULL,
  `photo_path` varchar(255) DEFAULT NULL,
  `note` varchar(255) DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `trailer_documents_trailer_id_doc_type_unique` (`trailer_id`,`doc_type`),
  KEY `trailer_documents_tenant_id_index` (`tenant_id`),
  KEY `trailer_documents_trailer_id_index` (`trailer_id`),
  CONSTRAINT `trailer_documents_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`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 `trailer_documents`
--

LOCK TABLES `trailer_documents` WRITE;
/*!40000 ALTER TABLE `trailer_documents` DISABLE KEYS */;
/*!40000 ALTER TABLE `trailer_documents` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `trailer_handovers`
--

DROP TABLE IF EXISTS `trailer_handovers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `trailer_handovers` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `trailer_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned NOT NULL,
  `kind` varchar(255) DEFAULT NULL,
  `place_type` varchar(255) DEFAULT NULL,
  `yard_id` bigint(20) unsigned DEFAULT NULL,
  `lat` decimal(10,7) DEFAULT NULL,
  `lng` decimal(10,7) DEFAULT NULL,
  `accuracy` decimal(8,2) DEFAULT NULL,
  `location_name` varchar(255) DEFAULT NULL,
  `key_code` varchar(255) DEFAULT NULL,
  `note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `trailer_handovers_tenant_id_index` (`tenant_id`),
  KEY `trailer_handovers_trailer_id_index` (`trailer_id`),
  KEY `trailer_handovers_user_id_index` (`user_id`),
  KEY `trailer_handovers_yard_id_index` (`yard_id`),
  CONSTRAINT `trailer_handovers_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `trailer_handovers`
--

LOCK TABLES `trailer_handovers` WRITE;
/*!40000 ALTER TABLE `trailer_handovers` DISABLE KEYS */;
INSERT INTO `trailer_handovers` VALUES (1,1,1,4,'al',NULL,NULL,NULL,NULL,NULL,'Duisburg garaj',NULL,NULL,'2026-09-20 14:39:04'),(2,4,4,11,'al',NULL,NULL,NULL,NULL,NULL,'İstanbul Ana Depo',NULL,NULL,'2026-09-26 16:52:00');
/*!40000 ALTER TABLE `trailer_handovers` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `trailer_vendors`
--

DROP TABLE IF EXISTS `trailer_vendors`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `trailer_vendors` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `contract_no` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `trailer_vendors_tenant_id_index` (`tenant_id`),
  CONSTRAINT `trailer_vendors_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `trailer_vendors`
--

LOCK TABLES `trailer_vendors` WRITE;
/*!40000 ALTER TABLE `trailer_vendors` DISABLE KEYS */;
INSERT INTO `trailer_vendors` VALUES (1,1,'TIP Trailer Services','+31 77 000','TIP-2026-88'),(2,4,'Anadolu Dorse Kiralama','+90 212 555 11 22','SOZ-2026-045');
/*!40000 ALTER TABLE `trailer_vendors` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `trailers`
--

DROP TABLE IF EXISTS `trailers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `trailers` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `plate` varchar(255) DEFAULT NULL,
  `trailer_type` varchar(255) DEFAULT NULL,
  `ownership` varchar(255) DEFAULT NULL,
  `vendor_id` bigint(20) unsigned DEFAULT NULL,
  `contract_no` varchar(255) DEFAULT NULL,
  `inspection_exp` date DEFAULT NULL,
  `tire_note` varchar(255) DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'garajda',
  `assigned_user_id` bigint(20) unsigned DEFAULT NULL,
  `last_lat` decimal(10,7) DEFAULT NULL,
  `last_lng` decimal(10,7) DEFAULT NULL,
  `last_location_name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `trailers_tenant_id_index` (`tenant_id`),
  KEY `trailers_vendor_id_index` (`vendor_id`),
  KEY `trailers_assigned_user_id_index` (`assigned_user_id`),
  CONSTRAINT `trailers_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `trailers`
--

LOCK TABLES `trailers` WRITE;
/*!40000 ALTER TABLE `trailers` DISABLE KEYS */;
INSERT INTO `trailers` VALUES (1,1,'DU-TR 2201','tenteli','firma',NULL,NULL,'2027-05-01',NULL,'garajda',NULL,51.4344000,6.7623000,'Duisburg garaj'),(2,1,'NL-TIP 8891','konteyner_sasi','kiralik',1,'TIP-2026-88',NULL,NULL,'kiralik_parkta',NULL,51.3704000,6.1724000,'TIP Venlo'),(3,1,'DU-TR 4470','frigo','firma',NULL,NULL,'2027-01-20',NULL,'garajda',NULL,51.4344000,6.7623000,'Duisburg garaj'),(4,4,'34 XYZ 456','Tenteli','firma',NULL,NULL,NULL,NULL,'garajda',11,NULL,NULL,NULL);
/*!40000 ALTER TABLE `trailers` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `useful_contacts`
--

DROP TABLE IF EXISTS `useful_contacts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `useful_contacts` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `title` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `note` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `useful_contacts_tenant_id_index` (`tenant_id`),
  CONSTRAINT `useful_contacts_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `useful_contacts`
--

LOCK TABLES `useful_contacts` WRITE;
/*!40000 ALTER TABLE `useful_contacts` DISABLE KEYS */;
INSERT INTO `useful_contacts` VALUES (1,1,'Dispeç','+49 203 00001','7/24'),(2,1,'Yol yardım','+49 800 111','Avrupa'),(3,1,'CMR sigorta','+49 211 222','Hasar ihbar'),(4,4,'Gümrük Müşavirliği','+90 212 444 00 00','İhracat evrakları için'),(5,4,'Yol Yardım','+90 850 222 33 44','7/24 çekici hizmeti');
/*!40000 ALTER TABLE `useful_contacts` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `users`
--

DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned DEFAULT NULL,
  `role` varchar(255) NOT NULL,
  `first_name` varchar(255) DEFAULT NULL,
  `last_name` varchar(255) DEFAULT NULL,
  `email` varchar(255) NOT NULL,
  `username` varchar(255) DEFAULT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(255) NOT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `phone_cc` varchar(255) NOT NULL DEFAULT '+90',
  `avatar_path` varchar(255) DEFAULT NULL,
  `theme_mode` varchar(255) NOT NULL DEFAULT 'system',
  `theme_color` varchar(255) DEFAULT NULL,
  `lang` varchar(5) NOT NULL DEFAULT 'tr',
  `email_lang` varchar(5) NOT NULL DEFAULT 'tr',
  `staff_type` varchar(255) NOT NULL DEFAULT 'kadrolu',
  `emergency_name` varchar(255) DEFAULT NULL,
  `emergency_phone` varchar(255) DEFAULT NULL,
  `license_class` varchar(255) DEFAULT NULL,
  `license_exp` date DEFAULT NULL,
  `cpc_exp` date DEFAULT NULL,
  `adr_exp` date DEFAULT NULL,
  `tacho_exp` date DEFAULT NULL,
  `passport_exp` date DEFAULT NULL,
  `visa_exp` date DEFAULT NULL,
  `medical_exp` date DEFAULT NULL,
  `residency_status` varchar(255) NOT NULL DEFAULT 'citizen',
  `residency_permit_exp` date DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `remember_token` varchar(100) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `users_email_unique` (`email`),
  UNIQUE KEY `users_username_unique` (`username`),
  KEY `users_tenant_id_index` (`tenant_id`),
  CONSTRAINT `users_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `users`
--

LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES (1,NULL,'super','Platform','Yönetici','admin@fleetnora.local','admin',NULL,'$2y$12$rvzF079UGWqYBwphp9BWa.CTkLn4N3JoUyFND14fzDmVjFy57Hnze',NULL,'+90',NULL,'system','#d11515','tr','tr','kadrolu',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'citizen',NULL,1,NULL,'2026-09-20 14:39:03','2026-09-26 19:11:33'),(2,1,'admin','Samet','Bayat','yonetici@ornek.local','ayse',NULL,'$2y$12$p9rFCiIwfr4LUpJaXuvZ1OoK0O9Zbd09pboc31UQpShLxaN6FZdn.','5320000001','+90',NULL,'dark',NULL,'tr','tr','kadrolu',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'temporary_resident','2026-10-03',1,NULL,'2026-09-20 14:39:03','2026-09-26 16:48:26'),(3,1,'dispatcher','Mehmet','Kaya','sevk@ornek.local','mehmet',NULL,'$2y$12$GarztsaaqYqGXb/5fSvty.I4/OUjKcIeF8k0IKl5MDLcjRGEsEHdm','5320000002','+90',NULL,'system',NULL,'tr','tr','kadrolu',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'citizen',NULL,1,NULL,'2026-09-20 14:39:03','2026-09-20 14:39:03'),(4,1,'driver','Cihan','Seven','sofor@ornek.local','cihan',NULL,'$2y$12$Nu7m2yucnu2TPuHOhdD2XemiZ2cQD020BwWqcPDViVSODzsTxBGVe','484136745','+32',NULL,'system',NULL,'tr','tr','kadrolu',NULL,NULL,'CE','2028-06-01',NULL,NULL,'2027-01-20',NULL,'2027-03-15',NULL,'citizen',NULL,1,'15q6fNCU4bL1hE9xPGG4RJ22pZGIro8pQryhT4pzntwJU3v2Wxs88CxogRaS','2026-09-20 14:39:04','2026-09-20 14:39:04'),(5,1,'driver','Deniz','Aydın','deniz@ornek.local','deniz',NULL,'$2y$12$twdXdA3il2mfS9KoEuid/eksmBJgNLfy3x5bDxXUMgyDT7oY.j5zm','5320000004','+90',NULL,'system',NULL,'tr','tr','kadrolu',NULL,NULL,'CE','2027-09-10',NULL,NULL,NULL,NULL,NULL,NULL,'citizen',NULL,1,NULL,'2026-09-20 14:39:04','2026-09-20 14:39:04'),(6,1,'hr','Elif','Demir','ik@ornek.local','elif',NULL,'$2y$12$XEHshqdRcNFXnSMU4BCa3efT.YhCy0BB1xIWbkh/M76WBqHCeHXHS','5320000003','+90',NULL,'system',NULL,'tr','tr','kadrolu',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'citizen',NULL,1,NULL,'2026-09-20 14:39:04','2026-09-20 14:39:04'),(7,2,'admin','Kayıt','Sahibi','admin@yenibaslayan.local','yenibaslayan-admin',NULL,'$2y$12$xzi5h9UcMaH24WGwDBIMc.qSg6H9UrInhosUl.6ZW7vkrzwukWkFy',NULL,'+90',NULL,'system',NULL,'tr','tr','kadrolu',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'citizen',NULL,1,NULL,'2026-09-20 14:39:05','2026-09-20 14:39:05'),(8,4,'admin','Elif','Aydın','demo1@fleetnora-test.local',NULL,NULL,'$2y$12$EowiWVLbZpepSliHBGc7cetGDPxFc3ZRbHNdrd6.HM7r2r3xmQFwS','+90 532 111 22 33','+90',NULL,'system',NULL,'tr','tr','kadrolu',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'citizen',NULL,1,NULL,'2026-09-26 10:39:58','2026-09-26 10:39:58'),(10,6,'admin','Burak','Kaya','demo2b@fleetnora-test.local',NULL,NULL,'$2y$12$LwKDr0z83c2gq6oecJ0PBuoO8l15JFG.beZX1HYo9FgR13aXfjYDq','+90 533 444 55 66','+90',NULL,'system',NULL,'tr','tr','kadrolu',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'citizen',NULL,1,NULL,'2026-09-26 10:40:52','2026-09-26 10:40:52'),(11,4,'driver','Mehmet','Yıldız','mehmet.yildiz-demo@fleetnora-test.local',NULL,NULL,'$2y$12$XDvCn.qfLbT6y0FRv5GOweQAoxRfxzhDwQTwmc2USNCTEYSwrzMpC',NULL,'+90',NULL,'system',NULL,'tr','tr','kadrolu',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'citizen',NULL,1,NULL,'2026-09-26 11:48:40','2026-09-26 11:48:40'),(12,4,'driver','Ali','Kara','ali.kara-demo@fleetnora-test.local',NULL,NULL,'$2y$12$6//GizmJELAjBBOs1d9khe3Pqr/xo5P7NLsM7sGAM.z4hlqXNF1Pe',NULL,'+90',NULL,'system',NULL,'tr','tr','kadrolu',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'citizen',NULL,1,NULL,'2026-09-26 16:52:00','2026-09-26 16:52:00'),(13,2,'driver','Emre','Şahin','emre.sahin-demo-2@fleetnora-test.local',NULL,NULL,'$2y$12$QzWNQ.tjbi6E5ZUmXZLVF.36OiPvl9je2WOPOrYQqa7CNVOzuL0Fy',NULL,'+90',NULL,'system',NULL,'tr','tr','kadrolu',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'citizen',NULL,1,NULL,'2026-09-26 16:52:00','2026-09-26 16:52:00'),(14,6,'driver','Emre','Şahin','emre.sahin-demo-6@fleetnora-test.local',NULL,NULL,'$2y$12$sFGNmZeWP8EMwtt4rtM.S./U7Pt24OLpTa/nGNcKiTHFFHbi4ZE2O',NULL,'+90',NULL,'system',NULL,'tr','tr','kadrolu',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'citizen',NULL,1,NULL,'2026-09-26 16:52:00','2026-09-26 16:52:00'),(16,8,'admin','Monserrat','Waters','vkerluke@example.com',NULL,'2026-09-26 17:26:58','$2y$12$B95BBdRLxZ8bqQ52Od5SveNOYInErQWvh2wgx8yv8nsSRGQhaGdg.',NULL,'+90',NULL,'system',NULL,'tr','tr','kadrolu',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'citizen',NULL,1,'Hrsa6zVSFd','2026-09-26 17:26:58','2026-09-26 17:26:58'),(17,9,'admin','Seven','','ajans@creatingz.com.tr',NULL,NULL,'$2y$12$pW08Kafl6qyGPvqyl2GpC.GCY44mGJXR7xE1A7t.TYzmv7rwRt1Ui','05432319847','+90',NULL,'system',NULL,'tr','tr','kadrolu',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'citizen',NULL,1,NULL,'2026-09-26 19:07:48','2026-09-26 19:07:48');
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `vehicle_documents`
--

DROP TABLE IF EXISTS `vehicle_documents`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `vehicle_documents` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `vehicle_id` bigint(20) unsigned NOT NULL,
  `doc_type` varchar(255) NOT NULL,
  `expires_on` date DEFAULT NULL,
  `photo_path` varchar(255) DEFAULT NULL,
  `note` varchar(255) DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vehicle_documents_vehicle_id_doc_type_unique` (`vehicle_id`,`doc_type`),
  KEY `vehicle_documents_tenant_id_index` (`tenant_id`),
  KEY `vehicle_documents_vehicle_id_index` (`vehicle_id`),
  CONSTRAINT `vehicle_documents_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`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 `vehicle_documents`
--

LOCK TABLES `vehicle_documents` WRITE;
/*!40000 ALTER TABLE `vehicle_documents` DISABLE KEYS */;
/*!40000 ALTER TABLE `vehicle_documents` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `vehicle_handovers`
--

DROP TABLE IF EXISTS `vehicle_handovers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `vehicle_handovers` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `vehicle_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned NOT NULL,
  `kind` varchar(255) DEFAULT NULL,
  `km` int(10) unsigned DEFAULT NULL,
  `fuel_pct` tinyint(3) unsigned DEFAULT NULL,
  `adblue_pct` tinyint(3) unsigned DEFAULT NULL,
  `damage_note` text DEFAULT NULL,
  `lat` decimal(10,7) DEFAULT NULL,
  `lng` decimal(10,7) DEFAULT NULL,
  `signature` varchar(255) DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'open',
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vehicle_handovers_tenant_id_index` (`tenant_id`),
  KEY `vehicle_handovers_vehicle_id_index` (`vehicle_id`),
  KEY `vehicle_handovers_user_id_index` (`user_id`),
  CONSTRAINT `vehicle_handovers_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `vehicle_handovers`
--

LOCK TABLES `vehicle_handovers` WRITE;
/*!40000 ALTER TABLE `vehicle_handovers` DISABLE KEYS */;
INSERT INTO `vehicle_handovers` VALUES (1,1,1,4,'teslim_al',181800,80,60,NULL,NULL,NULL,NULL,'closed','2026-09-20 14:39:04'),(2,4,4,11,'teslim_al',85000,90,NULL,NULL,NULL,NULL,NULL,'completed','2026-09-26 16:52:00');
/*!40000 ALTER TABLE `vehicle_handovers` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `vehicle_location_pings`
--

DROP TABLE IF EXISTS `vehicle_location_pings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `vehicle_location_pings` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `vehicle_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `lat` decimal(10,7) NOT NULL,
  `lng` decimal(10,7) NOT NULL,
  `accuracy_m` decimal(8,2) DEFAULT NULL,
  `speed_kmh` decimal(6,2) DEFAULT NULL,
  `heading` decimal(5,1) DEFAULT NULL,
  `recorded_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `vehicle_location_pings_tenant_id_vehicle_id_recorded_at_index` (`tenant_id`,`vehicle_id`,`recorded_at`),
  KEY `vehicle_location_pings_tenant_id_index` (`tenant_id`),
  CONSTRAINT `vehicle_location_pings_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`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 `vehicle_location_pings`
--

LOCK TABLES `vehicle_location_pings` WRITE;
/*!40000 ALTER TABLE `vehicle_location_pings` DISABLE KEYS */;
/*!40000 ALTER TABLE `vehicle_location_pings` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `vehicle_odometer_logs`
--

DROP TABLE IF EXISTS `vehicle_odometer_logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `vehicle_odometer_logs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `vehicle_id` bigint(20) unsigned NOT NULL,
  `km` int(10) unsigned NOT NULL,
  `source` varchar(255) NOT NULL,
  `source_id` bigint(20) unsigned DEFAULT NULL,
  `recorded_by` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `vehicle_odometer_logs_tenant_id_index` (`tenant_id`),
  KEY `vehicle_odometer_logs_vehicle_id_index` (`vehicle_id`),
  CONSTRAINT `vehicle_odometer_logs_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `vehicle_odometer_logs`
--

LOCK TABLES `vehicle_odometer_logs` WRITE;
/*!40000 ALTER TABLE `vehicle_odometer_logs` DISABLE KEYS */;
INSERT INTO `vehicle_odometer_logs` VALUES (1,1,1,181800,'handover',1,4,'2026-09-20 15:06:39'),(2,1,1,182340,'fuel_log',1,4,'2026-09-20 15:06:39'),(3,1,1,182340,'fuel_log',2,4,'2026-09-20 15:06:39'),(4,1,2,96210,'fuel_log',3,5,'2026-09-20 15:06:39'),(5,4,4,85200,'fuel_log',4,8,'2026-09-26 11:50:48'),(6,4,4,85000,'handover',2,11,'2026-09-26 16:52:00');
/*!40000 ALTER TABLE `vehicle_odometer_logs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `vehicle_request_comments`
--

DROP TABLE IF EXISTS `vehicle_request_comments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `vehicle_request_comments` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `request_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned NOT NULL,
  `body` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vehicle_request_comments_tenant_id_index` (`tenant_id`),
  KEY `vehicle_request_comments_request_id_index` (`request_id`),
  KEY `vehicle_request_comments_user_id_index` (`user_id`),
  CONSTRAINT `vehicle_request_comments_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`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 `vehicle_request_comments`
--

LOCK TABLES `vehicle_request_comments` WRITE;
/*!40000 ALTER TABLE `vehicle_request_comments` DISABLE KEYS */;
/*!40000 ALTER TABLE `vehicle_request_comments` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `vehicle_request_photos`
--

DROP TABLE IF EXISTS `vehicle_request_photos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `vehicle_request_photos` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `request_id` bigint(20) unsigned NOT NULL,
  `path` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vehicle_request_photos_tenant_id_index` (`tenant_id`),
  KEY `vehicle_request_photos_request_id_index` (`request_id`),
  CONSTRAINT `vehicle_request_photos_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`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 `vehicle_request_photos`
--

LOCK TABLES `vehicle_request_photos` WRITE;
/*!40000 ALTER TABLE `vehicle_request_photos` DISABLE KEYS */;
/*!40000 ALTER TABLE `vehicle_request_photos` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `vehicle_requests`
--

DROP TABLE IF EXISTS `vehicle_requests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `vehicle_requests` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned NOT NULL,
  `vehicle_id` bigint(20) unsigned DEFAULT NULL,
  `trailer_id` bigint(20) unsigned DEFAULT NULL,
  `job_id` bigint(20) unsigned DEFAULT NULL,
  `category` varchar(255) DEFAULT NULL,
  `req_type` varchar(255) DEFAULT NULL,
  `urgency` varchar(255) DEFAULT NULL,
  `body` text DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'open',
  `lat` decimal(10,7) DEFAULT NULL,
  `lng` decimal(10,7) DEFAULT NULL,
  `workshop_note` text DEFAULT NULL,
  `cost_est` decimal(10,2) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vehicle_requests_tenant_id_index` (`tenant_id`),
  KEY `vehicle_requests_user_id_index` (`user_id`),
  KEY `vehicle_requests_vehicle_id_index` (`vehicle_id`),
  KEY `vehicle_requests_trailer_id_index` (`trailer_id`),
  KEY `vehicle_requests_job_id_index` (`job_id`),
  CONSTRAINT `vehicle_requests_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`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 `vehicle_requests`
--

LOCK TABLES `vehicle_requests` WRITE;
/*!40000 ALTER TABLE `vehicle_requests` DISABLE KEYS */;
/*!40000 ALTER TABLE `vehicle_requests` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `vehicles`
--

DROP TABLE IF EXISTS `vehicles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `vehicles` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `plate` varchar(255) DEFAULT NULL,
  `vin` varchar(255) DEFAULT NULL,
  `euro_class` varchar(255) DEFAULT NULL,
  `fuel_card_last4` varchar(4) DEFAULT NULL,
  `inspection_exp` date DEFAULT NULL,
  `tacho_cal_exp` date DEFAULT NULL,
  `first_reg` date DEFAULT NULL,
  `current_km` int(10) unsigned DEFAULT NULL,
  `maintenance_interval_km` int(10) unsigned DEFAULT 15000,
  `last_maintenance_km` int(10) unsigned DEFAULT NULL,
  `last_maintenance_at` date DEFAULT NULL,
  `maintenance_notified_stage` varchar(255) DEFAULT NULL,
  `currently_inside_zone_id` bigint(20) unsigned DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'available',
  `assigned_user_id` bigint(20) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vehicles_tenant_id_index` (`tenant_id`),
  KEY `vehicles_assigned_user_id_index` (`assigned_user_id`),
  CONSTRAINT `vehicles_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `vehicles`
--

LOCK TABLES `vehicles` WRITE;
/*!40000 ALTER TABLE `vehicles` DISABLE KEYS */;
INSERT INTO `vehicles` VALUES (1,1,'DU-EX 1044','WMA1234567890','Euro 6',NULL,'2027-04-01','2027-02-01',NULL,182340,15000,NULL,NULL,'due',NULL,'assigned',4),(2,1,'DU-EX 2087','WMA2234567891','Euro 6',NULL,'2027-06-15','2027-03-10',NULL,96210,15000,NULL,NULL,'due',NULL,'available',5),(3,1,'DU-EX 3311','WMA3234567892','Euro 5',NULL,'2026-09-25','2026-10-01',NULL,NULL,15000,NULL,NULL,NULL,NULL,'workshop',NULL),(4,4,'34 ABC 123',NULL,NULL,NULL,NULL,NULL,NULL,85200,15000,NULL,NULL,NULL,NULL,'available',NULL),(5,2,'06 TRY 001',NULL,'Euro 6',NULL,NULL,NULL,NULL,NULL,15000,NULL,NULL,NULL,NULL,'available',NULL),(6,6,'61 KRD 007',NULL,'Euro 6',NULL,NULL,NULL,NULL,NULL,15000,NULL,NULL,NULL,NULL,'available',NULL);
/*!40000 ALTER TABLE `vehicles` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `work_days`
--

DROP TABLE IF EXISTS `work_days`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `work_days` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned NOT NULL,
  `work_date` date NOT NULL,
  `status` varchar(255) DEFAULT NULL,
  `note` varchar(255) DEFAULT NULL,
  `leave_id` bigint(20) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `work_days_tenant_id_index` (`tenant_id`),
  KEY `work_days_user_id_index` (`user_id`),
  KEY `work_days_leave_id_index` (`leave_id`),
  CONSTRAINT `work_days_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`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 `work_days`
--

LOCK TABLES `work_days` WRITE;
/*!40000 ALTER TABLE `work_days` DISABLE KEYS */;
/*!40000 ALTER TABLE `work_days` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `yards`
--

DROP TABLE IF EXISTS `yards`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `yards` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `kind` varchar(255) DEFAULT NULL,
  `country` varchar(2) DEFAULT NULL,
  `address` varchar(255) DEFAULT NULL,
  `lat` decimal(10,7) DEFAULT NULL,
  `lng` decimal(10,7) DEFAULT NULL,
  `radius_m` int(10) unsigned NOT NULL DEFAULT 20000,
  PRIMARY KEY (`id`),
  KEY `yards_tenant_id_index` (`tenant_id`),
  CONSTRAINT `yards_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `yards`
--

LOCK TABLES `yards` WRITE;
/*!40000 ALTER TABLE `yards` DISABLE KEYS */;
INSERT INTO `yards` VALUES (1,1,'Duisburg garaj','garage','DE','Hafenstr. 12, Duisburg',51.4344000,6.7623000,20000),(2,1,'TIP Venlo kiralık','rental','NL','Trade Port, Venlo',51.3704000,6.1724000,15000),(3,4,'İstanbul Ana Depo','garage','TR','Hadımköy OSB, İstanbul',41.1244000,28.6172000,200);
/*!40000 ALTER TABLE `yards` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Dumping routines for database 'fleetnora'
--
/*!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-10-03 18:12:30
