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

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `goldr_db_a0df0185e0` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;

USE `goldr_db_a0df0185e0`;
DROP TABLE IF EXISTS `agenda_notes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `agenda_notes` (
  `profile_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `note_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `note_value` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  PRIMARY KEY (`profile_id`,`note_key`),
  KEY `idx_profile` (`profile_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `agenda_notes` WRITE;
/*!40000 ALTER TABLE `agenda_notes` DISABLE KEYS */;
/*!40000 ALTER TABLE `agenda_notes` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `app_settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `app_settings` (
  `profile_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `setting_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `setting_value` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `setting_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  PRIMARY KEY (`profile_id`,`setting_key`),
  CONSTRAINT `fk_settings_profiles` FOREIGN KEY (`profile_id`) REFERENCES `profiles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `app_settings` WRITE;
/*!40000 ALTER TABLE `app_settings` DISABLE KEYS */;
INSERT INTO `app_settings` VALUES ('1e936681-772b-4afc-8bb6-ee1d9a880403','language','TR','str'),('1e936681-772b-4afc-8bb6-ee1d9a880403','password_enabled','0','bool'),('1e936681-772b-4afc-8bb6-ee1d9a880403','password_hash','','str'),('1e936681-772b-4afc-8bb6-ee1d9a880403','startup_history_fix_done_v1','\"1\"','str');
/*!40000 ALTER TABLE `app_settings` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `audit_logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `audit_logs` (
  `id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `profile_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `user_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `action` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `target_table` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `target_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `details` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `ip_address` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `fk_audit_profiles` (`profile_id`),
  CONSTRAINT `fk_audit_profiles` FOREIGN KEY (`profile_id`) REFERENCES `profiles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `audit_logs` WRITE;
/*!40000 ALTER TABLE `audit_logs` DISABLE KEYS */;
/*!40000 ALTER TABLE `audit_logs` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `barcode_history`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `barcode_history` (
  `id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `profile_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `barcode` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `product_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `gram` decimal(19,4) DEFAULT '0.0000',
  `karat` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `buy_date` datetime DEFAULT NULL,
  `buy_from` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `buy_price` decimal(19,4) DEFAULT '0.0000',
  `buy_method` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `is_sold` tinyint(1) DEFAULT '0',
  `sell_date` datetime DEFAULT NULL,
  `sell_to` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `sell_price` decimal(19,4) DEFAULT '0.0000',
  `sell_method` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `movements_json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `fk_barcode_profiles` (`profile_id`),
  CONSTRAINT `fk_barcode_profiles` FOREIGN KEY (`profile_id`) REFERENCES `profiles` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `barcode_history` WRITE;
/*!40000 ALTER TABLE `barcode_history` DISABLE KEYS */;
/*!40000 ALTER TABLE `barcode_history` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `categories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `categories` (
  `id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `profile_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_cats_profiles` (`profile_id`),
  CONSTRAINT `fk_cats_profiles` FOREIGN KEY (`profile_id`) REFERENCES `profiles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `categories` WRITE;
/*!40000 ALTER TABLE `categories` DISABLE KEYS */;
INSERT INTO `categories` VALUES ('b6d2334b-8cf2-4708-913a-c81f8a17bbf5','1e936681-772b-4afc-8bb6-ee1d9a880403','Gümüş'),('da06104e-9a1f-4a40-bcff-fb2e7f8d0527','1e936681-772b-4afc-8bb6-ee1d9a880403','Altın');
/*!40000 ALTER TABLE `categories` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `customer_history_events`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `customer_history_events` (
  `id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `profile_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `person_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `person_full_name` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `event_date` datetime DEFAULT NULL,
  `event_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `debt_original` decimal(19,4) DEFAULT '0.0000',
  `credit_original` decimal(19,4) DEFAULT '0.0000',
  `currency` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `transaction_amount` decimal(19,4) DEFAULT '0.0000',
  `related_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `fk_hist_profiles` (`profile_id`),
  CONSTRAINT `fk_hist_profiles` FOREIGN KEY (`profile_id`) REFERENCES `profiles` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `customer_history_events` WRITE;
/*!40000 ALTER TABLE `customer_history_events` DISABLE KEYS */;
/*!40000 ALTER TABLE `customer_history_events` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `debt_records`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `debt_records` (
  `id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `profile_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `person_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `person_full_name` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `record_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `transaction_date` date DEFAULT NULL,
  `debt_category` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `original_amount` decimal(19,4) DEFAULT '0.0000',
  `currency` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `total_amount_base` decimal(19,4) DEFAULT '0.0000',
  `product_name` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `product_quantity` decimal(19,4) DEFAULT '0.0000',
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'Active',
  `due_date` date DEFAULT NULL,
  `is_paid` tinyint(1) DEFAULT '0',
  `paid_amount_base` decimal(19,4) DEFAULT '0.0000',
  `paid_quantity` decimal(19,4) DEFAULT '0.0000',
  `payment_date` date DEFAULT NULL,
  `is_deleted` tinyint(1) DEFAULT '0',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `fk_debt_profiles` (`profile_id`),
  CONSTRAINT `fk_debt_profiles` FOREIGN KEY (`profile_id`) REFERENCES `profiles` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `debt_records` WRITE;
/*!40000 ALTER TABLE `debt_records` DISABLE KEYS */;
/*!40000 ALTER TABLE `debt_records` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `deleted_profiles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `deleted_profiles` (
  `profile_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `profile_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `transaction_uuid` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `device_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `deleted_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`profile_id`),
  KEY `idx_deleted_profiles_deleted_at` (`deleted_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `deleted_profiles` WRITE;
/*!40000 ALTER TABLE `deleted_profiles` DISABLE KEYS */;
INSERT INTO `deleted_profiles` VALUES ('103a46c7-f07a-4ad9-a4cd-796803bde4e6','Deleted from API','2b951deb-f7a8-4585-abc8-2f867a8839e6','WEB','2026-03-18 18:46:30'),('3bd1deb2-de30-4f45-9ddf-09e876b30ea0','Deleted from API','1086ee34-4c14-4696-b525-7f8721d01050','WEB','2026-03-18 15:14:47'),('650e5624-5ea5-49ed-b67a-61faee88165e','Deleted from API','ea5b41b4-2378-476f-af9e-e00a6c2a1865','WEB','2026-03-18 15:14:45'),('68ba753b-8a33-4397-8981-0fa2947099a1','Deleted from API','666ddebf-40ed-4570-8ab2-6900c72fb0e7','WEB','2026-03-18 18:46:30'),('d575f42f-43db-4d84-994c-ad90c8eb3fcc','Deleted from API','0503ed38-2138-4327-85bd-f8451abf6306','WEB','2026-03-18 15:14:46'),('d9aa2f9c-419e-4cc7-8ec4-37694fe05ecb','Deleted from API','764459ff-a6aa-46f1-bfb3-69be760747ec','WEB','2026-03-18 18:46:29'),('e1286566-0a8d-4bd0-9f40-1b456f3c3c1e','Deleted from API','a9a48a32-548d-4f26-8058-042ab7a11bf3','WEB','2026-03-18 15:14:46'),('e85a2857-d368-412c-946f-64056d94ea21','Deleted from API','c36b6c01-0eed-490a-b149-52f72076e7e8','WEB','2026-03-18 18:46:31');
/*!40000 ALTER TABLE `deleted_profiles` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `depots`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `depots` (
  `id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `profile_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `is_deleted` tinyint(1) DEFAULT '0',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `fk_depots_profiles` (`profile_id`),
  CONSTRAINT `fk_depots_profiles` FOREIGN KEY (`profile_id`) REFERENCES `profiles` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `depots` WRITE;
/*!40000 ALTER TABLE `depots` DISABLE KEYS */;
INSERT INTO `depots` VALUES ('4cc4c8dc-aa37-4e3c-9c5a-bc69695f20c3','1e936681-772b-4afc-8bb6-ee1d9a880403','Merkez',0,'2026-03-18 21:46:25','2026-03-18 21:46:25');
/*!40000 ALTER TABLE `depots` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `document_counters`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `document_counters` (
  `id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `profile_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `doc_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `last_no` int NOT NULL DEFAULT '0',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniq_doc_counter` (`profile_id`,`doc_type`),
  CONSTRAINT `fk_doc_counter_profiles` FOREIGN KEY (`profile_id`) REFERENCES `profiles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `document_counters` WRITE;
/*!40000 ALTER TABLE `document_counters` DISABLE KEYS */;
/*!40000 ALTER TABLE `document_counters` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `financial_accounts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `financial_accounts` (
  `id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `profile_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `is_deleted` tinyint(1) DEFAULT '0',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `fk_accounts_profiles` (`profile_id`),
  CONSTRAINT `fk_accounts_profiles` FOREIGN KEY (`profile_id`) REFERENCES `profiles` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `financial_accounts` WRITE;
/*!40000 ALTER TABLE `financial_accounts` DISABLE KEYS */;
INSERT INTO `financial_accounts` VALUES ('c6b6ded2-6a67-427b-98c9-a8ba8b7d66d6','1e936681-772b-4afc-8bb6-ee1d9a880403','Ana Kasa','cash',0,'2026-03-18 21:46:25','2026-03-18 21:46:25');
/*!40000 ALTER TABLE `financial_accounts` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `financial_transactions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `financial_transactions` (
  `id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `profile_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `account_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `transaction_date` date DEFAULT NULL,
  `transaction_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `amount` decimal(19,4) DEFAULT '0.0000',
  `currency` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `base_amount` decimal(19,4) DEFAULT '0.0000',
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `related_person_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `related_record_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `is_deleted` tinyint(1) DEFAULT '0',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `fk_trans_profiles` (`profile_id`),
  KEY `fk_trans_accounts` (`account_id`),
  CONSTRAINT `fk_trans_accounts` FOREIGN KEY (`account_id`) REFERENCES `financial_accounts` (`id`),
  CONSTRAINT `fk_trans_profiles` FOREIGN KEY (`profile_id`) REFERENCES `profiles` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `financial_transactions` WRITE;
/*!40000 ALTER TABLE `financial_transactions` DISABLE KEYS */;
/*!40000 ALTER TABLE `financial_transactions` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `global_sync_events`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `global_sync_events` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `transaction_uuid` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `device_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `profile_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `table_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `action_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `record_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `payload_json` json DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_profile_created` (`profile_id`,`created_at`),
  KEY `idx_tx_uuid` (`transaction_uuid`)
) ENGINE=InnoDB AUTO_INCREMENT=1099 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `global_sync_events` WRITE;
/*!40000 ALTER TABLE `global_sync_events` DISABLE KEYS */;
INSERT INTO `global_sync_events` VALUES (1083,'9f311e8c-081f-48d5-9ecd-66bc6eb7a7c6','42c394ca-cd8d-4420-b222-e4f6af18c289','1e936681-772b-4afc-8bb6-ee1d9a880403','profiles','ADD','1e936681-772b-4afc-8bb6-ee1d9a880403','{\"meta\": {\"source\": \"sync.profiles.import\"}, \"after\": {\"id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\", \"name\": \"xc\", \"is_active\": 1, \"created_at\": \"2026-03-18T21:46:23\", \"is_deleted\": 0}, \"before\": null, \"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\"}','2026-03-18 18:46:31'),(1084,'9f311e8c-081f-48d5-9ecd-66bc6eb7a7c6','42c394ca-cd8d-4420-b222-e4f6af18c289','1e936681-772b-4afc-8bb6-ee1d9a880403','app_settings','ADD','3556388d-a2dc-3b3c-ddcd-d09c92708f07','{\"meta\": {\"source\": \"sync.profiles.import\"}, \"after\": {\"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\", \"setting_key\": \"language\", \"setting_type\": \"str\", \"setting_value\": \"TR\"}, \"before\": null, \"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\"}','2026-03-18 18:46:31'),(1085,'9f311e8c-081f-48d5-9ecd-66bc6eb7a7c6','42c394ca-cd8d-4420-b222-e4f6af18c289','1e936681-772b-4afc-8bb6-ee1d9a880403','app_settings','ADD','9f3bf87f-5bcb-2f24-c17a-18000e68758a','{\"meta\": {\"source\": \"sync.profiles.import\"}, \"after\": {\"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\", \"setting_key\": \"password_enabled\", \"setting_type\": \"bool\", \"setting_value\": \"0\"}, \"before\": null, \"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\"}','2026-03-18 18:46:31'),(1086,'9f311e8c-081f-48d5-9ecd-66bc6eb7a7c6','42c394ca-cd8d-4420-b222-e4f6af18c289','1e936681-772b-4afc-8bb6-ee1d9a880403','app_settings','ADD','d2b6ea63-24e1-2389-8d98-c848ff1be629','{\"meta\": {\"source\": \"sync.profiles.import\"}, \"after\": {\"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\", \"setting_key\": \"password_hash\", \"setting_type\": \"str\", \"setting_value\": \"\"}, \"before\": null, \"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\"}','2026-03-18 18:46:31'),(1087,'9f311e8c-081f-48d5-9ecd-66bc6eb7a7c6','42c394ca-cd8d-4420-b222-e4f6af18c289','1e936681-772b-4afc-8bb6-ee1d9a880403','app_settings','ADD','7f4c6fa0-9d71-88e0-f36c-68b09d33557f','{\"meta\": {\"source\": \"sync.profiles.import\"}, \"after\": {\"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\", \"setting_key\": \"startup_history_fix_done_v1\", \"setting_type\": \"str\", \"setting_value\": \"\\\"1\\\"\"}, \"before\": null, \"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\"}','2026-03-18 18:46:31'),(1088,'9f311e8c-081f-48d5-9ecd-66bc6eb7a7c6','42c394ca-cd8d-4420-b222-e4f6af18c289','1e936681-772b-4afc-8bb6-ee1d9a880403','users','ADD','1a9e3744-758b-45b7-b149-171053586120','{\"meta\": {\"source\": \"sync.profiles.import\"}, \"after\": {\"id\": \"1a9e3744-758b-45b7-b149-171053586120\", \"role\": \"admin\", \"username\": \"admin\", \"full_name\": \"Yönetici\", \"is_active\": 1, \"created_at\": \"2026-03-18T21:46:23\", \"is_deleted\": 0, \"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\", \"password_hash\": \"\"}, \"before\": null, \"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\"}','2026-03-18 18:46:31'),(1089,'9f311e8c-081f-48d5-9ecd-66bc6eb7a7c6','42c394ca-cd8d-4420-b222-e4f6af18c289','1e936681-772b-4afc-8bb6-ee1d9a880403','depots','ADD','4cc4c8dc-aa37-4e3c-9c5a-bc69695f20c3','{\"meta\": {\"source\": \"sync.profiles.import\"}, \"after\": {\"id\": \"4cc4c8dc-aa37-4e3c-9c5a-bc69695f20c3\", \"name\": \"Merkez\", \"created_at\": \"2026-03-18T21:46:25\", \"is_deleted\": 0, \"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\", \"updated_at\": \"2026-03-18T21:46:25\"}, \"before\": null, \"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\"}','2026-03-18 18:46:31'),(1090,'9f311e8c-081f-48d5-9ecd-66bc6eb7a7c6','42c394ca-cd8d-4420-b222-e4f6af18c289','1e936681-772b-4afc-8bb6-ee1d9a880403','categories','ADD','b6d2334b-8cf2-4708-913a-c81f8a17bbf5','{\"meta\": {\"source\": \"sync.profiles.import\"}, \"after\": {\"id\": \"b6d2334b-8cf2-4708-913a-c81f8a17bbf5\", \"name\": \"Gümüş\", \"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\"}, \"before\": null, \"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\"}','2026-03-18 18:46:31'),(1091,'9f311e8c-081f-48d5-9ecd-66bc6eb7a7c6','42c394ca-cd8d-4420-b222-e4f6af18c289','1e936681-772b-4afc-8bb6-ee1d9a880403','categories','ADD','da06104e-9a1f-4a40-bcff-fb2e7f8d0527','{\"meta\": {\"source\": \"sync.profiles.import\"}, \"after\": {\"id\": \"da06104e-9a1f-4a40-bcff-fb2e7f8d0527\", \"name\": \"Altın\", \"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\"}, \"before\": null, \"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\"}','2026-03-18 18:46:31'),(1092,'9f311e8c-081f-48d5-9ecd-66bc6eb7a7c6','42c394ca-cd8d-4420-b222-e4f6af18c289','1e936681-772b-4afc-8bb6-ee1d9a880403','financial_accounts','ADD','c6b6ded2-6a67-427b-98c9-a8ba8b7d66d6','{\"meta\": {\"source\": \"sync.profiles.import\"}, \"after\": {\"id\": \"c6b6ded2-6a67-427b-98c9-a8ba8b7d66d6\", \"name\": \"Ana Kasa\", \"type\": \"cash\", \"created_at\": \"2026-03-18T21:46:25\", \"is_deleted\": 0, \"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\", \"updated_at\": \"2026-03-18T21:46:25\"}, \"before\": null, \"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\"}','2026-03-18 18:46:31'),(1093,'4bfe27ef-6e53-4164-a662-3fe7090bb933','42c394ca-cd8d-4420-b222-e4f6af18c289','1e936681-772b-4afc-8bb6-ee1d9a880403','app_settings','UPDATE','9f3bf87f-5bcb-2f24-c17a-18000e68758a','{\"meta\": {\"source\": \"AuthRepository._publish_current_profile_password_settings_once\"}, \"after\": {\"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\", \"setting_key\": \"password_enabled\", \"setting_type\": \"bool\", \"setting_value\": \"0\"}, \"before\": null, \"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\"}','2026-03-18 18:46:32'),(1094,'70bfb58c-2daa-4ea8-a1f5-a5d3b8d0ef9c','42c394ca-cd8d-4420-b222-e4f6af18c289','1e936681-772b-4afc-8bb6-ee1d9a880403','app_settings','UPDATE','d2b6ea63-24e1-2389-8d98-c848ff1be629','{\"meta\": {\"source\": \"AuthRepository._publish_current_profile_password_settings_once\"}, \"after\": {\"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\", \"setting_key\": \"password_hash\", \"setting_type\": \"str\", \"setting_value\": \"\"}, \"before\": null, \"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\"}','2026-03-18 18:46:32'),(1095,'5994e034-7fde-474e-ad87-84b3dbcb2bcd','42c394ca-cd8d-4420-b222-e4f6af18c289','1e936681-772b-4afc-8bb6-ee1d9a880403','depots','ADD','4cc4c8dc-aa37-4e3c-9c5a-bc69695f20c3','{\"meta\": {\"source\": \"BaseManager.add_item\"}, \"after\": {\"id\": \"4cc4c8dc-aa37-4e3c-9c5a-bc69695f20c3\", \"name\": \"Merkez\", \"created_at\": \"2026-03-18T21:46:25\", \"is_deleted\": 0, \"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\", \"updated_at\": \"2026-03-18T21:46:25\"}, \"before\": null, \"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\"}','2026-03-18 18:46:33'),(1096,'31f5f6bc-4aea-4e98-8c36-1d9c7648c124','42c394ca-cd8d-4420-b222-e4f6af18c289','1e936681-772b-4afc-8bb6-ee1d9a880403','categories','ADD','da06104e-9a1f-4a40-bcff-fb2e7f8d0527','{\"meta\": {\"source\": \"BaseManager.add_item\"}, \"after\": {\"id\": \"da06104e-9a1f-4a40-bcff-fb2e7f8d0527\", \"name\": \"Altın\", \"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\"}, \"before\": null, \"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\"}','2026-03-18 18:46:33'),(1097,'e883b12e-fbb2-45a4-ba68-9eaa01347a83','42c394ca-cd8d-4420-b222-e4f6af18c289','1e936681-772b-4afc-8bb6-ee1d9a880403','categories','ADD','b6d2334b-8cf2-4708-913a-c81f8a17bbf5','{\"meta\": {\"source\": \"BaseManager.add_item\"}, \"after\": {\"id\": \"b6d2334b-8cf2-4708-913a-c81f8a17bbf5\", \"name\": \"Gümüş\", \"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\"}, \"before\": null, \"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\"}','2026-03-18 18:46:34'),(1098,'0e7f0ad0-9326-4b3c-9e35-2b87f920a6f8','42c394ca-cd8d-4420-b222-e4f6af18c289','1e936681-772b-4afc-8bb6-ee1d9a880403','financial_accounts','ADD','c6b6ded2-6a67-427b-98c9-a8ba8b7d66d6','{\"meta\": {\"source\": \"BaseManager.add_item\"}, \"after\": {\"id\": \"c6b6ded2-6a67-427b-98c9-a8ba8b7d66d6\", \"name\": \"Ana Kasa\", \"type\": \"cash\", \"created_at\": \"2026-03-18T21:46:25\", \"is_deleted\": 0, \"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\", \"updated_at\": \"2026-03-18T21:46:25\"}, \"before\": null, \"profile_id\": \"1e936681-772b-4afc-8bb6-ee1d9a880403\"}','2026-03-18 18:46:35');
/*!40000 ALTER TABLE `global_sync_events` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `persons`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `persons` (
  `id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `profile_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `full_name` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `phone_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `is_deleted` tinyint(1) DEFAULT '0',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `fk_persons_profiles` (`profile_id`),
  CONSTRAINT `fk_persons_profiles` FOREIGN KEY (`profile_id`) REFERENCES `profiles` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `persons` WRITE;
/*!40000 ALTER TABLE `persons` DISABLE KEYS */;
/*!40000 ALTER TABLE `persons` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `product_definitions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `product_definitions` (
  `id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `profile_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `stock_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `name` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `category_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `barcode_header` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `karat_purity` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `workmanship_fee` decimal(19,4) DEFAULT '0.0000',
  `workmanship_currency` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'TRY',
  `default_purchase_price` decimal(19,4) DEFAULT '0.0000',
  `default_sale_price` decimal(19,4) DEFAULT '0.0000',
  `purchase_currency` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'TRY',
  `sale_currency` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'TRY',
  `default_weight_gr` decimal(19,4) DEFAULT '0.0000',
  `is_active` tinyint(1) DEFAULT '1',
  `is_deleted` tinyint(1) DEFAULT '0',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `fk_products_profiles` (`profile_id`),
  CONSTRAINT `fk_products_profiles` FOREIGN KEY (`profile_id`) REFERENCES `profiles` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `product_definitions` WRITE;
/*!40000 ALTER TABLE `product_definitions` DISABLE KEYS */;
/*!40000 ALTER TABLE `product_definitions` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `profiles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `profiles` (
  `id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `is_active` tinyint(1) DEFAULT '1',
  `is_deleted` tinyint(1) DEFAULT '0',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `profiles` WRITE;
/*!40000 ALTER TABLE `profiles` DISABLE KEYS */;
INSERT INTO `profiles` VALUES ('1e936681-772b-4afc-8bb6-ee1d9a880403','xc',1,0,'2026-03-18 21:46:23');
/*!40000 ALTER TABLE `profiles` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `repair_records`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `repair_records` (
  `id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `profile_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `customer_full_name` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `product_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `complaint_request` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `receipt_date` date DEFAULT NULL,
  `estimated_fee` decimal(19,4) DEFAULT '0.0000',
  `fee_currency` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `delivery_date` date DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `is_deleted` tinyint(1) DEFAULT '0',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `fk_repair_profiles` (`profile_id`),
  CONSTRAINT `fk_repair_profiles` FOREIGN KEY (`profile_id`) REFERENCES `profiles` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `repair_records` WRITE;
/*!40000 ALTER TABLE `repair_records` DISABLE KEYS */;
/*!40000 ALTER TABLE `repair_records` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `sales`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `sales` (
  `id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `profile_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `sale_date` date DEFAULT NULL,
  `customer_full_name` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `total_amount` decimal(19,4) DEFAULT '0.0000',
  `currency` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `payment_method_summary` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `products_json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `is_deleted` tinyint(1) DEFAULT '0',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `fk_sales_profiles` (`profile_id`),
  CONSTRAINT `fk_sales_profiles` FOREIGN KEY (`profile_id`) REFERENCES `profiles` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `sales` WRITE;
/*!40000 ALTER TABLE `sales` DISABLE KEYS */;
/*!40000 ALTER TABLE `sales` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `scheduled_transactions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `scheduled_transactions` (
  `id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `profile_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `due_date` date DEFAULT NULL,
  `transaction_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `amount` decimal(19,4) DEFAULT '0.0000',
  `currency` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `target` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `person_full_name` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'Pending',
  `is_deleted` tinyint(1) DEFAULT '0',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `fk_st_profiles` (`profile_id`),
  CONSTRAINT `fk_st_profiles` FOREIGN KEY (`profile_id`) REFERENCES `profiles` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `scheduled_transactions` WRITE;
/*!40000 ALTER TABLE `scheduled_transactions` DISABLE KEYS */;
/*!40000 ALTER TABLE `scheduled_transactions` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `service_definitions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `service_definitions` (
  `id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `profile_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `custom_columns_json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `clone_columns_json` longtext COLLATE utf8mb4_general_ci,
  PRIMARY KEY (`id`),
  KEY `fk_servdef_profiles` (`profile_id`),
  CONSTRAINT `fk_servdef_profiles` FOREIGN KEY (`profile_id`) REFERENCES `profiles` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `service_definitions` WRITE;
/*!40000 ALTER TABLE `service_definitions` DISABLE KEYS */;
/*!40000 ALTER TABLE `service_definitions` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `service_jobs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `service_jobs` (
  `id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `profile_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `service_def_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `customer_name` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `fee` decimal(19,4) DEFAULT '0.0000',
  `currency` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `start_date` date DEFAULT NULL,
  `delivery_date` date DEFAULT NULL,
  `dynamic_data_json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  PRIMARY KEY (`id`),
  KEY `fk_servjob_profiles` (`profile_id`),
  KEY `fk_servjob_def` (`service_def_id`),
  CONSTRAINT `fk_servjob_def` FOREIGN KEY (`service_def_id`) REFERENCES `service_definitions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_servjob_profiles` FOREIGN KEY (`profile_id`) REFERENCES `profiles` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `service_jobs` WRITE;
/*!40000 ALTER TABLE `service_jobs` DISABLE KEYS */;
/*!40000 ALTER TABLE `service_jobs` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `stock_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `stock_items` (
  `id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `profile_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `depot_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `stock_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'Product',
  `item_type_name` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `quantity` decimal(19,4) DEFAULT '0.0000',
  `quantity_gr` decimal(19,4) DEFAULT '0.0000',
  `purchase_price_base` decimal(19,4) DEFAULT '0.0000',
  `unique_barcode` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `is_deleted` tinyint(1) DEFAULT '0',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_unique_stock` (`profile_id`,`depot_id`,`item_type_name`,`purchase_price_base`,`unique_barcode`),
  CONSTRAINT `fk_stock_profiles` FOREIGN KEY (`profile_id`) REFERENCES `profiles` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `stock_items` WRITE;
/*!40000 ALTER TABLE `stock_items` DISABLE KEYS */;
/*!40000 ALTER TABLE `stock_items` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `stock_movements`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `stock_movements` (
  `id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `profile_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `date` datetime DEFAULT NULL,
  `item_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `product_name` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `operation_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `quantity` decimal(19,4) DEFAULT NULL,
  `source` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `destination` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `user` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `fk_moves_profiles` (`profile_id`),
  CONSTRAINT `fk_moves_profiles` FOREIGN KEY (`profile_id`) REFERENCES `profiles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `stock_movements` WRITE;
/*!40000 ALTER TABLE `stock_movements` DISABLE KEYS */;
/*!40000 ALTER TABLE `stock_movements` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `tax_applications`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tax_applications` (
  `id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `source_table` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `source_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `profile_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `subtotal` decimal(19,4) NOT NULL DEFAULT '0.0000',
  `tax_total` decimal(19,4) NOT NULL DEFAULT '0.0000',
  `grand_total` decimal(19,4) NOT NULL DEFAULT '0.0000',
  `currency` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `snapshot_json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_tax_app_source` (`source_table`,`source_id`),
  KEY `idx_tax_app_profile` (`profile_id`),
  CONSTRAINT `fk_tax_app_profiles` FOREIGN KEY (`profile_id`) REFERENCES `profiles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `tax_applications` WRITE;
/*!40000 ALTER TABLE `tax_applications` DISABLE KEYS */;
/*!40000 ALTER TABLE `tax_applications` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `tax_profile_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tax_profile_items` (
  `id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `profile_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `tax_profile_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `tax_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `priority` int NOT NULL DEFAULT '0',
  `enabled_by_default` tinyint(1) DEFAULT '1',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniq_profile_tax` (`tax_profile_id`,`tax_id`),
  KEY `idx_tax_profile_items_profile` (`profile_id`),
  KEY `fk_tax_profile_items_tax` (`tax_id`),
  CONSTRAINT `fk_tax_profile_items_profile` FOREIGN KEY (`tax_profile_id`) REFERENCES `tax_profiles` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_tax_profile_items_profiles` FOREIGN KEY (`profile_id`) REFERENCES `profiles` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_tax_profile_items_tax` FOREIGN KEY (`tax_id`) REFERENCES `taxes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `tax_profile_items` WRITE;
/*!40000 ALTER TABLE `tax_profile_items` DISABLE KEYS */;
/*!40000 ALTER TABLE `tax_profile_items` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `tax_profiles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tax_profiles` (
  `id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `profile_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `name` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_tax_profiles_profile` (`profile_id`),
  CONSTRAINT `fk_tax_profiles_profiles` FOREIGN KEY (`profile_id`) REFERENCES `profiles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `tax_profiles` WRITE;
/*!40000 ALTER TABLE `tax_profiles` DISABLE KEYS */;
/*!40000 ALTER TABLE `tax_profiles` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `taxes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `taxes` (
  `id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `profile_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `name` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `rate` decimal(19,4) NOT NULL DEFAULT '0.0000',
  `type` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `country` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `active` tinyint(1) DEFAULT '1',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_taxes_profile` (`profile_id`),
  CONSTRAINT `fk_taxes_profiles` FOREIGN KEY (`profile_id`) REFERENCES `profiles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `taxes` WRITE;
/*!40000 ALTER TABLE `taxes` DISABLE KEYS */;
/*!40000 ALTER TABLE `taxes` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `user_access_scopes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `user_access_scopes` (
  `user_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `scope_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `target_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  KEY `fk_scope_users` (`user_id`),
  CONSTRAINT `fk_scope_users` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `user_access_scopes` WRITE;
/*!40000 ALTER TABLE `user_access_scopes` DISABLE KEYS */;
/*!40000 ALTER TABLE `user_access_scopes` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `user_permissions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `user_permissions` (
  `user_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `permission_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  PRIMARY KEY (`user_id`,`permission_code`),
  CONSTRAINT `fk_perm_users` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `user_permissions` WRITE;
/*!40000 ALTER TABLE `user_permissions` DISABLE KEYS */;
/*!40000 ALTER TABLE `user_permissions` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `users` (
  `id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `profile_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `full_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `password_hash` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `role` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'employee',
  `is_active` tinyint(1) DEFAULT '1',
  `is_deleted` tinyint(1) DEFAULT '0',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `fk_users_profiles` (`profile_id`),
  CONSTRAINT `fk_users_profiles` FOREIGN KEY (`profile_id`) REFERENCES `profiles` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES ('1a9e3744-758b-45b7-b149-171053586120','1e936681-772b-4afc-8bb6-ee1d9a880403','admin','Yönetici','','admin',1,0,'2026-03-18 21:46:23');
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
/*!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 */;

