
/*!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'),('1e936681-772b-4afc-8bb6-ee1d9a880403','web_rates_cache_at','1773862448','int'),('1e936681-772b-4afc-8bb6-ee1d9a880403','web_rates_cache_json','{\"Update_Date\":\"2026-03-18 22:15:08\",\"USD\":{\"Alış\":\"44,2048\",\"Tür\":\"Döviz\",\"Satış\":\"44,2232\",\"Değişim\":\"%0,05\"},\"EUR\":{\"Alış\":\"50,8821\",\"Tür\":\"Döviz\",\"Satış\":\"50,9517\",\"Değişim\":\"%-0,23\"},\"GBP\":{\"Alış\":\"58,7791\",\"Tür\":\"Döviz\",\"Satış\":\"58,8619\",\"Değişim\":\"%-0,33\"},\"CHF\":{\"Alış\":\"55,7895\",\"Tür\":\"Döviz\",\"Satış\":\"55,8253\",\"Değişim\":\"%-0,90\"},\"CAD\":{\"Alış\":\"32,2149\",\"Tür\":\"Döviz\",\"Satış\":\"32,2346\",\"Değişim\":\"%-0,16\"},\"RUB\":{\"Alış\":\"0,5218\",\"Tür\":\"Döviz\",\"Satış\":\"0,5252\",\"Değişim\":\"%-1,96\"},\"AED\":{\"Alış\":\"12,0341\",\"Tür\":\"Döviz\",\"Satış\":\"12,0392\",\"Değişim\":\"%0,03\"},\"AUD\":{\"Alış\":\"31,1575\",\"Tür\":\"Döviz\",\"Satış\":\"31,1745\",\"Değişim\":\"%-0,73\"},\"DKK\":{\"Alış\":\"6,7873\",\"Tür\":\"Döviz\",\"Satış\":\"6,7919\",\"Değişim\":\"%-0,51\"},\"SEK\":{\"Alış\":\"4,7060\",\"Tür\":\"Döviz\",\"Satış\":\"4,7163\",\"Değişim\":\"%-1,09\"},\"NOK\":{\"Alış\":\"4,6018\",\"Tür\":\"Döviz\",\"Satış\":\"4,6068\",\"Değişim\":\"%-0,18\"},\"JPY\":{\"Alış\":\"0,2772\",\"Tür\":\"Döviz\",\"Satış\":\"0,2782\",\"Değişim\":\"%-0,14\"},\"KWD\":{\"Alış\":\"143,9544\",\"Tür\":\"Döviz\",\"Satış\":\"144,4730\",\"Değişim\":\"%0,09\"},\"ZAR\":{\"Alış\":\"2,6135\",\"Tür\":\"Döviz\",\"Satış\":\"2,6152\",\"Değişim\":\"%-1,41\"},\"BHD\":{\"Alış\":\"117,0833\",\"Tür\":\"Döviz\",\"Satış\":\"117,1320\",\"Değişim\":\"%0,05\"},\"LYD\":{\"Alış\":\"6,9287\",\"Tür\":\"Döviz\",\"Satış\":\"6,9315\",\"Değişim\":\"%-0,10\"},\"SAR\":{\"Alış\":\"11,7597\",\"Tür\":\"Döviz\",\"Satış\":\"11,7914\",\"Değişim\":\"%0,05\"},\"IQD\":{\"Alış\":\"0,0337\",\"Tür\":\"Döviz\",\"Satış\":\"0,0338\",\"Değişim\":\"%0,05\"},\"ILS\":{\"Alış\":\"14,2289\",\"Tür\":\"Döviz\",\"Satış\":\"14,2348\",\"Değişim\":\"%-0,30\"},\"IRR\":{\"Alış\":\"0,0001\",\"Tür\":\"Döviz\",\"Satış\":\"0,0001\",\"Değişim\":\"%-99,72\"},\"INR\":{\"Alış\":\"0,4752\",\"Tür\":\"Döviz\",\"Satış\":\"0,4754\",\"Değişim\":\"%-0,61\"},\"MXN\":{\"Alış\":\"2,4869\",\"Tür\":\"Döviz\",\"Satış\":\"2,4879\",\"Değişim\":\"%-0,62\"},\"HUF\":{\"Alış\":\"0,1292\",\"Tür\":\"Döviz\",\"Satış\":\"0,1293\",\"Değişim\":\"%-1,53\"},\"NZD\":{\"Alış\":\"25,6870\",\"Tür\":\"Döviz\",\"Satış\":\"25,6977\",\"Değişim\":\"%-0,76\"},\"BRL\":{\"Alış\":\"8,4724\",\"Tür\":\"Döviz\",\"Satış\":\"8,4759\",\"Değişim\":\"%-0,37\"},\"IDR\":{\"Alış\":\"0,0026\",\"Tür\":\"Döviz\",\"Satış\":\"0,0026\",\"Değişim\":\"%0,02\"},\"CZK\":{\"Alış\":\"2,0738\",\"Tür\":\"Döviz\",\"Satış\":\"2,0746\",\"Değişim\":\"%-0,64\"},\"PLN\":{\"Alış\":\"11,8651\",\"Tür\":\"Döviz\",\"Satış\":\"11,8701\",\"Değişim\":\"%-0,84\"},\"RON\":{\"Alış\":\"9,9582\",\"Tür\":\"Döviz\",\"Satış\":\"9,9714\",\"Değişim\":\"%-0,49\"},\"CNY\":{\"Alış\":\"6,4118\",\"Tür\":\"Döviz\",\"Satış\":\"6,4146\",\"Değişim\":\"%-0,11\"},\"ARS\":{\"Alış\":\"0,0317\",\"Tür\":\"Döviz\",\"Satış\":\"0,0317\",\"Değişim\":\"%0,19\"},\"ALL\":{\"Alış\":\"0,5294\",\"Tür\":\"Döviz\",\"Satış\":\"0,5296\",\"Değişim\":\"%-0,32\"},\"AZN\":{\"Alış\":\"26,0028\",\"Tür\":\"Döviz\",\"Satış\":\"26,0136\",\"Değişim\":\"%0,05\"},\"BAM\":{\"Alış\":\"26,0580\",\"Tür\":\"Döviz\",\"Satış\":\"26,0689\",\"Değişim\":\"%-0,94\"},\"CLP\":{\"Alış\":\"0,0482\",\"Tür\":\"Döviz\",\"Satış\":\"0,0482\",\"Değişim\":\"%-0,98\"},\"COP\":{\"Alış\":\"0,0119\",\"Tür\":\"Döviz\",\"Satış\":\"0,0119\",\"Değişim\":\"%-0,04\"},\"CRC\":{\"Alış\":\"0,0947\",\"Tür\":\"Döviz\",\"Satış\":\"0,0948\",\"Değişim\":\"%0,52\"},\"DZD\":{\"Alış\":\"0,3335\",\"Tür\":\"Döviz\",\"Satış\":\"0,3337\",\"Değişim\":\"%-0,29\"},\"EGP\":{\"Alış\":\"0,8449\",\"Tür\":\"Döviz\",\"Satış\":\"0,8453\",\"Değişim\":\"%-0,03\"},\"HKD\":{\"Alış\":\"5,6397\",\"Tür\":\"Döviz\",\"Satış\":\"5,6420\",\"Değişim\":\"%0,03\"},\"ISK\":{\"Alış\":\"0,3545\",\"Tür\":\"Döviz\",\"Satış\":\"0,3547\",\"Değişim\":\"%-0,13\"},\"KRW\":{\"Alış\":\"0,0294\",\"Tür\":\"Döviz\",\"Satış\":\"0,0294\",\"Değişim\":\"%-0,99\"},\"KZT\":{\"Alış\":\"0,0917\",\"Tür\":\"Döviz\",\"Satış\":\"0,0917\",\"Değişim\":\"%-0,30\"},\"LBP\":{\"Alış\":\"0,0005\",\"Tür\":\"Döviz\",\"Satış\":\"0,0005\",\"Değişim\":\"%-0,06\"},\"LKR\":{\"Alış\":\"0,1420\",\"Tür\":\"Döviz\",\"Satış\":\"0,1420\",\"Değişim\":\"%0,05\"},\"MAD\":{\"Alış\":\"4,7121\",\"Tür\":\"Döviz\",\"Satış\":\"4,7141\",\"Değişim\":\"%-0,10\"},\"MDL\":{\"Alış\":\"2,5445\",\"Tür\":\"Döviz\",\"Satış\":\"2,5455\",\"Değişim\":\"%0,09\"},\"MKD\":{\"Alış\":\"0,8264\",\"Tür\":\"Döviz\",\"Satış\":\"0,8268\",\"Değişim\":\"%0,05\"},\"MYR\":{\"Alış\":\"11,2903\",\"Tür\":\"Döviz\",\"Satış\":\"11,2950\",\"Değişim\":\"%0,21\"},\"OMR\":{\"Alış\":\"114,9730\",\"Tür\":\"Döviz\",\"Satış\":\"115,0208\",\"Değişim\":\"%0,06\"},\"PEN\":{\"Alış\":\"12,8990\",\"Tür\":\"Döviz\",\"Satış\":\"12,9043\",\"Değişim\":\"%-0,24\"},\"PHP\":{\"Alış\":\"0,7392\",\"Tür\":\"Döviz\",\"Satış\":\"0,7396\",\"Değişim\":\"%-0,17\"},\"PKR\":{\"Alış\":\"0,1581\",\"Tür\":\"Döviz\",\"Satış\":\"0,1585\",\"Değişim\":\"%0,06\"},\"QAR\":{\"Alış\":\"12,1225\",\"Tür\":\"Döviz\",\"Satış\":\"12,1437\",\"Değişim\":\"%0,04\"},\"RSD\":{\"Alış\":\"0,4330\",\"Tür\":\"Döviz\",\"Satış\":\"0,4345\",\"Değişim\":\"%-0,18\"},\"SGD\":{\"Alış\":\"34,4704\",\"Tür\":\"Döviz\",\"Satış\":\"34,4847\",\"Değişim\":\"%-0,43\"},\"SYP\":{\"Alış\":\"0,3827\",\"Tür\":\"Döviz\",\"Satış\":\"0,3829\",\"Değişim\":\"%0,05\"},\"THB\":{\"Alış\":\"1,3506\",\"Tür\":\"Döviz\",\"Satış\":\"1,3512\",\"Değişim\":\"%-1,24\"},\"TWD\":{\"Alış\":\"1,3823\",\"Tür\":\"Döviz\",\"Satış\":\"1,3828\",\"Değişim\":\"%-0,35\"},\"UAH\":{\"Alış\":\"1,0050\",\"Tür\":\"Döviz\",\"Satış\":\"1,0054\",\"Değişim\":\"%-0,28\"},\"UYU\":{\"Alış\":\"1,0901\",\"Tür\":\"Döviz\",\"Satış\":\"1,0906\",\"Değişim\":\"%0,20\"},\"GEL\":{\"Alış\":\"16,2817\",\"Tür\":\"Döviz\",\"Satış\":\"16,2885\",\"Değişim\":\"%-0,31\"},\"TND\":{\"Alış\":\"15,1542\",\"Tür\":\"Döviz\",\"Satış\":\"15,1605\",\"Değişim\":\"%0,57\"},\"BGN\":{\"Alış\":\"26,0683\",\"Tür\":\"Döviz\",\"Satış\":\"26,2976\",\"Değişim\":\"%0,68\"},\"ons\":{\"Alış\":\"$4.856,43\",\"Tür\":\"Altın\",\"Satış\":\"$4.857,06\",\"Değişim\":\"%-2,99\"},\"gram-altin\":{\"Alış\":\"6.903,48\",\"Tür\":\"Altın\",\"Satış\":\"6.904,37\",\"Değişim\":\"%-2,93\"},\"gram-has-altin\":{\"Alış\":\"6.868,96\",\"Tür\":\"Altın\",\"Satış\":\"6.869,85\",\"Değişim\":\"%-2,93\"},\"ceyrek-altin\":{\"Alış\":\"11.465,56\",\"Tür\":\"Altın\",\"Satış\":\"11.736,26\",\"Değişim\":\"%-1,02\"},\"yarim-altin\":{\"Alış\":\"22.859,46\",\"Tür\":\"Altın\",\"Satış\":\"23.472,52\",\"Değişim\":\"%-1,02\"},\"tam-altin\":{\"Alış\":\"45.862,23\",\"Tür\":\"Altın\",\"Satış\":\"46.801,48\",\"Değişim\":\"%-1,02\"},\"cumhuriyet-altini\":{\"Alış\":\"47.564,00\",\"Tür\":\"Altın\",\"Satış\":\"48.282,00\",\"Değişim\":\"%-1,02\"},\"ata-altin\":{\"Alış\":\"47.295,43\",\"Tür\":\"Altın\",\"Satış\":\"48.524,23\",\"Değişim\":\"%-1,02\"},\"14-ayar-altin\":{\"Alış\":\"4.084,61\",\"Tür\":\"Altın\",\"Satış\":\"4.091,54\",\"Değişim\":\"%-1,02\"},\"18-ayar-altin\":{\"Alış\":\"5.231,16\",\"Tür\":\"Altın\",\"Satış\":\"5.240,04\",\"Değişim\":\"%-1,02\"},\"22-ayar-bilezik\":{\"Alış\":\"6.535,37\",\"Tür\":\"Altın\",\"Satış\":\"6.546,46\",\"Değişim\":\"%-1,02\"},\"ikibucuk-altin\":{\"Alış\":\"114.655,58\",\"Tür\":\"Altın\",\"Satış\":\"116.573,01\",\"Değişim\":\"%-1,02\"},\"besli-altin\":{\"Alış\":\"232.177,56\",\"Tür\":\"Altın\",\"Satış\":\"236.878,65\",\"Değişim\":\"%-1,02\"},\"gremse-altin\":{\"Alış\":\"114.655,58\",\"Tür\":\"Altın\",\"Satış\":\"117.362,61\",\"Değişim\":\"%-1,02\"},\"resat-altin\":{\"Alış\":\"47.295,43\",\"Tür\":\"Altın\",\"Satış\":\"48.524,23\",\"Değişim\":\"%-1,02\"},\"hamit-altin\":{\"Alış\":\"47.295,43\",\"Tür\":\"Altın\",\"Satış\":\"48.524,23\",\"Değişim\":\"%-1,02\"},\"gumus\":{\"Alış\":\"108,46\",\"Tür\":\"Altın\",\"Satış\":\"108,54\",\"Değişim\":\"%-3,70\"},\"gram-platin\":{\"Alış\":\"2.902,07\",\"Tür\":\"Altın\",\"Satış\":\"2.908,65\",\"Değişim\":\"%-4,22\"},\"gram-paladyum\":{\"Alış\":\"2.141,58\",\"Tür\":\"Altın\",\"Satış\":\"2.148,49\",\"Değişim\":\"%-5,93\"}}','json');
/*!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 */;

