-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3308
-- Waktu pembuatan: 03 Jan 2026 pada 10.41
-- Versi server: 10.4.32-MariaDB
-- Versi PHP: 8.2.12

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `umi-cell`
--

-- --------------------------------------------------------

--
-- Struktur dari tabel `branches`
--

CREATE TABLE `branches` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `address` text DEFAULT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `branches`
--

INSERT INTO `branches` (`id`, `name`, `address`, `phone`, `is_active`, `created_at`, `updated_at`) VALUES
(1, 'Cabang Pusat', 'Jl. Raya Utama No. 123, Kaliwungu', '021-12345678', 1, '2025-12-21 05:59:33', '2026-01-03 01:46:11'),
(2, 'Cabang Mijen', 'Jl. Mijen Raya No. 456, Mijen', '021-87654321', 1, '2025-12-21 05:59:33', '2026-01-03 01:46:00');

-- --------------------------------------------------------

--
-- Struktur dari tabel `brands`
--

CREATE TABLE `brands` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `brands`
--

INSERT INTO `brands` (`id`, `name`, `created_at`, `updated_at`) VALUES
(1, 'Samsung', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(2, 'iPhone', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(3, 'Xiaomi', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(4, 'Oppo', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(5, 'Vivo', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(6, 'Realme', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(7, 'Infinix', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(8, 'Tecno', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(9, 'Universal', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(10, 'Lenovo', '2026-01-03 01:23:15', '2026-01-03 01:23:15'),
(11, 'Redmi', '2026-01-03 01:32:36', '2026-01-03 01:32:36');

-- --------------------------------------------------------

--
-- Struktur dari tabel `cache`
--

CREATE TABLE `cache` (
  `key` varchar(255) NOT NULL,
  `value` mediumtext NOT NULL,
  `expiration` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `cache`
--

INSERT INTO `cache` (`key`, `value`, `expiration`) VALUES
('laravel_cache_spatie.permission.cache', 'a:3:{s:5:\"alias\";a:4:{s:1:\"a\";s:2:\"id\";s:1:\"b\";s:4:\"name\";s:1:\"c\";s:10:\"guard_name\";s:1:\"r\";s:5:\"roles\";}s:11:\"permissions\";a:53:{i:0;a:4:{s:1:\"a\";i:1;s:1:\"b\";s:17:\"permissions.index\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:1;a:4:{s:1:\"a\";i:2;s:1:\"b\";s:11:\"roles.index\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:2;a:4:{s:1:\"a\";i:3;s:1:\"b\";s:12:\"roles.create\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:3;a:4:{s:1:\"a\";i:4;s:1:\"b\";s:10:\"roles.edit\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:4;a:4:{s:1:\"a\";i:5;s:1:\"b\";s:12:\"roles.delete\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:5;a:4:{s:1:\"a\";i:6;s:1:\"b\";s:11:\"users.index\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:6;a:4:{s:1:\"a\";i:7;s:1:\"b\";s:12:\"users.create\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:7;a:4:{s:1:\"a\";i:8;s:1:\"b\";s:10:\"users.edit\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:8;a:4:{s:1:\"a\";i:9;s:1:\"b\";s:12:\"users.delete\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:9;a:4:{s:1:\"a\";i:10;s:1:\"b\";s:14:\"branches.index\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:10;a:4:{s:1:\"a\";i:11;s:1:\"b\";s:15:\"branches.create\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:11;a:4:{s:1:\"a\";i:12;s:1:\"b\";s:13:\"branches.edit\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:12;a:4:{s:1:\"a\";i:13;s:1:\"b\";s:15:\"branches.delete\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:13;a:4:{s:1:\"a\";i:14;s:1:\"b\";s:16:\"categories.index\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:14;a:4:{s:1:\"a\";i:15;s:1:\"b\";s:17:\"categories.create\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:15;a:4:{s:1:\"a\";i:16;s:1:\"b\";s:15:\"categories.edit\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:16;a:4:{s:1:\"a\";i:17;s:1:\"b\";s:17:\"categories.delete\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:17;a:4:{s:1:\"a\";i:18;s:1:\"b\";s:12:\"brands.index\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:18;a:4:{s:1:\"a\";i:19;s:1:\"b\";s:13:\"brands.create\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:19;a:4:{s:1:\"a\";i:20;s:1:\"b\";s:11:\"brands.edit\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:20;a:4:{s:1:\"a\";i:21;s:1:\"b\";s:13:\"brands.delete\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:21;a:4:{s:1:\"a\";i:22;s:1:\"b\";s:15:\"suppliers.index\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:22;a:4:{s:1:\"a\";i:23;s:1:\"b\";s:16:\"suppliers.create\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:23;a:4:{s:1:\"a\";i:24;s:1:\"b\";s:14:\"suppliers.edit\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:24;a:4:{s:1:\"a\";i:25;s:1:\"b\";s:16:\"suppliers.delete\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:25;a:4:{s:1:\"a\";i:26;s:1:\"b\";s:15:\"customers.index\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:26;a:4:{s:1:\"a\";i:27;s:1:\"b\";s:16:\"customers.create\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:27;a:4:{s:1:\"a\";i:28;s:1:\"b\";s:14:\"customers.edit\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:28;a:4:{s:1:\"a\";i:29;s:1:\"b\";s:16:\"customers.delete\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:29;a:4:{s:1:\"a\";i:30;s:1:\"b\";s:14:\"products.index\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:30;a:4:{s:1:\"a\";i:31;s:1:\"b\";s:15:\"products.create\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:31;a:4:{s:1:\"a\";i:32;s:1:\"b\";s:13:\"products.edit\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:32;a:4:{s:1:\"a\";i:33;s:1:\"b\";s:15:\"products.delete\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:33;a:4:{s:1:\"a\";i:34;s:1:\"b\";s:15:\"purchases.index\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:34;a:4:{s:1:\"a\";i:35;s:1:\"b\";s:16:\"purchases.create\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:35;a:4:{s:1:\"a\";i:36;s:1:\"b\";s:14:\"purchases.edit\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:36;a:4:{s:1:\"a\";i:37;s:1:\"b\";s:16:\"purchases.delete\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:37;a:4:{s:1:\"a\";i:39;s:1:\"b\";s:11:\"sales.index\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:38;a:4:{s:1:\"a\";i:40;s:1:\"b\";s:12:\"sales.create\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:39;a:4:{s:1:\"a\";i:41;s:1:\"b\";s:10:\"sales.edit\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:40;a:4:{s:1:\"a\";i:42;s:1:\"b\";s:12:\"sales.delete\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:41;a:4:{s:1:\"a\";i:43;s:1:\"b\";s:21:\"stock-movements.index\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:42;a:4:{s:1:\"a\";i:44;s:1:\"b\";s:19:\"stock-opnames.index\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:43;a:4:{s:1:\"a\";i:45;s:1:\"b\";s:20:\"stock-opnames.create\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:44;a:4:{s:1:\"a\";i:46;s:1:\"b\";s:18:\"stock-opnames.edit\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:45;a:4:{s:1:\"a\";i:47;s:1:\"b\";s:20:\"stock-opnames.delete\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:46;a:4:{s:1:\"a\";i:48;s:1:\"b\";s:12:\"profit.index\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:47;a:4:{s:1:\"a\";i:50;s:1:\"b\";s:10:\"item.index\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:48;a:4:{s:1:\"a\";i:51;s:1:\"b\";s:14:\"services.index\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:49;a:4:{s:1:\"a\";i:52;s:1:\"b\";s:15:\"services.create\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:50;a:4:{s:1:\"a\";i:53;s:1:\"b\";s:13:\"services.edit\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:51;a:4:{s:1:\"a\";i:54;s:1:\"b\";s:15:\"services.delete\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}i:52;a:4:{s:1:\"a\";i:55;s:1:\"b\";s:21:\"service-reports.index\";s:1:\"c\";s:3:\"web\";s:1:\"r\";a:1:{i:0;i:1;}}}s:5:\"roles\";a:1:{i:0;a:3:{s:1:\"a\";i:1;s:1:\"b\";s:5:\"admin\";s:1:\"c\";s:3:\"web\";}}}', 1767487946);

-- --------------------------------------------------------

--
-- Struktur dari tabel `cache_locks`
--

CREATE TABLE `cache_locks` (
  `key` varchar(255) NOT NULL,
  `owner` varchar(255) NOT NULL,
  `expiration` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Struktur dari tabel `categories`
--

CREATE TABLE `categories` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `categories`
--

INSERT INTO `categories` (`id`, `name`, `description`, `created_at`, `updated_at`) VALUES
(1, 'Handphone', 'Produk handphone baru dan bekas', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(2, 'Aksesoris HP', 'Aksesoris handphone seperti case, charger, dll', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(3, 'Sparepart', 'Sparepart handphone', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(4, 'Pulsa & Paket Data', 'Produk digital pulsa dan paket data', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(5, 'Laptop', 'Produk laptop baru dan bekas', '2026-01-03 01:22:40', '2026-01-03 01:22:40');

-- --------------------------------------------------------

--
-- Struktur dari tabel `customers`
--

CREATE TABLE `customers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `customers`
--

INSERT INTO `customers` (`id`, `name`, `phone`, `address`, `email`, `user_id`, `created_at`, `updated_at`) VALUES
(6, 'Dzul', '089613658060', 'Jl. cangkiran gunungpati km.03 mijen semarang', 'Dzul123@gmail.com', 5, '2026-01-03 01:20:22', '2026-01-03 01:20:22'),
(7, 'Rama', '081225131504', 'Ngelimut', 'Rama123@gmail.com', 6, '2026-01-03 01:20:54', '2026-01-03 01:20:55');

-- --------------------------------------------------------

--
-- Struktur dari tabel `failed_jobs`
--

CREATE TABLE `failed_jobs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `uuid` varchar(255) NOT NULL,
  `connection` text NOT NULL,
  `queue` text NOT NULL,
  `payload` longtext NOT NULL,
  `exception` longtext NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Struktur dari tabel `jobs`
--

CREATE TABLE `jobs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `queue` varchar(255) NOT NULL,
  `payload` longtext NOT NULL,
  `attempts` tinyint(3) UNSIGNED NOT NULL,
  `reserved_at` int(10) UNSIGNED DEFAULT NULL,
  `available_at` int(10) UNSIGNED NOT NULL,
  `created_at` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Struktur dari tabel `job_batches`
--

CREATE TABLE `job_batches` (
  `id` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `total_jobs` int(11) NOT NULL,
  `pending_jobs` int(11) NOT NULL,
  `failed_jobs` int(11) NOT NULL,
  `failed_job_ids` longtext NOT NULL,
  `options` mediumtext DEFAULT NULL,
  `cancelled_at` int(11) DEFAULT NULL,
  `created_at` int(11) NOT NULL,
  `finished_at` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Struktur dari tabel `migrations`
--

CREATE TABLE `migrations` (
  `id` int(10) UNSIGNED NOT NULL,
  `migration` varchar(255) NOT NULL,
  `batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `migrations`
--

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '0001_01_01_000000_create_users_table', 1),
(2, '0001_01_01_000001_create_cache_table', 1),
(3, '0001_01_01_000002_create_jobs_table', 1),
(4, '2025_12_07_033020_create_permission_tables', 1),
(5, '2025_12_07_221610_create_branches_table', 1),
(6, '2025_12_07_221832_create_categories_table', 1),
(7, '2025_12_07_221844_create_brands_table', 1),
(8, '2025_12_07_221854_create_suppliers_table', 1),
(9, '2025_12_07_221900_create_customers_table', 1),
(10, '2025_12_07_221905_create_products_table', 1),
(11, '2025_12_07_221912_create_product_stocks_table', 1),
(12, '2025_12_07_221918_create_product_prices_table', 1),
(13, '2025_12_07_221923_create_stock_movements_table', 1),
(14, '2025_12_07_221929_create_purchases_table', 1),
(15, '2025_12_07_221934_create_purchase_details_table', 1),
(16, '2025_12_07_221939_create_sales_table', 1),
(17, '2025_12_07_221944_create_sale_details_table', 1),
(18, '2025_12_07_221951_create_stock_opnames_table', 1),
(19, '2025_12_07_221957_create_stock_opname_details_table', 1),
(20, '2025_12_31_170645_create_services_table', 2),
(21, '2025_12_31_170930_create_service_details_table', 2),
(22, '2025_12_31_171008_create_service_status_histories_table', 2),
(23, '2026_01_03_005021_add_user_id_to_customers_table', 3),
(24, '2026_01_03_020258_add_barcode_to_purchases_table', 4),
(25, '2026_01_03_062019_add_barcode_to_sales_table', 5),
(26, '2026_01_03_065544_add_barcode_to_services_table', 6);

-- --------------------------------------------------------

--
-- Struktur dari tabel `model_has_permissions`
--

CREATE TABLE `model_has_permissions` (
  `permission_id` bigint(20) UNSIGNED NOT NULL,
  `model_type` varchar(255) NOT NULL,
  `model_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Struktur dari tabel `model_has_roles`
--

CREATE TABLE `model_has_roles` (
  `role_id` bigint(20) UNSIGNED NOT NULL,
  `model_type` varchar(255) NOT NULL,
  `model_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `model_has_roles`
--

INSERT INTO `model_has_roles` (`role_id`, `model_type`, `model_id`) VALUES
(1, 'App\\Models\\User', 1),
(2, 'App\\Models\\User', 5),
(2, 'App\\Models\\User', 6);

-- --------------------------------------------------------

--
-- Struktur dari tabel `password_reset_tokens`
--

CREATE TABLE `password_reset_tokens` (
  `email` varchar(255) NOT NULL,
  `token` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Struktur dari tabel `permissions`
--

CREATE TABLE `permissions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `guard_name` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `permissions`
--

INSERT INTO `permissions` (`id`, `name`, `guard_name`, `created_at`, `updated_at`) VALUES
(1, 'permissions.index', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(2, 'roles.index', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(3, 'roles.create', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(4, 'roles.edit', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(5, 'roles.delete', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(6, 'users.index', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(7, 'users.create', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(8, 'users.edit', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(9, 'users.delete', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(10, 'branches.index', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(11, 'branches.create', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(12, 'branches.edit', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(13, 'branches.delete', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(14, 'categories.index', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(15, 'categories.create', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(16, 'categories.edit', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(17, 'categories.delete', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(18, 'brands.index', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(19, 'brands.create', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(20, 'brands.edit', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(21, 'brands.delete', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(22, 'suppliers.index', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(23, 'suppliers.create', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(24, 'suppliers.edit', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(25, 'suppliers.delete', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(26, 'customers.index', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(27, 'customers.create', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(28, 'customers.edit', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(29, 'customers.delete', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(30, 'products.index', 'web', '2025-12-21 08:21:42', '2025-12-21 08:21:42'),
(31, 'products.create', 'web', '2025-12-21 08:21:42', '2025-12-21 08:21:42'),
(32, 'products.edit', 'web', '2025-12-21 08:21:42', '2025-12-21 08:21:42'),
(33, 'products.delete', 'web', '2025-12-21 08:21:42', '2025-12-21 08:21:42'),
(34, 'purchases.index', 'web', '2025-12-22 07:47:23', '2025-12-22 07:47:23'),
(35, 'purchases.create', 'web', '2025-12-22 07:47:23', '2025-12-22 07:47:23'),
(36, 'purchases.edit', 'web', '2025-12-22 07:47:23', '2025-12-22 07:47:23'),
(37, 'purchases.delete', 'web', '2025-12-22 07:47:23', '2025-12-22 07:47:23'),
(39, 'sales.index', 'web', '2025-12-22 09:42:03', '2025-12-22 09:42:03'),
(40, 'sales.create', 'web', '2025-12-22 09:42:03', '2025-12-22 09:42:03'),
(41, 'sales.edit', 'web', '2025-12-22 09:42:03', '2025-12-22 09:42:03'),
(42, 'sales.delete', 'web', '2025-12-22 09:42:03', '2025-12-22 09:42:03'),
(43, 'stock-movements.index', 'web', '2025-12-25 06:41:03', '2025-12-25 06:41:03'),
(44, 'stock-opnames.index', 'web', '2025-12-25 06:41:03', '2025-12-25 06:41:03'),
(45, 'stock-opnames.create', 'web', '2025-12-25 06:41:03', '2025-12-25 06:41:03'),
(46, 'stock-opnames.edit', 'web', '2025-12-25 06:41:03', '2025-12-25 06:41:03'),
(47, 'stock-opnames.delete', 'web', '2025-12-25 06:41:03', '2025-12-25 06:41:03'),
(48, 'profit.index', 'web', '2025-12-25 06:57:08', '2025-12-25 06:57:08'),
(50, 'item.index', 'web', '2025-12-25 17:43:09', '2025-12-25 17:43:09'),
(51, 'services.index', 'web', '2025-12-31 10:17:45', '2025-12-31 10:17:45'),
(52, 'services.create', 'web', '2025-12-31 10:17:45', '2025-12-31 10:17:45'),
(53, 'services.edit', 'web', '2025-12-31 10:17:45', '2025-12-31 10:17:45'),
(54, 'services.delete', 'web', '2025-12-31 10:17:45', '2025-12-31 10:17:45'),
(55, 'service-reports.index', 'web', '2026-01-01 00:28:15', '2026-01-01 00:28:15');

-- --------------------------------------------------------

--
-- Struktur dari tabel `products`
--

CREATE TABLE `products` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `category_id` bigint(20) UNSIGNED NOT NULL,
  `brand_id` bigint(20) UNSIGNED NOT NULL,
  `barcode` varchar(255) DEFAULT NULL,
  `unit` varchar(20) NOT NULL DEFAULT 'pcs',
  `min_stock` int(11) NOT NULL DEFAULT 0,
  `description` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `products`
--

INSERT INTO `products` (`id`, `name`, `category_id`, `brand_id`, `barcode`, `unit`, `min_stock`, `description`, `created_at`, `updated_at`) VALUES
(21, 'IdeaPad Pro 5 (16\'\', Gen 10)', 5, 10, 'PRD260103sf60_fjEuDCaP9)GijkSL&U%9R$iT7[?l%JxM0t9s&I0Fql?)BgH6Md)8FF%^(D}kPDI.<Dj[6*7k(s%[Q(s8PX+W;f7mdV?M>D:', 'unit', 5, '- Up to Windows 11 Pro\n- Peak performance with AMD Ryzen™ AI 300 Series processors & Copilot+ experiences\n- 16″ Laptop with high-resolution OLED display for awe-inspiring visuals\n- Ideal for learners & educators to empower their creativity', '2026-01-03 01:26:17', '2026-01-03 01:26:17'),
(26, 'Infinix GT 30 Pro', 1, 7, 'PRD260103m>?j:GoN;2mG7N*QtO^OO[j^f07Zi=+QM^vCu7|>yITGW.N7}@2T^%EDLsg,tS7}T{$$xJ>k>gtK@W]N8hehwkFc73m&uYOfvqKr', 'pcs', 3, 'OS Version	Android 15\nVersion Detail	XOS 15\nUkuran Layar	6.78 inch\nTechnology	AMOLED\nScreen Resolution	2720 x 1224 Pixel\nResolusi Kamera Belakang	108 MP\nResolusi Kamera Utama Lainnya	8 MP\nResolusi Kamera Depan	13 MP\nDetail Prosesor	Dimensity 8350 Ultimate\nGPU	Mali G615-MC6\nRAM	8 GB\nMemori Internal	256 GB\nUSB	Type-C\nNFC	Ya\nSensor	Fingerprint, Accelerometer, Gyroscope, Proximity, Compass\nKapasitas Baterai	5200 mAh\nDaya Fast Charging	45 W', '2026-01-03 02:03:47', '2026-01-03 02:03:47'),
(27, 'OPPO Find N5', 1, 4, 'PRD260103,_>kk.qT>?]46rd^YL;DE4F[brZ5c7uVj8h8Pat9WKF[QXRL!!FvfSp]9?l,6nF$>9k1)|,MFmS_l.aEYMF-*JtLkypZf%tn3]IU', 'pcs', 3, 'OS Version	Android 15\nVersion Detail	ColorOS 15\nUkuran Layar	8.12 inch\nTechnology	Foldable LTPO OLED\nScreen Resolution	2480 x 2248 Pixel\nResolusi Kamera Belakang	50 MP\nResolusi Kamera Utama Lainnya	50, 8 MP\nResolusi Kamera Depan	8 MP\nDetail Prosesor	Snapdragon 8 Elite\nKecepatan CPU	4.32 GHz\nGPU	Adreno 830\nRAM	16 GB\nMemori Internal	512 GB\nNFC	Ya\nKapasitas Baterai	5600 mAh\nDaya Fast Charging	80 W', '2026-01-03 02:03:47', '2026-01-03 02:03:47'),
(28, 'Xiaomi 15', 1, 3, 'PRD260103.0w6X2Z%m](4Dm5Lg>.]:K^*C3ZO*%L9w*U}uJbfoodG#ga_^,i0R?ZXl.f8dd!)!g[_JjzC.;^r^P}aZ-@a$}e%IVcbji5V:iSQ', 'pcs', 3, 'Dimensi	152,3 x 71,2 x 8,08 mm\nBerat	191 g\nOS Version	Android 15\nUkuran Layar	6.36 inch\nTechnology	LTPO AMOLED\nScreen Resolution	2670 x 1200 Pixel\nResolusi Kamera Belakang	50 MP\nResolusi Kamera Utama Lainnya	50, 50 MP\nResolusi Kamera Depan	32 MP\nDetail Prosesor	Snapdragon 8 Elite\nJumlah Core	Octa Core\nGPU	Adreno 830\nRAM	12 GB\nMemori Internal	256 GB\nUSB	Type-C, USB OTG\nNFC	Ya\nSensor	Fingerprint, Accelerometer, Gyroscope, Proximity, Compass, Barometer\nKapasitas Baterai	5400 mAh\nDaya Fast Charging	90 W', '2026-01-03 02:03:47', '2026-01-03 02:03:47'),
(29, 'realme C75x', 1, 6, 'PRD260103KkIy6S@s5S8>]MAGsIg?1dg.sa?zDNbcZ#(fWFV,gw45k^&Li^.wk8!zHPGX!e0t|TKOKsA{k+o$B3[i*7p:HFC[%=jihr?1Z)n_', 'pcs', 3, 'OS Version	Android 15\nVersion Detail	UI 6.0\nUkuran Layar	6.67 inch\nTechnology	-\nScreen Resolution	1604 x 720 Pixel\nResolusi Kamera Belakang	50 MP\nResolusi Kamera Utama Lainnya	-\nResolusi Kamera Depan	5 MP\nDetail Prosesor	Helio G81 Ultra\nGPU	-\nRAM	8 GB\nMemori Internal	128 GB\nUSB	Type-C\nNFC	Ya\nKapasitas Baterai	5600 mAh\nDaya Fast Charging	45 W', '2026-01-03 02:03:47', '2026-01-03 02:03:47'),
(30, 'LCD TOUCHSCREEN OPPO RENO', 3, 4, 'PRD260103}|I,OWZHB(|IFMu.LK[8jlXYd1%>$s;p)N60cU*>@m@Z>+ZXU.$.N)r1hR>13QHtIB!(s]7_7<63fuZ?Nal?(i;OGA0:50R3O${&', 'pcs', 3, 'LCD TOUCHSCREEN OPPO RENO 12F 4G/5G / RENO 12 FS / REAL 12 4G / K12X 5G / F27', '2026-01-03 02:11:24', '2026-01-03 02:11:24'),
(31, 'Softcase Kaca Oppo Reno 12F', 2, 4, 'PRD260103G&iGq!6=LqQl1V+Sp^LfFEtgj1HQrH1I_[v*x2tx1MPxb>-Dj9zdD@O>GbRf.l1|.[F.d85COoWJ_Vu,0*cJjD@1B{x3}C5r7NGd', 'pcs', 10, '(H162) Softcase Kaca Oppo Reno 12F Terbaru - Case Hp Oppo Reno 12F Terbaru', '2026-01-03 02:12:40', '2026-01-03 02:12:40');

-- --------------------------------------------------------

--
-- Struktur dari tabel `product_prices`
--

CREATE TABLE `product_prices` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `product_id` bigint(20) UNSIGNED NOT NULL,
  `branch_id` bigint(20) UNSIGNED NOT NULL,
  `purchase_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `selling_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `effective_date` date NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `product_prices`
--

INSERT INTO `product_prices` (`id`, `product_id`, `branch_id`, `purchase_price`, `selling_price`, `effective_date`, `created_at`, `updated_at`) VALUES
(22, 21, 1, 15000000.00, 17500000.00, '2026-01-03', '2026-01-03 01:26:17', '2026-01-03 01:26:17'),
(23, 21, 2, 15000000.00, 18000000.00, '2026-01-03', '2026-01-03 01:26:17', '2026-01-03 01:26:17'),
(28, 26, 1, 3700000.00, 4500000.00, '2026-01-03', '2026-01-03 02:03:47', '2026-01-03 02:03:47'),
(29, 27, 1, 26100000.00, 27400000.00, '2026-01-03', '2026-01-03 02:03:47', '2026-01-03 02:03:47'),
(30, 28, 1, 11400000.00, 12300000.00, '2026-01-03', '2026-01-03 02:03:47', '2026-01-03 02:03:47'),
(31, 29, 1, 2400000.00, 3200000.00, '2026-01-03', '2026-01-03 02:03:47', '2026-01-03 02:03:47'),
(32, 30, 2, 210000.00, 475000.00, '2026-01-03', '2026-01-03 02:11:24', '2026-01-03 02:11:24'),
(33, 31, 2, 28000.00, 39000.00, '2026-01-03', '2026-01-03 02:12:40', '2026-01-03 02:12:40');

-- --------------------------------------------------------

--
-- Struktur dari tabel `product_stocks`
--

CREATE TABLE `product_stocks` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `product_id` bigint(20) UNSIGNED NOT NULL,
  `branch_id` bigint(20) UNSIGNED NOT NULL,
  `quantity` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `product_stocks`
--

INSERT INTO `product_stocks` (`id`, `product_id`, `branch_id`, `quantity`, `created_at`, `updated_at`) VALUES
(22, 21, 1, 15, '2026-01-03 01:26:17', '2026-01-03 02:38:54'),
(23, 21, 2, 11, '2026-01-03 01:26:17', '2026-01-03 02:07:42'),
(28, 26, 1, 20, '2026-01-03 02:03:47', '2026-01-03 02:05:10'),
(29, 27, 1, 10, '2026-01-03 02:03:47', '2026-01-03 02:03:47'),
(30, 28, 1, 7, '2026-01-03 02:03:47', '2026-01-03 02:38:54'),
(31, 29, 1, 15, '2026-01-03 02:03:47', '2026-01-03 02:06:46'),
(32, 30, 2, 10, '2026-01-03 02:11:24', '2026-01-03 02:11:24'),
(33, 31, 2, 20, '2026-01-03 02:12:40', '2026-01-03 02:12:40');

-- --------------------------------------------------------

--
-- Struktur dari tabel `purchases`
--

CREATE TABLE `purchases` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `purchase_number` varchar(255) NOT NULL,
  `barcode` varchar(255) DEFAULT NULL,
  `supplier_id` bigint(20) UNSIGNED NOT NULL,
  `branch_id` bigint(20) UNSIGNED NOT NULL,
  `purchase_date` date NOT NULL,
  `total_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `status` enum('pending','completed','cancelled') NOT NULL DEFAULT 'pending',
  `notes` text DEFAULT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `purchases`
--

INSERT INTO `purchases` (`id`, `purchase_number`, `barcode`, `supplier_id`, `branch_id`, `purchase_date`, `total_amount`, `status`, `notes`, `user_id`, `created_at`, `updated_at`) VALUES
(14, 'PO202601030001', 'PUR260103Y%MowJxyM=S<ci5G{3XDA;Ah{MHaE|z2#sW:&Eujc,.%0$^r:f_S**bKt)D<>2q2rh&J@l+E!e4ShcT6h>jRCmubMX@T3Zqkc[gd', 2, 1, '2026-01-03', 18500000.00, 'completed', 'pembelian pertama', 1, '2026-01-03 02:05:10', '2026-01-03 02:05:10'),
(15, 'PO202601030002', 'PUR260103)?Ez[5{A;d^a7dpH;@_<!]10gW.}.{VK&mg9AlA(<9$AU2@%x%I:H3*v7CH<4(U|>&dBAdi:Yj($$6Z21w9;Zjn@^C@YA1:,7+Bw', 1, 2, '2026-01-03', 75000000.00, 'completed', 'pembelian kedua', 1, '2026-01-03 02:05:35', '2026-01-03 02:05:35'),
(16, 'PO202601030003', 'PUR260103r[6ZlW2&LFC!c?}qaUtk79;y!roG2m1bozMkseQ60vWtCcE.2(30$)v:]i}p$G(q30;.)qB>Bgbb{LXJ-<k{1)zlzff7S1bts)OG', 1, 1, '2026-01-03', 16800000.00, 'completed', 'pembelian ketiga', 1, '2026-01-03 02:06:04', '2026-01-03 02:06:04');

-- --------------------------------------------------------

--
-- Struktur dari tabel `purchase_details`
--

CREATE TABLE `purchase_details` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `purchase_id` bigint(20) UNSIGNED NOT NULL,
  `product_id` bigint(20) UNSIGNED NOT NULL,
  `quantity` int(11) NOT NULL,
  `purchase_price` decimal(15,2) NOT NULL,
  `subtotal` decimal(15,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `purchase_details`
--

INSERT INTO `purchase_details` (`id`, `purchase_id`, `product_id`, `quantity`, `purchase_price`, `subtotal`, `created_at`, `updated_at`) VALUES
(17, 14, 26, 5, 3700000.00, 18500000.00, '2026-01-03 02:05:10', '2026-01-03 02:05:10'),
(18, 15, 21, 5, 15000000.00, 75000000.00, '2026-01-03 02:05:35', '2026-01-03 02:05:35'),
(19, 16, 29, 7, 2400000.00, 16800000.00, '2026-01-03 02:06:04', '2026-01-03 02:06:04');

-- --------------------------------------------------------

--
-- Struktur dari tabel `roles`
--

CREATE TABLE `roles` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `guard_name` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `roles`
--

INSERT INTO `roles` (`id`, `name`, `guard_name`, `created_at`, `updated_at`) VALUES
(1, 'admin', 'web', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(2, 'customer', 'web', '2026-01-02 17:51:52', '2026-01-02 17:51:52');

-- --------------------------------------------------------

--
-- Struktur dari tabel `role_has_permissions`
--

CREATE TABLE `role_has_permissions` (
  `permission_id` bigint(20) UNSIGNED NOT NULL,
  `role_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `role_has_permissions`
--

INSERT INTO `role_has_permissions` (`permission_id`, `role_id`) VALUES
(1, 1),
(2, 1),
(3, 1),
(4, 1),
(5, 1),
(6, 1),
(7, 1),
(8, 1),
(9, 1),
(10, 1),
(11, 1),
(12, 1),
(13, 1),
(14, 1),
(15, 1),
(16, 1),
(17, 1),
(18, 1),
(19, 1),
(20, 1),
(21, 1),
(22, 1),
(23, 1),
(24, 1),
(25, 1),
(26, 1),
(27, 1),
(28, 1),
(29, 1),
(30, 1),
(31, 1),
(32, 1),
(33, 1),
(34, 1),
(35, 1),
(36, 1),
(37, 1),
(39, 1),
(40, 1),
(41, 1),
(42, 1),
(43, 1),
(44, 1),
(45, 1),
(46, 1),
(47, 1),
(48, 1),
(50, 1),
(51, 1),
(52, 1),
(53, 1),
(54, 1),
(55, 1);

-- --------------------------------------------------------

--
-- Struktur dari tabel `sales`
--

CREATE TABLE `sales` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `sale_number` varchar(255) NOT NULL,
  `barcode` varchar(255) DEFAULT NULL,
  `customer_id` bigint(20) UNSIGNED DEFAULT NULL,
  `branch_id` bigint(20) UNSIGNED NOT NULL,
  `cashier_id` bigint(20) UNSIGNED NOT NULL,
  `sale_date` date NOT NULL,
  `subtotal` 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,
  `total_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `payment_method` enum('cash','transfer','credit') NOT NULL DEFAULT 'cash',
  `status` enum('pending','completed','cancelled') NOT NULL DEFAULT 'completed',
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `sales`
--

INSERT INTO `sales` (`id`, `sale_number`, `barcode`, `customer_id`, `branch_id`, `cashier_id`, `sale_date`, `subtotal`, `discount`, `tax`, `total_amount`, `payment_method`, `status`, `notes`, `created_at`, `updated_at`) VALUES
(13, 'SO202601030001', 'SAL260103tyy6ec;6K}6)&(AScikS29:&^s28XJlD,JC#7Iq=I,I}GCJG);k;3,iVu[Hs08>$2Zy>Z6;LTp!(7TzW<Pbi7suffqo*9dT36$6w', 6, 1, 1, '2026-01-03', 23900000.00, 0.00, 0.00, 23900000.00, 'cash', 'completed', 'pembelian pertama', '2026-01-03 02:06:46', '2026-01-03 02:06:46'),
(14, 'SO202601030002', 'SAL260103MyIewf-b3VU_;--:lf&L6|;%a0C!Qb-RH;ES&vdscMK,:$15;OS41Ozz:y%?Zog9AXon7#1(bl:ajAkwRZn[NnLoHHSH@O#A@0jI', 6, 2, 1, '2026-01-03', 18000000.00, 500000.00, 100000.00, 17600000.00, 'cash', 'completed', 'pembelian kedua', '2026-01-03 02:07:42', '2026-01-03 02:07:42'),
(15, 'SO202601030003', 'SAL260103en&S|>s>y$q5B[X*.3n1FqWJ6)@vxZ;xXj<PbVg6go^<-Ic-}n&P)^Pr8HN:pxRF?2DOl).W0GRKK|ZA,LQul@nFl|7$FBjBKbA>', 7, 1, 1, '2026-01-03', 24600000.00, 0.00, 100000.00, 24700000.00, 'cash', 'completed', 'penjualan ketiga', '2026-01-03 02:08:26', '2026-01-03 02:08:26');

-- --------------------------------------------------------

--
-- Struktur dari tabel `sale_details`
--

CREATE TABLE `sale_details` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `sale_id` bigint(20) UNSIGNED NOT NULL,
  `product_id` bigint(20) UNSIGNED NOT NULL,
  `quantity` int(11) NOT NULL,
  `selling_price` decimal(15,2) NOT NULL,
  `purchase_price` decimal(15,2) NOT NULL,
  `discount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `subtotal` decimal(15,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `sale_details`
--

INSERT INTO `sale_details` (`id`, `sale_id`, `product_id`, `quantity`, `selling_price`, `purchase_price`, `discount`, `subtotal`, `created_at`, `updated_at`) VALUES
(18, 13, 21, 1, 17500000.00, 15000000.00, 0.00, 17500000.00, '2026-01-03 02:06:46', '2026-01-03 02:06:46'),
(19, 13, 29, 2, 3200000.00, 2400000.00, 0.00, 6400000.00, '2026-01-03 02:06:46', '2026-01-03 02:06:46'),
(20, 14, 21, 1, 18000000.00, 15000000.00, 0.00, 18000000.00, '2026-01-03 02:07:42', '2026-01-03 02:07:42'),
(21, 15, 28, 2, 12300000.00, 11400000.00, 0.00, 24600000.00, '2026-01-03 02:08:26', '2026-01-03 02:08:26');

-- --------------------------------------------------------

--
-- Struktur dari tabel `services`
--

CREATE TABLE `services` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `service_number` varchar(255) NOT NULL,
  `barcode` varchar(255) DEFAULT NULL,
  `customer_id` bigint(20) UNSIGNED NOT NULL,
  `branch_id` bigint(20) UNSIGNED NOT NULL,
  `technician_id` bigint(20) UNSIGNED DEFAULT NULL,
  `service_date` date NOT NULL,
  `device_type` varchar(255) NOT NULL,
  `device_brand` varchar(255) NOT NULL,
  `device_model` varchar(255) NOT NULL,
  `imei` varchar(255) DEFAULT NULL,
  `complaint` text NOT NULL,
  `diagnosis` text DEFAULT NULL,
  `estimated_cost` decimal(15,2) NOT NULL DEFAULT 0.00,
  `service_fee` decimal(15,2) NOT NULL DEFAULT 0.00,
  `parts_cost` decimal(15,2) NOT NULL DEFAULT 0.00,
  `total_cost` decimal(15,2) NOT NULL DEFAULT 0.00,
  `down_payment` decimal(15,2) NOT NULL DEFAULT 0.00,
  `remaining_payment` decimal(15,2) NOT NULL DEFAULT 0.00,
  `status` enum('menunggu diagnosa','sedang diagnosa','menunggu persetujuan','menunggu spare part','dalam pengerjaan','quality control','siap diambil','selesai','dibatalkan') NOT NULL DEFAULT 'menunggu diagnosa',
  `priority` enum('normal','urgent','very urgent') NOT NULL DEFAULT 'normal',
  `estimated_completion` datetime DEFAULT NULL,
  `completed_at` datetime DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `services`
--

INSERT INTO `services` (`id`, `service_number`, `barcode`, `customer_id`, `branch_id`, `technician_id`, `service_date`, `device_type`, `device_brand`, `device_model`, `imei`, `complaint`, `diagnosis`, `estimated_cost`, `service_fee`, `parts_cost`, `total_cost`, `down_payment`, `remaining_payment`, `status`, `priority`, `estimated_completion`, `completed_at`, `notes`, `created_at`, `updated_at`) VALUES
(6, 'SRV-20260103-0001', 'SRV260103HA152MMB4J9TL6JEN00I9JATF9A8YWF2MHCTYEALK9ZRDWNGIBV99ONJRKJ900VEF7DFVQMS1K7UN3FGMY90QM5N4OKVLRUJ7YOY', 6, 2, 1, '2026-01-03', 'Handphone', 'Oppo', 'Oppo Reno 12F', '1234567890', 'Layar pecah', 'Harus ganti layar', 544000.00, 30000.00, 514000.00, 544000.00, 50000.00, 494000.00, 'menunggu diagnosa', 'normal', '2026-01-04 16:14:00', NULL, 'service pertama', '2026-01-03 02:15:07', '2026-01-03 02:15:07'),
(7, 'SRV-20260103-0002', 'SRV2601038LIQLAMGTSBQGTSRQZK3K2RRU3BFKCFN00MKVF2VTYUMT7ELI1CCXCQPH4DLH59IHMBIA1ST3587WJWZV3FI2C6ND0W29NCX93OX', 6, 1, 1, '2026-01-03', 'Laptop', 'Lenovo', 'Lenovo Idepad i7', '0987654321', 'Bluescreen', 'WIndows error, harus install ulang windows', 90000.00, 90000.00, 0.00, 90000.00, 0.00, 90000.00, 'selesai', 'urgent', '2026-01-03 16:16:00', '2026-01-03 09:17:51', 'service kedua', '2026-01-03 02:16:44', '2026-01-03 02:35:30');

-- --------------------------------------------------------

--
-- Struktur dari tabel `service_details`
--

CREATE TABLE `service_details` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `service_id` bigint(20) UNSIGNED NOT NULL,
  `product_id` bigint(20) UNSIGNED NOT NULL,
  `quantity` int(11) NOT NULL,
  `unit_price` decimal(15,2) NOT NULL,
  `subtotal` decimal(15,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `service_details`
--

INSERT INTO `service_details` (`id`, `service_id`, `product_id`, `quantity`, `unit_price`, `subtotal`, `created_at`, `updated_at`) VALUES
(3, 6, 30, 1, 475000.00, 475000.00, '2026-01-03 02:15:07', '2026-01-03 02:15:07'),
(4, 6, 31, 1, 39000.00, 39000.00, '2026-01-03 02:15:07', '2026-01-03 02:15:07');

-- --------------------------------------------------------

--
-- Struktur dari tabel `service_status_histories`
--

CREATE TABLE `service_status_histories` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `service_id` bigint(20) UNSIGNED NOT NULL,
  `status` varchar(255) NOT NULL,
  `notes` text DEFAULT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `service_status_histories`
--

INSERT INTO `service_status_histories` (`id`, `service_id`, `status`, `notes`, `user_id`, `created_at`, `updated_at`) VALUES
(10, 6, 'menunggu diagnosa', 'Service baru dibuat', 1, '2026-01-03 02:15:07', '2026-01-03 02:15:07'),
(11, 7, 'menunggu diagnosa', 'Service baru dibuat', 1, '2026-01-03 02:16:44', '2026-01-03 02:16:44'),
(12, 7, 'dalam pengerjaan', 'install windows 11', 1, '2026-01-03 02:17:10', '2026-01-03 02:17:10'),
(13, 7, 'siap diambil', 'Install Selesai', 1, '2026-01-03 02:17:41', '2026-01-03 02:17:41'),
(14, 7, 'selesai', 'Status diubah menjadi selesai', 1, '2026-01-03 02:17:51', '2026-01-03 02:17:51');

-- --------------------------------------------------------

--
-- Struktur dari tabel `sessions`
--

CREATE TABLE `sessions` (
  `id` varchar(255) NOT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text DEFAULT NULL,
  `payload` longtext NOT NULL,
  `last_activity` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `sessions`
--

INSERT INTO `sessions` (`id`, `user_id`, `ip_address`, `user_agent`, `payload`, `last_activity`) VALUES
('0xmejuQxTZwSP66uah1K83k3ZPFK9ilZbWPvJNMm', 5, '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoidGNLbDZhQ3JvY3lTUVNtbnNzTU85NThlNHBnQlBHeVZydktkMklGZiI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6NTY6Imh0dHA6Ly9sb2NhbGhvc3Q6ODA4Mi91bWktY2VsbC9wdWJsaWMvY3VzdG9tZXIvZGFzaGJvYXJkIjtzOjU6InJvdXRlIjtzOjE4OiJjdXN0b21lci5kYXNoYm9hcmQiO31zOjUwOiJsb2dpbl93ZWJfNTliYTM2YWRkYzJiMmY5NDAxNTgwZjAxNGM3ZjU4ZWE0ZTMwOTg5ZCI7aTo1O30=', 1767433074),
('GVt1dmmixl5tLdlDt4fe4SzbRDOW3Dc87VbpncMn', 1, '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36', 'YTo1OntzOjY6Il90b2tlbiI7czo0MDoiVk1oVGthZWhFVUIzaGJKWGpRZXNkS2w4c1d4aVNqQWpXWGhhQ1R5ViI7czozOiJ1cmwiO2E6MDp7fXM6OToiX3ByZXZpb3VzIjthOjI6e3M6MzoidXJsIjtzOjY2OiJodHRwOi8vbG9jYWxob3N0OjgwODIvdW1pLWNlbGwvcHVibGljL2FkbWluL3JlcG9ydC9zZXJ2aWNlL3JldmVudWUiO3M6NToicm91dGUiO3M6MjI6InJlcG9ydC5zZXJ2aWNlLnJldmVudWUiO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX1zOjUwOiJsb2dpbl93ZWJfNTliYTM2YWRkYzJiMmY5NDAxNTgwZjAxNGM3ZjU4ZWE0ZTMwOTg5ZCI7aToxO30=', 1767433148);

-- --------------------------------------------------------

--
-- Struktur dari tabel `stock_movements`
--

CREATE TABLE `stock_movements` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `product_id` bigint(20) UNSIGNED NOT NULL,
  `branch_id` bigint(20) UNSIGNED NOT NULL,
  `type` enum('in','out','transfer','adjustment') NOT NULL,
  `quantity` int(11) NOT NULL,
  `reference_type` varchar(255) DEFAULT NULL,
  `reference_id` bigint(20) UNSIGNED DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `stock_movements`
--

INSERT INTO `stock_movements` (`id`, `product_id`, `branch_id`, `type`, `quantity`, `reference_type`, `reference_id`, `notes`, `user_id`, `created_at`) VALUES
(34, 21, 1, 'in', 5, 'App\\Models\\Purchase', 12, 'Pembelian #PO202601030001', 1, '2026-01-03 01:52:53'),
(35, 26, 1, 'in', 5, 'App\\Models\\Purchase', 13, 'Pembelian #PO202601030002', 1, '2026-01-03 02:04:28'),
(36, 26, 1, 'in', 5, 'App\\Models\\Purchase', 14, 'Pembelian #PO202601030001', 1, '2026-01-03 02:05:10'),
(37, 21, 2, 'in', 5, 'App\\Models\\Purchase', 15, 'Pembelian #PO202601030002', 1, '2026-01-03 02:05:35'),
(38, 29, 1, 'in', 7, 'App\\Models\\Purchase', 16, 'Pembelian #PO202601030003', 1, '2026-01-03 02:06:04'),
(39, 21, 1, 'out', 1, 'App\\Models\\Sale', 13, 'Penjualan #SO202601030001', 1, '2026-01-03 02:06:46'),
(40, 29, 1, 'out', 2, 'App\\Models\\Sale', 13, 'Penjualan #SO202601030001', 1, '2026-01-03 02:06:46'),
(41, 21, 2, 'out', 1, 'App\\Models\\Sale', 14, 'Penjualan #SO202601030002', 1, '2026-01-03 02:07:42'),
(42, 28, 1, 'out', 2, 'App\\Models\\Sale', 15, 'Penjualan #SO202601030003', 1, '2026-01-03 02:08:26'),
(43, 21, 1, 'adjustment', 1, 'App\\Models\\StockOpname', 2, 'Stock Opname #OP202601030001 (+1)', 1, '2026-01-03 02:38:54'),
(44, 28, 1, 'adjustment', 1, 'App\\Models\\StockOpname', 2, 'Stock Opname #OP202601030001 (-1)', 1, '2026-01-03 02:38:54');

-- --------------------------------------------------------

--
-- Struktur dari tabel `stock_opnames`
--

CREATE TABLE `stock_opnames` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `opname_number` varchar(255) NOT NULL,
  `branch_id` bigint(20) UNSIGNED NOT NULL,
  `opname_date` date NOT NULL,
  `status` enum('draft','completed') NOT NULL DEFAULT 'draft',
  `notes` text DEFAULT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `stock_opnames`
--

INSERT INTO `stock_opnames` (`id`, `opname_number`, `branch_id`, `opname_date`, `status`, `notes`, `user_id`, `created_at`, `updated_at`) VALUES
(2, 'OP202601030001', 1, '2026-01-03', 'completed', 'stock opname pertama', 1, '2026-01-03 02:38:54', '2026-01-03 02:38:54');

-- --------------------------------------------------------

--
-- Struktur dari tabel `stock_opname_details`
--

CREATE TABLE `stock_opname_details` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `stock_opname_id` bigint(20) UNSIGNED NOT NULL,
  `product_id` bigint(20) UNSIGNED NOT NULL,
  `system_stock` int(11) NOT NULL,
  `physical_stock` int(11) NOT NULL,
  `difference` int(11) NOT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `stock_opname_details`
--

INSERT INTO `stock_opname_details` (`id`, `stock_opname_id`, `product_id`, `system_stock`, `physical_stock`, `difference`, `notes`, `created_at`, `updated_at`) VALUES
(5, 2, 21, 14, 15, 1, 'cancel', '2026-01-03 02:38:54', '2026-01-03 02:38:54'),
(6, 2, 28, 8, 7, -1, 'hilang', '2026-01-03 02:38:54', '2026-01-03 02:38:54');

-- --------------------------------------------------------

--
-- Struktur dari tabel `suppliers`
--

CREATE TABLE `suppliers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `suppliers`
--

INSERT INTO `suppliers` (`id`, `name`, `phone`, `address`, `email`, `created_at`, `updated_at`) VALUES
(1, 'PT Distributor Handphone Jaya', '021-11111111', 'Jl. Mangga Dua, Jakarta', 'supplier1@example.com', '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(2, 'CV Aksesoris Mobile', '021-22222222', 'Jl. ITC Cempaka Mas, Jakarta', 'supplier2@example.com', '2025-12-21 05:59:33', '2025-12-21 05:59:33');

-- --------------------------------------------------------

--
-- Struktur dari tabel `users`
--

CREATE TABLE `users` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(255) NOT NULL,
  `remember_token` varchar(100) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `users`
--

INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, 'Farikin', 'admin@gmail.com', NULL, '$2y$12$LBvyRRvSIC1GJgw1K4FxC.tqoLj9Oj2pa5LFYAB7edyIjYoDTTkgW', NULL, '2025-12-21 05:59:33', '2025-12-21 05:59:33'),
(5, 'Dzul', 'Dzul123@gmail.com', NULL, '$2y$12$Xv1uCYnv/HquY9766gWzYOKlD6HV6e9/RkMj2eadrARNVdPzntvWq', NULL, '2026-01-03 01:20:22', '2026-01-03 01:20:22'),
(6, 'Rama', 'Rama123@gmail.com', NULL, '$2y$12$ZMAsBSwDxyr/DdSFSbTJnOqAlDPl7GtrOd4rZcqqhX/tzW6rg4iHa', NULL, '2026-01-03 01:20:55', '2026-01-03 01:20:55');

--
-- Indexes for dumped tables
--

--
-- Indeks untuk tabel `branches`
--
ALTER TABLE `branches`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `brands`
--
ALTER TABLE `brands`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `cache`
--
ALTER TABLE `cache`
  ADD PRIMARY KEY (`key`);

--
-- Indeks untuk tabel `cache_locks`
--
ALTER TABLE `cache_locks`
  ADD PRIMARY KEY (`key`);

--
-- Indeks untuk tabel `categories`
--
ALTER TABLE `categories`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `customers`
--
ALTER TABLE `customers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customers_user_id_foreign` (`user_id`);

--
-- Indeks untuk tabel `failed_jobs`
--
ALTER TABLE `failed_jobs`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`);

--
-- Indeks untuk tabel `jobs`
--
ALTER TABLE `jobs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `jobs_queue_index` (`queue`);

--
-- Indeks untuk tabel `job_batches`
--
ALTER TABLE `job_batches`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `migrations`
--
ALTER TABLE `migrations`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `model_has_permissions`
--
ALTER TABLE `model_has_permissions`
  ADD PRIMARY KEY (`permission_id`,`model_id`,`model_type`),
  ADD KEY `model_has_permissions_model_id_model_type_index` (`model_id`,`model_type`);

--
-- Indeks untuk tabel `model_has_roles`
--
ALTER TABLE `model_has_roles`
  ADD PRIMARY KEY (`role_id`,`model_id`,`model_type`),
  ADD KEY `model_has_roles_model_id_model_type_index` (`model_id`,`model_type`);

--
-- Indeks untuk tabel `password_reset_tokens`
--
ALTER TABLE `password_reset_tokens`
  ADD PRIMARY KEY (`email`);

--
-- Indeks untuk tabel `permissions`
--
ALTER TABLE `permissions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `permissions_name_guard_name_unique` (`name`,`guard_name`);

--
-- Indeks untuk tabel `products`
--
ALTER TABLE `products`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `products_barcode_unique` (`barcode`),
  ADD KEY `products_category_id_foreign` (`category_id`),
  ADD KEY `products_brand_id_foreign` (`brand_id`);

--
-- Indeks untuk tabel `product_prices`
--
ALTER TABLE `product_prices`
  ADD PRIMARY KEY (`id`),
  ADD KEY `product_prices_product_id_foreign` (`product_id`),
  ADD KEY `product_prices_branch_id_foreign` (`branch_id`);

--
-- Indeks untuk tabel `product_stocks`
--
ALTER TABLE `product_stocks`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `product_stocks_product_id_branch_id_unique` (`product_id`,`branch_id`),
  ADD KEY `product_stocks_branch_id_foreign` (`branch_id`);

--
-- Indeks untuk tabel `purchases`
--
ALTER TABLE `purchases`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `purchases_purchase_number_unique` (`purchase_number`),
  ADD UNIQUE KEY `purchases_barcode_unique` (`barcode`),
  ADD KEY `purchases_supplier_id_foreign` (`supplier_id`),
  ADD KEY `purchases_branch_id_foreign` (`branch_id`),
  ADD KEY `purchases_user_id_foreign` (`user_id`);

--
-- Indeks untuk tabel `purchase_details`
--
ALTER TABLE `purchase_details`
  ADD PRIMARY KEY (`id`),
  ADD KEY `purchase_details_purchase_id_foreign` (`purchase_id`),
  ADD KEY `purchase_details_product_id_foreign` (`product_id`);

--
-- Indeks untuk tabel `roles`
--
ALTER TABLE `roles`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `roles_name_guard_name_unique` (`name`,`guard_name`);

--
-- Indeks untuk tabel `role_has_permissions`
--
ALTER TABLE `role_has_permissions`
  ADD PRIMARY KEY (`permission_id`,`role_id`),
  ADD KEY `role_has_permissions_role_id_foreign` (`role_id`);

--
-- Indeks untuk tabel `sales`
--
ALTER TABLE `sales`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `sales_sale_number_unique` (`sale_number`),
  ADD UNIQUE KEY `sales_barcode_unique` (`barcode`),
  ADD KEY `sales_customer_id_foreign` (`customer_id`),
  ADD KEY `sales_branch_id_foreign` (`branch_id`),
  ADD KEY `sales_cashier_id_foreign` (`cashier_id`);

--
-- Indeks untuk tabel `sale_details`
--
ALTER TABLE `sale_details`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sale_details_sale_id_foreign` (`sale_id`),
  ADD KEY `sale_details_product_id_foreign` (`product_id`);

--
-- Indeks untuk tabel `services`
--
ALTER TABLE `services`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `services_service_number_unique` (`service_number`),
  ADD UNIQUE KEY `services_barcode_unique` (`barcode`),
  ADD KEY `services_customer_id_foreign` (`customer_id`),
  ADD KEY `services_branch_id_foreign` (`branch_id`),
  ADD KEY `services_technician_id_foreign` (`technician_id`);

--
-- Indeks untuk tabel `service_details`
--
ALTER TABLE `service_details`
  ADD PRIMARY KEY (`id`),
  ADD KEY `service_details_service_id_foreign` (`service_id`),
  ADD KEY `service_details_product_id_foreign` (`product_id`);

--
-- Indeks untuk tabel `service_status_histories`
--
ALTER TABLE `service_status_histories`
  ADD PRIMARY KEY (`id`),
  ADD KEY `service_status_histories_service_id_foreign` (`service_id`),
  ADD KEY `service_status_histories_user_id_foreign` (`user_id`);

--
-- Indeks untuk tabel `sessions`
--
ALTER TABLE `sessions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sessions_user_id_index` (`user_id`),
  ADD KEY `sessions_last_activity_index` (`last_activity`);

--
-- Indeks untuk tabel `stock_movements`
--
ALTER TABLE `stock_movements`
  ADD PRIMARY KEY (`id`),
  ADD KEY `stock_movements_product_id_foreign` (`product_id`),
  ADD KEY `stock_movements_branch_id_foreign` (`branch_id`),
  ADD KEY `stock_movements_user_id_foreign` (`user_id`);

--
-- Indeks untuk tabel `stock_opnames`
--
ALTER TABLE `stock_opnames`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `stock_opnames_opname_number_unique` (`opname_number`),
  ADD KEY `stock_opnames_branch_id_foreign` (`branch_id`),
  ADD KEY `stock_opnames_user_id_foreign` (`user_id`);

--
-- Indeks untuk tabel `stock_opname_details`
--
ALTER TABLE `stock_opname_details`
  ADD PRIMARY KEY (`id`),
  ADD KEY `stock_opname_details_stock_opname_id_foreign` (`stock_opname_id`),
  ADD KEY `stock_opname_details_product_id_foreign` (`product_id`);

--
-- Indeks untuk tabel `suppliers`
--
ALTER TABLE `suppliers`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `users_email_unique` (`email`);

--
-- AUTO_INCREMENT untuk tabel yang dibuang
--

--
-- AUTO_INCREMENT untuk tabel `branches`
--
ALTER TABLE `branches`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT untuk tabel `brands`
--
ALTER TABLE `brands`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT untuk tabel `categories`
--
ALTER TABLE `categories`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT untuk tabel `customers`
--
ALTER TABLE `customers`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT untuk tabel `failed_jobs`
--
ALTER TABLE `failed_jobs`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT untuk tabel `jobs`
--
ALTER TABLE `jobs`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT untuk tabel `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=27;

--
-- AUTO_INCREMENT untuk tabel `permissions`
--
ALTER TABLE `permissions`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=56;

--
-- AUTO_INCREMENT untuk tabel `products`
--
ALTER TABLE `products`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=32;

--
-- AUTO_INCREMENT untuk tabel `product_prices`
--
ALTER TABLE `product_prices`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34;

--
-- AUTO_INCREMENT untuk tabel `product_stocks`
--
ALTER TABLE `product_stocks`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34;

--
-- AUTO_INCREMENT untuk tabel `purchases`
--
ALTER TABLE `purchases`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;

--
-- AUTO_INCREMENT untuk tabel `purchase_details`
--
ALTER TABLE `purchase_details`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;

--
-- AUTO_INCREMENT untuk tabel `roles`
--
ALTER TABLE `roles`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT untuk tabel `sales`
--
ALTER TABLE `sales`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;

--
-- AUTO_INCREMENT untuk tabel `sale_details`
--
ALTER TABLE `sale_details`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;

--
-- AUTO_INCREMENT untuk tabel `services`
--
ALTER TABLE `services`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT untuk tabel `service_details`
--
ALTER TABLE `service_details`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT untuk tabel `service_status_histories`
--
ALTER TABLE `service_status_histories`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;

--
-- AUTO_INCREMENT untuk tabel `stock_movements`
--
ALTER TABLE `stock_movements`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=45;

--
-- AUTO_INCREMENT untuk tabel `stock_opnames`
--
ALTER TABLE `stock_opnames`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT untuk tabel `stock_opname_details`
--
ALTER TABLE `stock_opname_details`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT untuk tabel `suppliers`
--
ALTER TABLE `suppliers`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT untuk tabel `users`
--
ALTER TABLE `users`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- Ketidakleluasaan untuk tabel pelimpahan (Dumped Tables)
--

--
-- Ketidakleluasaan untuk tabel `customers`
--
ALTER TABLE `customers`
  ADD CONSTRAINT `customers_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Ketidakleluasaan untuk tabel `model_has_permissions`
--
ALTER TABLE `model_has_permissions`
  ADD CONSTRAINT `model_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE;

--
-- Ketidakleluasaan untuk tabel `model_has_roles`
--
ALTER TABLE `model_has_roles`
  ADD CONSTRAINT `model_has_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;

--
-- Ketidakleluasaan untuk tabel `products`
--
ALTER TABLE `products`
  ADD CONSTRAINT `products_brand_id_foreign` FOREIGN KEY (`brand_id`) REFERENCES `brands` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `products_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE;

--
-- Ketidakleluasaan untuk tabel `product_prices`
--
ALTER TABLE `product_prices`
  ADD CONSTRAINT `product_prices_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `product_prices_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE;

--
-- Ketidakleluasaan untuk tabel `product_stocks`
--
ALTER TABLE `product_stocks`
  ADD CONSTRAINT `product_stocks_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `product_stocks_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE;

--
-- Ketidakleluasaan untuk tabel `purchases`
--
ALTER TABLE `purchases`
  ADD CONSTRAINT `purchases_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `purchases_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `purchases_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Ketidakleluasaan untuk tabel `purchase_details`
--
ALTER TABLE `purchase_details`
  ADD CONSTRAINT `purchase_details_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `purchase_details_purchase_id_foreign` FOREIGN KEY (`purchase_id`) REFERENCES `purchases` (`id`) ON DELETE CASCADE;

--
-- Ketidakleluasaan untuk tabel `role_has_permissions`
--
ALTER TABLE `role_has_permissions`
  ADD CONSTRAINT `role_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `role_has_permissions_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;

--
-- Ketidakleluasaan untuk tabel `sales`
--
ALTER TABLE `sales`
  ADD CONSTRAINT `sales_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `sales_cashier_id_foreign` FOREIGN KEY (`cashier_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `sales_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL;

--
-- Ketidakleluasaan untuk tabel `sale_details`
--
ALTER TABLE `sale_details`
  ADD CONSTRAINT `sale_details_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `sale_details_sale_id_foreign` FOREIGN KEY (`sale_id`) REFERENCES `sales` (`id`) ON DELETE CASCADE;

--
-- Ketidakleluasaan untuk tabel `services`
--
ALTER TABLE `services`
  ADD CONSTRAINT `services_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `services_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `services_technician_id_foreign` FOREIGN KEY (`technician_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Ketidakleluasaan untuk tabel `service_details`
--
ALTER TABLE `service_details`
  ADD CONSTRAINT `service_details_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `service_details_service_id_foreign` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON DELETE CASCADE;

--
-- Ketidakleluasaan untuk tabel `service_status_histories`
--
ALTER TABLE `service_status_histories`
  ADD CONSTRAINT `service_status_histories_service_id_foreign` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `service_status_histories_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Ketidakleluasaan untuk tabel `stock_movements`
--
ALTER TABLE `stock_movements`
  ADD CONSTRAINT `stock_movements_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `stock_movements_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `stock_movements_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Ketidakleluasaan untuk tabel `stock_opnames`
--
ALTER TABLE `stock_opnames`
  ADD CONSTRAINT `stock_opnames_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `stock_opnames_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Ketidakleluasaan untuk tabel `stock_opname_details`
--
ALTER TABLE `stock_opname_details`
  ADD CONSTRAINT `stock_opname_details_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `stock_opname_details_stock_opname_id_foreign` FOREIGN KEY (`stock_opname_id`) REFERENCES `stock_opnames` (`id`) ON DELETE CASCADE;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
