-- https://www.phpmyadmin.net/
--
-- Waktu pembuatan: 05 Jul 2022 pada 09.03
-- Versi server: 10.4.24-MariaDB
-- Versi PHP: 8.1.6

START TRANSACTION;



--
-- Database: `edwin-erp-db`
--

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

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

CREATE TABLE `brands` (
  `id` varchar(8) NOT NULL,
  `name` varchar(20) NOT NULL,
  `description` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

INSERT INTO `brands` (`id`, `name`, `description`) VALUES
('MER-0001', 'N1', 'd1'),
('MER-0002', 'N2', 'd2');

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

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

CREATE TABLE `categories` (
  `id` varchar(10) NOT NULL,
  `name` varchar(20) NOT NULL,
  `description` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

INSERT INTO `categories` (`id`, `name`, `description`) VALUES
('CAT-0001', 'n1', 'd1'),
('CAT-0002', 'n2', 'd2'),
('CAT-0003', 'n3', 'd3'),
('CAT-0004', 'n4', 'd4');

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

--
-- Struktur dari tabel `crud_logs`
--

CREATE TABLE `crud_logs` (
  `id` varchar(20) NOT NULL,
  `date_time` datetime NOT NULL,
  `user_id` varchar(10) NOT NULL,
  `table_name` varchar(50) NOT NULL,
  `operation` varchar(20) NOT NULL,
  `primary_key` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

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

CREATE TABLE `customers` (
  `id` varchar(9) NOT NULL,
  `name` varchar(50) NOT NULL,
  `business_entity` varchar(20) NOT NULL,
  `phone_number` int(20) DEFAULT NULL,
  `email` varchar(50) DEFAULT NULL,
  `npwp` int(20) DEFAULT NULL,
  `term` int(10) DEFAULT NULL,
  `discount` double DEFAULT NULL,
  `status` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

INSERT INTO `customers` (`id`, `name`, `business_entity`, `phone_number`, `email`, `npwp`, `term`, `discount`, `status`) VALUES
('CUS-00001', 'N11', 'CV', 11, 'e11', 11, 11, 40, 'active'),
('CUS-00002', 'N1', 'PT', 2, 'e1', 1, 1, 50, 'b'),
('CUS-00003', 'N1', 'PT', 2, 'e1', 1, 1, 50, 'active'),
('CUS-00004', 'N1', 'PT', NULL, 'e1', 1, 1, 50, 'active'),
('CUS-00005', 'N1', 'PT', NULL, 'e1', 1, 1, 50, 'active'),
('CUS-00006', 'N1', 'PT', NULL, 'e1', 1, 1, 50, 'active'),
('CUS-00007', 'N1', 'PT', NULL, 'e1', 1, 1, 50, 'active'),
('CUS-00008', 'N1', 'PT', NULL, 'e1', 1, 1, 50, 'active'),
('CUS-00009', 'N1', 'PT', NULL, 'e1', 1, 1, 50, 'active'),
('CUS-00010', 'N1', 'PT', NULL, 'e1', 1, 1, 50, 'active'),
('CUS-00011', 'N1', 'PT', NULL, 'e1', 1, 1, 50, 'active');

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

--
-- Struktur dari tabel `customer_addresses`
--

CREATE TABLE `customer_addresses` (
  `customer_id` varchar(9) NOT NULL,
  `id` int(5) NOT NULL,
  `address` varchar(250) NOT NULL,
  `city` varchar(100) DEFAULT NULL,
  `sub_district` varchar(100) DEFAULT NULL,
  `urban_village` varchar(100) DEFAULT NULL,
  `postal_code` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `customer_addresses`
--

INSERT INTO `customer_addresses` (`customer_id`, `id`, `address`, `city`, `sub_district`, `urban_village`, `postal_code`) VALUES
('CUS-00004', 1, 'a1', 'k1', 'kk1', 'kkk1', 1),
('CUS-00004', 2, 'a11', 'k11', 'kk11', 'kkk11', 11),
('CUS-00004', 3, 'a1', 'k1', 'kk1', 'kkk1', 1),
('CUS-00004', 4, 'a12', 'k12', 'kk12', 'kkk12', 12),
('CUS-00005', 1, 'a1', 'k1', 'kk1', 'kkk1', 1),
('CUS-00005', 2, 'a11', 'k11', 'kk11', 'kkk11', 11),
('CUS-00010', 1, 'a1', 'k1', 'kk1', 'kkk1', 1),
('CUS-00011', 1, 'a1', 'k1', 'kk1', 'kkk1', 1),
('CUS-00011', 2, 'a11', 'k11', 'kk11', 'kkk11', 11);

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

--
-- Struktur dari tabel `delivery_notes`
--

CREATE TABLE `delivery_notes` (
  `id` varchar(14) NOT NULL,
  `date` date NOT NULL,
  `customer_id` varchar(9) NOT NULL,
  `customer_address` varchar(250) NOT NULL,
  `recipient` varchar(9) NOT NULL,
  `recipient_address` varchar(250) NOT NULL,
  `vehicle` varchar(20) DEFAULT NULL,
  `sender` varchar(50) DEFAULT NULL,
  `notes` varchar(100) DEFAULT NULL,
  `status` varchar(10) NOT NULL,
  `is_delivered` int(1) NOT NULL,
  `sales_invoice_id` varchar(14) DEFAULT NULL,
  `drafted_by` varchar(10) NOT NULL,
  `last_edited_by` varchar(10) NOT NULL,
  `last_edited_at` datetime NOT NULL,
  `submitted_by` varchar(10) DEFAULT NULL,
  `submitted_at` datetime DEFAULT NULL,
  `delivered_by` varchar(10) DEFAULT NULL,
  `delivered_at` datetime DEFAULT NULL,
  `done_by` varchar(10) DEFAULT NULL,
  `done_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `delivery_notes`
--

INSERT INTO `delivery_notes` (`id`, `date`, `customer_id`, `customer_address`, `recipient`, `recipient_address`, `vehicle`, `sender`, `notes`, `status`, `is_delivered`, `sales_invoice_id`, `drafted_by`, `last_edited_by`, `last_edited_at`, `submitted_by`, `submitted_at`, `delivered_by`, `delivered_at`, `done_by`, `done_at`) VALUES
('BM220704-SJ001', '2022-07-04', 'CUS-00001', '1', 'CUS-00001', 'a_pelanggan_baru', 'Skuter', 'Megawatiiii', 'cc', 'Submitted', 1, 'BM/2207/00001', 'EMP-00001', 'EMP-00001', '2022-07-04 16:32:52', 'EMP-00001', '2022-07-04 16:32:52', 'EMP-00001', '2022-07-04 15:32:47', NULL, NULL),
('BM220704-SJ002', '2022-07-04', 'CUS-00001', 'a_pelanggan', 'CUS-00001', 'a_pelanggan', 'Truk', 'Soekarno', 'c1', 'Submitted', 1, 'BM/2207/00001', 'EMP-00001', 'EMP-00001', '2022-07-04 15:29:30', 'EMP-00001', '2022-07-04 15:29:30', 'EMP-00001', '2022-07-04 16:50:56', NULL, NULL);

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

--
-- Struktur dari tabel `delivery_note_details`
--

CREATE TABLE `delivery_note_details` (
  `delivery_note_id` varchar(14) NOT NULL,
  `tally_sheet_id` varchar(14) NOT NULL,
  `sales_order_id` varchar(14) NOT NULL,
  `product_id` varchar(10) NOT NULL,
  `product_alias_name` varchar(100) NOT NULL,
  `product_name` varchar(100) NOT NULL,
  `quantity` double NOT NULL,
  `unit` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `delivery_note_details`
--

INSERT INTO `delivery_note_details` (`delivery_note_id`, `tally_sheet_id`, `sales_order_id`, `product_id`, `product_alias_name`, `product_name`, `quantity`, `unit`) VALUES
('BM220704-SJ001', 'BM220629-TO001', 'BM220629-SO001', 'STO-000001', 'AN', 'N1', 1, 'kg'),
('BM220704-SJ001', 'BM220629-TO001', 'BM220629-SO001', 'STO-000002', 'AN2', 'N2', 1.5, 'kg'),
('BM220704-SJ002', 'BM220629-TO002', 'BM220629-SO001', 'STO-000001', 'AN', 'N1', 1, 'kg'),
('BM220704-SJ002', 'BM220629-TO002', 'BM220629-SO001', 'STO-000002', 'AN2', 'N2', 1.5, 'kg');

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

--
-- Struktur dari tabel `departments`
--

CREATE TABLE `departments` (
  `id` varchar(10) NOT NULL,
  `name` varchar(20) NOT NULL,
  `description` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `departments`
--

INSERT INTO `departments` (`id`, `name`, `description`) VALUES
('D-00001', 'DD1d', 'dd1d'),
('D-00003', 'D3', 'd3'),
('D-00004', 'A3', 'a3'),
('D-00005', 'D1', 'd1'),
('D-00006', 'D1', 'd1'),
('D-00007', 'D1', 'd1'),
('D-00008', 'D1', 'd1'),
('D-00009', 'D1', 'd1'),
('D-00010', 'D1', 'd1'),
('D-00011', 'D1', 'd1'),
('D-00012', 'D1111', 'd1111');

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

--
-- Struktur dari tabel `employees`
--

CREATE TABLE `employees` (
  `id` varchar(9) NOT NULL,
  `nip` varchar(20) DEFAULT NULL,
  `name` varchar(50) NOT NULL,
  `initial` varchar(5) DEFAULT NULL,
  `department_id` varchar(10) DEFAULT NULL,
  `position_id` varchar(10) DEFAULT NULL,
  `email` varchar(50) DEFAULT NULL,
  `phone_number` int(20) DEFAULT NULL,
  `nik` int(20) DEFAULT NULL,
  `npwp` int(20) DEFAULT NULL,
  `date_of_birth` date DEFAULT NULL,
  `start_date` date DEFAULT NULL,
  `address` varchar(250) DEFAULT NULL,
  `city` varchar(100) DEFAULT NULL,
  `sub_district` varchar(100) DEFAULT NULL,
  `urban_village` varchar(100) DEFAULT NULL,
  `postal_code` int(10) DEFAULT NULL,
  `status` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `employees`
--

INSERT INTO `employees` (`id`, `nip`, `name`, `initial`, `department_id`, `position_id`, `email`, `phone_number`, `nik`, `npwp`, `date_of_birth`, `start_date`, `address`, `city`, `sub_district`, `urban_village`, `postal_code`, `status`) VALUES
('EMP-00001', '11', 'EMP1', 'e11', 'D-00012', 'P-00003', 'e11', 11, 11, 11, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'active'),
('EMP-00002', '1', 'EMP2', 'e1', 'D-00012', 'P-00003', 'e1', NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'active'),
('EMP-00003', '12', 'E12', 'e12', NULL, NULL, 'e12', 12, 12, 12, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'active'),
('EMP-00004', '12', 'E12', 'e12', NULL, NULL, 'e12', 12, 12, 12, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'active'),
('EMP-00005', '12', 'E12', 'e12', NULL, NULL, 'e12', 12, 12, 12, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'active'),
('EMP-00006', '12', 'E12', 'e12', NULL, NULL, 'e12', 12, 12, 12, NULL, NULL, 'a1', 'k1', 'kc1', 'kl1', 1, 'active');

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

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

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

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

--
-- Struktur dari tabel `grades`
--

CREATE TABLE `grades` (
  `id` varchar(10) NOT NULL,
  `name` varchar(50) NOT NULL,
  `description` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `grades`
--

INSERT INTO `grades` (`id`, `name`, `description`) VALUES
('G-00001', 'N11', 'dd1'),
('G-00002', 'NEWW', 'NEWW D');

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

--
-- Struktur dari tabel `groups`
--

CREATE TABLE `groups` (
  `id` varchar(10) NOT NULL,
  `name` varchar(50) NOT NULL,
  `description` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `groups`
--

INSERT INTO `groups` (`id`, `name`, `description`) VALUES
('G-00001', 'admin', 'admin_desc'),
('G-00002', 'Human Resources', NULL),
('G-00003', 'N11', 'D11'),
('G-00004', 'Human Resources', NULL),
('G-00005', 'Human Resources', NULL),
('G-00006', 'Human Resources', NULL),
('G-00007', 'Human Resources', NULL),
('G-00008', 'Human Resources', NULL),
('G-00009', 'Human Resources', NULL),
('G-00010', 'Human Resources', NULL),
('G-00011', 'Human Resources', NULL),
('G-00012', 'Human Resources', NULL);

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

--
-- Struktur dari tabel `group_access_rights`
--

CREATE TABLE `group_access_rights` (
  `group_id` varchar(10) NOT NULL,
  `module_id` varchar(10) NOT NULL,
  `menu_id` int(5) NOT NULL,
  `access_right_id` int(5) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `group_access_rights`
--

INSERT INTO `group_access_rights` (`group_id`, `module_id`, `menu_id`, `access_right_id`) VALUES
('G-00001', 'MOD-004', 15, 1),
('G-00001', 'MOD-004', 15, 2),
('G-00001', 'MOD-004', 15, 3),
('G-00001', 'MOD-004', 15, 4),
('G-00001', 'MOD-004', 16, 1),
('G-00001', 'MOD-004', 16, 2),
('G-00001', 'MOD-004', 16, 3),
('G-00001', 'MOD-004', 16, 4),
('G-00002', 'MOD-004', 1, 1),
('G-00002', 'MOD-004', 1, 2),
('G-00002', 'MOD-004', 1, 3),
('G-00002', 'MOD-004', 1, 4),
('G-00002', 'MOD-004', 2, 1),
('G-00002', 'MOD-004', 2, 2),
('G-00002', 'MOD-004', 2, 3),
('G-00002', 'MOD-004', 2, 4),
('G-00002', 'MOD-004', 2, 5),
('G-00002', 'MOD-004', 2, 6),
('G-00002', 'MOD-004', 2, 7),
('G-00002', 'MOD-004', 2, 8),
('G-00002', 'MOD-004', 2, 9),
('G-00002', 'MOD-004', 2, 10),
('G-00002', 'MOD-004', 3, 1),
('G-00002', 'MOD-004', 3, 2),
('G-00002', 'MOD-004', 3, 3),
('G-00002', 'MOD-004', 3, 4),
('G-00002', 'MOD-004', 4, 1),
('G-00002', 'MOD-004', 4, 2),
('G-00002', 'MOD-004', 4, 3),
('G-00002', 'MOD-004', 4, 4),
('G-00002', 'MOD-004', 5, 1),
('G-00002', 'MOD-004', 5, 2),
('G-00002', 'MOD-004', 5, 3),
('G-00002', 'MOD-004', 5, 4),
('G-00002', 'MOD-004', 6, 1),
('G-00002', 'MOD-004', 6, 2),
('G-00002', 'MOD-004', 6, 3),
('G-00002', 'MOD-004', 6, 4),
('G-00002', 'MOD-004', 7, 1),
('G-00002', 'MOD-004', 7, 2),
('G-00002', 'MOD-004', 7, 3),
('G-00002', 'MOD-004', 7, 4),
('G-00002', 'MOD-004', 8, 1),
('G-00002', 'MOD-004', 8, 2),
('G-00002', 'MOD-004', 8, 3),
('G-00002', 'MOD-004', 8, 4),
('G-00002', 'MOD-004', 9, 1),
('G-00002', 'MOD-004', 9, 2),
('G-00002', 'MOD-004', 9, 3),
('G-00002', 'MOD-004', 9, 4),
('G-00002', 'MOD-004', 10, 1),
('G-00002', 'MOD-004', 10, 2),
('G-00002', 'MOD-004', 10, 3),
('G-00002', 'MOD-004', 10, 4),
('G-00002', 'MOD-004', 11, 1),
('G-00002', 'MOD-004', 11, 2),
('G-00002', 'MOD-004', 11, 3),
('G-00002', 'MOD-004', 11, 4),
('G-00002', 'MOD-004', 12, 1),
('G-00002', 'MOD-004', 12, 2),
('G-00002', 'MOD-004', 12, 3),
('G-00002', 'MOD-004', 12, 4),
('G-00002', 'MOD-004', 13, 1),
('G-00002', 'MOD-004', 13, 2),
('G-00002', 'MOD-004', 13, 3),
('G-00002', 'MOD-004', 13, 4),
('G-00002', 'MOD-004', 14, 1),
('G-00002', 'MOD-004', 14, 2),
('G-00002', 'MOD-004', 14, 3),
('G-00002', 'MOD-004', 14, 4),
('G-00002', 'MOD-004', 15, 1),
('G-00002', 'MOD-004', 15, 2),
('G-00002', 'MOD-004', 15, 3),
('G-00002', 'MOD-004', 15, 4),
('G-00002', 'MOD-004', 16, 1),
('G-00002', 'MOD-004', 16, 2),
('G-00002', 'MOD-004', 16, 3),
('G-00002', 'MOD-004', 16, 4),
('G-00002', 'MOD-004', 17, 1),
('G-00002', 'MOD-004', 17, 2),
('G-00002', 'MOD-004', 17, 3),
('G-00002', 'MOD-004', 17, 4),
('G-00002', 'MOD-004', 18, 1),
('G-00002', 'MOD-004', 18, 2),
('G-00002', 'MOD-004', 18, 3),
('G-00002', 'MOD-004', 18, 4),
('G-00002', 'MOD-004', 18, 5),
('G-00002', 'MOD-004', 18, 6),
('G-00002', 'MOD-004', 19, 1),
('G-00002', 'MOD-004', 19, 2),
('G-00002', 'MOD-004', 19, 3),
('G-00002', 'MOD-004', 19, 4),
('G-00002', 'MOD-004', 20, 1),
('G-00002', 'MOD-004', 20, 2),
('G-00002', 'MOD-004', 20, 3),
('G-00002', 'MOD-004', 20, 4),
('G-00011', 'MOD-004', 16, 1),
('G-00011', 'MOD-004', 16, 2),
('G-00012', 'MOD-004', 16, 1),
('G-00012', 'MOD-004', 16, 2);

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

--
-- Struktur dari tabel `group_users`
--

CREATE TABLE `group_users` (
  `group_id` varchar(10) NOT NULL,
  `user_id` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `group_users`
--

INSERT INTO `group_users` (`group_id`, `user_id`) VALUES
('G-00001', 'USER-00001'),
('G-00002', 'USER-00001'),
('G-00010', 'USER-00001'),
('G-00011', 'USER-00001'),
('G-00012', 'USER-00001'),
('G-00001', 'USER-00002'),
('G-00002', 'USER-00002'),
('G-00010', 'USER-00002'),
('G-00011', 'USER-00002'),
('G-00012', 'USER-00002'),
('G-00004', 'USER-00004'),
('G-00005', 'USER-00004'),
('G-00004', 'USER-00005'),
('G-00005', 'USER-00005'),
('G-00004', 'USER-00011'),
('G-00005', 'USER-00011');

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

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

CREATE TABLE `migrations` (
  `id` int(10) UNSIGNED NOT NULL,
  `migration` varchar(255) COLLATE utf8mb4_unicode_ci 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, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_resets_table', 1),
(3, '2016_06_01_000001_create_oauth_auth_codes_table', 1),
(4, '2016_06_01_000002_create_oauth_access_tokens_table', 1),
(5, '2016_06_01_000003_create_oauth_refresh_tokens_table', 1),
(6, '2016_06_01_000004_create_oauth_clients_table', 1),
(7, '2016_06_01_000005_create_oauth_personal_access_clients_table', 1),
(8, '2019_08_19_000000_create_failed_jobs_table', 1),
(9, '2019_12_14_000001_create_personal_access_tokens_table', 1);

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

--
-- Struktur dari tabel `modules`
--

CREATE TABLE `modules` (
  `id` varchar(10) NOT NULL,
  `name` varchar(50) NOT NULL,
  `number` int(5) DEFAULT NULL,
  `description` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `modules`
--

INSERT INTO `modules` (`id`, `name`, `number`, `description`) VALUES
('MOD-001', 'misc', 99, NULL),
('MOD-002', 'Sales', 1, NULL),
('MOD-003', 'inventory', 2, NULL),
('MOD-004', 'All', 0, NULL);

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

--
-- Struktur dari tabel `module_menus`
--

CREATE TABLE `module_menus` (
  `module_id` varchar(10) NOT NULL,
  `id` int(5) NOT NULL,
  `name` varchar(50) NOT NULL,
  `description` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `module_menus`
--

INSERT INTO `module_menus` (`module_id`, `id`, `name`, `description`) VALUES
('MOD-001', 1, 'test', 't'),
('MOD-002', 1, 'Customer', NULL),
('MOD-004', 1, 'User', NULL),
('MOD-004', 2, 'Group', NULL),
('MOD-004', 3, 'Department', NULL),
('MOD-004', 4, 'Position', NULL),
('MOD-004', 5, 'Employee', NULL),
('MOD-004', 6, 'Customer', NULL),
('MOD-004', 7, 'Warehouse', NULL),
('MOD-004', 8, 'Grade', NULL),
('MOD-004', 9, 'Type', NULL),
('MOD-004', 10, 'Piece', NULL),
('MOD-004', 11, 'Category', NULL),
('MOD-004', 12, 'Brand', NULL),
('MOD-004', 13, 'Product', NULL),
('MOD-004', 14, 'Tax', NULL),
('MOD-004', 15, 'Sales Order', NULL),
('MOD-004', 16, 'Tally Sheet', NULL),
('MOD-004', 17, 'Surat Jalan', NULL),
('MOD-004', 18, 'Faktur Penjualan', NULL),
('MOD-004', 19, 'Pelunasan Faktur', NULL),
('MOD-004', 20, 'Retur Penjualan', NULL);

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

--
-- Struktur dari tabel `module_menu_access_rights`
--

CREATE TABLE `module_menu_access_rights` (
  `module_id` varchar(10) NOT NULL,
  `module_menu_id` int(5) NOT NULL,
  `id` int(5) NOT NULL,
  `name` varchar(100) NOT NULL,
  `ability_name` varchar(100) DEFAULT NULL,
  `ability_name_parent` varchar(100) DEFAULT NULL,
  `description` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `module_menu_access_rights`
--

INSERT INTO `module_menu_access_rights` (`module_id`, `module_menu_id`, `id`, `name`, `ability_name`, `ability_name_parent`, `description`) VALUES
('MOD-002', 1, 1, 'Create Customer', 'create-customer', NULL, NULL),
('MOD-002', 1, 2, 'Read Customer', 'read-customer', NULL, NULL),
('MOD-002', 1, 3, 'Update Customer', 'update-customer', NULL, NULL),
('MOD-002', 1, 4, 'Delete Customer', 'delete-customer', NULL, NULL),
('MOD-004', 1, 1, 'create', 'create-user', NULL, NULL),
('MOD-004', 1, 2, 'Read', 'read-user', NULL, NULL),
('MOD-004', 1, 3, 'Update', 'update-user', NULL, NULL),
('MOD-004', 1, 4, 'Delete', 'delete-user', NULL, NULL),
('MOD-004', 2, 1, 'Create', 'create-group', NULL, NULL),
('MOD-004', 2, 2, 'Read', 'read-group', NULL, NULL),
('MOD-004', 2, 3, 'Update', 'update-group', NULL, NULL),
('MOD-004', 2, 4, 'Delete', 'delete-group', NULL, NULL),
('MOD-004', 2, 5, 'Create Group User', 'create-group_user', NULL, NULL),
('MOD-004', 2, 6, 'Read Group User', 'read-group_user', NULL, NULL),
('MOD-004', 2, 7, 'Delete Group User', 'delete-group_user', NULL, NULL),
('MOD-004', 2, 8, 'Create Group Access Right', 'create-group_access_right', NULL, NULL),
('MOD-004', 2, 9, 'Read Group Access Right', 'read-group_access_right', NULL, NULL),
('MOD-004', 2, 10, 'Delete Group Access Right', 'delete-group_access_right', NULL, NULL),
('MOD-004', 3, 1, 'Create Department', 'create-department', NULL, NULL),
('MOD-004', 3, 2, 'Read Department', 'read-department', NULL, NULL),
('MOD-004', 3, 3, 'Update Department', 'update-department', NULL, NULL),
('MOD-004', 3, 4, 'Delete Department', 'delete-department', NULL, NULL),
('MOD-004', 4, 1, 'Create Position', 'create-position', NULL, NULL),
('MOD-004', 4, 2, 'Read Position', 'read-position', NULL, NULL),
('MOD-004', 4, 3, 'Update Position', 'update-position', NULL, NULL),
('MOD-004', 4, 4, 'Delete Position', 'delete-position', NULL, NULL),
('MOD-004', 5, 1, 'Create Employee', 'create-employee', NULL, NULL),
('MOD-004', 5, 2, 'Read Employee', 'read-employee', NULL, NULL),
('MOD-004', 5, 3, 'Update Employee', 'update-employee', NULL, NULL),
('MOD-004', 5, 4, 'Delete Employee', 'delete-employee', NULL, NULL),
('MOD-004', 6, 1, 'Create Customer', 'create-customer', NULL, NULL),
('MOD-004', 6, 2, 'Read Customer', 'read-customer', NULL, NULL),
('MOD-004', 6, 3, 'Update Customer', 'update-customer', NULL, NULL),
('MOD-004', 6, 4, 'Delete Customer', 'delete-customer', NULL, NULL),
('MOD-004', 7, 1, 'Create Warehouse', 'create-warehouse', NULL, NULL),
('MOD-004', 7, 2, 'Read Warehouse', 'read-warehouse', NULL, NULL),
('MOD-004', 7, 3, 'Update Warehouse', 'update-warehouse', NULL, NULL),
('MOD-004', 7, 4, 'Delete Warehouse', 'delete-warehouse', NULL, NULL),
('MOD-004', 8, 1, 'Create Grade', 'create-grade', NULL, NULL),
('MOD-004', 8, 2, 'Read Grade', 'read-grade', NULL, NULL),
('MOD-004', 8, 3, 'Update Grade', 'update-grade', NULL, NULL),
('MOD-004', 8, 4, 'Delete Grade', 'delete-grade', NULL, NULL),
('MOD-004', 9, 1, 'Create Type', 'create-type', NULL, NULL),
('MOD-004', 9, 2, 'Read Type', 'read-type', NULL, NULL),
('MOD-004', 9, 3, 'Update Type', 'update-type', NULL, NULL),
('MOD-004', 9, 4, 'Delete Type', 'delete-type', NULL, NULL),
('MOD-004', 10, 1, 'Create Piece', 'create-piece', NULL, NULL),
('MOD-004', 10, 2, 'Read Piece', 'read-piece', NULL, NULL),
('MOD-004', 10, 3, 'Update Piece', 'update-piece', NULL, NULL),
('MOD-004', 10, 4, 'Delete Piece', 'delete-piece', NULL, NULL),
('MOD-004', 11, 1, 'Create Category', 'create-category', NULL, NULL),
('MOD-004', 11, 2, 'Read Category', 'read-category', NULL, NULL),
('MOD-004', 11, 3, 'Update Category', 'update-category', NULL, NULL),
('MOD-004', 11, 4, 'Delete Category', 'delete-category', NULL, NULL),
('MOD-004', 12, 1, 'Create Brand', 'create-brand', NULL, NULL),
('MOD-004', 12, 2, 'Read Brand', 'read-brand', NULL, NULL),
('MOD-004', 12, 3, 'Update Brand', 'update-brand', NULL, NULL),
('MOD-004', 12, 4, 'Delete Brand', 'delete-brand', NULL, NULL),
('MOD-004', 13, 1, 'Create Product', 'create-product', NULL, NULL),
('MOD-004', 13, 2, 'Read Product', 'read-product', NULL, NULL),
('MOD-004', 13, 3, 'Update Product', 'update-product', NULL, NULL),
('MOD-004', 13, 4, 'Delete Product', 'delete-product', NULL, NULL),
('MOD-004', 14, 1, 'Create Tax', 'create-tax', NULL, NULL),
('MOD-004', 14, 2, 'Read Tax', 'read-tax', NULL, NULL),
('MOD-004', 14, 3, 'Update Tax', 'update-tax', NULL, NULL),
('MOD-004', 14, 4, 'Delete Tax', 'delete-tax', NULL, NULL),
('MOD-004', 15, 1, 'Buat Pesanan Penjualan', 'create-sales_order', NULL, NULL),
('MOD-004', 15, 2, 'Baca Pesanan Penjualan', 'read-sales_order', NULL, NULL),
('MOD-004', 15, 3, 'Ubah Pesanan Penjualan', 'update-sales_order', NULL, NULL),
('MOD-004', 15, 4, 'Hapus Pesanan Penjualan', 'delete-sales_order', NULL, NULL),
('MOD-004', 16, 1, 'Buat Tally Sheet', 'create-tally_sheet', NULL, NULL),
('MOD-004', 16, 2, 'Baca Tally Sheet', 'read-tally_sheet', NULL, NULL),
('MOD-004', 16, 3, 'Ubah Tally Sheet', 'update-tally_sheet', NULL, NULL),
('MOD-004', 16, 4, 'Hapus Tally Sheet', 'delete-tally_sheet', NULL, NULL),
('MOD-004', 17, 1, 'Buat Surat Jalan', 'create-delivery_note', NULL, NULL),
('MOD-004', 17, 2, 'Baca Surat Jalan', 'read-delivery_note', NULL, NULL),
('MOD-004', 17, 3, 'Ubah Surat Jalan', 'update-delivery_note', NULL, NULL),
('MOD-004', 17, 4, 'Hapus Surat Jalan', 'delete-delivery_note', NULL, NULL),
('MOD-004', 18, 1, 'Buat Faktur Penjualan', 'create-sales_invoice', NULL, NULL),
('MOD-004', 18, 2, 'Baca Faktur Penjualan', 'read-sales_invoice', NULL, NULL),
('MOD-004', 18, 3, 'Ubah Faktur Penjualan', 'update-sales_invoice', NULL, NULL),
('MOD-004', 18, 4, 'Hapus Faktur Penjualan', 'delete-sales_invoice', NULL, NULL),
('MOD-004', 18, 5, 'Ubah Status Faktur Penjualan dari Submitted ke Draft', 'submitted_to_draft-sales_invoice', NULL, NULL),
('MOD-004', 18, 6, 'Void Faktur Penjualan', 'void-sales_invoice', NULL, NULL),
('MOD-004', 19, 1, 'Buat Pelunasan Faktur', 'create-invoice_payment', NULL, NULL),
('MOD-004', 19, 2, 'Baca Pelunasan Faktur', 'read-invoice_payment', NULL, NULL),
('MOD-004', 19, 3, 'Ubah Pelunasan Faktur', 'update-invoice_payment', NULL, NULL),
('MOD-004', 19, 4, 'Hapus Pelunasan Faktur', 'delete-invoice_payment', NULL, NULL),
('MOD-004', 20, 1, 'Buat Retur Penjualan', 'create-sales_return', NULL, NULL),
('MOD-004', 20, 2, 'Baca Retur Penjualan', 'read-sales_return', NULL, NULL),
('MOD-004', 20, 3, 'Ubah Retur Penjualan', 'update-sales_return', NULL, NULL),
('MOD-004', 20, 4, 'Hapus Retur Penjualan', 'delete-sales_return', NULL, NULL);

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

--
-- Struktur dari tabel `oauth_access_tokens`
--

CREATE TABLE `oauth_access_tokens` (
  `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `client_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `scopes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `revoked` tinyint(1) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `expires_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `oauth_access_tokens`
--

INSERT INTO `oauth_access_tokens` (`id`, `user_id`, `client_id`, `name`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) VALUES
('03c23f6a5398e643dd8f0032a754949e3bf70c2740c2112c961e06acec60ac39fc5136b57bdf683a', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-02 08:13:37', '2022-06-02 08:13:37', '2023-06-02 15:13:37'),
('0b1efd3bc8b530c622d012e7fa3438100d215860a3f78fe92acc7ee482d7c951132da31ab851082f', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-03 01:48:32', '2022-06-03 01:48:32', '2023-06-03 08:48:32'),
('1897b07eca5d849fd2703e31aab3bf37168fae854a238c0d9844d69f563eb26967a2d4bba68e319d', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-02 08:15:47', '2022-06-02 08:15:47', '2023-06-02 15:15:47'),
('237e12c0e55c9a33737e89d866582144ddae3c29fc244cb210a1c4145f0b744cee26fc12b39ea51c', 'USER-00002', 1, 'Auth Token', '[]', 0, '2022-06-03 07:19:24', '2022-06-03 07:19:24', '2023-06-03 14:19:24'),
('23f3e276688fd654bd9de9aea7fc5a83737d0462a0686c7a3e591106b979673b8e03b64b60d313ee', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-08 04:08:32', '2022-06-08 04:08:32', '2023-06-08 11:08:32'),
('25bbe59d3a659be6640df4e786c9b4713bea808cfdf31868e2b6648538063bbc1c90d19f70577a13', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-08 05:09:29', '2022-06-08 05:09:29', '2023-06-08 12:09:29'),
('2b728668c877154bdf118fd3dd1c0f62ae61b818621a74a935f5fb3d9b5886db6d826facb2b07f50', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-02 07:29:10', '2022-06-02 07:29:10', '2023-06-02 14:29:10'),
('2ce0fecb132dba6899cec0c52eb667ef05a80a5eb0c114a10d80e7896f4c4b401637d81d519c5613', 'USER-00003', 1, 'Auth Token', '[]', 0, '2022-06-02 06:20:46', '2022-06-02 06:20:46', '2023-06-02 13:20:46'),
('3e1582b1791a2ebc93c543bd99517c8b338f589d62a320d8a3ee6ce0aa91433780dccae1dc0e29ae', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-02 07:59:08', '2022-06-02 07:59:08', '2023-06-02 14:59:08'),
('3e875e06ab796a2d36059f204fae0d138297b020c609feded03cb48fe142eff69626ebaa40b399fe', 'USER-00002', 1, 'Auth Token', '[]', 0, '2022-06-14 10:44:13', '2022-06-14 10:44:13', '2023-06-14 17:44:13'),
('4161b4572f867030704d120d833ab3c017d7ab15a45d0960d7cf6414e5a1daf28d0deaca3a00f782', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-08 04:05:17', '2022-06-08 04:05:17', '2023-06-08 11:05:17'),
('47128fbebde72800347d49d8c3a0ec710e5848d592710a25754abcf0118f2a0b60a469b8ac132d6b', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-03 07:21:25', '2022-06-03 07:21:25', '2023-06-03 14:21:25'),
('54e49186b86662a7d7c6b526d2b0fd82de033eec8ae54e7f8244bc1f88819be19f25602ce38a8de7', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-09 09:08:27', '2022-06-09 09:08:27', '2023-06-09 16:08:27'),
('5820ae1ffc6092d4b14f17c7e0c1fd754c4f6452776fe913860a6479aa2bf5811cb324da110fee63', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-08 04:06:21', '2022-06-08 04:06:21', '2023-06-08 11:06:21'),
('5b5e1f0afc333d34ee36a614403b8a3e940f9f58f6f5552c33e3025985c94cfeb5784da7d109b2e8', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-03 03:05:06', '2022-06-03 03:05:06', '2023-06-03 10:05:06'),
('739cc5d5516f4d6b090cac8f7dce2fd81e1d0971cc68feb017cb86aa0ebd460d75fb13e66841f5da', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-08 04:02:03', '2022-06-08 04:02:03', '2023-06-08 11:02:03'),
('749ec1f320f4ba28455fe3233e9eaa1851fac41b6b2aa446ed70ea00f5c39f785a52a3a85c9db3ff', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-08 04:04:20', '2022-06-08 04:04:20', '2023-06-08 11:04:20'),
('7adf9ec4a9661fdb005cf2a28c36c625bc25cb6f5373a98106396538d0738541f430baa0bdcfdefb', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-05-22 19:04:36', '2022-05-22 19:04:36', '2023-05-23 02:04:36'),
('7c9278d6fa702fb10cebb80d74752c78b05da6bb5bec039c5decc4a4fc5e5df07a129a8a50eb0fc6', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-08 04:03:42', '2022-06-08 04:03:42', '2023-06-08 11:03:42'),
('7d8627824b60fa856a75545a80447aee5f7c78410f2c7e9cea5dae23983c8c49ee35ac125d8fe12f', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-02 08:34:51', '2022-06-02 08:34:51', '2023-06-02 15:34:51'),
('820188123320e113a3bbbb6e00aee97d915b17fd2e82a17894205648481d383cfb578d70d6c4e654', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-02 07:56:52', '2022-06-02 07:56:52', '2023-06-02 14:56:52'),
('858ec902fe88ffade930be697bb4289b9033ba4137c1a5a7b71d8c69c36e0227cd454fd18fb1c17d', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-02 08:34:51', '2022-06-02 08:34:51', '2023-06-02 15:34:51'),
('88699547212b859103a3f2c855458588bb4f6124060a1c75ecdc9691b554a7ac5e336cd99f1b1841', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-02 07:28:00', '2022-06-02 07:28:00', '2023-06-02 14:28:00'),
('8ca511639c14eff4acccae48d426a164b4023cb1e7ad9d90b750dfe16d97784bb2f0406a9422b94d', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-02 08:41:39', '2022-06-02 08:41:39', '2023-06-02 15:41:39'),
('8eb43ec4fb145c14e90d83866818bec0853bb9b232501daa5d218ca1d498ae184e1e4b822b7196e4', 'USER-00003', 1, 'Auth Token', '[]', 0, '2022-06-02 06:22:10', '2022-06-02 06:22:10', '2023-06-02 13:22:10'),
('91552140d3e33882c85add634997fd46d11a81841a54b027e6a0a46c01d5cfb72357252fc0ec279e', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-02 07:57:55', '2022-06-02 07:57:55', '2023-06-02 14:57:55'),
('983a160f642ad1a6adc0c9e6fa2d6e98155ea858350312e372b9acac1af9f62d85caebf6f0e1ea48', 'USER-00002', 1, 'Auth Token', '[]', 0, '2022-06-17 06:48:50', '2022-06-17 06:48:50', '2023-06-17 13:48:50'),
('9ecabdcb171dba3f75f762032aa06c1419eecf82fd5c38e58e1864779a05bbf9fd14c5f714f37d66', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-03 01:49:15', '2022-06-03 01:49:15', '2023-06-03 08:49:15'),
('a510d78de4ae9ea19fd826dbe743940f271eb4632c3bab21049c6395adb7ab3a1ea6452a5b3c1888', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-02 06:32:02', '2022-06-02 06:32:02', '2023-06-02 13:32:02'),
('a7cce6d20c7e27ad60cc1b1372fb2df9672122dd9bfa8b903a4def576f6ad101958ce40339251a57', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-24 11:30:12', '2022-06-24 11:30:12', '2023-06-24 18:30:12'),
('b79042e7ab6927f0325d4e297019501436b21f38b0b70f1b76dde9c94c5fbf45d506a73da3b6240a', 'USER-00003', 1, 'Auth Token', '[]', 0, '2022-06-02 06:29:32', '2022-06-02 06:29:32', '2023-06-02 13:29:32'),
('bea4ffb191d73833dcae2fa497a79565c39009b80be84763fb1534bd2d67c138006b994af7784671', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-02 07:54:45', '2022-06-02 07:54:45', '2023-06-02 14:54:45'),
('cacd3893615f7a5200533e4e339edc5c96182788f6688a4723da0757462aab78fa21e190f2cef577', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-08 04:08:42', '2022-06-08 04:08:42', '2023-06-08 11:08:42'),
('cf5673cdcffa64957b467a263953174220a5e33565cf436af0d2d5bd7cc900693d472bf9e7f83660', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-02 07:28:47', '2022-06-02 07:28:47', '2023-06-02 14:28:47'),
('d02133ee02f30cdae21831d4a9fea620de529f4f3472b8161d8596d8207c2d4129d3cab9b334e4cd', 'USER-00005', 1, 'Auth Token', '[]', 0, '2022-06-13 03:51:18', '2022-06-13 03:51:18', '2023-06-13 10:51:18'),
('d299e3a6c229cb98ffd83e1e9c81c3012fa05e3c36a0a15f2308aa96839e8a0684abfa723dc4afe0', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-02 08:12:30', '2022-06-02 08:12:30', '2023-06-02 15:12:30'),
('d5a739b8be963fb307b40ace3e0890b48d33a63dfe5a54c8b9803e2056951c2c01006f9f9f49ea8a', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-14 10:07:27', '2022-06-14 10:07:27', '2023-06-14 17:07:27'),
('d8a4bfcd09839c88b358fb9c6d763677af18909097ca0df610c9869297fcd4c292a65b5c7fa9f30f', 'USER-00004', 1, 'Auth Token', '[]', 0, '2022-06-14 05:19:43', '2022-06-14 05:19:43', '2023-06-14 12:19:43'),
('de163f9ef46809bc46d7d5ba035be501d4461de0091a4c80f95afd6f253e9200751197963f7bbf66', 'USER-00003', 1, 'Auth Token', '[]', 0, '2022-06-02 05:10:21', '2022-06-02 05:10:21', '2023-06-02 12:10:21'),
('e2e68813c5bf8f37f367ea9c040135fb59b888d414d3232c9daf0156fcb868d1f60a51e458168d1d', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-02 07:56:33', '2022-06-02 07:56:33', '2023-06-02 14:56:33'),
('e53a435ffc3cd06c54b40e739a01396bb587766e6b298af1f002626025737eaceb161acff4068dd7', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-03 07:19:06', '2022-06-03 07:19:06', '2023-06-03 14:19:06'),
('e8cde4858e9dcd4a204b9f9f5771c7beb01cc39f106ea3766f2f1800830b6fa6eb2741bcba5a5d11', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-02 07:56:52', '2022-06-02 07:56:52', '2023-06-02 14:56:52'),
('ea435b649d29eb329549b7636be742106f4d21f4717cf19435084604e1d228491ffe800396c5aa1d', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-02 08:34:51', '2022-06-02 08:34:51', '2023-06-02 15:34:51'),
('ec4169dd15d9c6c61b1760897fda18cd3fabe19112645fcf56db2f7a8e4fe034439743c2e8e4fb83', 'USER-00003', 1, 'Auth Token', '[]', 0, '2022-06-02 06:23:55', '2022-06-02 06:23:55', '2023-06-02 13:23:55'),
('ee501f0bff4cd3b7737ae5bf47b5fc8ecaf49d97b731d2d53638ef721750b2b026659b71bba430d9', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-10 12:03:45', '2022-06-10 12:03:45', '2023-06-10 19:03:45'),
('f02fd71ebd18320063d645388454f8131b108a997ba55aaadd9f3e4376eb874c719d3a64de8b2d01', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-02 07:56:52', '2022-06-02 07:56:52', '2023-06-02 14:56:52'),
('f54326603990696e94577969aafeaff6b9fed3a640b641ccc5c43f7fa46133d2a4812b8099046a4e', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-02 08:34:41', '2022-06-02 08:34:41', '2023-06-02 15:34:41'),
('f6d6c3fa8213a5ed136797a30300c3a3788d0f15e2ae262bfbf843b0c8306258c73a90db0c9d3290', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-02 06:34:44', '2022-06-02 06:34:44', '2023-06-02 13:34:44'),
('fa86fa489bd4453d13e5adc7351170a188f1c529c8184201c45bd895f737abc6f73fda4a2ba0707d', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-02 08:34:40', '2022-06-02 08:34:40', '2023-06-02 15:34:40'),
('fd5c75dcecdc679149907dcd0988dca938ba01089d92fd103815149be4e03a165fcbd82e2afc8290', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-02 08:36:41', '2022-06-02 08:36:41', '2023-06-02 15:36:41'),
('fdc02c058f5bedb9df76b3ba9a32750f9ccc541a43648f6945d79ee11d349c0e90b3f13c63c7c2d9', 'USER-00001', 1, 'Auth Token', '[]', 0, '2022-06-14 10:07:41', '2022-06-14 10:07:41', '2023-06-14 17:07:41');

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

--
-- Struktur dari tabel `oauth_auth_codes`
--

CREATE TABLE `oauth_auth_codes` (
  `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `client_id` bigint(20) UNSIGNED NOT NULL,
  `scopes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `revoked` tinyint(1) NOT NULL,
  `expires_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Struktur dari tabel `oauth_clients`
--

CREATE TABLE `oauth_clients` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `secret` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `provider` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `redirect` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `personal_access_client` tinyint(1) NOT NULL,
  `password_client` tinyint(1) NOT NULL,
  `revoked` tinyint(1) 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 `oauth_clients`
--

INSERT INTO `oauth_clients` (`id`, `user_id`, `name`, `secret`, `provider`, `redirect`, `personal_access_client`, `password_client`, `revoked`, `created_at`, `updated_at`) VALUES
(1, NULL, 'Laravel Personal Access Client', 'eobX5csKyvBY29Erf6rwVSky5jDnS4J4mKOCgqJk', NULL, 'http://localhost', 1, 0, 0, '2022-05-22 18:55:52', '2022-05-22 18:55:52'),
(2, NULL, 'Laravel Password Grant Client', 'DjfAQW6QVjVCNqhXhuk8W6Td8QdOVYH8i72U7czA', 'users', 'http://localhost', 0, 1, 0, '2022-05-22 18:55:52', '2022-05-22 18:55:52');

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

--
-- Struktur dari tabel `oauth_personal_access_clients`
--

CREATE TABLE `oauth_personal_access_clients` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `client_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 `oauth_personal_access_clients`
--

INSERT INTO `oauth_personal_access_clients` (`id`, `client_id`, `created_at`, `updated_at`) VALUES
(1, 1, '2022-05-22 18:55:52', '2022-05-22 18:55:52');

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

--
-- Struktur dari tabel `oauth_refresh_tokens`
--

CREATE TABLE `oauth_refresh_tokens` (
  `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `access_token_id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `revoked` tinyint(1) NOT NULL,
  `expires_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Struktur dari tabel `pieces`
--

CREATE TABLE `pieces` (
  `id` varchar(10) NOT NULL,
  `name` varchar(50) NOT NULL,
  `description` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `pieces`
--

INSERT INTO `pieces` (`id`, `name`, `description`) VALUES
('BAG-0001', 'NN1', 'DD1'),
('BAG-0002', 'New', 'D New');

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

--
-- Struktur dari tabel `positions`
--

CREATE TABLE `positions` (
  `id` varchar(10) NOT NULL,
  `name` varchar(50) NOT NULL,
  `description` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `positions`
--

INSERT INTO `positions` (`id`, `name`, `description`) VALUES
('P-00001', 'New', 'New D'),
('P-00002', 'New 2', 'New D2'),
('P-00003', 'New 3', 'New D3');

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

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

CREATE TABLE `products` (
  `id` varchar(10) NOT NULL,
  `name` varchar(100) NOT NULL,
  `alias_name` varchar(100) NOT NULL,
  `piece_id` varchar(10) NOT NULL,
  `_group` varchar(10) NOT NULL,
  `category_id` varchar(10) DEFAULT NULL,
  `grade_id` varchar(10) DEFAULT NULL,
  `type_id` varchar(10) DEFAULT NULL,
  `brand_id` varchar(10) DEFAULT NULL,
  `unit` varchar(20) NOT NULL,
  `purchase_price` double DEFAULT NULL,
  `selling_price` double NOT NULL,
  `discount` double DEFAULT NULL,
  `tax_id` varchar(10) DEFAULT NULL,
  `status` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

INSERT INTO `products` (`id`, `name`, `alias_name`, `piece_id`, `_group`, `category_id`, `grade_id`, `type_id`, `brand_id`, `unit`, `purchase_price`, `selling_price`, `discount`, `tax_id`, `status`) VALUES
('STO-000001', 'N1', 'AN', 'BAG-0001', 'g1', 'CAT-0004', NULL, 'T-00001', NULL, 'kg', 5000, 10000, 0, 'TAX-001', 'Active'),
('STO-000002', 'N2', 'AN2', 'BAG-0001', 'g2', 'CAT-0001', NULL, 'T-00001', NULL, 'kg', 50000, 100000, 0, 'TAX-001', 'Active'),
('STO-000003', 'N3', 'AN', 'BAG-0001', 'g3', 'CAT-0002', 'g11', 't1', 'MER-0001', 'u1', 2500, 5000, 10, 'TAX-001', 'Active'),
('STO-000004', 'N4', 'AN4', 'BAG-0001', 'g1', 'CAT-0003', 'g111', 't111', 'b11', 'u1', 1000, 2000, 10, 'TAX-001', 'Active');

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

--
-- Struktur dari tabel `sales_invoices`
--

CREATE TABLE `sales_invoices` (
  `id` varchar(14) NOT NULL,
  `date` date NOT NULL,
  `type` varchar(10) NOT NULL,
  `recipient` varchar(9) NOT NULL,
  `discount` double NOT NULL,
  `ppn` double NOT NULL,
  `total` double NOT NULL,
  `down_payment` double NOT NULL,
  `notes` varchar(100) NOT NULL,
  `tax_included` int(1) NOT NULL,
  `status` varchar(10) NOT NULL,
  `drafted_by` varchar(10) NOT NULL,
  `last_edited_by` varchar(10) NOT NULL,
  `last_edited_at` datetime NOT NULL,
  `submitted_by` varchar(10) DEFAULT NULL,
  `submitted_at` datetime DEFAULT NULL,
  `done_by` varchar(10) DEFAULT NULL,
  `done_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `sales_invoices`
--

INSERT INTO `sales_invoices` (`id`, `date`, `type`, `recipient`, `discount`, `ppn`, `total`, `down_payment`, `notes`, `tax_included`, `status`, `drafted_by`, `last_edited_by`, `last_edited_at`, `submitted_by`, `submitted_at`, `done_by`, `done_at`) VALUES
('BM/2207/00001', '2022-07-04', 'Lokal', 'CUS-00001', 0, 0, 0, 0, 'cccc', 1, 'Cancelled', 'EMP-00001', 'EMP-00001', '2022-07-04 16:51:11', 'EMP-00001', '2022-07-04 17:06:09', NULL, NULL);

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

--
-- Struktur dari tabel `sales_invoice_details`
--

CREATE TABLE `sales_invoice_details` (
  `sales_invoice_id` varchar(14) NOT NULL,
  `product_alias_name` varchar(100) NOT NULL,
  `is_delivered` int(1) NOT NULL,
  `quantity` double NOT NULL,
  `unit` varchar(20) NOT NULL,
  `price` double NOT NULL,
  `subtotal` double NOT NULL,
  `discount_percentage` double NOT NULL,
  `fixed_discount` double NOT NULL,
  `subtotal_after_discount` double NOT NULL,
  `ppn` double NOT NULL,
  `total` double NOT NULL,
  `shrink` double NOT NULL,
  `returned` double NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `sales_invoice_details`
--

INSERT INTO `sales_invoice_details` (`sales_invoice_id`, `product_alias_name`, `is_delivered`, `quantity`, `unit`, `price`, `subtotal`, `discount_percentage`, `fixed_discount`, `subtotal_after_discount`, `ppn`, `total`, `shrink`, `returned`) VALUES
('BM/2207/00001', 'AN', 1, 10, 'kg', 10000, 100000, 90, 500, 9500, 0, 9500, -8, 0),
('BM/2207/00001', 'AN2', 1, 5, 'kg', 5000, 25000, 0, 5000, 20000, 0, 20000, -2, 0);

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

--
-- Struktur dari tabel `sales_orders`
--

CREATE TABLE `sales_orders` (
  `id` varchar(14) NOT NULL,
  `date` date NOT NULL,
  `customer_id` varchar(9) NOT NULL,
  `discount` double NOT NULL,
  `ppn` double NOT NULL,
  `total` double NOT NULL,
  `reference` varchar(20) NOT NULL,
  `notes` varchar(100) NOT NULL,
  `tax_included` int(1) NOT NULL,
  `status` varchar(10) NOT NULL,
  `drafted_by` varchar(10) NOT NULL,
  `last_edited_by` varchar(10) NOT NULL,
  `last_edited_at` datetime NOT NULL,
  `submitted_by` varchar(10) DEFAULT NULL,
  `submitted_at` datetime DEFAULT NULL,
  `done_by` varchar(10) DEFAULT NULL,
  `done_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `sales_orders`
--

INSERT INTO `sales_orders` (`id`, `date`, `customer_id`, `discount`, `ppn`, `total`, `reference`, `notes`, `tax_included`, `status`, `drafted_by`, `last_edited_by`, `last_edited_at`, `submitted_by`, `submitted_at`, `done_by`, `done_at`) VALUES
('BM220603-SO001', '2022-06-21', 'CUS-00001', 68500, 10100, 2961600, 'r1', 'c1', 0, 'Done', 'EMP-00001', 'EMP-00001', '2022-06-21 10:50:17', 'EMP-00001', '2022-06-21 10:50:17', NULL, NULL),
('BM220623-SO001', '2022-06-23', 'CUS-00001', 23500, 26955, 296500, 'r1', 'c1', 1, 'Done', 'EMP-00001', 'EMP-00001', '2022-06-23 16:35:15', 'EMP-00001', '2022-06-23 16:35:15', NULL, NULL),
('BM220629-SO001', '2022-06-29', 'CUS-00001', 23500, 26954.545454545, 296500, 'r1', 'c1', 1, 'Done', 'EMP-00001', 'EMP-00001', '2022-06-29 11:12:42', 'EMP-00001', '2022-06-29 11:12:42', 'EMP-00001', '2022-06-29 11:31:20');

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

--
-- Struktur dari tabel `sales_order_details`
--

CREATE TABLE `sales_order_details` (
  `sales_order_id` varchar(14) NOT NULL,
  `product_alias_name` varchar(100) NOT NULL,
  `quantity` double NOT NULL,
  `unit` varchar(20) NOT NULL,
  `price` double NOT NULL,
  `subtotal` double NOT NULL,
  `discount_percentage` double NOT NULL,
  `fixed_discount` double NOT NULL,
  `subtotal_after_discount` double NOT NULL,
  `ppn` double NOT NULL,
  `total` double NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `sales_order_details`
--

INSERT INTO `sales_order_details` (`sales_order_id`, `product_alias_name`, `quantity`, `unit`, `price`, `subtotal`, `discount_percentage`, `fixed_discount`, `subtotal_after_discount`, `ppn`, `total`) VALUES
('BM220603-SO001', 'AN', 20, 'kg', 10000, 20000, 90, 500, 1500, 100, 1600),
('BM220603-SO001', 'AN2', 1, 'kg', 1000000, 3000000, 0, 50000, 2950000, 10000, 2960000),
('BM220623-SO001', 'AN2', 3, 'kg', 100000, 300000, 0, 5000, 295000, 0, 295000),
('BM220629-SO001', 'AN', 2, 'kg', 10000, 20000, 90, 500, 1500, 0, 1500),
('BM220629-SO001', 'AN2', 3, 'kg', 100000, 300000, 0, 5000, 295000, 0, 295000);

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

--
-- Struktur dari tabel `sales_returns`
--

CREATE TABLE `sales_returns` (
  `id` varchar(14) NOT NULL,
  `sales_invoice_id` varchar(14) NOT NULL,
  `customer_id` varchar(9) NOT NULL,
  `customer_name` varchar(50) NOT NULL,
  `total` int(20) NOT NULL,
  `description` varchar(100) DEFAULT NULL,
  `drafted_by` varchar(10) NOT NULL,
  `submitted_by` varchar(10) DEFAULT NULL,
  `submitted_at` date DEFAULT NULL,
  `deleted_at` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Struktur dari tabel `sales_return_details`
--

CREATE TABLE `sales_return_details` (
  `sales_return_id` varchar(14) NOT NULL,
  `delivery_note_id` varchar(14) NOT NULL,
  `sales_order_id` varchar(14) NOT NULL,
  `product_id` varchar(10) NOT NULL,
  `product_name` varchar(50) NOT NULL,
  `quantity` double NOT NULL,
  `unit` varchar(10) NOT NULL,
  `price` int(20) NOT NULL,
  `subtotal` int(20) NOT NULL,
  `percentage_discount` int(5) DEFAULT NULL,
  `fixed_discount` int(20) DEFAULT NULL,
  `subtotal_after_discount` int(20) NOT NULL,
  `ppn` int(10) DEFAULT NULL,
  `total` int(20) NOT NULL,
  `deleted_at` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Struktur dari tabel `sections`
--

CREATE TABLE `sections` (
  `id` varchar(8) NOT NULL,
  `name` varchar(20) NOT NULL,
  `description` varchar(100) DEFAULT NULL,
  `deleted_at` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Struktur dari tabel `tally_sheets`
--

CREATE TABLE `tally_sheets` (
  `id` varchar(14) NOT NULL,
  `date` date NOT NULL,
  `customer_id` varchar(9) NOT NULL,
  `warehouse_id` varchar(8) NOT NULL,
  `notes` varchar(100) DEFAULT NULL,
  `status` varchar(10) NOT NULL,
  `drafted_by` varchar(10) NOT NULL,
  `last_edited_by` varchar(10) NOT NULL,
  `last_edited_at` datetime NOT NULL,
  `submitted_by` varchar(10) DEFAULT NULL,
  `submitted_at` datetime DEFAULT NULL,
  `done_by` varchar(10) DEFAULT NULL,
  `done_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `tally_sheets`
--

INSERT INTO `tally_sheets` (`id`, `date`, `customer_id`, `warehouse_id`, `notes`, `status`, `drafted_by`, `last_edited_by`, `last_edited_at`, `submitted_by`, `submitted_at`, `done_by`, `done_at`) VALUES
('BM220623-TO002', '2022-06-23', 'CUS-00001', 'g1', 'c1', 'Submitted', 'EMP-00001', 'EMP-00001', '2022-06-23 17:34:01', 'EMP-00001', '2022-06-23 17:34:01', 'EMP-00001', '2022-06-27 13:26:14'),
('BM220623-TO003', '2022-06-23', 'CUS-00001', 'g1', 'c1', 'Cancelled', 'EMP-00001', 'EMP-00001', '2022-06-23 17:26:52', 'EMP-00001', '2022-06-23 17:26:52', NULL, NULL),
('BM220623-TO004', '2022-06-27', 'CUS-00001', 'WAR-0001', 'c1', 'Submitted', 'EMP-00001', 'EMP-00001', '2022-06-27 11:05:53', 'EMP-00001', '2022-06-27 11:05:53', 'EMP-00001', '2022-06-27 13:26:14'),
('BM220623-TO006', '2022-06-29', 'CUS-00001', 'WAR-0001', 'c1', 'Draft', 'EMP-00001', 'EMP-00001', '2022-06-29 12:55:12', 'EMP-00001', '2022-06-29 10:29:57', NULL, NULL),
('BM220629-TO001', '2022-06-29', 'CUS-00001', 'g1', 'c1', 'Done', 'EMP-00001', 'EMP-00001', '2022-06-29 11:31:18', 'EMP-00001', '2022-06-29 11:31:18', 'EMP-00001', '2022-07-04 16:32:52'),
('BM220629-TO002', '2022-06-29', 'CUS-00001', 'g1', 'c1', 'Done', 'EMP-00001', 'EMP-00001', '2022-06-29 11:31:20', 'EMP-00001', '2022-06-29 11:31:20', 'EMP-00001', '2022-07-04 15:29:30');

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

--
-- Struktur dari tabel `tally_sheet_details`
--

CREATE TABLE `tally_sheet_details` (
  `tally_sheet_id` varchar(14) NOT NULL,
  `sales_order_id` varchar(14) NOT NULL,
  `product_id` varchar(10) NOT NULL,
  `product_alias_name` varchar(100) NOT NULL,
  `product_name` varchar(100) NOT NULL,
  `number_of_boxes` int(5) DEFAULT NULL,
  `boxes_quantity` double NOT NULL,
  `boxes_unit` varchar(20) NOT NULL,
  `action` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `tally_sheet_details`
--

INSERT INTO `tally_sheet_details` (`tally_sheet_id`, `sales_order_id`, `product_id`, `product_alias_name`, `product_name`, `number_of_boxes`, `boxes_quantity`, `boxes_unit`, `action`) VALUES
('BM220623-TO002', 'BM220603-SO001', 'STO-000001', 'AN', 'N1', 2, 4, 'kg', 'Next delivery'),
('BM220623-TO002', 'BM220603-SO001', 'STO-000002', 'AN2', 'N2', 6, 6, 'kg', 'Done'),
('BM220623-TO002', 'BM220603-SO001', 'STO-000003', 'AN', 'N3', 2, 14, 'kg', 'Next delivery'),
('BM220623-TO002', 'BM220623-SO001', 'STO-000002', 'AN2', 'N2', 1, 1, 'kg', 'Next delivery'),
('BM220623-TO003', 'BM220603-SO001', 'STO-000001', 'AN', 'N1', 2, 4, 'kg', 'Done'),
('BM220623-TO003', 'BM220603-SO001', 'STO-000002', 'AN2', 'N2', 6, 6, 'kg', 'Done'),
('BM220623-TO003', 'BM220603-SO001', 'STO-000003', 'AN', 'N3', 2, 15, 'kg', 'Done'),
('BM220623-TO003', 'BM220623-SO001', 'STO-000002', 'AN2', 'N2', 1, 1, 'kg', 'Done'),
('BM220623-TO004', 'BM220603-SO001', 'STO-000001', 'AN', 'N1', 2, 4, 'kg', 'Done'),
('BM220623-TO004', 'BM220603-SO001', 'STO-000002', 'AN2', 'N2', 6, 6, 'kg', 'Done'),
('BM220623-TO004', 'BM220603-SO001', 'STO-000003', 'AN', 'N3', 2, 15, 'kg', 'Done'),
('BM220623-TO004', 'BM220623-SO001', 'STO-000002', 'AN2', 'N2', 1, 2, 'kg', 'Done'),
('BM220623-TO006', 'BM220603-SO001', 'STO-000001', 'AN', 'N1', 2, 4, 'kg', 'Next delivery'),
('BM220623-TO006', 'BM220603-SO001', 'STO-000002', 'AN2', 'N2', 6, 6, 'kg', 'Done'),
('BM220623-TO006', 'BM220603-SO001', 'STO-000003', 'AN', 'N3', 2, 15, 'kg', 'Next delivery'),
('BM220623-TO006', 'BM220623-SO001', 'STO-000002', 'AN2', 'N2', 1, 2, 'kg', 'Next delivery'),
('BM220629-TO001', 'BM220629-SO001', 'STO-000001', 'AN', 'N1', 1, 1, 'kg', 'Next delivery'),
('BM220629-TO001', 'BM220629-SO001', 'STO-000002', 'AN2', 'N2', 1, 1.5, 'kg', 'Next delivery'),
('BM220629-TO002', 'BM220629-SO001', 'STO-000001', 'AN', 'N1', 1, 1, 'kg', 'Done'),
('BM220629-TO002', 'BM220629-SO001', 'STO-000002', 'AN2', 'N2', 1, 1.5, 'kg', 'Done');

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

--
-- Struktur dari tabel `tally_sheet_detail_boxes`
--

CREATE TABLE `tally_sheet_detail_boxes` (
  `tally_sheet_id` varchar(14) NOT NULL,
  `sales_order_id` varchar(14) NOT NULL,
  `product_id` varchar(10) NOT NULL,
  `box_id` int(5) NOT NULL,
  `quantity` double NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `tally_sheet_detail_boxes`
--

INSERT INTO `tally_sheet_detail_boxes` (`tally_sheet_id`, `sales_order_id`, `product_id`, `box_id`, `quantity`) VALUES
('BM220623-TO002', 'BM220603-SO001', 'STO-000001', 1, 2),
('BM220623-TO002', 'BM220603-SO001', 'STO-000001', 2, 2),
('BM220623-TO002', 'BM220603-SO001', 'STO-000002', 1, 1),
('BM220623-TO002', 'BM220603-SO001', 'STO-000002', 2, 1),
('BM220623-TO002', 'BM220603-SO001', 'STO-000002', 3, 1),
('BM220623-TO002', 'BM220603-SO001', 'STO-000002', 4, 1),
('BM220623-TO002', 'BM220603-SO001', 'STO-000002', 5, 1),
('BM220623-TO002', 'BM220603-SO001', 'STO-000002', 6, 1),
('BM220623-TO002', 'BM220603-SO001', 'STO-000003', 1, 12),
('BM220623-TO002', 'BM220603-SO001', 'STO-000003', 2, 2),
('BM220623-TO002', 'BM220623-SO001', 'STO-000002', 1, 1),
('BM220623-TO003', 'BM220603-SO001', 'STO-000001', 1, 2),
('BM220623-TO003', 'BM220603-SO001', 'STO-000001', 2, 2),
('BM220623-TO003', 'BM220603-SO001', 'STO-000002', 1, 1),
('BM220623-TO003', 'BM220603-SO001', 'STO-000002', 2, 1),
('BM220623-TO003', 'BM220603-SO001', 'STO-000002', 3, 1),
('BM220623-TO003', 'BM220603-SO001', 'STO-000002', 4, 1),
('BM220623-TO003', 'BM220603-SO001', 'STO-000002', 5, 1),
('BM220623-TO003', 'BM220603-SO001', 'STO-000002', 6, 1),
('BM220623-TO003', 'BM220603-SO001', 'STO-000003', 1, 13),
('BM220623-TO003', 'BM220603-SO001', 'STO-000003', 2, 2),
('BM220623-TO003', 'BM220623-SO001', 'STO-000002', 1, 1),
('BM220623-TO004', 'BM220603-SO001', 'STO-000001', 1, 2),
('BM220623-TO004', 'BM220603-SO001', 'STO-000001', 2, 2),
('BM220623-TO004', 'BM220603-SO001', 'STO-000002', 1, 1),
('BM220623-TO004', 'BM220603-SO001', 'STO-000002', 2, 1),
('BM220623-TO004', 'BM220603-SO001', 'STO-000002', 3, 1),
('BM220623-TO004', 'BM220603-SO001', 'STO-000002', 4, 1),
('BM220623-TO004', 'BM220603-SO001', 'STO-000002', 5, 1),
('BM220623-TO004', 'BM220603-SO001', 'STO-000002', 6, 1),
('BM220623-TO004', 'BM220603-SO001', 'STO-000003', 1, 13),
('BM220623-TO004', 'BM220603-SO001', 'STO-000003', 2, 2),
('BM220623-TO004', 'BM220623-SO001', 'STO-000002', 1, 2),
('BM220623-TO006', 'BM220603-SO001', 'STO-000001', 1, 2),
('BM220623-TO006', 'BM220603-SO001', 'STO-000001', 2, 2),
('BM220623-TO006', 'BM220603-SO001', 'STO-000002', 1, 1),
('BM220623-TO006', 'BM220603-SO001', 'STO-000002', 2, 1),
('BM220623-TO006', 'BM220603-SO001', 'STO-000002', 3, 1),
('BM220623-TO006', 'BM220603-SO001', 'STO-000002', 4, 1),
('BM220623-TO006', 'BM220603-SO001', 'STO-000002', 5, 1),
('BM220623-TO006', 'BM220603-SO001', 'STO-000002', 6, 1),
('BM220623-TO006', 'BM220603-SO001', 'STO-000003', 1, 13),
('BM220623-TO006', 'BM220603-SO001', 'STO-000003', 2, 2),
('BM220623-TO006', 'BM220623-SO001', 'STO-000002', 1, 2),
('BM220629-TO001', 'BM220629-SO001', 'STO-000001', 1, 1),
('BM220629-TO001', 'BM220629-SO001', 'STO-000002', 1, 1.5),
('BM220629-TO002', 'BM220629-SO001', 'STO-000001', 1, 1),
('BM220629-TO002', 'BM220629-SO001', 'STO-000002', 1, 1.5);

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

--
-- Struktur dari tabel `taxes`
--

CREATE TABLE `taxes` (
  `id` varchar(10) NOT NULL,
  `type` varchar(20) NOT NULL,
  `rate` double NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `taxes`
--

INSERT INTO `taxes` (`id`, `type`, `rate`) VALUES
('TAX-001', 'PPN', 10),
('TAX-002', 'N1', 1),
('TAX-003', 'N1', 1),
('TAX-004', 'N1', 1),
('TAX-005', 'N1', 1),
('TAX-006', 'N1', 1);

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

--
-- Struktur dari tabel `types`
--

CREATE TABLE `types` (
  `id` varchar(10) NOT NULL,
  `name` varchar(50) NOT NULL,
  `description` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `types`
--

INSERT INTO `types` (`id`, `name`, `description`) VALUES
('T-00001', 'NN1', 'DD1'),
('T-00002', 'New', 'D New');

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

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

CREATE TABLE `users` (
  `id` varchar(10) NOT NULL,
  `username` varchar(20) NOT NULL,
  `password` varchar(250) NOT NULL,
  `employee_id` varchar(9) DEFAULT NULL,
  `is_admin` int(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

INSERT INTO `users` (`id`, `username`, `password`, `employee_id`, `is_admin`) VALUES
('USER-00001', 'admin', 'admin', 'EMP-00001', 1),
('USER-00002', 'u2', '$2y$10$6Ox1P1QgnopLsI0EMlo6se61Me2rpGA8JlsWFA8csC1PPPww/2xAO', 'EMP-00001', 0),
('USER-00003', 'u3', '$2y$10$Eou9XCDcrEi9b.WAbUpZke1rtgzDvCKFLkCqapdD1/OPTJTIv43ee', NULL, 0),
('USER-00004', 'u10', '$2y$10$vhol3Ea3kx3VK5AYsJoWdOCvx5VKMLIUGMq.QHgDNBxua3Uzpo3GK', 'EMP-00001', 0),
('USER-00005', 'u11', '$2y$10$Kf/DG73ztwI79OriHmCzRuo44t5OMIznIQ.dclCmusbP4gbursRHe', 'EMP-00001', 0),
('USER-00006', 'u12', '$2y$10$G9pbBn9KwpRBdCQbE8z02uyg5A0iPpp64l8kguW31bcSTqYEwfFQC', 'EMP-00001', 0),
('USER-00007', 'u13', '$2y$10$Os6iXY.nidtZMtyVKfOVDeodFPi3wgwo4LsXqkGgJQcD8O4FMHXMW', 'EMP-00001', 0),
('USER-00008', 'u14', '$2y$10$f8lDeD7LY7WPENkG8RZkcOABUbU6N5/dUtZWaCepTPh6tlhNh04BC', 'EMP-00001', 0),
('USER-00009', 'u15', '$2y$10$PCg3tSZfDnPpQH2gzYXcU.NJ9Bxsz3lHWQPGReHUT4cQaeFdwZTJu', 'EMP-00001', 0),
('USER-00010', 'u16', '$2y$10$nPqJBRblvAAX8tarAa179.OBKM5L.CDOJG8lwQ48ZFliyATQD0G46', 'EMP-00001', 0);

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

--
-- Struktur dari tabel `warehouses`
--

CREATE TABLE `warehouses` (
  `id` varchar(8) NOT NULL,
  `name` varchar(50) NOT NULL,
  `address` varchar(250) NOT NULL,
  `city` varchar(100) DEFAULT NULL,
  `postal_code` int(10) DEFAULT NULL,
  `phone_number` int(20) DEFAULT NULL,
  `employee_id` varchar(9) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `warehouses`
--

INSERT INTO `warehouses` (`id`, `name`, `address`, `city`, `postal_code`, `phone_number`, `employee_id`) VALUES
('WAR-0001', 'N11', 'a11', 'c11', 11, 11, 'EMP-00006'),
('WAR-0002', 'N2', 'a2', 'c2', 2, 2, 'EMP-00006');

--
-- Indexes for dumped tables
--

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

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

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

--
-- Indeks untuk tabel `customer_addresses`
--
ALTER TABLE `customer_addresses`
  ADD PRIMARY KEY (`customer_id`,`id`) USING BTREE;

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

--
-- Indeks untuk tabel `delivery_note_details`
--
ALTER TABLE `delivery_note_details`
  ADD PRIMARY KEY (`delivery_note_id`,`tally_sheet_id`,`sales_order_id`,`product_id`);

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

--
-- Indeks untuk tabel `employees`
--
ALTER TABLE `employees`
  ADD PRIMARY KEY (`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 `grades`
--
ALTER TABLE `grades`
  ADD PRIMARY KEY (`id`);

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

--
-- Indeks untuk tabel `group_access_rights`
--
ALTER TABLE `group_access_rights`
  ADD PRIMARY KEY (`group_id`,`module_id`,`menu_id`,`access_right_id`) USING BTREE;

--
-- Indeks untuk tabel `group_users`
--
ALTER TABLE `group_users`
  ADD PRIMARY KEY (`user_id`,`group_id`);

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

--
-- Indeks untuk tabel `modules`
--
ALTER TABLE `modules`
  ADD PRIMARY KEY (`id`) USING BTREE;

--
-- Indeks untuk tabel `module_menus`
--
ALTER TABLE `module_menus`
  ADD PRIMARY KEY (`module_id`,`id`) USING BTREE;

--
-- Indeks untuk tabel `module_menu_access_rights`
--
ALTER TABLE `module_menu_access_rights`
  ADD PRIMARY KEY (`module_id`,`module_menu_id`,`id`) USING BTREE;

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

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

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

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

--
-- Indeks untuk tabel `oauth_refresh_tokens`
--
ALTER TABLE `oauth_refresh_tokens`
  ADD PRIMARY KEY (`id`),
  ADD KEY `oauth_refresh_tokens_access_token_id_index` (`access_token_id`);

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

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

--
-- Indeks untuk tabel `products`
--
ALTER TABLE `products`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `UNIQUE_NAME` (`name`),
  ADD UNIQUE KEY `UNIQUE` (`piece_id`,`grade_id`,`type_id`,`brand_id`);

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

--
-- Indeks untuk tabel `sales_invoice_details`
--
ALTER TABLE `sales_invoice_details`
  ADD PRIMARY KEY (`sales_invoice_id`,`product_alias_name`) USING BTREE;

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

--
-- Indeks untuk tabel `sales_order_details`
--
ALTER TABLE `sales_order_details`
  ADD PRIMARY KEY (`sales_order_id`,`product_alias_name`) USING BTREE;

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

--
-- Indeks untuk tabel `sales_return_details`
--
ALTER TABLE `sales_return_details`
  ADD PRIMARY KEY (`sales_return_id`,`delivery_note_id`,`sales_order_id`,`product_id`);

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

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

--
-- Indeks untuk tabel `tally_sheet_details`
--
ALTER TABLE `tally_sheet_details`
  ADD PRIMARY KEY (`tally_sheet_id`,`sales_order_id`,`product_id`);

--
-- Indeks untuk tabel `tally_sheet_detail_boxes`
--
ALTER TABLE `tally_sheet_detail_boxes`
  ADD PRIMARY KEY (`tally_sheet_id`,`sales_order_id`,`product_id`,`box_id`);

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

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

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

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

--
-- AUTO_INCREMENT untuk tabel yang dibuang
--

--
-- AUTO_INCREMENT untuk tabel `failed_jobs`
--
ALTER TABLE `failed_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=10;

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

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

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

--
-- Ketidakleluasaan untuk tabel `group_access_rights`
--
ALTER TABLE `group_access_rights`
  ADD CONSTRAINT `fk_group_id` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;

