/*
 Navicat Premium Dump SQL

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 100427 (10.4.27-MariaDB)
 Source Host           : localhost:3306
 Source Schema         : decopaint_erp

 Target Server Type    : MySQL
 Target Server Version : 100427 (10.4.27-MariaDB)
 File Encoding         : 65001

 Date: 23/05/2026 11:43:41
*/


-- ----------------------------
-- Table structure for app_settings
-- ----------------------------
CREATE TABLE `app_settings`  (
  `setting_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `setting_value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`setting_key`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of app_settings
-- ----------------------------
INSERT INTO `app_settings` VALUES ('app_logo', 'uploads/settings/logo_20260513230141_96290fee.jpg', '2026-05-13 23:01:41');
INSERT INTO `app_settings` VALUES ('app_name', 'DECOPAINT ERP', '2026-05-13 23:00:37');
INSERT INTO `app_settings` VALUES ('app_tagline', 'Integrated Operations Platform', '2026-05-13 23:00:37');
INSERT INTO `app_settings` VALUES ('browser_icon', 'uploads/settings/favicon_20260513230714_170a0b8f.png', '2026-05-13 23:07:14');
INSERT INTO `app_settings` VALUES ('company_name', 'PT. KREASI KARYA PAINTINDO', '2026-05-13 23:00:37');
INSERT INTO `app_settings` VALUES ('letterhead_address', 'Jl. Swakarsa IV A Jl. Buntu No.12A-B, RT.3/RW.2, Pd. Klp., Kec. Duren Sawit, Kota Jakarta Timur, Daerah Khusus Ibukota Jakarta 13450', '2026-05-20 15:52:10');
INSERT INTO `app_settings` VALUES ('letterhead_city', 'Jakarta', '2026-05-20 15:52:10');
INSERT INTO `app_settings` VALUES ('letterhead_email', 'decopaint.kkp@gmail.com', '2026-05-20 15:52:10');
INSERT INTO `app_settings` VALUES ('letterhead_phone', '', '2026-05-20 15:52:10');
INSERT INTO `app_settings` VALUES ('letterhead_website', 'www.decopaint.co.id', '2026-05-20 15:52:10');
INSERT INTO `app_settings` VALUES ('order_target_monthly_2026', '0', '2026-05-22 22:45:33');
INSERT INTO `app_settings` VALUES ('order_target_yearly_2026', '0', '2026-05-22 22:45:33');
INSERT INTO `app_settings` VALUES ('order_target_yearly_2027', '10000000000', '2026-05-22 22:42:27');

-- ----------------------------
-- Table structure for attendance
-- ----------------------------
CREATE TABLE `attendance`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `employee_id` bigint UNSIGNED NOT NULL,
  `attendance_date` date NOT NULL,
  `check_in` time NULL DEFAULT NULL,
  `check_out` time NULL DEFAULT NULL,
  `status` enum('present','late','leave','absent') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'present',
  `notes` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_attendance_unique`(`employee_id` ASC, `attendance_date` ASC) USING BTREE,
  CONSTRAINT `fk_attendance_employee` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of attendance
-- ----------------------------
INSERT INTO `attendance` VALUES (3, 1, '2026-05-19', '13:20:00', '13:20:06', 'present', 'Clock In dari top bar | Koordinat: -6.2429327, 106.9421288 | Lokasi: RW 02, Pondok Kelapa, Duren Sawit, East Jakarta, Special Capital Region of Jakarta, Java, 17412, Indonesia | Clock Out: -6.2429327, 106.9421288 (RW 02, Pondok Kelapa, Duren Sawit, East J');
INSERT INTO `attendance` VALUES (4, 1, '2026-05-22', '15:13:39', '15:24:55', 'present', 'Clock In dari top bar | Koordinat: -6.2458730, 106.9000433 | Lokasi: Jalan Jagur I, RW 10, Cipinang Melayu, Makasar, East Jakarta, Special Capital Region of Jakarta, Java, 13430, Indonesia | Clock Out: -6.2458730, 106.9000433 (Jalan Jagur I, RW 10, Cipina');
INSERT INTO `attendance` VALUES (5, 7, '2026-05-22', '16:38:12', '16:59:36', 'present', 'Clock In dari top bar | Koordinat: -6.2426880, 106.9420020 | Lokasi: RW 02, Pondok Kelapa, Duren Sawit, East Jakarta, Special Capital Region of Jakarta, Java, 17412, Indonesia | Clock Out: -6.2426880, 106.9420020 (RW 02, Pondok Kelapa, Duren Sawit, East J');
INSERT INTO `attendance` VALUES (6, 7, '2026-05-23', '08:00:14', NULL, 'present', 'Clock In dari top bar | Koordinat: -6.2426844, 106.9420070 | Lokasi: RW 02, Pondok Kelapa, Duren Sawit, East Jakarta, Special Capital Region of Jakarta, Java, 17412, Indonesia');

-- ----------------------------
-- Table structure for audit_logs
-- ----------------------------
CREATE TABLE `audit_logs`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `user_id` bigint UNSIGNED NULL DEFAULT NULL,
  `module_name` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `action_name` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `entity_type` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `entity_id` bigint UNSIGNED NULL DEFAULT NULL,
  `old_values` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL,
  `new_values` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL,
  `ip_address` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `user_agent` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `fk_audit_logs_user`(`user_id` ASC) USING BTREE,
  CONSTRAINT `fk_audit_logs_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of audit_logs
-- ----------------------------

-- ----------------------------
-- Table structure for brands
-- ----------------------------
CREATE TABLE `brands`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_internal` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `code`(`code` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of brands
-- ----------------------------
INSERT INTO `brands` VALUES (1, 'DECO', 'DECOPAINT', 1, '2026-05-13 22:33:10', '2026-05-13 22:33:10');
INSERT INTO `brands` VALUES (2, 'EXT01', 'Brand Lain', 0, '2026-05-13 22:33:10', '2026-05-13 22:33:10');
INSERT INTO `brands` VALUES (3, 'BR-DECO', 'Decopaint', 1, '2026-05-14 00:07:08', '2026-05-14 00:07:08');

-- ----------------------------
-- Table structure for cash_transactions
-- ----------------------------
CREATE TABLE `cash_transactions`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `trx_no` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `trx_date` datetime NOT NULL,
  `trx_direction` enum('in','out') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `category_name` enum('sales','service_income','procurement','salary','operational','other') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(15, 2) NOT NULL,
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `reference_type` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `reference_id` bigint UNSIGNED NULL DEFAULT NULL,
  `created_by` bigint UNSIGNED NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `trx_no`(`trx_no` ASC) USING BTREE,
  INDEX `fk_cash_transactions_user`(`created_by` ASC) USING BTREE,
  CONSTRAINT `fk_cash_transactions_user` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 60 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of cash_transactions
-- ----------------------------
INSERT INTO `cash_transactions` VALUES (1, 'IMP-D5A9280EEC0F', '2026-05-13 00:00:00', 'out', 'other', 1500000.00, 'Kasbon : Pak Wawan | Jumlah Uang: 1,500,000 | Kembalian: 0 | Sisa Saldo: 0', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (2, 'IMP-95A8A3513B6D', '2026-05-13 00:00:00', 'out', 'operational', 95000.00, 'Ongkir Offline JNE ( Tio ) | Jumlah Uang: 95,000 | Kembalian: 0 | Sisa Saldo: 0', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (3, 'IMP-64872A4EE626', '2026-05-14 00:00:00', 'out', 'operational', 2000000.00, 'Uang Lembur (350), Bensin (150), Ongkir G. Harta ( 1.5jt ) | Jumlah Uang: 2,000,000 | Kembalian: 0 | Sisa Saldo: 0', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (4, 'IMP-289057E6D848', '2026-05-15 00:00:00', 'out', 'other', 200000.00, 'Kasbon : Royadih ( Gudang ) | Jumlah Uang: 200,000 | Kembalian: 0 | Sisa Saldo: 0', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (5, 'IMP-9AB060751DBF', '2026-05-15 00:00:00', 'out', 'operational', 255000.00, 'Ongkir Gunung Harta | Jumlah Uang: 255,000 | Kembalian: 0 | Sisa Saldo: 750,000', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (6, 'IMP-3F0BAA012419', '2026-05-15 00:00:00', 'out', 'operational', 70000.00, 'Plastik Packing Uk : 35,28, Plg Kecil ( 3 Pack & 2 Pack ) | Jumlah Uang: 150,000 | Kembalian: 80,000 | Sisa Saldo: 830,000', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (7, 'IMP-A0771BB64DFF', '2026-05-15 00:00:00', 'out', 'operational', 99500.00, 'Super Pell, Beras, Kopi | Jumlah Uang: 100,000 | Kembalian: 500 | Sisa Saldo: 830,500', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (8, 'IMP-B9B511BD633F', '2026-05-15 00:00:00', 'out', 'operational', 85000.00, 'Ongkir JNE Tio ( Trucking ) | Jumlah Uang: 100,000 | Kembalian: 15,000 | Sisa Saldo: 745,500', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (9, 'IMP-C4683F8B1C15', '2026-05-15 00:00:00', 'out', 'operational', 902500.00, 'Kursi +5 | Jumlah Uang: TF | Kembalian: 0 | Sisa Saldo: 0', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (10, 'IMP-285273BA1CFB', '2026-05-15 00:00:00', 'out', 'other', 20000.00, 'Sumbangan | Jumlah Uang: 20,000 | Kembalian: AN. Alip Nobrian | Sisa Saldo: 725,500', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (11, 'IMP-EE928697435E', '2026-05-15 00:00:00', 'out', 'operational', 247000.00, 'Ongkir JNE Tio ( Trucking ) | Jumlah Uang: 250,000 | Kembalian: 3,000 | Sisa Saldo: 478,500', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (12, 'IMP-2F2D3C347F22', '2026-05-15 00:00:00', 'out', 'operational', 1600000.00, 'Bayar Kontrakan Sebelah | Jumlah Uang: TF | Kembalian: 0 | Sisa Saldo: 0', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (13, 'IMP-8577BEE65AC4', '2026-05-15 00:00:00', 'out', 'operational', 20000.00, 'Ongkir Pak Sulaiman | Jumlah Uang: 50,000 | Kembalian: 20,000 | Sisa Saldo: 458,500', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (14, 'IMP-7375011754E0', '2026-05-15 00:00:00', 'out', 'operational', 117000.00, 'Ongkir JNE Pak Yayat ( Trucking ) | Jumlah Uang: 120,000 | Kembalian: 3,000 | Sisa Saldo: 341,500', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (15, 'IMP-F02886FBC0F5', '2026-05-15 00:00:00', 'out', 'other', 350000.00, 'Kasbon : Mas Aan ( Packing ) | Jumlah Uang: 350,000 | Kembalian: 0 | Sisa Saldo: 0', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (16, 'IMP-71275A3C898F', '2026-05-15 00:00:00', 'out', 'operational', 50000.00, 'Galon & Bensin Mio | Jumlah Uang: 50,000 | Kembalian: 0 | Sisa Saldo: 291,500', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (17, 'IMP-DAA1404D6691', '2026-05-15 00:00:00', 'out', 'operational', 15000.00, 'Reimburse Pak Ryan | Jumlah Uang: 15,000 | Kembalian: 0 | Sisa Saldo: 276,500', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (18, 'IMP-C20D2ACA8182', '2026-05-16 00:00:00', 'out', 'operational', 98000.00, 'Plastik Wash 30X20, Double Tip, Kopi | Jumlah Uang: 100,000 | Kembalian: 2,000 | Sisa Saldo: 178,500', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (19, 'IMP-8110EB3954E0', '2026-05-16 00:00:00', 'out', 'operational', 54000.00, 'Colokan Kabel | Jumlah Uang: 100,000 | Kembalian: 46,000 | Sisa Saldo: 124,500', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (20, 'IMP-B4694BF6A3A5', '2026-05-18 00:00:00', 'out', 'operational', 55000.00, 'Ongkir Offline Mas Ryan F. | Jumlah Uang: 55,000 | Kembalian: 0 | Sisa Saldo: 469,500 | Metode: CASH', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (21, 'IMP-34583F868854', '2026-05-18 00:00:00', 'out', 'operational', 10000.00, 'Operasional Grapari ( Pak Tri ) | Jumlah Uang: 100,000 | Kembalian: 90,000 | Sisa Saldo: 459,500 | Metode: CASH', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (22, 'IMP-C0C6D3F9ED01', '2026-05-19 00:00:00', 'out', 'operational', 100000.00, 'Stella (7) & Vixal (1) | Jumlah Uang: 100,000 | Kembalian: 0 | Sisa Saldo: 359,500 | Metode: CASH', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (23, 'IMP-8A07BDDDF2A8', '2026-05-19 00:00:00', 'out', 'operational', 70000.00, 'Ongkir Offline ( Pak Yayat ) | Jumlah Uang: 70,000 | Kembalian: 0 | Sisa Saldo: 289,500 | Metode: CASH', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (24, 'IMP-4FB074419AE1', '2026-05-19 00:00:00', 'out', 'operational', 125000.00, 'PAM Air ( Bali ) | Jumlah Uang: 125,000 | Kembalian: 0 | Sisa Saldo: 0 | Metode: TF', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (25, 'IMP-954A7A00481A', '2026-05-19 00:00:00', 'out', 'operational', 304751.00, 'Listrik Kantor Pusat | Jumlah Uang: 304,751 | Kembalian: 0 | Sisa Saldo: 0 | Metode: TF', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (26, 'IMP-5AA5F10A3053', '2026-05-19 00:00:00', 'out', 'operational', 283050.00, 'Indihome ( Bali ) | Jumlah Uang: 283,050 | Kembalian: 0 | Sisa Saldo: 0 | Metode: TF', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (27, 'IMP-AC22F9EBFE9E', '2026-05-19 00:00:00', 'out', 'operational', 355200.00, 'Indihome ( Gudang ) | Jumlah Uang: 355,200 | Kembalian: 0 | Sisa Saldo: 0 | Metode: TF', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (28, 'IMP-31523E9D57C8', '2026-05-19 00:00:00', 'out', 'operational', 50000.00, 'Ongkir Offline HP Kantor | Jumlah Uang: 50,000 | Kembalian: 0 | Sisa Saldo: 239,000 | Metode: CASH', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (29, 'IMP-97910619E852', '2026-05-19 00:00:00', 'out', 'other', 100000.00, 'Iuran Bulanan 20.000 ( + 5Bulan ) sd. September 2026 | Jumlah Uang: 100,000 | Kembalian: 0 | Sisa Saldo: 139,500 | Metode: CASH', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (30, 'IMP-84ECAFA00602', '2026-05-19 00:00:00', 'out', 'operational', 104000.00, 'Kopi Point Ice Palm 25.000 x4 & IDM Tas 4.000 | Jumlah Uang: 104,000 | Kembalian: 0 | Sisa Saldo: 35,500 | Metode: CASH', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (31, 'IMP-0272C3833C53', '2026-05-19 00:00:00', 'out', 'operational', 10000.00, 'Kopi ( Pengajuan : Mas Rian ) | Jumlah Uang: 10,000 | Kembalian: 0 | Sisa Saldo: 25,500 | Metode: CASH', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (32, 'IMP-86AF9B0DAAFA', '2026-05-19 00:00:00', 'out', 'operational', 80000.00, 'Ongkir HP Kantor | Jumlah Uang: 80,000 | Kembalian: 0 | Sisa Saldo: 245,500 | Metode: CASH', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (33, 'IMP-56D68A7A4950', '2026-05-19 00:00:00', 'out', 'operational', 45000.00, 'Konsumsi Mas Andre 25k & Gas 20k | Jumlah Uang: 45,000 | Kembalian: 0 | Sisa Saldo: 200,500 | Metode: CASH', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (34, 'IMP-99AAED1D1346', '2026-05-19 00:00:00', 'out', 'operational', 300000.00, 'Ganti Baterai Samsung Note 10 | Jumlah Uang: 300,000 | Kembalian: 0 | Sisa Saldo: 500 | Metode: CASH', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (35, 'IMP-D30555F37B58', '2026-05-20 00:00:00', 'out', 'operational', 10000.00, 'Kopi ( Pengajuan : Mas Rian ) | Jumlah Uang: 10,000 | Kembalian: 0 | Sisa Saldo: 290,500 | Metode: CASH', NULL, NULL, NULL);
INSERT INTO `cash_transactions` VALUES (36, 'CASH-20260520153842', '2026-05-15 15:38:00', 'in', 'other', 1000000.00, 'Penambahan Saldo', NULL, NULL, 1);
INSERT INTO `cash_transactions` VALUES (37, 'CASH-20260520153924', '2026-05-18 15:39:00', 'in', 'other', 400000.00, 'Penambhan Saldo', NULL, NULL, 1);
INSERT INTO `cash_transactions` VALUES (38, 'CASH-20260521082415', '2026-05-19 12:00:00', 'in', 'other', 300000.00, 'Penambahan Saldo Operasional', NULL, NULL, 10);
INSERT INTO `cash_transactions` VALUES (39, 'CASH-20260521082632', '2026-05-20 10:10:00', 'in', 'other', 300000.00, 'Penambahan Saldo Operasional', NULL, NULL, 10);
INSERT INTO `cash_transactions` VALUES (40, 'CASH-20260521082717', '2026-05-20 11:15:00', 'out', 'operational', 50000.00, 'Ongkir Offline Pak Buana | Sisa Saldo : 240.500', NULL, NULL, 10);
INSERT INTO `cash_transactions` VALUES (41, 'CASH-20260521092011', '2026-05-21 09:20:00', 'out', 'operational', 92000.00, 'Galon : 31.500, Plastik Uk. 35 ( 3 Pack ) : 48.000, Kopi : 12.500 | Sisa Saldo : 148.500', NULL, NULL, 10);
INSERT INTO `cash_transactions` VALUES (42, 'TF-20260521111329', '2026-05-21 11:13:00', 'out', 'operational', 1660000.00, 'Cetak Label | Metode : Transfer', NULL, NULL, 10);
INSERT INTO `cash_transactions` VALUES (43, 'CASH-20260521111925', '2026-05-21 11:19:00', 'out', 'operational', 50000.00, 'Ongkir Kirim Sampel | Sisa Saldo : 98.500', NULL, NULL, 10);
INSERT INTO `cash_transactions` VALUES (44, 'CASH-20260521112135', '2026-05-21 11:21:00', 'out', 'operational', 90000.00, 'Bensin GrandMax : Pertalite | Sisa Saldo : 8.500', NULL, NULL, 10);
INSERT INTO `cash_transactions` VALUES (45, 'CASH-20260521132410', '2026-05-21 13:20:00', 'in', 'other', 500000.00, 'Penambahan Saldo Operasional | Sisa Saldo : 508.500', NULL, NULL, 10);
INSERT INTO `cash_transactions` VALUES (47, 'CASH-20260522083018', '2026-05-22 09:20:00', 'out', 'other', 10000.00, 'Reimburse Mas Nobrian ( Bensin GrandMax )', NULL, NULL, 10);
INSERT INTO `cash_transactions` VALUES (48, 'CASH-20260522093758', '2026-05-21 14:55:00', 'out', 'operational', 26000.00, 'Ongkir Kirim Sample ( Nia ) | Sisa Saldo : 472.500', NULL, NULL, 10);
INSERT INTO `cash_transactions` VALUES (49, 'TF-20260522094447', '2026-05-22 08:27:00', 'out', 'operational', 770000.00, 'Cetak Katalog | Metode : Transfer', NULL, NULL, 10);
INSERT INTO `cash_transactions` VALUES (52, 'CASH-20260522095628', '2026-05-22 11:00:00', 'out', 'operational', 20000.00, 'Ongkir Ambil Katalog | Sisa Saldo : 452.500', NULL, NULL, 10);
INSERT INTO `cash_transactions` VALUES (53, 'CASH-20260523085113', '2026-05-22 16:35:00', 'out', 'operational', 20000.00, 'Pengajuan Antar Barang Kantor | Sisa Saldo : 432.500', NULL, NULL, 10);
INSERT INTO `cash_transactions` VALUES (54, 'CASH-20260523085437', '2026-05-23 08:45:00', 'out', 'operational', 125000.00, 'Ongkir Offline Mba Nia | Sisa Saldo : 257.500', NULL, NULL, 10);
INSERT INTO `cash_transactions` VALUES (55, 'CASH-20260523085644', '2026-05-23 08:45:00', 'out', 'operational', 50000.00, 'Ongkir Offline Pak Ryan | Sisa Saldo : 382.500', NULL, NULL, 10);
INSERT INTO `cash_transactions` VALUES (56, 'TF-20260523100906', '2026-05-23 09:27:00', 'out', 'operational', 225000.00, 'Jasa Laminating Doff Katalog 90 Lembar x 2.500 | Metode : Transfer', NULL, NULL, 10);
INSERT INTO `cash_transactions` VALUES (57, 'CASH-20260523101241', '2026-05-23 09:55:00', 'out', 'operational', 200000.00, 'Bensin GrandMax 100.000, Kopi 10.000, Beras 70.000, Bensin Mio 20.000 | Sisa Saldo : 57.500', NULL, NULL, 10);
INSERT INTO `cash_transactions` VALUES (58, 'CASH-20260523101407', '2026-05-23 10:14:00', 'out', 'operational', 50000.00, 'Operasional Driver Kantor | Sisa Saldo : 7.500', NULL, NULL, 10);
INSERT INTO `cash_transactions` VALUES (59, 'CASH-20260523104009', '2026-05-23 10:40:00', 'in', 'other', 500000.00, 'Penambahan Saldo Operasional | Saldo Saat ini : 507.500', NULL, NULL, 10);

-- ----------------------------
-- Table structure for customers
-- ----------------------------
CREATE TABLE `customers`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `customer_code` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `email` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `city` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `province` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `segment` enum('retail','project','reseller') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'retail',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `customer_code`(`customer_code` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of customers
-- ----------------------------
INSERT INTO `customers` VALUES (1, 'CUST-0001', 'Pelanggan Umum', '081111111111', NULL, NULL, NULL, NULL, 'retail', '2026-05-13 22:33:10', '2026-05-13 22:33:10');

-- ----------------------------
-- Table structure for design_grafis_tasks
-- ----------------------------
CREATE TABLE `design_grafis_tasks`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `title` varchar(180) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `brief` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `priority` enum('low','normal','high') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'normal',
  `status` enum('open','in_progress','review','done') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'open',
  `due_date` date NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of design_grafis_tasks
-- ----------------------------

-- ----------------------------
-- Table structure for employees
-- ----------------------------
CREATE TABLE `employees`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `employee_code` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `full_name` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `division` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `position_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `manager_employee_id` bigint UNSIGNED NULL DEFAULT NULL,
  `phone` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `join_date` date NULL DEFAULT NULL,
  `employment_status` enum('active','inactive') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `basic_salary` decimal(15, 2) NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `employee_code`(`employee_code` ASC) USING BTREE,
  INDEX `fk_employees_manager`(`manager_employee_id` ASC) USING BTREE,
  CONSTRAINT `fk_employees_manager` FOREIGN KEY (`manager_employee_id`) REFERENCES `employees` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 25 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of employees
-- ----------------------------
INSERT INTO `employees` VALUES (1, '797734', 'Administrator', 'Direksi', 'System Admin', NULL, '081234567890', NULL, '2026-05-13', 'active', 15000000.00, '2026-05-13 22:33:10', '2026-05-13 23:52:19');
INSERT INTO `employees` VALUES (2, '142229', 'Yayat Syarif Hidayat', 'Kantor Pusat', 'Manager HR&GA/Finance/Operasional', NULL, '0813 1690 8356', 'Jl. Kp. Dalam, RT.05/01 Cawang, Jakarta Timur, Kramat Jati', '2026-05-13', 'active', 0.00, '2026-05-13 23:47:47', '2026-05-13 23:52:19');
INSERT INTO `employees` VALUES (3, '433020', 'Tri Febrianto', 'Kantor Pusat', 'Manager Marketing', NULL, '0857 1065 9722', 'Komp. Deplu 74 Blok C No.2, Pondok Karya, Pondok Aren', '2026-05-13', 'active', 0.00, '2026-05-13 23:47:47', '2026-05-13 23:52:19');
INSERT INTO `employees` VALUES (4, '935723', 'Alip Nobihan', 'Kantor Pusat', 'Staff GA/Operasional', NULL, '0822 9885 1142', 'Cilengsi', '2026-05-13', 'active', 0.00, '2026-05-13 23:47:47', '2026-05-13 23:52:19');
INSERT INTO `employees` VALUES (5, '652990', 'Wildan Fadilah Hakim', 'Kantor Pusat', 'Marketing On Line', NULL, '0878 9986 4151', 'Jl. Pedati 1, Rt.06/06 Bidara Cina, Jatinegara, Jakarta Timur', '2026-05-13', 'active', 0.00, '2026-05-13 23:47:47', '2026-05-20 13:38:26');
INSERT INTO `employees` VALUES (6, '030303', 'Nia Kurnia', 'Kantor Pusat', 'Marketing On Line', NULL, '8787 271 8646', 'Surowangan RT.05/01 Manyaran, Karangdede, Boyolali', '2026-05-13', 'active', 0.00, '2026-05-13 23:47:47', '2026-05-13 23:52:19');
INSERT INTO `employees` VALUES (7, '766148', 'Muhammad Ryan Furqon', 'Kantor Pusat', 'Marketing On Line', NULL, '0819 3348 3756', 'Jl. Tanah Merdeka No.8 Rt.009/004, Kp. Rambutan, Ciracas, Jakarta Timur', '2026-05-13', 'active', 0.00, '2026-05-13 23:47:47', '2026-05-13 23:52:19');
INSERT INTO `employees` VALUES (8, '666298', 'Yodia Arya Setiawan', 'Kantor Pusat', 'Marketing On Line', NULL, '0822 4622 2474', 'Jl. Bungur XII Rt.017/006, Kp. Rambutan, Ciracas, Jakarta Timur', '2026-05-13', 'active', 0.00, '2026-05-13 23:47:47', '2026-05-13 23:52:19');
INSERT INTO `employees` VALUES (9, '198456', 'Muhammad Hadidio Lukman', 'Kantor Bali', 'Marketing On Line', NULL, '0856 9532 1310', 'Jl. Bina Karya Rt.007/001, Pondok Kelapa, Duren Sawit, Jakarta Timur', '2026-05-13', 'active', 0.00, '2026-05-13 23:47:47', '2026-05-13 23:52:19');
INSERT INTO `employees` VALUES (10, '075033', 'Haryanto', 'Kantor Bali', 'Staff Umum', NULL, '0852 3233 4822', 'Jl. Hemat II No.29 Rt.009/003, Jelambar, Grogol, Jakarta Barat', '2026-05-13', 'active', 0.00, '2026-05-13 23:47:47', '2026-05-13 23:52:19');
INSERT INTO `employees` VALUES (11, '703029', 'Rachmad Fauzi Abdillah', 'Kantor Pusat', 'Desain Grafis', NULL, '0878 8877 5757', 'Jl. Curug Jaya No.31 Rt.005/001, Jati Cempaka, Pondok Gede, Bekasi', '2026-05-13', 'active', 0.00, '2026-05-13 23:47:47', '2026-05-13 23:52:19');
INSERT INTO `employees` VALUES (12, '015682', 'M Raihan Cahya Wiaksono', 'Kantor Pusat', 'Tim Sosmed', NULL, '0812 8926 4610', 'APT Kalibata City Unit A/20, Rt.001/009, Rawajati Pancoran, Jakarta Selatan', '2026-05-13', 'active', 0.00, '2026-05-13 23:47:47', '2026-05-13 23:52:19');
INSERT INTO `employees` VALUES (13, '547388', 'Septi Rahmadini', 'Kantor Pusat', 'Tim Sosmed', NULL, '0892 9802 5522', 'Bumi Pasar Kemis Indah Rt.004/002, Pasar Kemis', '2026-05-13', 'active', 0.00, '2026-05-13 23:47:47', '2026-05-13 23:52:19');
INSERT INTO `employees` VALUES (14, '840955', 'Ahmad Farhan Aushaf', 'Kantor Pusat', 'Tim Packing', NULL, '0896 5714 2724', 'Kp. Dalam Rt.05/01 Cawang, Jakarta Timur, Kramat Jati', '2026-05-13', 'active', 0.00, '2026-05-13 23:47:47', '2026-05-13 23:52:19');
INSERT INTO `employees` VALUES (15, '788305', 'Muhamad Bintang Pamungkas', 'Kantor Pusat', 'Tim Packing', NULL, '0857 2832 5255', 'Nayu Barat Rt.001/013, Nusukan, Banjarsari', '2026-05-13', 'active', 0.00, '2026-05-13 23:47:47', '2026-05-13 23:52:19');
INSERT INTO `employees` VALUES (16, '594022', 'Omawah', 'Kantor Pusat', 'Office Boy', NULL, '0819 4421 5334', 'Jl. Cawang 1 Gg. Kamboja Rt.008/012, Bidara Cina, Jatinegara, Jakarta Timur', '2026-05-13', 'active', 0.00, '2026-05-13 23:47:47', '2026-05-13 23:52:19');
INSERT INTO `employees` VALUES (17, '250612', 'Ripjali', 'Gudang / Rawalumbu', 'Spv Gudang', NULL, '0812 9957 4822', 'Kp. Baru Rt.005/004 Nusa Jaya, Karawaci', '2026-05-13', 'active', 0.00, '2026-05-13 23:47:47', '2026-05-13 23:52:19');
INSERT INTO `employees` VALUES (18, '863831', 'Royadih', 'Gudang / Rawalumbu', 'Staff Gudang', NULL, '0821 1644 1339', 'Pondok Kelapa Rt.007/001 Pondok Kelapa, Duren Sawit, Jakarta Timur', '2026-05-13', 'active', 0.00, '2026-05-13 23:47:47', '2026-05-13 23:52:19');
INSERT INTO `employees` VALUES (19, '478330', 'Tumiran', 'Gudang / Rawalumbu', 'Staff Gudang', NULL, '0857 7518 9004', 'Jl. Setia No.21 Rt.007/002 Bojong Rawalumbu, Bekasi', '2026-05-13', 'active', 0.00, '2026-05-13 23:47:47', '2026-05-13 23:52:19');
INSERT INTO `employees` VALUES (20, '630008', 'Sulaeman', 'Gudang / Rawalumbu', 'Staff Gudang', NULL, '0858 8824 0168', '-', '2026-05-13', 'active', 0.00, '2026-05-13 23:47:47', '2026-05-13 23:52:19');
INSERT INTO `employees` VALUES (21, '381166', 'Tedy Sulaeman', 'Gudang / Rawalumbu', 'Staff Gudang', NULL, '-', 'Blok Bojong Lpang Rt.001/001 Cikeduk, Depok', '2026-05-13', 'active', 0.00, '2026-05-13 23:47:47', '2026-05-13 23:52:19');
INSERT INTO `employees` VALUES (22, '171021', 'Muhammad Yusuf', 'Gudang / Rawalumbu', 'Driver', NULL, '0881 6192 983', 'Kp. Dalam Rt.005/001 Cawang, Kramat Jati, Jakarta Timur', '2026-05-13', 'active', 0.00, '2026-05-13 23:47:47', '2026-05-13 23:52:19');
INSERT INTO `employees` VALUES (23, '132108', 'Tri Hermansah', 'Kantor Pusat', 'Manager Sales', NULL, NULL, NULL, '2026-05-20', 'active', 0.00, '2026-05-20 13:01:20', '2026-05-20 14:43:19');
INSERT INTO `employees` VALUES (24, '273030', 'Muhamad rofi', 'Kantor Pusat', 'Manager Sales', NULL, '', '', '2026-05-20', 'active', 0.00, '2026-05-20 14:47:21', '2026-05-20 14:47:21');

-- ----------------------------
-- Table structure for hr_divisions
-- ----------------------------
CREATE TABLE `hr_divisions`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `name`(`name` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of hr_divisions
-- ----------------------------
INSERT INTO `hr_divisions` VALUES (1, 'Direksi', '2026-05-13 23:49:47');
INSERT INTO `hr_divisions` VALUES (2, 'Kantor Pusat', '2026-05-13 23:49:47');
INSERT INTO `hr_divisions` VALUES (3, 'Kantor Bali', '2026-05-13 23:49:47');
INSERT INTO `hr_divisions` VALUES (4, 'Gudang / Rawalumbu', '2026-05-13 23:49:47');

-- ----------------------------
-- Table structure for hr_positions
-- ----------------------------
CREATE TABLE `hr_positions`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `name`(`name` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 18 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of hr_positions
-- ----------------------------
INSERT INTO `hr_positions` VALUES (1, 'System Admin', '2026-05-13 23:49:47');
INSERT INTO `hr_positions` VALUES (2, 'Manager HR&GA/Finance/Operasional', '2026-05-13 23:49:47');
INSERT INTO `hr_positions` VALUES (3, 'Manager Marketing', '2026-05-13 23:49:47');
INSERT INTO `hr_positions` VALUES (4, 'Staff GA/Operasional', '2026-05-13 23:49:47');
INSERT INTO `hr_positions` VALUES (5, 'Marketing On Line', '2026-05-13 23:49:47');
INSERT INTO `hr_positions` VALUES (6, 'Staff Umum', '2026-05-13 23:49:47');
INSERT INTO `hr_positions` VALUES (7, 'Desain Grafis', '2026-05-13 23:49:47');
INSERT INTO `hr_positions` VALUES (8, 'Tim Sosmed', '2026-05-13 23:49:47');
INSERT INTO `hr_positions` VALUES (9, 'Tim Packing', '2026-05-13 23:49:47');
INSERT INTO `hr_positions` VALUES (10, 'Office Boy', '2026-05-13 23:49:47');
INSERT INTO `hr_positions` VALUES (11, 'Spv Gudang', '2026-05-13 23:49:47');
INSERT INTO `hr_positions` VALUES (12, 'Staff Gudang', '2026-05-13 23:49:47');
INSERT INTO `hr_positions` VALUES (13, 'Driver', '2026-05-13 23:49:47');
INSERT INTO `hr_positions` VALUES (14, 'Manager Sales', '2026-05-20 13:00:49');
INSERT INTO `hr_positions` VALUES (16, 'General Manager', '2026-05-20 13:01:02');
INSERT INTO `hr_positions` VALUES (17, 'Staff', '2026-05-20 15:46:31');

-- ----------------------------
-- Table structure for inventory_balances
-- ----------------------------
CREATE TABLE `inventory_balances`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `warehouse_id` bigint UNSIGNED NOT NULL,
  `product_id` bigint UNSIGNED NOT NULL,
  `qty_on_hand` decimal(14, 2) NOT NULL DEFAULT 0.00,
  `qty_reserved` decimal(14, 2) NOT NULL DEFAULT 0.00,
  `min_stock_snapshot` decimal(14, 2) NOT NULL DEFAULT 0.00,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_inventory_balances`(`warehouse_id` ASC, `product_id` ASC) USING BTREE,
  INDEX `fk_inventory_balances_product`(`product_id` ASC) USING BTREE,
  CONSTRAINT `fk_inventory_balances_product` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_inventory_balances_warehouse` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of inventory_balances
-- ----------------------------
INSERT INTO `inventory_balances` VALUES (2, 1, 61, 20.00, 0.00, 0.00, '2026-05-22 15:19:46');

-- ----------------------------
-- Table structure for inventory_transactions
-- ----------------------------
CREATE TABLE `inventory_transactions`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `trx_no` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `trx_date` datetime NOT NULL,
  `warehouse_id` bigint UNSIGNED NOT NULL,
  `product_id` bigint UNSIGNED NOT NULL,
  `trx_type` enum('in','out','transfer_in','transfer_out','adjust_plus','adjust_minus','reserve','release') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `qty` decimal(14, 2) NOT NULL,
  `unit_cost` decimal(15, 2) NULL DEFAULT NULL,
  `reference_type` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `reference_id` bigint UNSIGNED NULL DEFAULT NULL,
  `notes` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `created_by` bigint UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `trx_no`(`trx_no` ASC) USING BTREE,
  INDEX `fk_inventory_transactions_warehouse`(`warehouse_id` ASC) USING BTREE,
  INDEX `fk_inventory_transactions_product`(`product_id` ASC) USING BTREE,
  INDEX `fk_inventory_transactions_user`(`created_by` ASC) USING BTREE,
  INDEX `idx_inventory_transactions_trx_date`(`trx_date` ASC) USING BTREE,
  CONSTRAINT `fk_inventory_transactions_product` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_inventory_transactions_user` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_inventory_transactions_warehouse` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of inventory_transactions
-- ----------------------------
INSERT INTO `inventory_transactions` VALUES (1, 'INV-20260522151726-bed0', '2026-05-22 15:17:26', 1, 61, 'in', 20.00, NULL, NULL, NULL, '', 1, '2026-05-22 15:17:26');
INSERT INTO `inventory_transactions` VALUES (2, 'INV-20260522151736-370b', '2026-05-22 15:17:36', 1, 2, 'in', 20.00, NULL, NULL, NULL, '', 1, '2026-05-22 15:17:36');
INSERT INTO `inventory_transactions` VALUES (3, 'INV-20260522151759-3c25', '2026-05-22 15:17:59', 1, 61, 'in', 20.00, NULL, NULL, NULL, '', 1, '2026-05-22 15:17:59');
INSERT INTO `inventory_transactions` VALUES (4, 'INV-20260522151805-8815', '2026-05-22 15:18:05', 1, 61, 'in', 20.00, NULL, NULL, NULL, '', 1, '2026-05-22 15:18:05');
INSERT INTO `inventory_transactions` VALUES (5, 'INV-20260522151946-4f4c', '2026-05-22 15:19:46', 1, 61, 'in', 20.00, NULL, NULL, NULL, '', 1, '2026-05-22 15:19:46');

-- ----------------------------
-- Table structure for knowledge_articles
-- ----------------------------
CREATE TABLE `knowledge_articles`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `title` varchar(180) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `summary` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of knowledge_articles
-- ----------------------------

-- ----------------------------
-- Table structure for marketing_assets
-- ----------------------------
CREATE TABLE `marketing_assets`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `asset_name` varchar(180) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `asset_type` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `file_link` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `status` enum('available','in_use','archived') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'available',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of marketing_assets
-- ----------------------------

-- ----------------------------
-- Table structure for marketing_campaigns
-- ----------------------------
CREATE TABLE `marketing_campaigns`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(180) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `objective` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `start_date` date NULL DEFAULT NULL,
  `end_date` date NULL DEFAULT NULL,
  `budget` decimal(15, 2) NOT NULL DEFAULT 0.00,
  `status` enum('planned','running','paused','done') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'planned',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of marketing_campaigns
-- ----------------------------

-- ----------------------------
-- Table structure for office_assets
-- ----------------------------
CREATE TABLE `office_assets`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `asset_code` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `asset_name` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `category` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `location` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `condition_status` enum('good','fair','poor') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'good',
  `purchased_at` date NULL DEFAULT NULL,
  `value` decimal(15, 2) NOT NULL DEFAULT 0.00,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_by` bigint UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `asset_code`(`asset_code` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of office_assets
-- ----------------------------

-- ----------------------------
-- Table structure for order_items
-- ----------------------------
CREATE TABLE `order_items`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `order_id` bigint UNSIGNED NOT NULL,
  `line_no` int UNSIGNED NOT NULL,
  `item_type` enum('product','service') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'product',
  `product_id` bigint UNSIGNED NULL DEFAULT NULL,
  `service_order_id` bigint UNSIGNED NULL DEFAULT NULL,
  `qty` decimal(14, 2) NOT NULL DEFAULT 1.00,
  `unit_price` decimal(15, 2) NOT NULL DEFAULT 0.00,
  `discount` decimal(15, 2) NOT NULL DEFAULT 0.00,
  `tax` decimal(15, 2) NOT NULL DEFAULT 0.00,
  `line_total` decimal(15, 2) NOT NULL DEFAULT 0.00,
  `notes` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `fk_order_items_order`(`order_id` ASC) USING BTREE,
  INDEX `fk_order_items_product`(`product_id` ASC) USING BTREE,
  CONSTRAINT `fk_order_items_order` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_order_items_product` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 223 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of order_items
-- ----------------------------
INSERT INTO `order_items` VALUES (4, 2, 1, 'product', 28, NULL, 1.00, 212750.00, 0.00, 0.00, 212750.00, NULL);
INSERT INTO `order_items` VALUES (5, 3, 1, 'product', 46, NULL, 1.00, 115000.00, 0.00, 0.00, 115000.00, NULL);
INSERT INTO `order_items` VALUES (6, 4, 1, 'product', 28, NULL, 1.00, 212750.00, 0.00, 0.00, 212750.00, NULL);
INSERT INTO `order_items` VALUES (8, 5, 1, 'product', 46, NULL, 1.00, 115000.00, 0.00, 0.00, 115000.00, NULL);
INSERT INTO `order_items` VALUES (9, 6, 1, 'product', 46, NULL, 1.00, 115000.00, 0.00, 0.00, 115000.00, NULL);
INSERT INTO `order_items` VALUES (13, 8, 1, 'product', 55, NULL, 1.00, 316250.00, 0.00, 0.00, 316250.00, NULL);
INSERT INTO `order_items` VALUES (14, 9, 1, 'product', 42, NULL, 1.00, 316250.00, 0.00, 0.00, 316250.00, NULL);
INSERT INTO `order_items` VALUES (18, 10, 1, 'product', 10, NULL, 2.00, 2810000.00, 0.00, 0.00, 2810000.00, NULL);
INSERT INTO `order_items` VALUES (20, 11, 1, 'product', 45, NULL, 2.00, 448500.00, 0.00, 0.00, 448500.00, NULL);
INSERT INTO `order_items` VALUES (21, 12, 1, 'product', 55, NULL, 3.00, 948750.00, 0.00, 0.00, 948750.00, NULL);
INSERT INTO `order_items` VALUES (22, 13, 1, 'product', 56, NULL, 2.00, 138000.00, 0.00, 0.00, 138000.00, NULL);
INSERT INTO `order_items` VALUES (23, 14, 1, 'product', 48, NULL, 1.00, 86250.00, 0.00, 0.00, 86250.00, NULL);
INSERT INTO `order_items` VALUES (24, 15, 1, 'product', 55, NULL, 1.00, 316250.00, 0.00, 0.00, 316250.00, NULL);
INSERT INTO `order_items` VALUES (25, 16, 1, 'product', 55, NULL, 5.00, 7043750.00, 0.00, 0.00, 7043750.00, NULL);
INSERT INTO `order_items` VALUES (27, 18, 1, 'product', 49, NULL, 1.00, 172500.00, 0.00, 0.00, 172500.00, NULL);
INSERT INTO `order_items` VALUES (29, 19, 1, 'product', 55, NULL, 4.00, 1210000.00, 0.00, 0.00, 1210000.00, NULL);
INSERT INTO `order_items` VALUES (31, 17, 1, 'product', 55, NULL, 2.00, 632500.00, 0.00, 0.00, 632500.00, NULL);
INSERT INTO `order_items` VALUES (32, 20, 1, 'product', 55, NULL, 1.00, 316000.00, 0.00, 0.00, 316000.00, NULL);
INSERT INTO `order_items` VALUES (33, 21, 1, 'product', 55, NULL, 1.00, 316000.00, 0.00, 0.00, 316000.00, NULL);
INSERT INTO `order_items` VALUES (39, 24, 1, 'product', 55, NULL, 4.00, 1265000.00, 0.00, 0.00, 1265000.00, NULL);
INSERT INTO `order_items` VALUES (40, 23, 1, 'product', 24, NULL, 3.00, 672750.00, 0.00, 0.00, 672750.00, NULL);
INSERT INTO `order_items` VALUES (42, 25, 1, 'product', 28, NULL, 1.00, 212750.00, 0.00, 0.00, 212750.00, NULL);
INSERT INTO `order_items` VALUES (44, 27, 1, 'product', 56, NULL, 5.00, 7043750.00, 0.00, 0.00, 7043750.00, NULL);
INSERT INTO `order_items` VALUES (45, 28, 1, 'product', 49, NULL, 2.00, 345000.00, 0.00, 0.00, 345000.00, NULL);
INSERT INTO `order_items` VALUES (47, 30, 1, 'product', 55, NULL, 3.00, 948750.00, 0.00, 0.00, 948750.00, NULL);
INSERT INTO `order_items` VALUES (49, 29, 1, 'product', 55, NULL, 1.00, 316250.00, 0.00, 0.00, 316250.00, NULL);
INSERT INTO `order_items` VALUES (50, 22, 1, 'product', 56, NULL, 3.00, 948750.00, 0.00, 0.00, 948750.00, NULL);
INSERT INTO `order_items` VALUES (51, 31, 1, 'product', 48, NULL, 1.00, 86250.00, 0.00, 0.00, 86250.00, NULL);
INSERT INTO `order_items` VALUES (52, 32, 1, 'product', 24, NULL, 1.00, 1065000.00, 0.00, 0.00, 1065000.00, NULL);
INSERT INTO `order_items` VALUES (56, 26, 1, 'product', 46, NULL, 2.00, 230000.00, 0.00, 0.00, 230000.00, NULL);
INSERT INTO `order_items` VALUES (57, 33, 1, 'product', 55, NULL, 2.00, 632500.00, 0.00, 0.00, 632500.00, NULL);
INSERT INTO `order_items` VALUES (58, 34, 1, 'product', 48, NULL, 1.00, 86250.00, 0.00, 0.00, 86250.00, NULL);
INSERT INTO `order_items` VALUES (60, 35, 1, 'product', 56, NULL, 2.00, 632500.00, 0.00, 0.00, 632500.00, NULL);
INSERT INTO `order_items` VALUES (61, 36, 1, 'product', 2, NULL, 1.00, 546250.00, 0.00, 0.00, 546250.00, NULL);
INSERT INTO `order_items` VALUES (62, 37, 1, 'product', 10, NULL, 1.00, 385250.00, 0.00, 0.00, 385250.00, NULL);
INSERT INTO `order_items` VALUES (63, 38, 1, 'product', 56, NULL, 1.00, 316250.00, 0.00, 0.00, 316250.00, NULL);
INSERT INTO `order_items` VALUES (64, 39, 1, 'product', 55, NULL, 1.00, 316000.00, 0.00, 0.00, 316000.00, NULL);
INSERT INTO `order_items` VALUES (65, 40, 1, 'product', 28, NULL, 1.00, 212750.00, 0.00, 0.00, 212750.00, NULL);
INSERT INTO `order_items` VALUES (67, 41, 1, 'product', 28, NULL, 1.00, 212750.00, 0.00, 0.00, 212750.00, NULL);
INSERT INTO `order_items` VALUES (68, 42, 1, 'product', 6, NULL, 3.00, 552000.00, 0.00, 0.00, 552000.00, NULL);
INSERT INTO `order_items` VALUES (70, 43, 1, 'product', 10, NULL, 1.00, 385250.00, 0.00, 0.00, 385250.00, NULL);
INSERT INTO `order_items` VALUES (71, 44, 1, 'product', 46, NULL, 3.00, 345000.00, 0.00, 0.00, 345000.00, NULL);
INSERT INTO `order_items` VALUES (73, 45, 1, 'product', 46, NULL, 1.00, 115000.00, 0.00, 0.00, 115000.00, NULL);
INSERT INTO `order_items` VALUES (74, 46, 1, 'product', 46, NULL, 1.00, 115000.00, 0.00, 0.00, 115000.00, NULL);
INSERT INTO `order_items` VALUES (75, 47, 1, 'product', 55, NULL, 1.00, 316250.00, 0.00, 0.00, 316250.00, NULL);
INSERT INTO `order_items` VALUES (76, 48, 1, 'product', 46, NULL, 1.00, 115000.00, 0.00, 0.00, 115000.00, NULL);
INSERT INTO `order_items` VALUES (77, 49, 1, 'product', 24, NULL, 1.00, 224250.00, 0.00, 0.00, 224250.00, NULL);
INSERT INTO `order_items` VALUES (79, 50, 1, 'product', 24, NULL, 1.00, 224250.00, 0.00, 0.00, 224250.00, NULL);
INSERT INTO `order_items` VALUES (80, 51, 1, 'product', 55, NULL, 2.00, 632000.00, 0.00, 0.00, 632000.00, NULL);
INSERT INTO `order_items` VALUES (81, 52, 1, 'product', 49, NULL, 1.00, 172500.00, 0.00, 0.00, 172500.00, NULL);
INSERT INTO `order_items` VALUES (82, 53, 1, 'product', 6, NULL, 7.00, 1288000.00, 0.00, 0.00, 1288000.00, NULL);
INSERT INTO `order_items` VALUES (83, 54, 1, 'product', 50, NULL, 1.00, 150000.00, 0.00, 0.00, 150000.00, NULL);
INSERT INTO `order_items` VALUES (84, 55, 1, 'product', 46, NULL, 1.00, 115000.00, 0.00, 0.00, 115000.00, NULL);
INSERT INTO `order_items` VALUES (86, 57, 1, 'product', 24, NULL, 1.00, 224250.00, 0.00, 0.00, 224250.00, NULL);
INSERT INTO `order_items` VALUES (88, 59, 1, 'product', 6, NULL, 1.00, 184000.00, 0.00, 0.00, 184000.00, NULL);
INSERT INTO `order_items` VALUES (89, 56, 1, 'product', 10, NULL, 8.00, 385250.00, 0.00, 0.00, 385250.00, NULL);
INSERT INTO `order_items` VALUES (90, 60, 1, 'product', 55, NULL, 3.00, 948750.00, 0.00, 0.00, 948750.00, NULL);
INSERT INTO `order_items` VALUES (91, 61, 1, 'product', 49, NULL, 1.00, 172500.00, 0.00, 0.00, 172500.00, NULL);
INSERT INTO `order_items` VALUES (92, 62, 1, 'product', 24, NULL, 1.00, 1289250.00, 0.00, 0.00, 1289250.00, NULL);
INSERT INTO `order_items` VALUES (93, 63, 1, 'product', 6, NULL, 1.00, 750000.00, 0.00, 0.00, 750000.00, NULL);
INSERT INTO `order_items` VALUES (95, 64, 1, 'product', 45, NULL, 1.00, 224250.00, 0.00, 0.00, 224250.00, NULL);
INSERT INTO `order_items` VALUES (97, 58, 1, 'product', 46, NULL, 4.00, 460000.00, 0.00, 0.00, 460000.00, NULL);
INSERT INTO `order_items` VALUES (98, 65, 1, 'product', 24, NULL, 1.00, 224250.00, 0.00, 0.00, 224250.00, NULL);
INSERT INTO `order_items` VALUES (99, 66, 1, 'product', 48, NULL, 1.00, 86250.00, 0.00, 0.00, 86250.00, NULL);
INSERT INTO `order_items` VALUES (100, 67, 1, 'product', 55, NULL, 1.00, 1406000.00, 0.00, 0.00, 1406000.00, NULL);
INSERT INTO `order_items` VALUES (101, 68, 1, 'product', 55, NULL, 1.00, 316250.00, 0.00, 0.00, 316250.00, NULL);
INSERT INTO `order_items` VALUES (102, 69, 1, 'product', 48, NULL, 1.00, 86250.00, 0.00, 0.00, 86250.00, NULL);
INSERT INTO `order_items` VALUES (104, 71, 1, 'product', 10, NULL, 1.00, 2047250.00, 0.00, 0.00, 2047250.00, NULL);
INSERT INTO `order_items` VALUES (105, 72, 1, 'product', 24, NULL, 1.00, 224250.00, 0.00, 0.00, 224250.00, NULL);
INSERT INTO `order_items` VALUES (106, 70, 1, 'product', 46, NULL, 3.00, 115000.00, 0.00, 0.00, 115000.00, NULL);
INSERT INTO `order_items` VALUES (107, 73, 1, 'product', 55, NULL, 1.00, 316250.00, 0.00, 0.00, 316250.00, NULL);
INSERT INTO `order_items` VALUES (108, 74, 1, 'product', 54, NULL, 1.00, 375000.00, 0.00, 0.00, 375000.00, NULL);
INSERT INTO `order_items` VALUES (109, 75, 1, 'product', 49, NULL, 1.00, 172500.00, 0.00, 0.00, 172500.00, NULL);
INSERT INTO `order_items` VALUES (110, 76, 1, 'product', 48, NULL, 1.00, 86250.00, 0.00, 0.00, 86250.00, NULL);
INSERT INTO `order_items` VALUES (111, 77, 1, 'product', 6, NULL, 2.00, 368000.00, 0.00, 0.00, 368000.00, NULL);
INSERT INTO `order_items` VALUES (112, 78, 1, 'product', 55, NULL, 1.00, 1408750.00, 0.00, 0.00, 1408750.00, NULL);
INSERT INTO `order_items` VALUES (113, 79, 1, 'product', 55, NULL, 3.00, 948000.00, 0.00, 0.00, 948000.00, NULL);
INSERT INTO `order_items` VALUES (114, 80, 1, 'product', 55, NULL, 1.00, 316250.00, 0.00, 0.00, 316250.00, NULL);
INSERT INTO `order_items` VALUES (115, 81, 1, 'product', 47, NULL, 1.00, 97750.00, 0.00, 0.00, 97750.00, NULL);
INSERT INTO `order_items` VALUES (116, 82, 1, 'product', 55, NULL, 1.00, 316250.00, 0.00, 0.00, 316250.00, NULL);
INSERT INTO `order_items` VALUES (117, 83, 1, 'product', 47, NULL, 1.00, 97750.00, 0.00, 0.00, 97750.00, NULL);
INSERT INTO `order_items` VALUES (118, 84, 1, 'product', 28, NULL, 1.00, 212000.00, 0.00, 0.00, 212000.00, NULL);
INSERT INTO `order_items` VALUES (119, 85, 1, 'product', 46, NULL, 1.00, 115000.00, 0.00, 0.00, 115000.00, NULL);
INSERT INTO `order_items` VALUES (121, 86, 1, 'product', 55, NULL, 1.00, 316250.00, 0.00, 0.00, 316250.00, NULL);
INSERT INTO `order_items` VALUES (122, 87, 1, 'product', 2, NULL, 3.00, 1638750.00, 0.00, 0.00, 1638750.00, NULL);
INSERT INTO `order_items` VALUES (123, 88, 1, 'product', 55, NULL, 1.00, 316250.00, 0.00, 0.00, 316250.00, NULL);
INSERT INTO `order_items` VALUES (124, 89, 1, 'product', 28, NULL, 1.00, 212750.00, 0.00, 0.00, 212750.00, NULL);
INSERT INTO `order_items` VALUES (125, 90, 1, 'product', 2, NULL, 1.00, 115000.00, 0.00, 0.00, 115000.00, NULL);
INSERT INTO `order_items` VALUES (126, 91, 1, 'product', 28, NULL, 2.00, 425500.00, 0.00, 0.00, 425500.00, NULL);
INSERT INTO `order_items` VALUES (127, 92, 1, 'product', 55, NULL, 1.00, 316250.00, 0.00, 0.00, 316250.00, NULL);
INSERT INTO `order_items` VALUES (128, 93, 1, 'product', 49, NULL, 1.00, 172500.00, 0.00, 0.00, 172500.00, NULL);
INSERT INTO `order_items` VALUES (129, 94, 1, 'product', 56, NULL, 1.00, 69000.00, 0.00, 0.00, 69000.00, NULL);
INSERT INTO `order_items` VALUES (130, 95, 1, 'product', 55, NULL, 1.00, 316250.00, 0.00, 0.00, 316250.00, NULL);
INSERT INTO `order_items` VALUES (131, 96, 1, 'product', 55, NULL, 2.00, 632500.00, 0.00, 0.00, 632500.00, NULL);
INSERT INTO `order_items` VALUES (132, 97, 1, 'product', 20, NULL, 2.00, 1311000.00, 0.00, 0.00, 1311000.00, NULL);
INSERT INTO `order_items` VALUES (133, 98, 1, 'product', 6, NULL, 1.00, 874000.00, 0.00, 0.00, 874000.00, NULL);
INSERT INTO `order_items` VALUES (134, 99, 1, 'product', 10, NULL, 1.00, 1032500.00, 0.00, 0.00, 1032500.00, NULL);
INSERT INTO `order_items` VALUES (135, 100, 1, 'product', 55, NULL, 2.00, 632500.00, 0.00, 0.00, 632500.00, NULL);
INSERT INTO `order_items` VALUES (136, 101, 1, 'product', 55, NULL, 1.00, 1408750.00, 0.00, 0.00, 1408750.00, NULL);
INSERT INTO `order_items` VALUES (137, 102, 1, 'product', 49, NULL, 2.00, 345000.00, 0.00, 0.00, 345000.00, NULL);
INSERT INTO `order_items` VALUES (138, 103, 1, 'product', 55, NULL, 2.00, 632500.00, 0.00, 0.00, 632500.00, NULL);
INSERT INTO `order_items` VALUES (139, 104, 1, 'product', 55, NULL, 1.00, 316250.00, 0.00, 0.00, 316250.00, NULL);
INSERT INTO `order_items` VALUES (140, 105, 1, 'product', 2, NULL, 1.00, 115000.00, 0.00, 0.00, 115000.00, NULL);
INSERT INTO `order_items` VALUES (141, 106, 1, 'product', 55, NULL, 1.00, 316250.00, 0.00, 0.00, 316250.00, NULL);
INSERT INTO `order_items` VALUES (142, 107, 1, 'product', 10, NULL, 1.00, 3286000.00, 0.00, 0.00, 3286000.00, NULL);
INSERT INTO `order_items` VALUES (143, 108, 1, 'product', 6, NULL, 1.00, 184000.00, 0.00, 0.00, 184000.00, NULL);
INSERT INTO `order_items` VALUES (144, 109, 1, 'product', 28, NULL, 1.00, 212750.00, 0.00, 0.00, 212750.00, NULL);
INSERT INTO `order_items` VALUES (145, 110, 1, 'product', 28, NULL, 2.00, 425500.00, 0.00, 0.00, 425500.00, NULL);
INSERT INTO `order_items` VALUES (146, 111, 1, 'product', 55, NULL, 3.00, 948750.00, 0.00, 0.00, 948750.00, NULL);
INSERT INTO `order_items` VALUES (148, 112, 1, 'product', 56, NULL, 2.00, 138000.00, 0.00, 0.00, 138000.00, NULL);
INSERT INTO `order_items` VALUES (149, 113, 1, 'product', 56, NULL, 1.00, 316250.00, 0.00, 0.00, 316250.00, NULL);
INSERT INTO `order_items` VALUES (150, 114, 1, 'product', 55, NULL, 1.00, 316250.00, 0.00, 0.00, 316250.00, NULL);
INSERT INTO `order_items` VALUES (151, 115, 1, 'product', 55, NULL, 2.00, 632500.00, 0.00, 0.00, 632500.00, NULL);
INSERT INTO `order_items` VALUES (152, 116, 1, 'product', 20, NULL, 1.00, 138000.00, 0.00, 0.00, 138000.00, NULL);
INSERT INTO `order_items` VALUES (153, 117, 1, 'product', 46, NULL, 1.00, 115000.00, 0.00, 0.00, 115000.00, NULL);
INSERT INTO `order_items` VALUES (154, 118, 1, 'product', 20, NULL, 1.00, 138000.00, 0.00, 0.00, 138000.00, NULL);
INSERT INTO `order_items` VALUES (155, 119, 1, 'product', 55, NULL, 1.00, 1408750.00, 0.00, 0.00, 1408750.00, NULL);
INSERT INTO `order_items` VALUES (156, 120, 1, 'product', 55, NULL, 1.00, 316250.00, 0.00, 0.00, 316250.00, NULL);
INSERT INTO `order_items` VALUES (157, 121, 1, 'product', 61, NULL, 3.00, 345000.00, 0.00, 0.00, 345000.00, NULL);
INSERT INTO `order_items` VALUES (159, 122, 1, 'product', 28, NULL, 2.00, 425500.00, 0.00, 0.00, 425500.00, NULL);
INSERT INTO `order_items` VALUES (160, 123, 1, 'product', 55, NULL, 3.00, 948750.00, 0.00, 0.00, 948750.00, NULL);
INSERT INTO `order_items` VALUES (161, 124, 1, 'product', 46, NULL, 6.00, 690000.00, 0.00, 0.00, 690000.00, NULL);
INSERT INTO `order_items` VALUES (162, 125, 1, 'product', 55, NULL, 1.00, 316250.00, 0.00, 0.00, 316250.00, NULL);
INSERT INTO `order_items` VALUES (163, 126, 1, 'product', 55, NULL, 1.00, 1408750.00, 0.00, 0.00, 1408750.00, NULL);
INSERT INTO `order_items` VALUES (164, 127, 1, 'product', 49, NULL, 1.00, 172500.00, 0.00, 0.00, 172500.00, NULL);
INSERT INTO `order_items` VALUES (165, 128, 1, 'product', 55, NULL, 1.00, 316250.00, 0.00, 0.00, 316250.00, NULL);
INSERT INTO `order_items` VALUES (166, 129, 1, 'product', 46, NULL, 1.00, 115000.00, 0.00, 0.00, 115000.00, NULL);
INSERT INTO `order_items` VALUES (167, 130, 1, 'product', 28, NULL, 1.00, 1010550.00, 0.00, 0.00, 1010550.00, NULL);
INSERT INTO `order_items` VALUES (168, 131, 1, 'product', 61, NULL, 2.00, 1092500.00, 0.00, 0.00, 1092500.00, NULL);
INSERT INTO `order_items` VALUES (169, 132, 1, 'product', 55, NULL, 3.00, 948750.00, 0.00, 0.00, 948750.00, NULL);
INSERT INTO `order_items` VALUES (170, 133, 1, 'product', 48, NULL, 1.00, 86250.00, 0.00, 0.00, 86250.00, NULL);
INSERT INTO `order_items` VALUES (171, 134, 1, 'product', 55, NULL, 2.00, 28175000.00, 0.00, 0.00, 28175000.00, NULL);
INSERT INTO `order_items` VALUES (172, 135, 1, 'product', 49, NULL, 4.00, 690000.00, 0.00, 0.00, 690000.00, NULL);
INSERT INTO `order_items` VALUES (173, 136, 1, 'product', 10, NULL, 1.00, 500250.00, 0.00, 0.00, 500250.00, NULL);
INSERT INTO `order_items` VALUES (174, 137, 1, 'product', 55, NULL, 3.00, 948750.00, 0.00, 0.00, 948750.00, NULL);
INSERT INTO `order_items` VALUES (175, 138, 1, 'product', 46, NULL, 1.00, 115000.00, 0.00, 0.00, 115000.00, NULL);
INSERT INTO `order_items` VALUES (176, 139, 1, 'product', 46, NULL, 2.00, 230000.00, 0.00, 0.00, 230000.00, NULL);
INSERT INTO `order_items` VALUES (177, 140, 1, 'product', 56, NULL, 2.00, 138000.00, 0.00, 0.00, 138000.00, NULL);
INSERT INTO `order_items` VALUES (179, 141, 1, 'product', 56, NULL, 1.00, 69000.00, 0.00, 0.00, 69000.00, NULL);
INSERT INTO `order_items` VALUES (180, 142, 1, 'product', 46, NULL, 7.00, 805000.00, 0.00, 0.00, 805000.00, NULL);
INSERT INTO `order_items` VALUES (181, 143, 1, 'product', 55, NULL, 1.00, 316250.00, 0.00, 0.00, 316250.00, NULL);
INSERT INTO `order_items` VALUES (182, 144, 1, 'product', 46, NULL, 1.00, 115000.00, 0.00, 0.00, 115000.00, NULL);
INSERT INTO `order_items` VALUES (183, 145, 1, 'product', 56, NULL, 5.00, 7043750.00, 0.00, 0.00, 7043750.00, NULL);
INSERT INTO `order_items` VALUES (184, 146, 1, 'product', 36, NULL, 1.00, 316250.00, 0.00, 0.00, 316250.00, NULL);
INSERT INTO `order_items` VALUES (186, 147, 1, 'product', 55, NULL, 1.00, 1408000.00, 0.00, 0.00, 1408000.00, NULL);
INSERT INTO `order_items` VALUES (187, 148, 1, 'product', 46, NULL, 1.00, 115000.00, 0.00, 0.00, 115000.00, NULL);
INSERT INTO `order_items` VALUES (188, 149, 1, 'product', 10, NULL, 1.00, 385250.00, 0.00, 0.00, 385250.00, NULL);
INSERT INTO `order_items` VALUES (189, 150, 1, 'product', 24, NULL, 1.00, 1065200.00, 0.00, 0.00, 1065200.00, NULL);
INSERT INTO `order_items` VALUES (191, 152, 1, 'product', 24, NULL, 3.00, 672750.00, 0.00, 0.00, 672750.00, NULL);
INSERT INTO `order_items` VALUES (192, 151, 1, 'product', 24, NULL, 1.00, 224250.00, 0.00, 0.00, 224250.00, NULL);
INSERT INTO `order_items` VALUES (193, 153, 1, 'product', 24, NULL, 1.00, 224250.00, 0.00, 0.00, 224250.00, NULL);
INSERT INTO `order_items` VALUES (194, 154, 1, 'product', 24, NULL, 1.00, 224250.00, 0.00, 0.00, 224250.00, NULL);
INSERT INTO `order_items` VALUES (197, 156, 1, 'product', 55, NULL, 6.00, 8085000.00, 0.00, 0.00, 8085000.00, NULL);
INSERT INTO `order_items` VALUES (199, 155, 1, 'product', 55, NULL, 1.00, 1347500.00, 0.00, 0.00, 1347500.00, NULL);
INSERT INTO `order_items` VALUES (200, 157, 1, 'product', 55, NULL, 1.00, 316250.00, 0.00, 0.00, 316250.00, NULL);
INSERT INTO `order_items` VALUES (207, 158, 1, 'product', 24, NULL, 1.00, 672000.00, 0.00, 0.00, 672000.00, NULL);
INSERT INTO `order_items` VALUES (208, 159, 1, 'product', 10, NULL, 1.00, 716169.00, 0.00, 0.00, 716169.00, NULL);
INSERT INTO `order_items` VALUES (214, 165, 1, 'product', 46, NULL, 1.00, 252000.00, 0.00, 0.00, 252000.00, NULL);
INSERT INTO `order_items` VALUES (218, 164, 1, 'product', 46, NULL, 1.00, 882515.00, 0.00, 0.00, 882515.00, NULL);
INSERT INTO `order_items` VALUES (219, 162, 1, 'product', 6, NULL, 1.00, 982080.00, 0.00, 0.00, 982080.00, NULL);
INSERT INTO `order_items` VALUES (221, 161, 1, 'product', 55, NULL, 1.00, 1815000.00, 0.00, 0.00, 1815000.00, NULL);
INSERT INTO `order_items` VALUES (222, 174, 1, 'product', 48, NULL, 4.00, 75000.00, 0.00, 0.00, 75000.00, NULL);

-- ----------------------------
-- Table structure for orders
-- ----------------------------
CREATE TABLE `orders`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `order_no` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `order_date` datetime NOT NULL,
  `customer_id` bigint UNSIGNED NULL DEFAULT NULL,
  `channel_id` bigint UNSIGNED NOT NULL,
  `platform_id` bigint UNSIGNED NULL DEFAULT NULL,
  `store_id` bigint UNSIGNED NULL DEFAULT NULL,
  `order_source_ref` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `order_type` enum('product','service','mixed') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'product',
  `status` enum('draft','confirmed','packed','shipped','completed','canceled') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
  `subtotal` decimal(15, 2) NOT NULL DEFAULT 0.00,
  `discount_total` decimal(15, 2) NOT NULL DEFAULT 0.00,
  `shipping_cost` decimal(15, 2) NOT NULL DEFAULT 0.00,
  `tax_total` decimal(15, 2) NOT NULL DEFAULT 0.00,
  `grand_total` decimal(15, 2) NOT NULL DEFAULT 0.00,
  `created_by` bigint UNSIGNED NULL DEFAULT NULL,
  `approved_by` bigint UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `order_no`(`order_no` ASC) USING BTREE,
  INDEX `fk_orders_customer`(`customer_id` ASC) USING BTREE,
  INDEX `fk_orders_channel`(`channel_id` ASC) USING BTREE,
  INDEX `fk_orders_platform`(`platform_id` ASC) USING BTREE,
  INDEX `fk_orders_store`(`store_id` ASC) USING BTREE,
  INDEX `fk_orders_created_by`(`created_by` ASC) USING BTREE,
  INDEX `fk_orders_approved_by`(`approved_by` ASC) USING BTREE,
  INDEX `idx_orders_order_date`(`order_date` ASC) USING BTREE,
  INDEX `idx_orders_status`(`status` ASC) USING BTREE,
  CONSTRAINT `fk_orders_approved_by` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_orders_channel` FOREIGN KEY (`channel_id`) REFERENCES `sales_channels` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_orders_created_by` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_orders_customer` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_orders_platform` FOREIGN KEY (`platform_id`) REFERENCES `platforms` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_orders_store` FOREIGN KEY (`store_id`) REFERENCES `stores` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 178 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of orders
-- ----------------------------
INSERT INTO `orders` VALUES (2, 'ORD-20260520-00001', '2026-05-20 14:04:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'shipped', 212750.00, 0.00, 0.00, 0.00, 212750.00, 3, NULL, '2026-05-20 14:05:11', '2026-05-20 14:05:11');
INSERT INTO `orders` VALUES (3, 'ORD-20260520-00002', '2026-05-20 14:05:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'packed', 115000.00, 0.00, 0.00, 0.00, 115000.00, 3, NULL, '2026-05-20 14:06:03', '2026-05-20 14:06:03');
INSERT INTO `orders` VALUES (4, 'ORD-20260520-00003', '2026-05-20 14:18:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'shipped', 212750.00, 0.00, 0.00, 0.00, 212750.00, 3, NULL, '2026-05-20 14:18:57', '2026-05-20 14:18:57');
INSERT INTO `orders` VALUES (5, 'ORD-20260520-00004', '2026-05-20 14:18:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'packed', 115000.00, 0.00, 0.00, 0.00, 115000.00, 3, NULL, '2026-05-20 14:19:24', '2026-05-20 14:19:34');
INSERT INTO `orders` VALUES (6, 'ORD-20260520-00005', '2026-05-20 14:19:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'packed', 115000.00, 0.00, 0.00, 0.00, 115000.00, 3, NULL, '2026-05-20 14:19:49', '2026-05-20 14:19:49');
INSERT INTO `orders` VALUES (8, 'ORD-20260520-00006', '2026-05-20 16:09:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 316250.00, 0.00, 0.00, 0.00, 316250.00, 5, NULL, '2026-05-20 16:11:59', '2026-05-20 16:11:59');
INSERT INTO `orders` VALUES (9, '260520VBM44UHR', '2026-05-21 08:00:00', NULL, 5, NULL, NULL, 'kkcstoreofficial', 'product', 'confirmed', 316250.00, 0.00, 0.00, 0.00, 316250.00, 2, NULL, '2026-05-21 08:01:51', '2026-05-21 08:01:51');
INSERT INTO `orders` VALUES (10, 'ORD-20260521-00001', '2026-05-21 08:06:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'shipped', 2810000.00, 0.00, 0.00, 0.00, 2810000.00, 3, NULL, '2026-05-21 08:11:50', '2026-05-21 08:44:57');
INSERT INTO `orders` VALUES (11, 'ORD-20260521-00002', '2026-05-21 09:07:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'confirmed', 448500.00, 0.00, 0.00, 0.00, 448500.00, 5, NULL, '2026-05-21 09:09:25', '2026-05-21 09:10:16');
INSERT INTO `orders` VALUES (12, 'ORD-20260521-00003', '2026-05-21 09:10:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'confirmed', 948750.00, 0.00, 0.00, 0.00, 948750.00, 5, NULL, '2026-05-21 09:13:20', '2026-05-21 09:13:20');
INSERT INTO `orders` VALUES (13, 'ORD-20260521-00004', '2026-05-21 09:13:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'confirmed', 138000.00, 0.00, 0.00, 0.00, 138000.00, 5, NULL, '2026-05-21 09:24:41', '2026-05-21 09:24:41');
INSERT INTO `orders` VALUES (14, 'ORD-20260521-00005', '2026-05-21 09:24:00', NULL, 5, NULL, NULL, 'Decorative Paint Shop', 'product', 'confirmed', 86250.00, 0.00, 0.00, 0.00, 86250.00, 5, NULL, '2026-05-21 09:25:36', '2026-05-21 09:25:36');
INSERT INTO `orders` VALUES (15, 'ORD-20260521-00006', '2026-05-21 09:25:00', NULL, 5, NULL, NULL, 'Decorative Paint Shop', 'product', 'confirmed', 316250.00, 0.00, 0.00, 0.00, 316250.00, 5, NULL, '2026-05-21 09:26:42', '2026-05-21 09:26:42');
INSERT INTO `orders` VALUES (16, 'ORD-20260521-00007', '2026-05-21 09:26:00', NULL, 4, NULL, NULL, 'Decopaint Official', 'product', 'confirmed', 7043750.00, 0.00, 0.00, 0.00, 7043750.00, 5, NULL, '2026-05-21 09:28:05', '2026-05-21 09:28:05');
INSERT INTO `orders` VALUES (17, 'ORD-20260521-00008', '2026-05-21 09:28:00', NULL, 4, NULL, NULL, 'Decopaint Official', 'product', 'confirmed', 632500.00, 0.00, 0.00, 0.00, 632500.00, 5, NULL, '2026-05-21 09:46:38', '2026-05-21 11:52:23');
INSERT INTO `orders` VALUES (18, 'ORD-20260521-00009', '2026-05-21 09:46:00', NULL, 4, NULL, NULL, 'Decopaint Official', 'product', 'confirmed', 172500.00, 0.00, 0.00, 0.00, 172500.00, 5, NULL, '2026-05-21 09:48:01', '2026-05-21 09:48:01');
INSERT INTO `orders` VALUES (19, 'ORD-20260521-00010', '2026-05-21 10:26:00', NULL, 4, NULL, NULL, 'Decorative Paint', 'product', 'confirmed', 1210000.00, 0.00, 0.00, 0.00, 1210000.00, 4, NULL, '2026-05-21 10:27:40', '2026-05-21 10:27:40');
INSERT INTO `orders` VALUES (20, 'ORD-20260521-00011', '2026-05-21 13:26:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'packed', 316000.00, 0.00, 0.00, 0.00, 316000.00, 3, NULL, '2026-05-21 13:26:51', '2026-05-21 13:26:51');
INSERT INTO `orders` VALUES (21, 'ORD-20260521-00012', '2026-05-21 13:43:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'draft', 316000.00, 0.00, 0.00, 0.00, 316000.00, 3, NULL, '2026-05-21 13:43:27', '2026-05-21 13:43:27');
INSERT INTO `orders` VALUES (22, 'ORD-20260521-00013', '2026-05-21 13:46:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'confirmed', 948750.00, 0.00, 0.00, 0.00, 948750.00, 5, NULL, '2026-05-21 13:48:45', '2026-05-21 13:48:45');
INSERT INTO `orders` VALUES (23, 'ORD-20260521-00014', '2026-05-21 14:05:00', NULL, 4, NULL, NULL, 'Decorative Paint', 'product', 'confirmed', 672750.00, 0.00, 0.00, 0.00, 672750.00, 4, NULL, '2026-05-21 14:06:07', '2026-05-21 14:09:32');
INSERT INTO `orders` VALUES (24, 'ORD-20260521-00015', '2026-05-21 14:06:00', NULL, 4, NULL, NULL, 'Decorative Paint', 'product', 'draft', 1265000.00, 0.00, 0.00, 0.00, 1265000.00, 4, NULL, '2026-05-21 14:08:07', '2026-05-21 14:09:14');
INSERT INTO `orders` VALUES (25, 'ORD-20260521-00016', '2026-05-21 15:14:00', NULL, 1, NULL, NULL, 'Decopaint Bali', 'product', 'completed', 212750.00, 0.00, 0.00, 0.00, 212750.00, 13, NULL, '2026-05-21 15:14:36', '2026-05-21 15:15:03');
INSERT INTO `orders` VALUES (26, 'ORD-20260521-00017', '2026-05-21 16:05:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 230000.00, 0.00, 0.00, 0.00, 230000.00, 5, NULL, '2026-05-21 16:06:22', '2026-05-22 13:46:20');
INSERT INTO `orders` VALUES (27, 'ORD-20260522-00001', '2026-05-22 09:29:00', NULL, 1, NULL, NULL, 'Decopaint Official', 'product', 'confirmed', 7043750.00, 0.00, 0.00, 0.00, 7043750.00, 5, NULL, '2026-05-22 09:34:31', '2026-05-22 09:34:31');
INSERT INTO `orders` VALUES (28, 'ORD-20260522-00002', '2026-05-22 09:34:00', NULL, 1, NULL, NULL, 'Decopaint Official', 'product', 'confirmed', 345000.00, 0.00, 0.00, 0.00, 345000.00, 5, NULL, '2026-05-22 09:35:22', '2026-05-22 09:35:22');
INSERT INTO `orders` VALUES (29, 'ORD-20260522-00003', '2026-05-22 09:35:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 316250.00, 0.00, 0.00, 0.00, 316250.00, 5, NULL, '2026-05-22 09:36:13', '2026-05-22 09:37:59');
INSERT INTO `orders` VALUES (30, 'ORD-20260522-00004', '2026-05-22 09:36:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 948750.00, 0.00, 0.00, 0.00, 948750.00, 5, NULL, '2026-05-22 09:37:24', '2026-05-22 09:37:24');
INSERT INTO `orders` VALUES (31, 'ORD-20260522-00005', '2026-05-22 09:40:00', NULL, 4, NULL, NULL, 'Decorative Paint', 'product', 'confirmed', 86250.00, 0.00, 0.00, 0.00, 86250.00, 4, NULL, '2026-05-22 09:41:19', '2026-05-22 09:41:19');
INSERT INTO `orders` VALUES (32, 'ORD-20260522-00006', '2026-05-22 09:52:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'packed', 1065000.00, 0.00, 0.00, 0.00, 1065000.00, 3, NULL, '2026-05-22 09:53:00', '2026-05-22 09:53:00');
INSERT INTO `orders` VALUES (33, 'ORD-20260522-00007', '2026-05-22 13:46:00', NULL, 4, NULL, NULL, 'Decopaint Official', 'product', 'completed', 632500.00, 0.00, 0.00, 0.00, 632500.00, 5, NULL, '2026-05-22 13:52:46', '2026-05-22 13:52:46');
INSERT INTO `orders` VALUES (34, 'ORD-20260522-00008', '2026-05-22 13:52:00', NULL, 4, NULL, NULL, 'Decopaint Official', 'product', 'confirmed', 86250.00, 0.00, 0.00, 0.00, 86250.00, 5, NULL, '2026-05-22 13:53:31', '2026-05-22 13:53:31');
INSERT INTO `orders` VALUES (35, 'ORD-20260522-00009', '2026-05-22 13:53:00', NULL, 4, NULL, NULL, 'Decopaint Official', 'product', 'confirmed', 632500.00, 0.00, 0.00, 0.00, 632500.00, 5, NULL, '2026-05-22 13:54:43', '2026-05-22 13:54:43');
INSERT INTO `orders` VALUES (36, 'ORD-20260522-00010', '2026-05-02 13:55:00', NULL, 4, NULL, NULL, 'Decopaint Official', 'product', 'completed', 546250.00, 0.00, 0.00, 0.00, 546250.00, 5, NULL, '2026-05-22 13:58:54', '2026-05-22 13:58:54');
INSERT INTO `orders` VALUES (37, 'ORD-20260522-00011', '2026-05-02 13:58:00', NULL, 4, NULL, NULL, 'Decopaint Official', 'product', 'completed', 385250.00, 0.00, 0.00, 0.00, 385250.00, 5, NULL, '2026-05-22 14:00:51', '2026-05-22 14:00:51');
INSERT INTO `orders` VALUES (38, 'ORD-20260522-00012', '2026-05-02 14:00:00', NULL, 4, NULL, NULL, 'Decopaint Official', 'product', 'completed', 316250.00, 0.00, 0.00, 0.00, 316250.00, 5, NULL, '2026-05-22 14:02:19', '2026-05-22 14:02:19');
INSERT INTO `orders` VALUES (39, 'ORD-20260522-00013', '2026-05-02 13:46:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 316000.00, 0.00, 0.00, 0.00, 316000.00, 3, NULL, '2026-05-22 14:03:08', '2026-05-22 14:03:08');
INSERT INTO `orders` VALUES (40, 'ORD-20260522-00014', '2026-05-02 14:02:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 212750.00, 0.00, 0.00, 0.00, 212750.00, 5, NULL, '2026-05-22 14:03:15', '2026-05-22 14:03:15');
INSERT INTO `orders` VALUES (41, 'ORD-20260522-00015', '2026-05-03 14:03:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 212750.00, 0.00, 0.00, 0.00, 212750.00, 3, NULL, '2026-05-22 14:03:46', '2026-05-22 14:03:52');
INSERT INTO `orders` VALUES (42, 'ORD-20260522-00016', '2026-05-04 14:03:00', NULL, 1, NULL, NULL, 'Decopaint Store', 'product', 'completed', 552000.00, 0.00, 0.00, 0.00, 552000.00, 5, NULL, '2026-05-22 14:08:34', '2026-05-22 14:08:34');
INSERT INTO `orders` VALUES (43, 'ORD-20260522-00017', '2026-05-04 14:03:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 385250.00, 0.00, 0.00, 0.00, 385250.00, 3, NULL, '2026-05-22 14:08:38', '2026-05-22 14:08:54');
INSERT INTO `orders` VALUES (44, 'ORD-20260522-00018', '2026-05-04 14:08:00', NULL, 1, NULL, NULL, 'Decopaint Store', 'product', 'completed', 345000.00, 0.00, 0.00, 0.00, 345000.00, 5, NULL, '2026-05-22 14:09:35', '2026-05-22 14:09:35');
INSERT INTO `orders` VALUES (45, 'ORD-20260522-00019', '2026-05-04 14:08:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 115000.00, 0.00, 0.00, 0.00, 115000.00, 3, NULL, '2026-05-22 14:10:15', '2026-05-22 14:10:21');
INSERT INTO `orders` VALUES (46, 'ORD-20260522-00020', '2026-05-05 14:10:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 115000.00, 0.00, 0.00, 0.00, 115000.00, 3, NULL, '2026-05-22 14:10:53', '2026-05-22 14:10:53');
INSERT INTO `orders` VALUES (47, 'ORD-20260522-00021', '2026-05-04 14:09:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 316250.00, 0.00, 0.00, 0.00, 316250.00, 5, NULL, '2026-05-22 14:11:05', '2026-05-22 14:11:05');
INSERT INTO `orders` VALUES (48, 'ORD-20260522-00022', '2026-05-06 14:10:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 115000.00, 0.00, 0.00, 0.00, 115000.00, 3, NULL, '2026-05-22 14:11:26', '2026-05-22 14:11:26');
INSERT INTO `orders` VALUES (49, 'ORD-20260522-00023', '2026-05-06 14:11:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 224250.00, 0.00, 0.00, 0.00, 224250.00, 3, NULL, '2026-05-22 14:11:55', '2026-05-22 14:11:55');
INSERT INTO `orders` VALUES (50, '260505JGWSPVXR', '2026-05-22 14:09:00', NULL, 5, NULL, NULL, 'kkcstoreofficial', 'product', 'completed', 224250.00, 0.00, 0.00, 0.00, 224250.00, 2, NULL, '2026-05-22 14:12:18', '2026-05-22 14:12:27');
INSERT INTO `orders` VALUES (51, 'ORD-20260522-00024', '2026-05-22 14:11:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 632000.00, 0.00, 0.00, 0.00, 632000.00, 3, NULL, '2026-05-22 14:12:44', '2026-05-22 14:12:44');
INSERT INTO `orders` VALUES (52, 'ORD-20260522-00025', '2026-05-07 14:12:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'draft', 172500.00, 0.00, 0.00, 0.00, 172500.00, 3, NULL, '2026-05-22 14:13:22', '2026-05-22 14:13:22');
INSERT INTO `orders` VALUES (53, 'ORD-20260522-00026', '2026-05-04 14:11:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 1288000.00, 0.00, 0.00, 0.00, 1288000.00, 5, NULL, '2026-05-22 14:13:44', '2026-05-22 14:13:44');
INSERT INTO `orders` VALUES (54, 'ORD-20260522-00027', '2026-05-07 14:13:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 150000.00, 0.00, 0.00, 0.00, 150000.00, 3, NULL, '2026-05-22 14:14:14', '2026-05-22 14:14:14');
INSERT INTO `orders` VALUES (55, 'ORD-20260522-00028', '2026-05-08 14:14:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 115000.00, 0.00, 0.00, 0.00, 115000.00, 3, NULL, '2026-05-22 14:14:43', '2026-05-22 14:14:43');
INSERT INTO `orders` VALUES (56, 'ORD-20260522-00029', '2026-05-04 14:13:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 385250.00, 0.00, 0.00, 0.00, 385250.00, 5, NULL, '2026-05-22 14:14:49', '2026-05-22 14:16:21');
INSERT INTO `orders` VALUES (57, '260507RH4KQHAY', '2026-05-07 14:12:00', NULL, 5, NULL, NULL, 'kkcstoreofficial', 'product', 'completed', 224250.00, 0.00, 0.00, 0.00, 224250.00, 2, NULL, '2026-05-22 14:15:16', '2026-05-22 14:15:16');
INSERT INTO `orders` VALUES (58, 'ORD-20260522-00030', '2026-05-11 14:14:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 460000.00, 0.00, 0.00, 0.00, 460000.00, 3, NULL, '2026-05-22 14:15:30', '2026-05-22 14:18:48');
INSERT INTO `orders` VALUES (59, 'ORD-20260522-00031', '2026-05-11 14:15:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 184000.00, 0.00, 0.00, 0.00, 184000.00, 3, NULL, '2026-05-22 14:16:06', '2026-05-22 14:16:06');
INSERT INTO `orders` VALUES (60, 'ORD-20260522-00032', '2026-05-04 14:14:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 948750.00, 0.00, 0.00, 0.00, 948750.00, 5, NULL, '2026-05-22 14:16:57', '2026-05-22 14:16:57');
INSERT INTO `orders` VALUES (61, 'ORD-20260522-00033', '2026-05-04 14:16:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 172500.00, 0.00, 0.00, 0.00, 172500.00, 5, NULL, '2026-05-22 14:17:33', '2026-05-22 14:17:33');
INSERT INTO `orders` VALUES (62, '260506NQYU4RKT', '2026-05-06 14:16:00', NULL, 5, NULL, NULL, 'kkcstoreofficial', 'product', 'completed', 1289250.00, 0.00, 0.00, 0.00, 1289250.00, 2, NULL, '2026-05-22 14:17:37', '2026-05-22 14:17:37');
INSERT INTO `orders` VALUES (63, 'ORD-20260522-00034', '2026-05-11 14:16:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 750000.00, 0.00, 0.00, 0.00, 750000.00, 3, NULL, '2026-05-22 14:17:54', '2026-05-22 14:17:54');
INSERT INTO `orders` VALUES (64, '2605103KJSQAGM', '2026-05-11 14:17:00', NULL, 1, NULL, NULL, 'kkcstoreofficial', 'product', 'completed', 224250.00, 0.00, 0.00, 0.00, 224250.00, 2, NULL, '2026-05-22 14:18:44', '2026-05-22 14:18:44');
INSERT INTO `orders` VALUES (65, 'ORD-20260522-00035', '2026-05-11 14:18:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 224250.00, 0.00, 0.00, 0.00, 224250.00, 3, NULL, '2026-05-22 14:19:40', '2026-05-22 14:19:40');
INSERT INTO `orders` VALUES (66, 'ORD-20260522-00036', '2026-05-11 14:19:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 86250.00, 0.00, 0.00, 0.00, 86250.00, 3, NULL, '2026-05-22 14:20:09', '2026-05-22 14:20:09');
INSERT INTO `orders` VALUES (67, 'ORD-20260522-00037', '2026-05-11 14:20:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 1406000.00, 0.00, 0.00, 0.00, 1406000.00, 3, NULL, '2026-05-22 14:20:53', '2026-05-22 14:20:53');
INSERT INTO `orders` VALUES (68, 'ORD-20260522-00038', '2026-05-12 14:20:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 316250.00, 0.00, 0.00, 0.00, 316250.00, 3, NULL, '2026-05-22 14:21:17', '2026-05-22 14:21:17');
INSERT INTO `orders` VALUES (69, 'ORD-20260522-00039', '2026-05-12 14:21:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 86250.00, 0.00, 0.00, 0.00, 86250.00, 3, NULL, '2026-05-22 14:21:51', '2026-05-22 14:21:51');
INSERT INTO `orders` VALUES (70, 'ORD-20260522-00040', '2026-05-12 14:21:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 115000.00, 0.00, 0.00, 0.00, 115000.00, 3, NULL, '2026-05-22 14:22:30', '2026-05-22 14:23:31');
INSERT INTO `orders` VALUES (71, 'ORD-20260522-00041', '2026-05-04 14:17:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 2047250.00, 0.00, 0.00, 0.00, 2047250.00, 5, NULL, '2026-05-22 14:22:47', '2026-05-22 14:22:47');
INSERT INTO `orders` VALUES (72, 'ORD-20260522-00042', '2026-05-12 14:22:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 224250.00, 0.00, 0.00, 0.00, 224250.00, 3, NULL, '2026-05-22 14:23:03', '2026-05-22 14:23:03');
INSERT INTO `orders` VALUES (73, 'ORD-20260522-00043', '2026-05-12 14:23:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 316250.00, 0.00, 0.00, 0.00, 316250.00, 3, NULL, '2026-05-22 14:24:03', '2026-05-22 14:24:03');
INSERT INTO `orders` VALUES (74, 'ORD-20260522-00044', '2026-05-04 14:22:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 375000.00, 0.00, 0.00, 0.00, 375000.00, 5, NULL, '2026-05-22 14:24:10', '2026-05-22 14:24:10');
INSERT INTO `orders` VALUES (75, 'ORD-20260522-00045', '2026-05-12 14:24:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 172500.00, 0.00, 0.00, 0.00, 172500.00, 3, NULL, '2026-05-22 14:24:34', '2026-05-22 14:24:34');
INSERT INTO `orders` VALUES (76, 'ORD-20260522-00046', '2026-05-04 14:24:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 86250.00, 0.00, 0.00, 0.00, 86250.00, 5, NULL, '2026-05-22 14:24:41', '2026-05-22 14:24:41');
INSERT INTO `orders` VALUES (77, 'ORD-20260522-00047', '2026-05-12 14:24:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 368000.00, 0.00, 0.00, 0.00, 368000.00, 3, NULL, '2026-05-22 14:25:34', '2026-05-22 14:25:34');
INSERT INTO `orders` VALUES (78, 'ORD-20260522-00048', '2026-05-04 14:24:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 1408750.00, 0.00, 0.00, 0.00, 1408750.00, 5, NULL, '2026-05-22 14:25:54', '2026-05-22 14:25:54');
INSERT INTO `orders` VALUES (79, 'ORD-20260522-00049', '2026-05-13 14:25:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'draft', 948000.00, 0.00, 0.00, 0.00, 948000.00, 3, NULL, '2026-05-22 14:26:24', '2026-05-22 14:26:24');
INSERT INTO `orders` VALUES (80, 'ORD-20260522-00050', '2026-05-14 14:26:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 316250.00, 0.00, 0.00, 0.00, 316250.00, 3, NULL, '2026-05-22 14:27:13', '2026-05-22 14:27:13');
INSERT INTO `orders` VALUES (81, 'ORD-20260522-00051', '2026-05-05 14:25:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 97750.00, 0.00, 0.00, 0.00, 97750.00, 5, NULL, '2026-05-22 14:27:14', '2026-05-22 14:27:14');
INSERT INTO `orders` VALUES (82, 'ORD-20260522-00052', '2026-05-05 14:27:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 316250.00, 0.00, 0.00, 0.00, 316250.00, 5, NULL, '2026-05-22 14:27:55', '2026-05-22 14:27:55');
INSERT INTO `orders` VALUES (83, 'ORD-20260522-00053', '2026-05-05 14:27:00', NULL, 4, NULL, NULL, 'Decopaint Official', 'product', 'completed', 97750.00, 0.00, 0.00, 0.00, 97750.00, 5, NULL, '2026-05-22 14:29:28', '2026-05-22 14:29:28');
INSERT INTO `orders` VALUES (84, 'ORD-20260522-00054', '2026-05-15 14:27:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 212000.00, 0.00, 0.00, 0.00, 212000.00, 3, NULL, '2026-05-22 14:30:20', '2026-05-22 14:30:20');
INSERT INTO `orders` VALUES (85, 'ORD-20260522-00055', '2026-05-05 14:29:00', NULL, 4, NULL, NULL, 'Decopaint Official', 'product', 'completed', 115000.00, 0.00, 0.00, 0.00, 115000.00, 5, NULL, '2026-05-22 14:30:26', '2026-05-22 14:30:26');
INSERT INTO `orders` VALUES (86, 'ORD-20260522-00056', '2026-05-15 14:30:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 316250.00, 0.00, 0.00, 0.00, 316250.00, 3, NULL, '2026-05-22 14:30:49', '2026-05-22 14:30:54');
INSERT INTO `orders` VALUES (87, 'ORD-20260522-00057', '2026-05-05 14:30:00', NULL, 4, NULL, NULL, 'Decopaint Official', 'product', 'completed', 1638750.00, 0.00, 0.00, 0.00, 1638750.00, 5, NULL, '2026-05-22 14:31:37', '2026-05-22 14:31:37');
INSERT INTO `orders` VALUES (88, 'ORD-20260522-00058', '2026-05-17 14:30:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 316250.00, 0.00, 0.00, 0.00, 316250.00, 3, NULL, '2026-05-22 14:31:52', '2026-05-22 14:31:52');
INSERT INTO `orders` VALUES (89, 'ORD-20260522-00059', '2026-05-18 14:31:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 212750.00, 0.00, 0.00, 0.00, 212750.00, 3, NULL, '2026-05-22 14:32:24', '2026-05-22 14:32:24');
INSERT INTO `orders` VALUES (90, 'ORD-20260522-00060', '2026-05-05 14:31:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 115000.00, 0.00, 0.00, 0.00, 115000.00, 5, NULL, '2026-05-22 14:32:50', '2026-05-22 14:32:50');
INSERT INTO `orders` VALUES (91, 'ORD-20260522-00061', '2026-05-20 14:32:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'completed', 425500.00, 0.00, 0.00, 0.00, 425500.00, 3, NULL, '2026-05-22 14:33:22', '2026-05-22 14:33:22');
INSERT INTO `orders` VALUES (92, 'ORD-20260522-00062', '2026-05-05 14:32:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 316250.00, 0.00, 0.00, 0.00, 316250.00, 5, NULL, '2026-05-22 14:33:27', '2026-05-22 14:33:27');
INSERT INTO `orders` VALUES (93, 'ORD-20260522-00063', '2026-05-05 14:33:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 172500.00, 0.00, 0.00, 0.00, 172500.00, 5, NULL, '2026-05-22 14:34:03', '2026-05-22 14:34:03');
INSERT INTO `orders` VALUES (94, 'ORD-20260522-00064', '2026-05-06 14:34:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 69000.00, 0.00, 0.00, 0.00, 69000.00, 5, NULL, '2026-05-22 14:36:10', '2026-05-22 14:36:10');
INSERT INTO `orders` VALUES (95, 'ORD-20260522-00065', '2026-05-06 14:36:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 316250.00, 0.00, 0.00, 0.00, 316250.00, 5, NULL, '2026-05-22 14:36:58', '2026-05-22 14:36:58');
INSERT INTO `orders` VALUES (96, 'ORD-20260522-00066', '2026-05-06 14:36:00', NULL, 1, NULL, NULL, 'Decopaint Store', 'product', 'completed', 632500.00, 0.00, 0.00, 0.00, 632500.00, 5, NULL, '2026-05-22 14:37:52', '2026-05-22 14:37:52');
INSERT INTO `orders` VALUES (97, 'ORD-20260522-00067', '2026-05-06 14:37:00', NULL, 4, NULL, NULL, 'Decopaint Official', 'product', 'completed', 1311000.00, 0.00, 0.00, 0.00, 1311000.00, 5, NULL, '2026-05-22 14:38:51', '2026-05-22 14:38:51');
INSERT INTO `orders` VALUES (98, 'ORD-20260522-00068', '2026-05-06 14:38:00', NULL, 1, NULL, NULL, 'Decopaint Store', 'product', 'completed', 874000.00, 0.00, 0.00, 0.00, 874000.00, 5, NULL, '2026-05-22 14:40:08', '2026-05-22 14:40:08');
INSERT INTO `orders` VALUES (99, 'ORD-20260522-00069', '2026-05-06 14:40:00', NULL, 4, NULL, NULL, 'Decopaint Official', 'product', 'completed', 1032500.00, 0.00, 0.00, 0.00, 1032500.00, 5, NULL, '2026-05-22 14:41:15', '2026-05-22 14:41:15');
INSERT INTO `orders` VALUES (100, 'ORD-20260522-00070', '2026-05-07 14:41:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 632500.00, 0.00, 0.00, 0.00, 632500.00, 5, NULL, '2026-05-22 14:42:16', '2026-05-22 14:42:16');
INSERT INTO `orders` VALUES (101, 'ORD-20260522-00071', '2026-05-07 14:42:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 1408750.00, 0.00, 0.00, 0.00, 1408750.00, 5, NULL, '2026-05-22 14:49:19', '2026-05-22 14:49:19');
INSERT INTO `orders` VALUES (102, 'ORD-20260522-00072', '2026-05-07 14:49:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 345000.00, 0.00, 0.00, 0.00, 345000.00, 5, NULL, '2026-05-22 14:50:30', '2026-05-22 14:50:30');
INSERT INTO `orders` VALUES (103, 'ORD-20260522-00073', '2026-05-08 14:50:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 632500.00, 0.00, 0.00, 0.00, 632500.00, 5, NULL, '2026-05-22 14:52:07', '2026-05-22 14:52:07');
INSERT INTO `orders` VALUES (104, 'ORD-20260522-00074', '2026-05-08 14:52:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 316250.00, 0.00, 0.00, 0.00, 316250.00, 5, NULL, '2026-05-22 14:53:28', '2026-05-22 14:53:28');
INSERT INTO `orders` VALUES (105, 'ORD-20260522-00075', '2026-05-08 14:53:00', NULL, 5, NULL, NULL, 'Decorative Paint Shop', 'product', 'completed', 115000.00, 0.00, 0.00, 0.00, 115000.00, 5, NULL, '2026-05-22 14:54:16', '2026-05-22 14:54:16');
INSERT INTO `orders` VALUES (106, 'ORD-20260522-00076', '2026-05-08 14:54:00', NULL, 5, NULL, NULL, 'Decorative Paint Shop', 'product', 'completed', 316250.00, 0.00, 0.00, 0.00, 316250.00, 5, NULL, '2026-05-22 14:54:58', '2026-05-22 14:54:58');
INSERT INTO `orders` VALUES (107, 'ORD-20260522-00077', '2026-05-08 14:54:00', NULL, 4, NULL, NULL, 'Decopaint Official', 'product', 'completed', 3286000.00, 0.00, 0.00, 0.00, 3286000.00, 5, NULL, '2026-05-22 14:56:01', '2026-05-22 14:56:01');
INSERT INTO `orders` VALUES (108, 'ORD-20260522-00078', '2026-05-09 14:56:00', NULL, 4, NULL, NULL, 'Decopaint Official', 'product', 'completed', 184000.00, 0.00, 0.00, 0.00, 184000.00, 5, NULL, '2026-05-22 14:58:33', '2026-05-22 14:58:33');
INSERT INTO `orders` VALUES (109, 'ORD-20260522-00079', '2026-05-09 14:58:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 212750.00, 0.00, 0.00, 0.00, 212750.00, 5, NULL, '2026-05-22 14:59:37', '2026-05-22 14:59:37');
INSERT INTO `orders` VALUES (110, 'ORD-20260522-00080', '2026-05-11 14:59:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 425500.00, 0.00, 0.00, 0.00, 425500.00, 5, NULL, '2026-05-22 15:00:43', '2026-05-22 15:00:43');
INSERT INTO `orders` VALUES (111, 'ORD-20260522-00081', '2026-05-11 15:00:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 948750.00, 0.00, 0.00, 0.00, 948750.00, 5, NULL, '2026-05-22 15:02:05', '2026-05-22 15:02:05');
INSERT INTO `orders` VALUES (112, 'ORD-20260522-00082', '2026-05-11 15:02:00', NULL, 4, NULL, NULL, 'Decopaint Official', 'product', 'completed', 138000.00, 0.00, 0.00, 0.00, 138000.00, 5, NULL, '2026-05-22 15:03:22', '2026-05-22 15:06:10');
INSERT INTO `orders` VALUES (113, 'ORD-20260522-00083', '2026-05-13 15:06:00', NULL, 4, NULL, NULL, 'Decopaint Official', 'product', 'completed', 316250.00, 0.00, 0.00, 0.00, 316250.00, 5, NULL, '2026-05-22 15:08:16', '2026-05-22 15:08:16');
INSERT INTO `orders` VALUES (114, 'ORD-20260522-00084', '2026-05-13 15:08:00', NULL, 4, NULL, NULL, 'Decopaint Official', 'product', 'completed', 316250.00, 0.00, 0.00, 0.00, 316250.00, 5, NULL, '2026-05-22 15:08:57', '2026-05-22 15:08:57');
INSERT INTO `orders` VALUES (115, 'ORD-20260522-00085', '2026-05-13 15:08:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 632500.00, 0.00, 0.00, 0.00, 632500.00, 5, NULL, '2026-05-22 15:10:04', '2026-05-22 15:10:04');
INSERT INTO `orders` VALUES (116, 'ORD-20260522-00086', '2026-05-13 15:10:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 138000.00, 0.00, 0.00, 0.00, 138000.00, 5, NULL, '2026-05-22 15:10:47', '2026-05-22 15:10:47');
INSERT INTO `orders` VALUES (117, 'ORD-20260522-00087', '2026-05-13 15:10:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 115000.00, 0.00, 0.00, 0.00, 115000.00, 5, NULL, '2026-05-22 15:11:15', '2026-05-22 15:11:15');
INSERT INTO `orders` VALUES (118, 'ORD-20260522-00088', '2026-05-13 15:11:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 138000.00, 0.00, 0.00, 0.00, 138000.00, 5, NULL, '2026-05-22 15:12:01', '2026-05-22 15:12:01');
INSERT INTO `orders` VALUES (119, 'ORD-20260522-00089', '2026-05-13 15:12:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 1408750.00, 0.00, 0.00, 0.00, 1408750.00, 5, NULL, '2026-05-22 15:13:37', '2026-05-22 15:13:37');
INSERT INTO `orders` VALUES (120, 'ORD-20260522-00090', '2026-05-13 15:13:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 316250.00, 0.00, 0.00, 0.00, 316250.00, 5, NULL, '2026-05-22 15:14:36', '2026-05-22 15:14:36');
INSERT INTO `orders` VALUES (121, 'ORD-20260522-00091', '2026-05-13 15:14:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 345000.00, 0.00, 0.00, 0.00, 345000.00, 5, NULL, '2026-05-22 15:16:07', '2026-05-22 15:16:07');
INSERT INTO `orders` VALUES (122, 'ORD-20260522-00092', '2026-05-13 15:16:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 425500.00, 0.00, 0.00, 0.00, 425500.00, 5, NULL, '2026-05-22 15:17:43', '2026-05-22 15:17:43');
INSERT INTO `orders` VALUES (123, 'ORD-20260522-00093', '2026-05-15 16:05:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 948750.00, 0.00, 0.00, 0.00, 948750.00, 5, NULL, '2026-05-22 16:07:52', '2026-05-22 16:07:52');
INSERT INTO `orders` VALUES (124, 'ORD-20260522-00094', '2026-05-15 16:07:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 690000.00, 0.00, 0.00, 0.00, 690000.00, 5, NULL, '2026-05-22 16:08:41', '2026-05-22 16:08:41');
INSERT INTO `orders` VALUES (125, 'ORD-20260522-00095', '2026-05-15 16:08:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 316250.00, 0.00, 0.00, 0.00, 316250.00, 5, NULL, '2026-05-22 16:09:20', '2026-05-22 16:09:20');
INSERT INTO `orders` VALUES (126, 'ORD-20260522-00096', '2026-05-15 16:09:00', NULL, 1, NULL, NULL, 'Decopaint Official', 'product', 'completed', 1408750.00, 0.00, 0.00, 0.00, 1408750.00, 5, NULL, '2026-05-22 16:11:02', '2026-05-22 16:11:02');
INSERT INTO `orders` VALUES (127, 'ORD-20260522-00097', '2026-05-15 16:11:00', NULL, 1, NULL, NULL, 'Decopaint Official', 'product', 'completed', 172500.00, 0.00, 0.00, 0.00, 172500.00, 5, NULL, '2026-05-22 16:11:37', '2026-05-22 16:11:37');
INSERT INTO `orders` VALUES (128, 'ORD-20260522-00098', '2026-05-15 16:11:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 316250.00, 0.00, 0.00, 0.00, 316250.00, 5, NULL, '2026-05-22 16:12:33', '2026-05-22 16:12:33');
INSERT INTO `orders` VALUES (129, 'ORD-20260522-00099', '2026-05-15 16:12:00', NULL, 5, NULL, NULL, 'Decopaint Official', 'product', 'completed', 115000.00, 0.00, 0.00, 0.00, 115000.00, 5, NULL, '2026-05-22 16:14:09', '2026-05-22 16:14:09');
INSERT INTO `orders` VALUES (130, 'ORD-20260522-00100', '2026-05-15 16:16:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 1010550.00, 0.00, 0.00, 0.00, 1010550.00, 5, NULL, '2026-05-22 16:19:18', '2026-05-22 16:19:18');
INSERT INTO `orders` VALUES (131, 'ORD-20260522-00101', '2026-05-15 16:19:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 1092500.00, 0.00, 0.00, 0.00, 1092500.00, 5, NULL, '2026-05-22 16:20:11', '2026-05-22 16:20:11');
INSERT INTO `orders` VALUES (132, 'ORD-20260522-00102', '2026-05-15 16:20:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 948750.00, 0.00, 0.00, 0.00, 948750.00, 5, NULL, '2026-05-22 16:21:24', '2026-05-22 16:21:24');
INSERT INTO `orders` VALUES (133, 'ORD-20260522-00103', '2026-05-16 16:21:00', NULL, 4, NULL, NULL, 'Decopaint Official', 'product', 'completed', 86250.00, 0.00, 0.00, 0.00, 86250.00, 5, NULL, '2026-05-22 16:22:56', '2026-05-22 16:22:56');
INSERT INTO `orders` VALUES (134, 'ORD-20260522-00104', '2026-05-16 16:22:00', NULL, 4, NULL, NULL, 'Decopaint Official', 'product', 'completed', 28175000.00, 0.00, 0.00, 0.00, 28175000.00, 5, NULL, '2026-05-22 16:24:55', '2026-05-22 16:24:55');
INSERT INTO `orders` VALUES (135, 'ORD-20260522-00105', '2026-05-16 16:24:00', NULL, 4, NULL, NULL, 'Decopaint Official', 'product', 'completed', 690000.00, 0.00, 0.00, 0.00, 690000.00, 5, NULL, '2026-05-22 16:25:47', '2026-05-22 16:25:47');
INSERT INTO `orders` VALUES (136, 'ORD-20260522-00106', '2026-05-22 16:25:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 500250.00, 0.00, 0.00, 0.00, 500250.00, 5, NULL, '2026-05-22 16:26:35', '2026-05-22 16:26:35');
INSERT INTO `orders` VALUES (137, 'ORD-20260522-00107', '2026-05-18 16:26:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 948750.00, 0.00, 0.00, 0.00, 948750.00, 5, NULL, '2026-05-22 16:28:16', '2026-05-22 16:28:16');
INSERT INTO `orders` VALUES (138, 'ORD-20260522-00108', '2026-05-18 16:28:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 115000.00, 0.00, 0.00, 0.00, 115000.00, 5, NULL, '2026-05-22 16:28:45', '2026-05-22 16:28:45');
INSERT INTO `orders` VALUES (139, 'ORD-20260522-00109', '2026-05-18 16:28:00', NULL, 4, NULL, NULL, 'Decopaint Official', 'product', 'completed', 230000.00, 0.00, 0.00, 0.00, 230000.00, 5, NULL, '2026-05-22 16:29:38', '2026-05-22 16:29:38');
INSERT INTO `orders` VALUES (140, 'ORD-20260522-00110', '2026-05-18 16:29:00', NULL, 4, NULL, NULL, 'Decopaint Official', 'product', 'completed', 138000.00, 0.00, 0.00, 0.00, 138000.00, 5, NULL, '2026-05-22 16:30:42', '2026-05-22 16:30:42');
INSERT INTO `orders` VALUES (141, 'ORD-20260522-00111', '2026-05-19 16:35:00', NULL, 4, NULL, NULL, 'Decopaint Official', 'product', 'completed', 69000.00, 0.00, 0.00, 0.00, 69000.00, 5, NULL, '2026-05-22 16:37:03', '2026-05-22 16:37:48');
INSERT INTO `orders` VALUES (142, 'ORD-20260522-00112', '2026-05-19 16:37:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 805000.00, 0.00, 0.00, 0.00, 805000.00, 5, NULL, '2026-05-22 16:38:48', '2026-05-22 16:38:48');
INSERT INTO `orders` VALUES (143, 'ORD-20260522-00113', '2026-05-19 16:38:00', NULL, 5, NULL, NULL, 'Decopaint Store', 'product', 'completed', 316250.00, 0.00, 0.00, 0.00, 316250.00, 5, NULL, '2026-05-22 16:39:36', '2026-05-22 16:39:36');
INSERT INTO `orders` VALUES (144, 'ORD-20260522-00114', '2026-05-22 16:40:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'confirmed', 115000.00, 0.00, 0.00, 0.00, 115000.00, 3, NULL, '2026-05-22 16:40:28', '2026-05-22 16:40:28');
INSERT INTO `orders` VALUES (145, 'ORD-20260522-00115', '2026-05-19 16:39:00', NULL, 1, NULL, NULL, 'Decopaint Official', 'product', 'completed', 7043750.00, 0.00, 0.00, 0.00, 7043750.00, 5, NULL, '2026-05-22 16:40:30', '2026-05-22 16:40:30');
INSERT INTO `orders` VALUES (146, 'ORD-20260522-00116', '2026-05-19 16:40:00', NULL, 4, NULL, NULL, 'Decopaint Official', 'product', 'completed', 316250.00, 0.00, 0.00, 0.00, 316250.00, 5, NULL, '2026-05-22 16:41:20', '2026-05-22 16:41:20');
INSERT INTO `orders` VALUES (147, 'ORD-20260522-00117', '2026-05-18 16:40:00', NULL, 1, NULL, NULL, 'KKC Olshop', 'product', 'completed', 1408000.00, 0.00, 0.00, 0.00, 1408000.00, 3, NULL, '2026-05-22 16:41:26', '2026-05-22 16:41:47');
INSERT INTO `orders` VALUES (148, 'ORD-20260523-00001', '2026-05-23 08:01:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'packed', 115000.00, 0.00, 0.00, 0.00, 115000.00, 3, NULL, '2026-05-23 08:26:17', '2026-05-23 08:26:17');
INSERT INTO `orders` VALUES (149, 'ORD-20260523-00002', '2026-05-23 08:26:00', NULL, 4, NULL, NULL, 'KKC Olshop', 'product', 'packed', 385250.00, 0.00, 0.00, 0.00, 385250.00, 3, NULL, '2026-05-23 08:26:41', '2026-05-23 08:26:41');
INSERT INTO `orders` VALUES (150, 'ORD-20260523-00003', '2026-05-03 09:24:00', NULL, 4, NULL, NULL, 'Decorative Paint', 'product', 'confirmed', 1065200.00, 0.00, 0.00, 0.00, 1065200.00, 4, NULL, '2026-05-23 09:33:35', '2026-05-23 09:33:35');
INSERT INTO `orders` VALUES (151, 'ORD-20260523-00004', '2026-05-04 09:33:00', NULL, 4, NULL, NULL, 'Decorative Paint', 'product', 'confirmed', 224250.00, 0.00, 0.00, 0.00, 224250.00, 4, NULL, '2026-05-23 09:34:54', '2026-05-23 09:37:04');
INSERT INTO `orders` VALUES (152, 'ORD-20260523-00005', '2026-05-05 09:34:00', NULL, 4, NULL, NULL, 'Decorative Paint', 'product', 'confirmed', 672750.00, 0.00, 0.00, 0.00, 672750.00, 4, NULL, '2026-05-23 09:36:24', '2026-05-23 09:36:24');
INSERT INTO `orders` VALUES (153, 'ORD-20260523-00006', '2026-05-05 09:37:00', NULL, 4, NULL, NULL, 'Decorative Paint', 'product', 'confirmed', 224250.00, 0.00, 0.00, 0.00, 224250.00, 4, NULL, '2026-05-23 09:37:49', '2026-05-23 09:37:49');
INSERT INTO `orders` VALUES (154, 'ORD-20260523-00007', '2026-05-06 09:37:00', NULL, 4, NULL, NULL, 'Decorative Paint', 'product', 'confirmed', 224250.00, 0.00, 0.00, 0.00, 224250.00, 4, NULL, '2026-05-23 09:38:14', '2026-05-23 09:38:14');
INSERT INTO `orders` VALUES (155, 'ORD-20260523-00008', '2026-05-07 09:38:00', NULL, 4, NULL, NULL, 'Decorative Paint', 'product', 'confirmed', 1347500.00, 0.00, 0.00, 0.00, 1347500.00, 4, NULL, '2026-05-23 09:39:58', '2026-05-23 09:42:09');
INSERT INTO `orders` VALUES (156, 'ORD-20260523-00009', '2026-05-07 09:39:00', NULL, 4, NULL, NULL, 'Decorative Paint', 'product', 'confirmed', 8085000.00, 0.00, 0.00, 0.00, 8085000.00, 4, NULL, '2026-05-23 09:41:17', '2026-05-23 09:41:44');
INSERT INTO `orders` VALUES (157, 'ORD-20260523-00010', '2026-05-07 09:42:00', NULL, 4, NULL, NULL, 'Decorative Paint', 'product', 'confirmed', 316250.00, 0.00, 0.00, 0.00, 316250.00, 4, NULL, '2026-05-23 09:44:09', '2026-05-23 09:44:09');
INSERT INTO `orders` VALUES (158, 'ORD-20260523-00011', '2026-05-01 09:42:00', NULL, 1, NULL, NULL, 'yookkcpaintstore', 'product', 'completed', 672000.00, 0.00, 0.00, 0.00, 672000.00, 13, NULL, '2026-05-23 09:45:27', '2026-05-23 09:50:10');
INSERT INTO `orders` VALUES (159, 'ORD-20260523-00012', '2026-05-12 09:50:00', NULL, 4, NULL, NULL, 'Decopaint Bali', 'product', 'completed', 716169.00, 0.00, 0.00, 0.00, 716169.00, 13, NULL, '2026-05-23 09:51:30', '2026-05-23 09:51:30');
INSERT INTO `orders` VALUES (161, 'ORD-20260523-00013', '2026-05-02 09:52:00', NULL, 1, NULL, NULL, 'Decopaint Bali', 'product', 'completed', 1815000.00, 0.00, 0.00, 0.00, 1815000.00, 13, NULL, '2026-05-23 09:53:39', '2026-05-23 10:11:05');
INSERT INTO `orders` VALUES (162, 'ORD-20260523-00014', '2026-05-04 09:53:00', NULL, 4, NULL, NULL, 'Decopaint Bali', 'product', 'completed', 982080.00, 0.00, 0.00, 0.00, 982080.00, 13, NULL, '2026-05-23 09:55:12', '2026-05-23 10:10:02');
INSERT INTO `orders` VALUES (164, 'ORD-20260523-00016', '2026-05-04 09:55:00', NULL, 4, NULL, NULL, 'Decopaint Bali', 'product', 'completed', 882515.00, 0.00, 0.00, 0.00, 882515.00, 13, NULL, '2026-05-23 10:06:43', '2026-05-23 10:09:05');
INSERT INTO `orders` VALUES (165, 'ORD-20260523-00017', '2026-05-05 10:07:00', NULL, 1, NULL, NULL, 'Decopaint Bali', 'product', 'completed', 252000.00, 0.00, 0.00, 0.00, 252000.00, 13, NULL, '2026-05-23 10:08:06', '2026-05-23 10:08:06');
INSERT INTO `orders` VALUES (174, '584148472811783977', '2026-05-23 11:16:00', NULL, 4, NULL, NULL, 'starstore decoshop', 'product', 'confirmed', 75000.00, 0.00, 0.00, 0.00, 75000.00, 2, NULL, '2026-05-23 11:16:58', '2026-05-23 11:16:58');

-- ----------------------------
-- Table structure for payments
-- ----------------------------
CREATE TABLE `payments`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `payment_no` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `order_id` bigint UNSIGNED NOT NULL,
  `payment_date` datetime NOT NULL,
  `method_name` enum('cash','transfer','ewallet','cod') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(15, 2) NOT NULL,
  `status` enum('pending','paid','failed','refunded') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `external_ref` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `received_by` bigint UNSIGNED NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `payment_no`(`payment_no` ASC) USING BTREE,
  INDEX `fk_payments_order`(`order_id` ASC) USING BTREE,
  INDEX `fk_payments_received_by`(`received_by` ASC) USING BTREE,
  CONSTRAINT `fk_payments_order` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_payments_received_by` FOREIGN KEY (`received_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of payments
-- ----------------------------

-- ----------------------------
-- Table structure for payroll_periods
-- ----------------------------
CREATE TABLE `payroll_periods`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `period_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `status` enum('draft','approved','paid') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `period_code`(`period_code` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of payroll_periods
-- ----------------------------

-- ----------------------------
-- Table structure for payrolls
-- ----------------------------
CREATE TABLE `payrolls`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `payroll_period_id` bigint UNSIGNED NOT NULL,
  `employee_id` bigint UNSIGNED NOT NULL,
  `basic_salary` decimal(15, 2) NOT NULL DEFAULT 0.00,
  `allowance` decimal(15, 2) NOT NULL DEFAULT 0.00,
  `deduction` decimal(15, 2) NOT NULL DEFAULT 0.00,
  `overtime` decimal(15, 2) NOT NULL DEFAULT 0.00,
  `net_salary` decimal(15, 2) NOT NULL DEFAULT 0.00,
  `status` enum('draft','approved','paid') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
  `paid_at` datetime NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `fk_payrolls_period`(`payroll_period_id` ASC) USING BTREE,
  INDEX `fk_payrolls_employee`(`employee_id` ASC) USING BTREE,
  CONSTRAINT `fk_payrolls_employee` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_payrolls_period` FOREIGN KEY (`payroll_period_id`) REFERENCES `payroll_periods` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of payrolls
-- ----------------------------

-- ----------------------------
-- Table structure for permissions
-- ----------------------------
CREATE TABLE `permissions`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `code` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `module_name` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `action_name` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `code`(`code` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 82 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of permissions
-- ----------------------------
INSERT INTO `permissions` VALUES (1, 'dashboard.view', 'Akses menu Dashboard', 'dashboard', 'view', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (2, 'orders.view', 'Akses menu Orders', 'orders', 'view', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (3, 'orders.add', 'Tambah order', 'orders', 'add', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (4, 'orders.edit', 'Ubah order', 'orders', 'edit', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (5, 'orders.delete', 'Hapus order', 'orders', 'delete', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (6, 'inventory.view', 'Akses menu Inventory', 'inventory', 'view', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (7, 'inventory.add', 'Tambah inventory', 'inventory', 'add', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (8, 'inventory.edit', 'Ubah inventory', 'inventory', 'edit', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (9, 'inventory.delete', 'Hapus inventory', 'inventory', 'delete', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (10, 'produk.view', 'Akses menu Produk', 'produk', 'view', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (11, 'produk.add', 'Tambah produk', 'produk', 'add', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (12, 'produk.edit', 'Ubah produk', 'produk', 'edit', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (13, 'produk.delete', 'Hapus produk', 'produk', 'delete', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (14, 'services.view', 'Akses menu Services', 'services', 'view', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (15, 'services.add', 'Tambah service order', 'services', 'add', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (16, 'services.edit', 'Ubah service order', 'services', 'edit', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (17, 'services.delete', 'Hapus service order', 'services', 'delete', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (18, 'marketing.view', 'Akses menu Marketing', 'marketing', 'view', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (19, 'marketing.add', 'Tambah sales channel', 'marketing', 'add', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (20, 'marketing.edit', 'Ubah sales channel', 'marketing', 'edit', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (21, 'marketing.delete', 'Hapus sales channel', 'marketing', 'delete', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (22, 'finance.view', 'Akses menu Finance', 'finance', 'view', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (23, 'finance.add', 'Tambah mutasi kas', 'finance', 'add', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (24, 'finance.edit', 'Ubah mutasi kas', 'finance', 'edit', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (25, 'finance.delete', 'Hapus mutasi kas', 'finance', 'delete', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (26, 'hr.view', 'Akses menu HR', 'hr', 'view', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (27, 'hr.add', 'Tambah data HR', 'hr', 'add', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (28, 'hr.edit', 'Ubah data HR', 'hr', 'edit', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (29, 'hr.delete', 'Hapus data HR', 'hr', 'delete', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (30, 'absensi.view', 'Akses menu Absensi', 'absensi', 'view', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (31, 'absensi.add', 'Tambah absensi', 'absensi', 'add', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (32, 'absensi.edit', 'Ubah absensi', 'absensi', 'edit', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (33, 'absensi.delete', 'Hapus absensi', 'absensi', 'delete', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (34, 'procurement.view', 'Akses menu Procurement', 'procurement', 'view', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (35, 'executive.view', 'Akses menu Executive', 'executive', 'view', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (36, 'laporan_kpi.view', 'Akses menu Laporan KPI', 'laporan_kpi', 'view', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (37, 'laporan_data.view', 'Akses menu Laporan Data', 'laporan_data', 'view', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (38, 'user_management.view', 'Akses menu User Management', 'user_management', 'view', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (39, 'user_management.add', 'Tambah user', 'user_management', 'add', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (40, 'user_management.edit', 'Ubah user', 'user_management', 'edit', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (41, 'user_management.delete', 'Hapus user', 'user_management', 'delete', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (42, 'role_management.view', 'Akses menu Role Management', 'role_management', 'view', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (43, 'role_management.add', 'Tambah role', 'role_management', 'add', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (44, 'role_management.edit', 'Ubah role dan permission', 'role_management', 'edit', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (45, 'role_management.delete', 'Hapus role', 'role_management', 'delete', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (46, 'settings.view', 'Akses menu Settings', 'settings', 'view', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (47, 'settings.edit', 'Ubah pengaturan aplikasi', 'settings', 'edit', '2026-05-19 08:37:22', '2026-05-19 08:37:22');
INSERT INTO `permissions` VALUES (48, 'my_profile.view', 'Akses menu My Profile', 'my_profile', 'view', '2026-05-19 08:39:15', '2026-05-19 08:39:15');
INSERT INTO `permissions` VALUES (49, 'my_profile.edit', 'Ubah profil sendiri', 'my_profile', 'edit', '2026-05-19 08:39:15', '2026-05-19 08:39:15');
INSERT INTO `permissions` VALUES (50, 'summary_order.view', 'Akses menu Summary Order', 'summary_order', 'view', '2026-05-20 13:06:19', '2026-05-20 13:06:19');
INSERT INTO `permissions` VALUES (51, 'knowledge.view', 'Akses menu Knowledge', 'knowledge', 'view', '2026-05-20 14:56:56', '2026-05-20 14:56:56');
INSERT INTO `permissions` VALUES (52, 'knowledge.add', 'Tambah knowledge', 'knowledge', 'add', '2026-05-20 15:09:38', '2026-05-20 15:09:38');
INSERT INTO `permissions` VALUES (53, 'knowledge.edit', 'Ubah knowledge', 'knowledge', 'edit', '2026-05-20 15:09:38', '2026-05-20 15:09:38');
INSERT INTO `permissions` VALUES (54, 'knowledge.delete', 'Hapus knowledge', 'knowledge', 'delete', '2026-05-20 15:09:38', '2026-05-20 15:09:38');
INSERT INTO `permissions` VALUES (55, 'digital_marketing.view', 'Akses menu Digital Marketing', 'digital_marketing', 'view', '2026-05-20 15:15:26', '2026-05-20 15:15:26');
INSERT INTO `permissions` VALUES (56, 'social_media.view', 'Akses menu Social Media', 'social_media', 'view', '2026-05-20 15:20:44', '2026-05-20 15:20:44');
INSERT INTO `permissions` VALUES (57, 'social_media.add', 'Tambah social media task', 'social_media', 'add', '2026-05-20 15:20:44', '2026-05-20 15:20:44');
INSERT INTO `permissions` VALUES (58, 'social_media.edit', 'Ubah social media task', 'social_media', 'edit', '2026-05-20 15:20:44', '2026-05-20 15:20:44');
INSERT INTO `permissions` VALUES (59, 'social_media.delete', 'Hapus social media task', 'social_media', 'delete', '2026-05-20 15:20:44', '2026-05-20 15:20:44');
INSERT INTO `permissions` VALUES (60, 'design_grafis.view', 'Akses menu Desain Grafis', 'design_grafis', 'view', '2026-05-20 15:20:44', '2026-05-20 15:20:44');
INSERT INTO `permissions` VALUES (61, 'design_grafis.add', 'Tambah desain grafis task', 'design_grafis', 'add', '2026-05-20 15:20:44', '2026-05-20 15:20:44');
INSERT INTO `permissions` VALUES (62, 'design_grafis.edit', 'Ubah desain grafis task', 'design_grafis', 'edit', '2026-05-20 15:20:44', '2026-05-20 15:20:44');
INSERT INTO `permissions` VALUES (63, 'design_grafis.delete', 'Hapus desain grafis task', 'design_grafis', 'delete', '2026-05-20 15:20:44', '2026-05-20 15:20:44');
INSERT INTO `permissions` VALUES (64, 'campaign.view', 'Akses menu Campaign', 'campaign', 'view', '2026-05-20 15:20:44', '2026-05-20 15:20:44');
INSERT INTO `permissions` VALUES (65, 'campaign.add', 'Tambah campaign', 'campaign', 'add', '2026-05-20 15:20:44', '2026-05-20 15:20:44');
INSERT INTO `permissions` VALUES (66, 'campaign.edit', 'Ubah campaign', 'campaign', 'edit', '2026-05-20 15:20:44', '2026-05-20 15:20:44');
INSERT INTO `permissions` VALUES (67, 'campaign.delete', 'Hapus campaign', 'campaign', 'delete', '2026-05-20 15:20:44', '2026-05-20 15:20:44');
INSERT INTO `permissions` VALUES (68, 'asset_library.view', 'Akses menu Asset Library', 'asset_library', 'view', '2026-05-20 15:20:44', '2026-05-20 15:20:44');
INSERT INTO `permissions` VALUES (69, 'asset_library.add', 'Tambah asset', 'asset_library', 'add', '2026-05-20 15:20:44', '2026-05-20 15:20:44');
INSERT INTO `permissions` VALUES (70, 'asset_library.edit', 'Ubah asset', 'asset_library', 'edit', '2026-05-20 15:20:44', '2026-05-20 15:20:44');
INSERT INTO `permissions` VALUES (71, 'asset_library.delete', 'Hapus asset', 'asset_library', 'delete', '2026-05-20 15:20:44', '2026-05-20 15:20:44');
INSERT INTO `permissions` VALUES (72, 'order_target.view', 'Akses menu Target Order', 'order_target', 'view', '2026-05-22 22:35:50', '2026-05-22 22:35:50');
INSERT INTO `permissions` VALUES (73, 'order_target.edit', 'Ubah target order bulanan dan tahunan', 'order_target', 'edit', '2026-05-22 22:35:50', '2026-05-22 22:35:50');
INSERT INTO `permissions` VALUES (74, 'purchase_order.view', 'Akses menu Purchase Order', 'purchase_order', 'view', '2026-05-23 08:25:34', '2026-05-23 08:25:34');
INSERT INTO `permissions` VALUES (75, 'purchase_order.add', 'Tambah purchase order', 'purchase_order', 'add', '2026-05-23 08:25:35', '2026-05-23 08:25:35');
INSERT INTO `permissions` VALUES (76, 'purchase_order.edit', 'Ubah purchase order', 'purchase_order', 'edit', '2026-05-23 08:25:35', '2026-05-23 08:25:35');
INSERT INTO `permissions` VALUES (77, 'purchase_order.delete', 'Hapus purchase order', 'purchase_order', 'delete', '2026-05-23 08:25:35', '2026-05-23 08:25:35');
INSERT INTO `permissions` VALUES (78, 'office_asset_management.view', 'Akses menu Office Asset Management', 'office_asset_management', 'view', '2026-05-23 08:35:33', '2026-05-23 08:35:33');
INSERT INTO `permissions` VALUES (79, 'office_asset_management.add', 'Tambah aset kantor', 'office_asset_management', 'add', '2026-05-23 08:35:33', '2026-05-23 08:35:33');
INSERT INTO `permissions` VALUES (80, 'office_asset_management.edit', 'Ubah aset kantor', 'office_asset_management', 'edit', '2026-05-23 08:35:33', '2026-05-23 08:35:33');
INSERT INTO `permissions` VALUES (81, 'office_asset_management.delete', 'Hapus aset kantor', 'office_asset_management', 'delete', '2026-05-23 08:35:33', '2026-05-23 08:35:33');

-- ----------------------------
-- Table structure for platforms
-- ----------------------------
CREATE TABLE `platforms`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `channel_id` bigint UNSIGNED NOT NULL,
  `code` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `code`(`code` ASC) USING BTREE,
  INDEX `fk_platforms_channel`(`channel_id` ASC) USING BTREE,
  CONSTRAINT `fk_platforms_channel` FOREIGN KEY (`channel_id`) REFERENCES `sales_channels` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of platforms
-- ----------------------------
INSERT INTO `platforms` VALUES (1, 1, 'WHATSAPP', 'WhatsApp');
INSERT INTO `platforms` VALUES (2, 1, 'TELEPON', 'Telepon');

-- ----------------------------
-- Table structure for product_categories
-- ----------------------------
CREATE TABLE `product_categories`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `parent_id` bigint UNSIGNED NULL DEFAULT NULL,
  `code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `code`(`code` ASC) USING BTREE,
  INDEX `fk_product_categories_parent`(`parent_id` ASC) USING BTREE,
  CONSTRAINT `fk_product_categories_parent` FOREIGN KEY (`parent_id`) REFERENCES `product_categories` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of product_categories
-- ----------------------------
INSERT INTO `product_categories` VALUES (1, NULL, 'DECORATIVE', 'Decorative Paint', '2026-05-13 22:33:10', '2026-05-13 22:33:10');
INSERT INTO `product_categories` VALUES (2, NULL, 'SUPPORTING', 'Supporting Material', '2026-05-13 22:33:10', '2026-05-13 22:33:10');
INSERT INTO `product_categories` VALUES (3, NULL, 'CAT-PAINT', 'Cat & Coating', '2026-05-14 00:07:08', '2026-05-14 00:07:08');
INSERT INTO `product_categories` VALUES (4, NULL, 'CAT-TOOLS', 'Tools & Aksesoris', '2026-05-14 00:07:08', '2026-05-14 00:07:08');

-- ----------------------------
-- Table structure for products
-- ----------------------------
CREATE TABLE `products`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `sku` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `barcode` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `name` varchar(180) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `category_id` bigint UNSIGNED NOT NULL,
  `brand_id` bigint UNSIGNED NOT NULL,
  `product_type` enum('decorative_paint','supporting_material','service_material') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `unit_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `cost_price` decimal(15, 2) NOT NULL DEFAULT 0.00,
  `sell_price` decimal(15, 2) NOT NULL DEFAULT 0.00,
  `min_stock` decimal(14, 2) NOT NULL DEFAULT 0.00,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `sku`(`sku` ASC) USING BTREE,
  INDEX `fk_products_category`(`category_id` ASC) USING BTREE,
  INDEX `fk_products_brand`(`brand_id` ASC) USING BTREE,
  CONSTRAINT `fk_products_brand` FOREIGN KEY (`brand_id`) REFERENCES `brands` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_products_category` FOREIGN KEY (`category_id`) REFERENCES `product_categories` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 88 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of products
-- ----------------------------
INSERT INTO `products` VALUES (1, 'DECO-INT-001', NULL, 'Decopaint Interior Premium 5L', 1, 1, 'decorative_paint', 'liter', 120000.00, 175000.00, 20.00, 1, '2026-05-13 22:33:10', '2026-05-13 22:33:10');
INSERT INTO `products` VALUES (2, 'BCPC-KG-1', NULL, 'Basecoat Primer Coat', 3, 3, 'decorative_paint', '1 Kg', 0.00, 115000.00, 10.00, 1, '2026-05-14 00:07:08', '2026-05-22 14:26:25');
INSERT INTO `products` VALUES (6, 'DWCL-KG-1', NULL, 'Deco Wash Cement Look', 3, 3, 'decorative_paint', '1 Kg', 0.00, 184000.00, 10.00, 1, '2026-05-14 00:07:08', '2026-05-22 14:26:11');
INSERT INTO `products` VALUES (10, 'PDW-MOCKUP-2000', NULL, 'Paket Deco Wash', 3, 3, 'decorative_paint', 'Paket Mock Up isi 3', 0.00, 385250.00, 5.00, 1, '2026-05-14 00:07:08', '2026-05-22 14:25:54');
INSERT INTO `products` VALUES (20, 'DPL-KG-1', NULL, 'Deco Plaster', 3, 3, 'decorative_paint', '1 Kg', 0.00, 138000.00, 10.00, 1, '2026-05-14 00:07:08', '2026-05-22 14:25:34');
INSERT INTO `products` VALUES (24, 'SCL-KG-1', NULL, 'Stucco Cement Look', 3, 3, 'decorative_paint', '1 Kg', 0.00, 224250.00, 5.00, 1, '2026-05-14 00:07:08', '2026-05-22 14:25:21');
INSERT INTO `products` VALUES (28, 'SCM-KG-1', NULL, 'Stucconesia', 3, 3, 'decorative_paint', '1 Kg', 0.00, 212750.00, 10.00, 1, '2026-05-14 00:07:08', '2026-05-22 14:25:04');
INSERT INTO `products` VALUES (32, 'SCMR-KG-1', NULL, 'Stucco Mirror', 3, 3, 'decorative_paint', '1 Kg', 0.00, 345000.00, 5.00, 1, '2026-05-14 00:07:08', '2026-05-22 14:24:44');
INSERT INTO `products` VALUES (36, 'SCV-KG-1', NULL, 'Stucconesia Veluto', 3, 3, 'decorative_paint', '1 Kg', 0.00, 316250.00, 5.00, 1, '2026-05-14 00:07:08', '2026-05-22 14:24:24');
INSERT INTO `products` VALUES (39, 'DPLT-KG-1', NULL, 'Decoplaster Perlato', 3, 3, 'decorative_paint', '1 Kg', 0.00, 287500.00, 5.00, 1, '2026-05-14 00:07:08', '2026-05-22 14:24:11');
INSERT INTO `products` VALUES (42, 'TSK-KG-1', NULL, 'Tekskam Kamprot', 3, 3, 'decorative_paint', '1 Kg', 0.00, 69000.00, 5.00, 0, '2026-05-14 00:07:08', '2026-05-22 14:49:33');
INSERT INTO `products` VALUES (45, 'DWX-LTR-1', NULL, 'Deco Wax', 3, 3, 'decorative_paint', '1 Liter', 0.00, 224250.00, 5.00, 1, '2026-05-14 00:07:08', '2026-05-22 14:23:37');
INSERT INTO `products` VALUES (46, 'DCL-BTL-350', NULL, 'Deco Color', 3, 3, 'decorative_paint', 'Botol 350 Gr', 0.00, 115000.00, 10.00, 1, '2026-05-14 00:07:08', '2026-05-22 14:23:17');
INSERT INTO `products` VALUES (47, 'DCL2-BTL-350', NULL, 'Decolic', 3, 3, 'decorative_paint', 'Botol 350 Gr', 0.00, 97750.00, 5.00, 1, '2026-05-14 00:07:08', '2026-05-22 14:23:00');
INSERT INTO `products` VALUES (48, 'KW-PCS-2M', NULL, 'Kain Wash', 4, 3, 'supporting_material', '2 Meter', 0.00, 86250.00, 10.00, 1, '2026-05-14 00:07:08', '2026-05-22 14:22:39');
INSERT INTO `products` VALUES (49, 'RBR-PCS-350', NULL, 'Roller Brush Texture/Roll Tekstur', 4, 3, 'supporting_material', '350 Gr', 0.00, 172500.00, 10.00, 1, '2026-05-14 00:07:08', '2026-05-22 14:22:29');
INSERT INTO `products` VALUES (50, 'NTP-PCS-2KG', NULL, 'NRT PRO Spray gun texture', 4, 3, 'supporting_material', '2 Kg', 0.00, 287500.00, 0.00, 0, '2026-05-14 00:07:08', '2026-05-22 14:22:14');
INSERT INTO `products` VALUES (51, 'GNW-PCS-200', NULL, 'Grind Velvet', 4, 3, 'supporting_material', '200 Gr', 0.00, 287500.00, 0.00, 0, '2026-05-14 00:07:08', '2026-05-22 14:22:03');
INSERT INTO `products` VALUES (52, 'TRV-PCS-300', NULL, 'Travertine tool', 4, 3, 'supporting_material', '300 Gr', 0.00, 345000.00, 0.00, 0, '2026-05-14 00:07:08', '2026-05-22 14:21:51');
INSERT INTO `products` VALUES (53, 'TRW-PCS-350', NULL, 'Trowel/Roskam gagang biru 20cm', 4, 3, 'supporting_material', '350 Gr', 0.00, 350000.00, 0.00, 0, '2026-05-14 00:07:08', '2026-05-22 14:21:31');
INSERT INTO `products` VALUES (54, 'TRW2-PCS-350', NULL, 'Trowel gagang ungu', 4, 3, 'supporting_material', '350 Gr', 0.00, 375000.00, 10.00, 1, '2026-05-14 00:07:08', '2026-05-22 14:21:16');
INSERT INTO `products` VALUES (55, 'TKM-N', NULL, 'Tekskam Kamprot Tipe N', 3, 3, 'decorative_paint', '5 KG', 0.00, 316250.00, 10.00, 1, '2026-05-14 00:24:39', '2026-05-22 14:19:43');
INSERT INTO `products` VALUES (56, 'TKM-TM', NULL, 'Tekskam Kamprot Tipe TM', 3, 3, 'decorative_paint', '5 KG', 0.00, 316250.00, 10.00, 1, '2026-05-14 00:24:39', '2026-05-22 14:19:08');
INSERT INTO `products` VALUES (57, 'PKT-TEKSKAM', NULL, 'Paket Tekskam', 3, 3, 'decorative_paint', 'Paket', 0.00, 0.00, 0.00, 1, '2026-05-14 00:24:39', '2026-05-14 00:24:39');
INSERT INTO `products` VALUES (58, 'PRD-609429', NULL, 'Tekskam Kamprot Tipe TM', 3, 3, 'decorative_paint', '1 KG', 0.00, 69000.00, 10.00, 1, '2026-05-22 14:40:52', '2026-05-22 14:46:29');
INSERT INTO `products` VALUES (59, 'PRD-717923', NULL, 'Tekskam Kamprot Tipe TM', 3, 3, 'decorative_paint', '25 KG', 0.00, 1408750.00, 10.00, 1, '2026-05-22 14:48:17', '2026-05-22 14:52:18');
INSERT INTO `products` VALUES (60, 'PRD-679074', NULL, 'Tekskam Kamprot Tipe N', 3, 3, 'decorative_paint', '25 KG', 0.00, 1408750.00, 10.00, 1, '2026-05-22 14:53:08', '2026-05-22 14:53:08');
INSERT INTO `products` VALUES (61, 'PRD-163595', NULL, 'Base coat primer coat', 3, 3, 'decorative_paint', '5 KG', 0.00, 546250.00, 10.00, 1, '2026-05-22 14:59:41', '2026-05-22 14:59:41');
INSERT INTO `products` VALUES (62, 'PRD-179067', NULL, 'Base coat primer coat', 3, 3, 'decorative_paint', '20 KG', 0.00, 2116000.00, 10.00, 1, '2026-05-22 15:00:31', '2026-05-22 15:08:56');
INSERT INTO `products` VALUES (63, 'PRD-430168', NULL, 'Deco wash cement look', 3, 3, 'decorative_paint', '5 KG', 0.00, 874000.00, 10.00, 1, '2026-05-22 15:03:45', '2026-05-22 15:05:11');
INSERT INTO `products` VALUES (64, 'PRD-326756', NULL, 'Deco wash cement look', 3, 3, 'decorative_paint', '20 KG', 0.00, 3385000.00, 10.00, 1, '2026-05-22 15:06:39', '2026-05-22 15:08:48');
INSERT INTO `products` VALUES (65, 'PRD-425878', NULL, 'Paket Deco Wash', 3, 3, 'decorative_paint', 'Paket Mock Up isi 4', 0.00, 500250.00, 5.00, 1, '2026-05-22 15:11:25', '2026-05-22 15:11:25');
INSERT INTO `products` VALUES (66, 'PRD-338914', NULL, 'Paket Deco Wash', 3, 3, 'decorative_paint', 'paket 10 meter', 0.00, 868500.00, 5.00, 1, '2026-05-22 15:12:30', '2026-05-22 15:12:30');
INSERT INTO `products` VALUES (67, 'PRD-226486', NULL, 'Paket Deco Wash', 3, 3, 'decorative_paint', 'paket 15 meter', 0.00, 1035500.00, 5.00, 1, '2026-05-22 15:13:40', '2026-05-22 15:13:40');
INSERT INTO `products` VALUES (68, 'PRD-136937', NULL, 'Paket Deco Wash', 3, 3, 'decorative_paint', 'paket 20 meter', 0.00, 1406500.00, 5.00, 1, '2026-05-22 15:14:26', '2026-05-22 15:14:26');
INSERT INTO `products` VALUES (69, 'PRD-761508', NULL, 'Paket Deco Wash', 3, 3, 'decorative_paint', 'paket 30 meter', 0.00, 2047250.00, 5.00, 1, '2026-05-22 15:15:23', '2026-05-23 11:22:15');
INSERT INTO `products` VALUES (70, 'PRD-517413', NULL, 'Paket Deco Wash', 3, 3, 'decorative_paint', 'paket 40 meter', 0.00, 2778500.00, 5.00, 1, '2026-05-22 15:16:05', '2026-05-22 15:16:05');
INSERT INTO `products` VALUES (71, 'PRD-092035', NULL, 'Paket Deco Wash', 3, 3, 'decorative_paint', 'paket 50 meter', 0.00, 3286000.00, 5.00, 1, '2026-05-22 15:16:54', '2026-05-22 15:16:54');
INSERT INTO `products` VALUES (72, 'PRD-251204', NULL, 'Paket Deco Wash', 3, 3, 'decorative_paint', 'paket 75 meter', 0.00, 4964000.00, 5.00, 1, '2026-05-22 15:17:42', '2026-05-22 15:17:42');
INSERT INTO `products` VALUES (73, 'PRD-341733', NULL, 'Paket Deco Wash', 3, 3, 'decorative_paint', 'paket 100 meter', 0.00, 6325000.00, 5.00, 1, '2026-05-22 15:18:20', '2026-05-22 15:18:20');
INSERT INTO `products` VALUES (74, 'PRD-019418', NULL, 'Decoplaster', 3, 3, 'decorative_paint', '5 KG', 0.00, 655500.00, 10.00, 1, '2026-05-22 18:53:07', '2026-05-22 18:53:07');
INSERT INTO `products` VALUES (75, 'PRD-016977', NULL, 'Decoplaster', 3, 3, 'decorative_paint', '20 KG', 0.00, 2539200.00, 5.00, 1, '2026-05-22 18:53:58', '2026-05-22 18:53:58');
INSERT INTO `products` VALUES (76, 'PRD-882884', NULL, 'Stucco Cement Look', 3, 3, 'decorative_paint', '5 KG', 0.00, 1065200.00, 10.00, 1, '2026-05-22 18:54:56', '2026-05-22 18:54:56');
INSERT INTO `products` VALUES (77, 'PRD-501083', NULL, 'Deco wash cement look', 3, 3, 'decorative_paint', '20 KG', 0.00, 4126200.00, 5.00, 1, '2026-05-22 18:55:39', '2026-05-22 18:55:49');
INSERT INTO `products` VALUES (78, 'PRD-304043', NULL, 'Stucco Cement Look', 3, 3, 'decorative_paint', '25 KG', 0.00, 5045650.00, 2.00, 1, '2026-05-22 18:56:35', '2026-05-22 18:56:43');
INSERT INTO `products` VALUES (79, 'PRD-263109', NULL, 'Stucconesia', 3, 3, 'decorative_paint', '5 KG', 0.00, 1010550.00, 10.00, 1, '2026-05-22 18:57:34', '2026-05-22 18:57:34');
INSERT INTO `products` VALUES (80, 'PRD-674601', NULL, 'Stucconesia', 3, 3, 'decorative_paint', '20 KG', 0.00, 3914600.00, 5.00, 1, '2026-05-22 18:58:21', '2026-05-22 18:58:21');
INSERT INTO `products` VALUES (81, 'PRD-496063', NULL, 'Stucconesia', 3, 3, 'decorative_paint', '25 KG', 0.00, 4786850.00, 2.00, 1, '2026-05-22 18:59:01', '2026-05-22 18:59:01');
INSERT INTO `products` VALUES (82, 'PRD-016310', NULL, 'Stucco Mirror Effect', 3, 3, 'decorative_paint', '5 KG', 0.00, 1638750.00, 5.00, 1, '2026-05-22 19:00:23', '2026-05-22 19:00:23');
INSERT INTO `products` VALUES (83, 'PRD-510344', NULL, 'Stucco Mirror Effect', 3, 3, 'decorative_paint', '20 KG', 0.00, 6417000.00, 2.00, 1, '2026-05-22 19:01:16', '2026-05-22 19:01:16');
INSERT INTO `products` VALUES (84, 'PRD-839810', NULL, 'Stucconesia Velutto', 3, 3, 'decorative_paint', '5 KG', 0.00, 1502200.00, 5.00, 1, '2026-05-22 19:02:33', '2026-05-22 19:02:33');
INSERT INTO `products` VALUES (85, 'PRD-480197', NULL, 'Stucconesia Velutto', 3, 3, 'decorative_paint', '20 KG', 0.00, 5850600.00, 5.00, 1, '2026-05-22 19:03:13', '2026-05-22 19:03:13');
INSERT INTO `products` VALUES (86, 'PRD-636877', NULL, 'Decoplaster Perlato', 3, 3, 'decorative_paint', '5 KG', 0.00, 1365000.00, 5.00, 1, '2026-05-22 19:04:26', '2026-05-22 19:04:26');
INSERT INTO `products` VALUES (87, 'PRD-622612', NULL, 'Decoplaster Perlato', 3, 3, 'decorative_paint', '20 KG', 0.00, 5318750.00, 5.00, 1, '2026-05-22 19:05:14', '2026-05-22 19:05:14');

-- ----------------------------
-- Table structure for purchase_order_items
-- ----------------------------
CREATE TABLE `purchase_order_items`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `purchase_order_id` bigint UNSIGNED NOT NULL,
  `line_no` int UNSIGNED NOT NULL,
  `product_id` bigint UNSIGNED NULL DEFAULT NULL,
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `qty` decimal(14, 2) NOT NULL DEFAULT 0.00,
  `unit_price` decimal(15, 2) NOT NULL DEFAULT 0.00,
  `line_total` decimal(15, 2) NOT NULL DEFAULT 0.00,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `fk_purchase_order_items_po`(`purchase_order_id` ASC) USING BTREE,
  CONSTRAINT `fk_purchase_order_items_po` FOREIGN KEY (`purchase_order_id`) REFERENCES `purchase_orders` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of purchase_order_items
-- ----------------------------
INSERT INTO `purchase_order_items` VALUES (1, 1, 1, 87, 'sdcsdcsd', 1.00, 20000.00, 20000.00);
INSERT INTO `purchase_order_items` VALUES (2, 1, 2, 67, 'dfsfs', 1.00, 4000000.00, 4000000.00);
INSERT INTO `purchase_order_items` VALUES (3, 2, 1, NULL, 'dcdcdccd - casc', 1.00, 3000.00, 3000.00);
INSERT INTO `purchase_order_items` VALUES (4, 2, 2, NULL, 'fsrfsrdfsd - acasc', 1.00, 50000.00, 50000.00);

-- ----------------------------
-- Table structure for purchase_orders
-- ----------------------------
CREATE TABLE `purchase_orders`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `po_no` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `po_date` date NOT NULL,
  `vendor_name` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('draft','ordered','received','canceled') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
  `subtotal` decimal(15, 2) NOT NULL DEFAULT 0.00,
  `grand_total` decimal(15, 2) NOT NULL DEFAULT 0.00,
  `created_by` bigint UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `po_no`(`po_no` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of purchase_orders
-- ----------------------------
INSERT INTO `purchase_orders` VALUES (1, 'PO-20260523-00001', '2026-05-23', 'KIMITEK', 'draft', 4020000.00, 4020000.00, 1, '2026-05-23 08:39:36', '2026-05-23 08:39:36');
INSERT INTO `purchase_orders` VALUES (2, 'PO-20260523-00002', '2026-05-23', 'KIMITEK', 'draft', 53000.00, 53000.00, 1, '2026-05-23 08:41:46', '2026-05-23 08:41:46');

-- ----------------------------
-- Table structure for role_permissions
-- ----------------------------
CREATE TABLE `role_permissions`  (
  `role_id` bigint UNSIGNED NOT NULL,
  `permission_id` bigint UNSIGNED NOT NULL,
  PRIMARY KEY (`role_id`, `permission_id`) USING BTREE,
  INDEX `fk_role_permissions_permission`(`permission_id` ASC) USING BTREE,
  CONSTRAINT `fk_role_permissions_permission` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_role_permissions_role` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of role_permissions
-- ----------------------------
INSERT INTO `role_permissions` VALUES (1, 1);
INSERT INTO `role_permissions` VALUES (1, 2);
INSERT INTO `role_permissions` VALUES (1, 3);
INSERT INTO `role_permissions` VALUES (1, 4);
INSERT INTO `role_permissions` VALUES (1, 5);
INSERT INTO `role_permissions` VALUES (1, 6);
INSERT INTO `role_permissions` VALUES (1, 7);
INSERT INTO `role_permissions` VALUES (1, 8);
INSERT INTO `role_permissions` VALUES (1, 9);
INSERT INTO `role_permissions` VALUES (1, 10);
INSERT INTO `role_permissions` VALUES (1, 11);
INSERT INTO `role_permissions` VALUES (1, 12);
INSERT INTO `role_permissions` VALUES (1, 13);
INSERT INTO `role_permissions` VALUES (1, 14);
INSERT INTO `role_permissions` VALUES (1, 15);
INSERT INTO `role_permissions` VALUES (1, 16);
INSERT INTO `role_permissions` VALUES (1, 17);
INSERT INTO `role_permissions` VALUES (1, 18);
INSERT INTO `role_permissions` VALUES (1, 19);
INSERT INTO `role_permissions` VALUES (1, 20);
INSERT INTO `role_permissions` VALUES (1, 21);
INSERT INTO `role_permissions` VALUES (1, 22);
INSERT INTO `role_permissions` VALUES (1, 23);
INSERT INTO `role_permissions` VALUES (1, 24);
INSERT INTO `role_permissions` VALUES (1, 25);
INSERT INTO `role_permissions` VALUES (1, 26);
INSERT INTO `role_permissions` VALUES (1, 27);
INSERT INTO `role_permissions` VALUES (1, 28);
INSERT INTO `role_permissions` VALUES (1, 29);
INSERT INTO `role_permissions` VALUES (1, 30);
INSERT INTO `role_permissions` VALUES (1, 31);
INSERT INTO `role_permissions` VALUES (1, 32);
INSERT INTO `role_permissions` VALUES (1, 33);
INSERT INTO `role_permissions` VALUES (1, 34);
INSERT INTO `role_permissions` VALUES (1, 35);
INSERT INTO `role_permissions` VALUES (1, 36);
INSERT INTO `role_permissions` VALUES (1, 37);
INSERT INTO `role_permissions` VALUES (1, 38);
INSERT INTO `role_permissions` VALUES (1, 39);
INSERT INTO `role_permissions` VALUES (1, 40);
INSERT INTO `role_permissions` VALUES (1, 41);
INSERT INTO `role_permissions` VALUES (1, 42);
INSERT INTO `role_permissions` VALUES (1, 43);
INSERT INTO `role_permissions` VALUES (1, 44);
INSERT INTO `role_permissions` VALUES (1, 45);
INSERT INTO `role_permissions` VALUES (1, 46);
INSERT INTO `role_permissions` VALUES (1, 47);
INSERT INTO `role_permissions` VALUES (1, 48);
INSERT INTO `role_permissions` VALUES (1, 49);
INSERT INTO `role_permissions` VALUES (1, 55);
INSERT INTO `role_permissions` VALUES (1, 56);
INSERT INTO `role_permissions` VALUES (1, 57);
INSERT INTO `role_permissions` VALUES (1, 58);
INSERT INTO `role_permissions` VALUES (1, 59);
INSERT INTO `role_permissions` VALUES (1, 60);
INSERT INTO `role_permissions` VALUES (1, 61);
INSERT INTO `role_permissions` VALUES (1, 62);
INSERT INTO `role_permissions` VALUES (1, 63);
INSERT INTO `role_permissions` VALUES (1, 64);
INSERT INTO `role_permissions` VALUES (1, 65);
INSERT INTO `role_permissions` VALUES (1, 66);
INSERT INTO `role_permissions` VALUES (1, 67);
INSERT INTO `role_permissions` VALUES (1, 68);
INSERT INTO `role_permissions` VALUES (1, 69);
INSERT INTO `role_permissions` VALUES (1, 70);
INSERT INTO `role_permissions` VALUES (1, 71);
INSERT INTO `role_permissions` VALUES (1, 74);
INSERT INTO `role_permissions` VALUES (1, 75);
INSERT INTO `role_permissions` VALUES (1, 76);
INSERT INTO `role_permissions` VALUES (1, 77);
INSERT INTO `role_permissions` VALUES (1, 78);
INSERT INTO `role_permissions` VALUES (1, 79);
INSERT INTO `role_permissions` VALUES (1, 80);
INSERT INTO `role_permissions` VALUES (1, 81);
INSERT INTO `role_permissions` VALUES (2, 1);
INSERT INTO `role_permissions` VALUES (2, 2);
INSERT INTO `role_permissions` VALUES (2, 6);
INSERT INTO `role_permissions` VALUES (2, 10);
INSERT INTO `role_permissions` VALUES (2, 14);
INSERT INTO `role_permissions` VALUES (2, 18);
INSERT INTO `role_permissions` VALUES (2, 22);
INSERT INTO `role_permissions` VALUES (2, 26);
INSERT INTO `role_permissions` VALUES (2, 30);
INSERT INTO `role_permissions` VALUES (2, 34);
INSERT INTO `role_permissions` VALUES (2, 35);
INSERT INTO `role_permissions` VALUES (2, 36);
INSERT INTO `role_permissions` VALUES (2, 37);
INSERT INTO `role_permissions` VALUES (2, 48);
INSERT INTO `role_permissions` VALUES (2, 49);
INSERT INTO `role_permissions` VALUES (2, 51);
INSERT INTO `role_permissions` VALUES (2, 55);
INSERT INTO `role_permissions` VALUES (2, 56);
INSERT INTO `role_permissions` VALUES (2, 60);
INSERT INTO `role_permissions` VALUES (2, 64);
INSERT INTO `role_permissions` VALUES (2, 68);
INSERT INTO `role_permissions` VALUES (2, 74);
INSERT INTO `role_permissions` VALUES (2, 75);
INSERT INTO `role_permissions` VALUES (2, 76);
INSERT INTO `role_permissions` VALUES (2, 77);
INSERT INTO `role_permissions` VALUES (2, 78);
INSERT INTO `role_permissions` VALUES (2, 79);
INSERT INTO `role_permissions` VALUES (2, 80);
INSERT INTO `role_permissions` VALUES (2, 81);
INSERT INTO `role_permissions` VALUES (3, 1);
INSERT INTO `role_permissions` VALUES (3, 2);
INSERT INTO `role_permissions` VALUES (3, 6);
INSERT INTO `role_permissions` VALUES (3, 7);
INSERT INTO `role_permissions` VALUES (3, 8);
INSERT INTO `role_permissions` VALUES (3, 9);
INSERT INTO `role_permissions` VALUES (3, 10);
INSERT INTO `role_permissions` VALUES (3, 11);
INSERT INTO `role_permissions` VALUES (3, 12);
INSERT INTO `role_permissions` VALUES (3, 13);
INSERT INTO `role_permissions` VALUES (3, 34);
INSERT INTO `role_permissions` VALUES (3, 48);
INSERT INTO `role_permissions` VALUES (3, 49);
INSERT INTO `role_permissions` VALUES (3, 50);
INSERT INTO `role_permissions` VALUES (3, 68);
INSERT INTO `role_permissions` VALUES (3, 74);
INSERT INTO `role_permissions` VALUES (3, 75);
INSERT INTO `role_permissions` VALUES (3, 76);
INSERT INTO `role_permissions` VALUES (3, 77);
INSERT INTO `role_permissions` VALUES (3, 78);
INSERT INTO `role_permissions` VALUES (3, 79);
INSERT INTO `role_permissions` VALUES (3, 80);
INSERT INTO `role_permissions` VALUES (3, 81);
INSERT INTO `role_permissions` VALUES (4, 1);
INSERT INTO `role_permissions` VALUES (4, 6);
INSERT INTO `role_permissions` VALUES (4, 7);
INSERT INTO `role_permissions` VALUES (4, 8);
INSERT INTO `role_permissions` VALUES (4, 9);
INSERT INTO `role_permissions` VALUES (4, 10);
INSERT INTO `role_permissions` VALUES (4, 11);
INSERT INTO `role_permissions` VALUES (4, 12);
INSERT INTO `role_permissions` VALUES (4, 13);
INSERT INTO `role_permissions` VALUES (4, 36);
INSERT INTO `role_permissions` VALUES (4, 37);
INSERT INTO `role_permissions` VALUES (4, 46);
INSERT INTO `role_permissions` VALUES (4, 47);
INSERT INTO `role_permissions` VALUES (4, 74);
INSERT INTO `role_permissions` VALUES (4, 75);
INSERT INTO `role_permissions` VALUES (4, 76);
INSERT INTO `role_permissions` VALUES (4, 77);
INSERT INTO `role_permissions` VALUES (4, 78);
INSERT INTO `role_permissions` VALUES (4, 79);
INSERT INTO `role_permissions` VALUES (4, 80);
INSERT INTO `role_permissions` VALUES (4, 81);
INSERT INTO `role_permissions` VALUES (5, 1);
INSERT INTO `role_permissions` VALUES (5, 2);
INSERT INTO `role_permissions` VALUES (5, 3);
INSERT INTO `role_permissions` VALUES (5, 4);
INSERT INTO `role_permissions` VALUES (5, 5);
INSERT INTO `role_permissions` VALUES (5, 48);
INSERT INTO `role_permissions` VALUES (5, 49);
INSERT INTO `role_permissions` VALUES (5, 50);
INSERT INTO `role_permissions` VALUES (5, 51);
INSERT INTO `role_permissions` VALUES (5, 68);
INSERT INTO `role_permissions` VALUES (6, 1);
INSERT INTO `role_permissions` VALUES (6, 2);
INSERT INTO `role_permissions` VALUES (6, 3);
INSERT INTO `role_permissions` VALUES (6, 4);
INSERT INTO `role_permissions` VALUES (6, 5);
INSERT INTO `role_permissions` VALUES (6, 14);
INSERT INTO `role_permissions` VALUES (6, 15);
INSERT INTO `role_permissions` VALUES (6, 16);
INSERT INTO `role_permissions` VALUES (6, 17);
INSERT INTO `role_permissions` VALUES (6, 36);
INSERT INTO `role_permissions` VALUES (6, 37);
INSERT INTO `role_permissions` VALUES (6, 46);
INSERT INTO `role_permissions` VALUES (6, 47);
INSERT INTO `role_permissions` VALUES (7, 1);
INSERT INTO `role_permissions` VALUES (7, 18);
INSERT INTO `role_permissions` VALUES (7, 19);
INSERT INTO `role_permissions` VALUES (7, 20);
INSERT INTO `role_permissions` VALUES (7, 21);
INSERT INTO `role_permissions` VALUES (7, 36);
INSERT INTO `role_permissions` VALUES (7, 37);
INSERT INTO `role_permissions` VALUES (7, 46);
INSERT INTO `role_permissions` VALUES (7, 47);
INSERT INTO `role_permissions` VALUES (7, 55);
INSERT INTO `role_permissions` VALUES (7, 56);
INSERT INTO `role_permissions` VALUES (7, 57);
INSERT INTO `role_permissions` VALUES (7, 58);
INSERT INTO `role_permissions` VALUES (7, 59);
INSERT INTO `role_permissions` VALUES (7, 60);
INSERT INTO `role_permissions` VALUES (7, 61);
INSERT INTO `role_permissions` VALUES (7, 62);
INSERT INTO `role_permissions` VALUES (7, 63);
INSERT INTO `role_permissions` VALUES (7, 64);
INSERT INTO `role_permissions` VALUES (7, 65);
INSERT INTO `role_permissions` VALUES (7, 66);
INSERT INTO `role_permissions` VALUES (7, 67);
INSERT INTO `role_permissions` VALUES (7, 68);
INSERT INTO `role_permissions` VALUES (7, 69);
INSERT INTO `role_permissions` VALUES (7, 70);
INSERT INTO `role_permissions` VALUES (7, 71);
INSERT INTO `role_permissions` VALUES (8, 1);
INSERT INTO `role_permissions` VALUES (8, 2);
INSERT INTO `role_permissions` VALUES (8, 48);
INSERT INTO `role_permissions` VALUES (8, 49);
INSERT INTO `role_permissions` VALUES (8, 50);
INSERT INTO `role_permissions` VALUES (8, 51);
INSERT INTO `role_permissions` VALUES (8, 64);
INSERT INTO `role_permissions` VALUES (8, 68);
INSERT INTO `role_permissions` VALUES (9, 1);
INSERT INTO `role_permissions` VALUES (9, 2);
INSERT INTO `role_permissions` VALUES (9, 18);
INSERT INTO `role_permissions` VALUES (9, 19);
INSERT INTO `role_permissions` VALUES (9, 20);
INSERT INTO `role_permissions` VALUES (9, 36);
INSERT INTO `role_permissions` VALUES (9, 48);
INSERT INTO `role_permissions` VALUES (9, 49);
INSERT INTO `role_permissions` VALUES (9, 50);
INSERT INTO `role_permissions` VALUES (9, 51);
INSERT INTO `role_permissions` VALUES (9, 52);
INSERT INTO `role_permissions` VALUES (9, 53);
INSERT INTO `role_permissions` VALUES (9, 54);
INSERT INTO `role_permissions` VALUES (9, 55);
INSERT INTO `role_permissions` VALUES (9, 56);
INSERT INTO `role_permissions` VALUES (9, 57);
INSERT INTO `role_permissions` VALUES (9, 58);
INSERT INTO `role_permissions` VALUES (9, 59);
INSERT INTO `role_permissions` VALUES (9, 60);
INSERT INTO `role_permissions` VALUES (9, 61);
INSERT INTO `role_permissions` VALUES (9, 62);
INSERT INTO `role_permissions` VALUES (9, 63);
INSERT INTO `role_permissions` VALUES (9, 64);
INSERT INTO `role_permissions` VALUES (9, 65);
INSERT INTO `role_permissions` VALUES (9, 66);
INSERT INTO `role_permissions` VALUES (9, 67);
INSERT INTO `role_permissions` VALUES (9, 68);
INSERT INTO `role_permissions` VALUES (9, 69);
INSERT INTO `role_permissions` VALUES (9, 70);
INSERT INTO `role_permissions` VALUES (9, 71);
INSERT INTO `role_permissions` VALUES (10, 1);
INSERT INTO `role_permissions` VALUES (10, 22);
INSERT INTO `role_permissions` VALUES (10, 23);
INSERT INTO `role_permissions` VALUES (10, 24);
INSERT INTO `role_permissions` VALUES (10, 25);
INSERT INTO `role_permissions` VALUES (10, 48);
INSERT INTO `role_permissions` VALUES (10, 49);
INSERT INTO `role_permissions` VALUES (11, 1);
INSERT INTO `role_permissions` VALUES (11, 2);
INSERT INTO `role_permissions` VALUES (11, 6);
INSERT INTO `role_permissions` VALUES (11, 10);
INSERT INTO `role_permissions` VALUES (11, 14);
INSERT INTO `role_permissions` VALUES (11, 18);
INSERT INTO `role_permissions` VALUES (11, 22);
INSERT INTO `role_permissions` VALUES (11, 26);
INSERT INTO `role_permissions` VALUES (11, 30);
INSERT INTO `role_permissions` VALUES (11, 34);
INSERT INTO `role_permissions` VALUES (11, 35);
INSERT INTO `role_permissions` VALUES (11, 36);
INSERT INTO `role_permissions` VALUES (11, 37);
INSERT INTO `role_permissions` VALUES (11, 48);
INSERT INTO `role_permissions` VALUES (11, 49);
INSERT INTO `role_permissions` VALUES (11, 50);
INSERT INTO `role_permissions` VALUES (11, 51);
INSERT INTO `role_permissions` VALUES (11, 55);
INSERT INTO `role_permissions` VALUES (11, 56);
INSERT INTO `role_permissions` VALUES (11, 60);
INSERT INTO `role_permissions` VALUES (11, 64);
INSERT INTO `role_permissions` VALUES (11, 68);

-- ----------------------------
-- Table structure for roles
-- ----------------------------
CREATE TABLE `roles`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `code` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `code`(`code` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 12 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of roles
-- ----------------------------
INSERT INTO `roles` VALUES (1, 'SUPER_ADMIN', 'Super Admin', 'Akses penuh sistem', '2026-05-13 22:33:10', '2026-05-13 22:33:10');
INSERT INTO `roles` VALUES (2, 'GENERAL_MANAGER', 'General Manager', 'Akses eksekutif', '2026-05-13 22:33:10', '2026-05-13 22:33:10');
INSERT INTO `roles` VALUES (3, 'WAREHOUSE_MANAGER', 'Warehouse Manager', 'Akses gudang manager', '2026-05-13 22:33:10', '2026-05-13 22:33:10');
INSERT INTO `roles` VALUES (4, 'WAREHOUSE_STAFF', 'Warehouse Staff', 'Akses operasional gudang', '2026-05-13 22:33:10', '2026-05-13 22:33:10');
INSERT INTO `roles` VALUES (5, 'SALES_EXEC', 'Sales Executive', 'Akses penjualan', '2026-05-13 22:33:10', '2026-05-13 22:33:10');
INSERT INTO `roles` VALUES (6, 'SERVICE_SALES', 'Service Sales', 'Akses layanan jasa', '2026-05-13 22:33:10', '2026-05-13 22:33:10');
INSERT INTO `roles` VALUES (7, 'MARKETING_STAFF', 'Marketing Staff', 'Akses marketing', '2026-05-13 22:33:10', '2026-05-13 22:33:10');
INSERT INTO `roles` VALUES (8, 'MANAGER_SALES', 'Manager Sales', NULL, '2026-05-20 11:45:51', '2026-05-20 11:45:51');
INSERT INTO `roles` VALUES (9, 'MANAGER_MARKETING', 'Manager Marketing', NULL, '2026-05-20 11:46:28', '2026-05-20 11:46:28');
INSERT INTO `roles` VALUES (10, 'FINANCE_ACCOUNTING_STAFF', 'Finance & Accounting Staff', NULL, '2026-05-20 11:50:09', '2026-05-20 11:50:09');
INSERT INTO `roles` VALUES (11, 'DIRECTOR', 'DIRECTOR', NULL, '2026-05-22 15:27:38', '2026-05-22 15:27:38');

-- ----------------------------
-- Table structure for sales_channels
-- ----------------------------
CREATE TABLE `sales_channels`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `code` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `code`(`code` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of sales_channels
-- ----------------------------
INSERT INTO `sales_channels` VALUES (1, 'OFFLINE', 'Offline');
INSERT INTO `sales_channels` VALUES (3, 'SOCIAL_COMMERCE', 'Social Commerce');
INSERT INTO `sales_channels` VALUES (4, 'TOKOPEDIA', 'Tokopedia');
INSERT INTO `sales_channels` VALUES (5, 'SHOPEE', 'Shopee');

-- ----------------------------
-- Table structure for service_assignments
-- ----------------------------
CREATE TABLE `service_assignments`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `service_order_id` bigint UNSIGNED NOT NULL,
  `employee_id` bigint UNSIGNED NOT NULL,
  `role_on_service` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `assigned_at` datetime NOT NULL,
  `start_at` datetime NULL DEFAULT NULL,
  `finish_at` datetime NULL DEFAULT NULL,
  `status` enum('assigned','on_progress','done','canceled') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'assigned',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `fk_service_assignments_service_order`(`service_order_id` ASC) USING BTREE,
  INDEX `fk_service_assignments_employee`(`employee_id` ASC) USING BTREE,
  CONSTRAINT `fk_service_assignments_employee` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_service_assignments_service_order` FOREIGN KEY (`service_order_id`) REFERENCES `service_orders` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of service_assignments
-- ----------------------------

-- ----------------------------
-- Table structure for service_materials
-- ----------------------------
CREATE TABLE `service_materials`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `service_order_id` bigint UNSIGNED NOT NULL,
  `product_id` bigint UNSIGNED NOT NULL,
  `source_type` enum('internal_stock','external_purchase') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `estimated_qty` decimal(14, 2) NOT NULL DEFAULT 0.00,
  `actual_qty` decimal(14, 2) NULL DEFAULT NULL,
  `unit_cost` decimal(15, 2) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `fk_service_materials_service_order`(`service_order_id` ASC) USING BTREE,
  INDEX `fk_service_materials_product`(`product_id` ASC) USING BTREE,
  CONSTRAINT `fk_service_materials_product` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_service_materials_service_order` FOREIGN KEY (`service_order_id`) REFERENCES `service_orders` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of service_materials
-- ----------------------------

-- ----------------------------
-- Table structure for service_orders
-- ----------------------------
CREATE TABLE `service_orders`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `service_order_no` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `order_id` bigint UNSIGNED NULL DEFAULT NULL,
  `customer_id` bigint UNSIGNED NOT NULL,
  `service_id` bigint UNSIGNED NOT NULL,
  `location_address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `area_m2` decimal(12, 2) NULL DEFAULT NULL,
  `scheduled_date` date NULL DEFAULT NULL,
  `status` enum('survey','quotation','approved','in_progress','done','canceled') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'survey',
  `estimated_cost` decimal(15, 2) NOT NULL DEFAULT 0.00,
  `final_cost` decimal(15, 2) NULL DEFAULT NULL,
  `uses_internal_paint` tinyint(1) NOT NULL DEFAULT 1,
  `uses_external_paint` tinyint(1) NOT NULL DEFAULT 0,
  `created_by` bigint UNSIGNED NULL DEFAULT NULL,
  `assigned_sales_id` bigint UNSIGNED NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `service_order_no`(`service_order_no` ASC) USING BTREE,
  INDEX `fk_service_orders_order`(`order_id` ASC) USING BTREE,
  INDEX `fk_service_orders_customer`(`customer_id` ASC) USING BTREE,
  INDEX `fk_service_orders_service`(`service_id` ASC) USING BTREE,
  INDEX `fk_service_orders_created_by`(`created_by` ASC) USING BTREE,
  INDEX `fk_service_orders_assigned_sales`(`assigned_sales_id` ASC) USING BTREE,
  INDEX `idx_service_orders_status`(`status` ASC) USING BTREE,
  CONSTRAINT `fk_service_orders_assigned_sales` FOREIGN KEY (`assigned_sales_id`) REFERENCES `employees` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_service_orders_created_by` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_service_orders_customer` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_service_orders_order` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_service_orders_service` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of service_orders
-- ----------------------------

-- ----------------------------
-- Table structure for services
-- ----------------------------
CREATE TABLE `services`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `service_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `service_name` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `pricing_model` enum('per_m2','per_project','custom') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'custom',
  `base_price` decimal(15, 2) NOT NULL DEFAULT 0.00,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `service_code`(`service_code` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of services
-- ----------------------------
INSERT INTO `services` VALUES (1, 'SRV-CAT-001', 'Jasa Pengecatan Interior', 'Layanan pengecatan interior rumah', 'per_m2', 45000.00, 1);

-- ----------------------------
-- Table structure for shipments
-- ----------------------------
CREATE TABLE `shipments`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `shipment_no` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `order_id` bigint UNSIGNED NOT NULL,
  `warehouse_id` bigint UNSIGNED NOT NULL,
  `courier_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `tracking_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `driver_employee_id` bigint UNSIGNED NULL DEFAULT NULL,
  `shipped_at` datetime NULL DEFAULT NULL,
  `delivered_at` datetime NULL DEFAULT NULL,
  `status` enum('ready','in_transit','delivered','returned') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ready',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `shipment_no`(`shipment_no` ASC) USING BTREE,
  INDEX `fk_shipments_order`(`order_id` ASC) USING BTREE,
  INDEX `fk_shipments_warehouse`(`warehouse_id` ASC) USING BTREE,
  INDEX `fk_shipments_driver`(`driver_employee_id` ASC) USING BTREE,
  CONSTRAINT `fk_shipments_driver` FOREIGN KEY (`driver_employee_id`) REFERENCES `employees` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_shipments_order` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_shipments_warehouse` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of shipments
-- ----------------------------

-- ----------------------------
-- Table structure for social_media_tasks
-- ----------------------------
CREATE TABLE `social_media_tasks`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `platform` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(180) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `content_date` date NULL DEFAULT NULL,
  `status` enum('planned','draft','review','posted') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'planned',
  `caption` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of social_media_tasks
-- ----------------------------

-- ----------------------------
-- Table structure for stores
-- ----------------------------
CREATE TABLE `stores`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `platform_id` bigint UNSIGNED NOT NULL,
  `store_code` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `store_name` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `store_type` enum('official','regular') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `owner_employee_id` bigint UNSIGNED NULL DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `store_code`(`store_code` ASC) USING BTREE,
  INDEX `fk_stores_platform`(`platform_id` ASC) USING BTREE,
  INDEX `fk_stores_owner`(`owner_employee_id` ASC) USING BTREE,
  CONSTRAINT `fk_stores_owner` FOREIGN KEY (`owner_employee_id`) REFERENCES `employees` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_stores_platform` FOREIGN KEY (`platform_id`) REFERENCES `platforms` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for warehouses
-- ----------------------------
CREATE TABLE `warehouses`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `manager_employee_id` bigint UNSIGNED NULL DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `code`(`code` ASC) USING BTREE,
  INDEX `fk_warehouses_manager`(`manager_employee_id` ASC) USING BTREE,
  CONSTRAINT `fk_warehouses_manager` FOREIGN KEY (`manager_employee_id`) REFERENCES `employees` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of warehouses
-- ----------------------------
INSERT INTO `warehouses` VALUES (1, 'WH-UTAMA', 'Gudang Utama', 'Jl. Warehouse No. 1', NULL, 1, '2026-05-13 22:33:10', '2026-05-13 22:33:10');

