-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `garage_saas`
--

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

--
-- Table structure for table `activity_logs`
--

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

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

--
-- Table structure for table `areas`
--

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

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

--
-- Table structure for table `audit_logs`
--

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

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

--
-- Table structure for table `car_brands`
--

CREATE TABLE `car_brands` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `logo` varchar(255) DEFAULT NULL,
  `type` enum('luxury','popular') NOT NULL DEFAULT 'popular',
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `description` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `car_brands`
--

INSERT INTO `car_brands` (`id`, `name`, `slug`, `logo`, `type`, `is_active`, `sort_order`, `description`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'Mercedes', 'mercedes', NULL, 'luxury', 1, 1, NULL, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(2, 'BMW', 'bmw', NULL, 'luxury', 1, 2, NULL, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(3, 'Audi', 'audi', NULL, 'luxury', 1, 3, NULL, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(4, 'Volvo', 'volvo', NULL, 'luxury', 1, 4, NULL, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(5, 'Mitsubishi', 'mitsubishi', NULL, 'luxury', 1, 5, NULL, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(6, 'Jaguar', 'jaguar', NULL, 'luxury', 1, 6, NULL, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(7, 'Porsche', 'porsche', NULL, 'luxury', 1, 7, NULL, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(8, 'Rolls Royce', 'rolls-royce', NULL, 'luxury', 1, 8, NULL, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(9, 'Ferrari', 'ferrari', NULL, 'luxury', 1, 9, NULL, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(10, 'Land Rover', 'land-rover', NULL, 'luxury', 1, 10, NULL, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(11, 'Maruti Suzuki', 'maruti-suzuki', NULL, 'popular', 1, 1, NULL, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(12, 'Hyundai', 'hyundai', NULL, 'popular', 1, 2, NULL, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(13, 'Honda', 'honda', NULL, 'popular', 1, 3, NULL, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(14, 'Toyota', 'toyota', NULL, 'popular', 1, 4, NULL, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(15, 'Tata', 'tata', NULL, 'popular', 1, 5, NULL, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(16, 'Mahindra', 'mahindra', NULL, 'popular', 1, 6, NULL, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(17, 'Chevrolet', 'chevrolet', NULL, 'popular', 1, 7, NULL, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(18, 'Fiat', 'fiat', NULL, 'popular', 1, 8, NULL, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(19, 'Renault', 'renault', NULL, 'popular', 1, 9, NULL, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(20, 'Kia', 'kia', NULL, 'popular', 1, 10, NULL, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(21, 'Skoda', 'skoda', NULL, 'popular', 1, 11, NULL, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(22, 'Volkswagen', 'volkswagen', NULL, 'popular', 1, 12, NULL, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(23, 'Test', 'test', 'car-brands/c2sG8Vb7jTwkadReHJpy3c40aQ3dIfoyHSyWDOke.jpg', 'luxury', 1, 11, 'testing', '2026-02-23 05:25:38', '2026-02-23 05:27:59', NULL);

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

--
-- Table structure for table `car_models`
--

CREATE TABLE `car_models` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `car_brand_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `year_from` year(4) DEFAULT NULL,
  `year_to` year(4) DEFAULT NULL,
  `fuel_type` varchar(255) DEFAULT NULL,
  `transmission_type` varchar(255) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `categories`
--

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

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

--
-- Table structure for table `cities`
--

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

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

--
-- Table structure for table `garages`
--

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

--
-- Dumping data for table `garages`
--

INSERT INTO `garages` (`id`, `name`, `address`, `contact_number`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, '', NULL, NULL, '2025-12-07 01:45:17', '2025-12-07 01:45:17', NULL),
(2, 'Auto Fix 1765090428', '123 Repair Lane', '555-0199', '2025-12-07 01:53:48', '2025-12-07 01:53:48', NULL),
(3, 'Test Garage Sargodha', 'sargodha\r\n04888888\r\nsargodha', '30000000', '2026-02-23 05:17:46', '2026-02-23 05:17:46', NULL),
(4, 'Tset', NULL, NULL, '2026-03-02 05:52:58', '2026-03-02 05:52:58', NULL),
(5, 'Tset', NULL, NULL, '2026-03-02 05:52:58', '2026-03-02 05:52:58', NULL),
(6, 'Tset', NULL, NULL, '2026-03-02 05:52:59', '2026-03-02 05:52:59', NULL),
(7, 'Tset', NULL, NULL, '2026-03-02 05:52:59', '2026-03-02 05:52:59', NULL),
(8, 'Test', 'Test', '30000000', '2026-03-02 05:53:23', '2026-03-02 05:53:23', NULL);

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

--
-- Table structure for table `garage_appointments`
--

CREATE TABLE `garage_appointments` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `appointment_number` varchar(255) NOT NULL,
  `order_number` varchar(255) DEFAULT NULL,
  `reference_number` varchar(255) DEFAULT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `garage_admin_id` bigint(20) UNSIGNED DEFAULT NULL,
  `service_writer_id` bigint(20) UNSIGNED DEFAULT NULL,
  `technician_id` bigint(20) UNSIGNED DEFAULT NULL,
  `customer_name` varchar(255) NOT NULL,
  `customer_email` varchar(255) DEFAULT NULL,
  `customer_phone` varchar(255) NOT NULL,
  `vehicle_type` varchar(255) DEFAULT NULL,
  `vehicle_make` varchar(255) DEFAULT NULL,
  `vehicle_model` varchar(255) DEFAULT NULL,
  `vehicle_year` varchar(255) DEFAULT NULL,
  `license_plate` varchar(255) DEFAULT NULL,
  `service_description` text DEFAULT NULL,
  `appointment_date` date NOT NULL,
  `start_time` time NOT NULL,
  `end_time` time NOT NULL,
  `status` enum('requested','confirmed','no_show','cancelled','completed','pending','in_progress') DEFAULT 'requested',
  `is_fleet_appointment` tinyint(1) NOT NULL DEFAULT 0,
  `order_reference` varchar(255) DEFAULT NULL,
  `public_notes` text DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `estimated_cost` decimal(10,2) DEFAULT NULL,
  `actual_cost` decimal(10,2) DEFAULT NULL,
  `confirmed_at` timestamp NULL DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `garage_appointment_internal_notes`
--

CREATE TABLE `garage_appointment_internal_notes` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `appointment_id` bigint(20) UNSIGNED NOT NULL,
  `created_by` bigint(20) UNSIGNED DEFAULT NULL,
  `note` text NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `garage_appointment_labels`
--

CREATE TABLE `garage_appointment_labels` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `color` varchar(255) NOT NULL DEFAULT '#3b82f6',
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `garage_appointment_label_pivot`
--

CREATE TABLE `garage_appointment_label_pivot` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `appointment_id` bigint(20) UNSIGNED NOT NULL,
  `label_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;

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

--
-- Table structure for table `garage_appointment_reminders`
--

CREATE TABLE `garage_appointment_reminders` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `appointment_id` bigint(20) UNSIGNED NOT NULL,
  `reminder_date` date NOT NULL,
  `reminder_time` time NOT NULL,
  `message` text DEFAULT NULL,
  `is_sent` tinyint(1) NOT NULL DEFAULT 0,
  `sent_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `garage_estimates`
--

CREATE TABLE `garage_estimates` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `garage_admin_id` bigint(20) UNSIGNED DEFAULT NULL,
  `customer_ledger_id` bigint(20) UNSIGNED DEFAULT NULL,
  `vehicle_id` bigint(20) UNSIGNED DEFAULT NULL,
  `estimate_number` varchar(255) NOT NULL,
  `estimate_date` date NOT NULL,
  `expiry_date` date DEFAULT NULL,
  `reference_number` varchar(255) DEFAULT NULL,
  `customer_notes` text DEFAULT NULL,
  `internal_notes` text DEFAULT NULL,
  `subtotal` decimal(15,2) NOT NULL DEFAULT 0.00,
  `tax_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `discount_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `discount_type` enum('percentage','fixed') DEFAULT NULL,
  `total_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `status` enum('draft','sent','accepted','rejected','expired','converted') NOT NULL DEFAULT 'draft',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `garage_estimate_items`
--

CREATE TABLE `garage_estimate_items` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `garage_estimate_id` bigint(20) UNSIGNED NOT NULL,
  `item_type` varchar(255) NOT NULL,
  `part_id` bigint(20) UNSIGNED DEFAULT NULL,
  `labor_id` bigint(20) UNSIGNED DEFAULT NULL,
  `service_group_id` bigint(20) UNSIGNED DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `quantity` int(11) NOT NULL DEFAULT 1,
  `unit_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `discount_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `discount_type` enum('percentage','fixed') DEFAULT NULL,
  `tax_rate` decimal(5,2) NOT NULL DEFAULT 0.00,
  `tax_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `total_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `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;

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

--
-- Table structure for table `garage_inspections`
--

CREATE TABLE `garage_inspections` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `garage_admin_id` bigint(20) UNSIGNED DEFAULT NULL,
  `customer_ledger_id` bigint(20) UNSIGNED DEFAULT NULL,
  `vehicle_id` bigint(20) UNSIGNED DEFAULT NULL,
  `inspection_number` varchar(255) NOT NULL,
  `inspection_date` date NOT NULL,
  `inspection_type` enum('pre_service','post_service','safety','emission','insurance','custom') NOT NULL DEFAULT 'pre_service',
  `findings` text DEFAULT NULL,
  `status` enum('pending','in_progress','completed','cancelled') NOT NULL DEFAULT 'pending',
  `total_cost` decimal(15,2) NOT NULL DEFAULT 0.00,
  `recommendations` text DEFAULT NULL,
  `inspection_items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`inspection_items`)),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `garage_inventory_adjustments`
--

CREATE TABLE `garage_inventory_adjustments` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `garage_admin_id` bigint(20) UNSIGNED DEFAULT NULL,
  `adjustment_number` varchar(255) NOT NULL,
  `adjustment_date` date NOT NULL,
  `adjustment_type` enum('increase','decrease','correction') NOT NULL DEFAULT 'correction',
  `reason` text DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `total_value` decimal(15,2) NOT NULL DEFAULT 0.00,
  `status` enum('draft','completed','cancelled') NOT NULL DEFAULT 'draft',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `garage_inventory_adjustment_items`
--

CREATE TABLE `garage_inventory_adjustment_items` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `garage_inventory_adjustment_id` bigint(20) UNSIGNED NOT NULL,
  `garage_part_id` bigint(20) UNSIGNED NOT NULL,
  `quantity_before` int(11) NOT NULL DEFAULT 0,
  `quantity_after` int(11) NOT NULL DEFAULT 0,
  `quantity_adjusted` int(11) NOT NULL DEFAULT 0,
  `unit_cost` decimal(15,2) NOT NULL DEFAULT 0.00,
  `total_value` decimal(15,2) NOT NULL DEFAULT 0.00,
  `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;

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

--
-- Table structure for table `garage_invoices`
--

CREATE TABLE `garage_invoices` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `garage_admin_id` bigint(20) UNSIGNED DEFAULT NULL,
  `customer_ledger_id` bigint(20) UNSIGNED DEFAULT NULL,
  `vehicle_id` bigint(20) UNSIGNED DEFAULT NULL,
  `work_order_id` bigint(20) UNSIGNED DEFAULT NULL,
  `estimate_id` bigint(20) UNSIGNED DEFAULT NULL,
  `invoice_number` varchar(255) NOT NULL,
  `invoice_date` date NOT NULL,
  `due_date` date DEFAULT NULL,
  `reference_number` varchar(255) DEFAULT NULL,
  `customer_notes` text DEFAULT NULL,
  `internal_notes` text DEFAULT NULL,
  `terms_conditions` text DEFAULT NULL,
  `subtotal` decimal(15,2) NOT NULL DEFAULT 0.00,
  `tax_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `discount_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `discount_type` enum('percentage','fixed') DEFAULT NULL,
  `shipping_charges` decimal(15,2) NOT NULL DEFAULT 0.00,
  `total_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `paid_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `balance_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `status` enum('draft','sent','partial','paid','overdue','cancelled') NOT NULL DEFAULT 'draft',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `garage_invoice_items`
--

CREATE TABLE `garage_invoice_items` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `garage_invoice_id` bigint(20) UNSIGNED NOT NULL,
  `item_type` varchar(255) NOT NULL,
  `part_id` bigint(20) UNSIGNED DEFAULT NULL,
  `labor_id` bigint(20) UNSIGNED DEFAULT NULL,
  `service_group_id` bigint(20) UNSIGNED DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `quantity` int(11) NOT NULL DEFAULT 1,
  `unit_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `discount_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `discount_type` enum('percentage','fixed') DEFAULT NULL,
  `tax_rate` decimal(5,2) NOT NULL DEFAULT 0.00,
  `tax_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `total_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `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;

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

--
-- Table structure for table `garage_labors`
--

CREATE TABLE `garage_labors` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `garage_labor_category_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `rate` decimal(15,2) NOT NULL DEFAULT 0.00,
  `rate_type` enum('hourly','fixed') NOT NULL DEFAULT 'hourly',
  `estimated_hours` decimal(5,2) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `is_taxable` tinyint(1) NOT NULL DEFAULT 1,
  `tax_rate` decimal(5,2) NOT NULL DEFAULT 0.00,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `garage_labor_categories`
--

CREATE TABLE `garage_labor_categories` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `garage_ledgers`
--

CREATE TABLE `garage_ledgers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `ledger_group_id` bigint(20) UNSIGNED DEFAULT NULL,
  `garage_sub_nature_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `ledger_type` enum('customer','vendor','simple','employee') NOT NULL DEFAULT 'simple',
  `opening_balance` decimal(15,2) NOT NULL DEFAULT 0.00,
  `opening_balance_type` enum('debit','credit') NOT NULL DEFAULT 'debit',
  `contact_person` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `tax_number` varchar(255) DEFAULT NULL,
  `credit_limit` decimal(15,2) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `garage_ledgers`
--

INSERT INTO `garage_ledgers` (`id`, `garage_id`, `ledger_group_id`, `garage_sub_nature_id`, `name`, `code`, `description`, `ledger_type`, `opening_balance`, `opening_balance_type`, `contact_person`, `phone`, `email`, `address`, `tax_number`, `credit_limit`, `is_active`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 1, NULL, NULL, 'test', 'CUS0001', 'asd', 'customer', 0.00, 'debit', NULL, '123', 'test@gmail.com', 'asd', '21321', NULL, 1, '2025-12-12 04:31:42', '2025-12-12 04:31:42', NULL);

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

--
-- Table structure for table `garage_natures`
--

CREATE TABLE `garage_natures` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) NOT NULL,
  `type` enum('debit','credit') NOT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `garage_natures`
--

INSERT INTO `garage_natures` (`id`, `garage_id`, `name`, `code`, `type`, `description`, `is_active`, `sort_order`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 1, 'Assets', 'A', 'debit', 'Resources owned by the business', 1, 1, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(2, 1, 'Liabilities', 'L', 'credit', 'Obligations of the business', 1, 2, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(3, 1, 'Capital/Equity', 'C', 'credit', 'Owner\'s equity in the business', 1, 3, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(4, 1, 'Income', 'I', 'credit', 'Revenue and income', 1, 4, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(5, 1, 'Expenses', 'E', 'debit', 'Costs of doing business', 1, 5, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL);

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

--
-- Table structure for table `garage_parts`
--

CREATE TABLE `garage_parts` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `garage_part_category_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `part_number` varchar(255) DEFAULT NULL,
  `code` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `brand` varchar(255) DEFAULT NULL,
  `manufacturer` varchar(255) DEFAULT NULL,
  `unit` varchar(255) NOT NULL DEFAULT 'piece',
  `cost_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `selling_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `stock_quantity` int(11) NOT NULL DEFAULT 0,
  `min_stock_level` int(11) NOT NULL DEFAULT 0,
  `max_stock_level` int(11) DEFAULT NULL,
  `location` varchar(255) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `is_taxable` tinyint(1) NOT NULL DEFAULT 1,
  `tax_rate` decimal(5,2) NOT NULL DEFAULT 0.00,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `garage_part_categories`
--

CREATE TABLE `garage_part_categories` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `garage_payments_received`
--

CREATE TABLE `garage_payments_received` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `garage_admin_id` bigint(20) UNSIGNED DEFAULT NULL,
  `customer_ledger_id` bigint(20) UNSIGNED DEFAULT NULL,
  `invoice_id` bigint(20) UNSIGNED DEFAULT NULL,
  `payment_number` varchar(255) NOT NULL,
  `payment_date` date NOT NULL,
  `reference_number` varchar(255) DEFAULT NULL,
  `payment_method` enum('cash','cheque','bank_transfer','card','online','other') NOT NULL DEFAULT 'cash',
  `cheque_number` varchar(255) DEFAULT NULL,
  `cheque_date` date DEFAULT NULL,
  `bank_name` varchar(255) DEFAULT NULL,
  `transaction_reference` varchar(255) DEFAULT NULL,
  `amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `notes` text DEFAULT NULL,
  `status` enum('draft','posted','cancelled') NOT NULL DEFAULT 'draft',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `garage_service_groups`
--

CREATE TABLE `garage_service_groups` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `total_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `estimated_time` decimal(5,2) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `garage_service_group_items`
--

CREATE TABLE `garage_service_group_items` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `garage_service_group_id` bigint(20) UNSIGNED NOT NULL,
  `item_type` varchar(255) NOT NULL,
  `part_id` bigint(20) UNSIGNED DEFAULT NULL,
  `labor_id` bigint(20) UNSIGNED DEFAULT NULL,
  `quantity` int(11) NOT NULL DEFAULT 1,
  `unit_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `total_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `sort_order` 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;

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

--
-- Table structure for table `garage_sub_natures`
--

CREATE TABLE `garage_sub_natures` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `garage_nature_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `garage_sub_natures`
--

INSERT INTO `garage_sub_natures` (`id`, `garage_id`, `garage_nature_id`, `name`, `code`, `description`, `is_active`, `sort_order`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 1, 1, 'Current Assets', 'CA', 'Assets convertible to cash within one year', 1, 1, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(2, 1, 1, 'Fixed Assets', 'FA', 'Long-term tangible assets', 1, 2, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(3, 1, 1, 'Investments', 'INV', 'Long-term investments and securities', 1, 3, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(4, 1, 1, 'Intangible Assets', 'IA', 'Non-physical assets like goodwill, patents, trademarks', 1, 4, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(5, 1, 1, 'Inventory/Stock', 'INV-ST', 'Stock of parts, supplies, and materials', 1, 5, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(6, 1, 1, 'Loans & Advances', 'LA', 'Loans given to employees, customers, or others', 1, 6, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(7, 1, 2, 'Current Liabilities', 'CL', 'Obligations due within one year', 1, 1, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(8, 1, 2, 'Long Term Liabilities', 'LTL', 'Obligations due after one year', 1, 2, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(9, 1, 2, 'Provisions', 'PROV', 'Provisions for expenses, taxes, and contingencies', 1, 3, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(10, 1, 2, 'Secured Loans', 'SL', 'Loans secured against assets', 1, 4, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(11, 1, 2, 'Unsecured Loans', 'UL', 'Loans without collateral', 1, 5, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(12, 1, 2, 'Duties & Taxes', 'DT', 'Outstanding duties, taxes, and statutory payments', 1, 6, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(13, 1, 3, 'Owners Equity', 'OE', 'Owner\'s capital and reserves', 1, 1, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(14, 1, 3, 'Reserves', 'RES', 'Reserves and surplus accounts', 1, 2, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(15, 1, 3, 'Drawings', 'DRW', 'Owner\'s drawings and withdrawals', 1, 3, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(16, 1, 3, 'Retained Earnings', 'RE', 'Accumulated profits retained in business', 1, 4, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(17, 1, 4, 'Operating Income', 'OI', 'Revenue from core business operations', 1, 1, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(18, 1, 4, 'Non-Operating Income', 'NOI', 'Revenue from secondary sources', 1, 2, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(19, 1, 4, 'Service Income', 'SI', 'Income from repair and maintenance services', 1, 3, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(20, 1, 4, 'Sales Income', 'SAL', 'Income from sale of parts and products', 1, 4, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(21, 1, 4, 'Other Income', 'OTH-INC', 'Miscellaneous income sources', 1, 5, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(22, 1, 4, 'Interest Income', 'INT-INC', 'Interest earned on investments and deposits', 1, 6, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(23, 1, 4, 'Discount Received', 'DIS-REC', 'Discounts received from suppliers', 1, 7, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(24, 1, 5, 'Operating Expenses', 'OPEX', 'Day-to-day business expenses', 1, 1, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(25, 1, 5, 'Non-Operating Expenses', 'NOE', 'Expenses outside core operations', 1, 2, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(26, 1, 5, 'Direct Expenses', 'DE', 'Expenses directly related to service delivery', 1, 3, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(27, 1, 5, 'Indirect Expenses', 'IE', 'Overhead and indirect operational costs', 1, 4, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(28, 1, 5, 'Personnel Expenses', 'PE', 'Salaries, wages, and employee benefits', 1, 5, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(29, 1, 5, 'Administrative Expenses', 'AE', 'Office administration and management costs', 1, 6, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(30, 1, 5, 'Financial Expenses', 'FE', 'Interest, bank charges, and financial costs', 1, 7, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(31, 1, 5, 'Depreciation', 'DEP', 'Depreciation on fixed assets', 1, 8, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(32, 1, 5, 'Maintenance & Repairs', 'MRE', 'Maintenance and repair expenses', 1, 9, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(33, 1, 5, 'Marketing & Advertising', 'MA', 'Marketing, advertising, and promotional expenses', 1, 10, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(34, 1, 5, 'Taxes & Duties', 'TD', 'Tax payments and duties', 1, 11, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL),
(35, 1, 5, 'Discount Allowed', 'DIS-ALL', 'Discounts given to customers', 1, 12, '2025-12-10 13:09:49', '2025-12-10 13:09:49', NULL);

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

--
-- Table structure for table `garage_vehicles`
--

CREATE TABLE `garage_vehicles` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `customer_ledger_id` bigint(20) UNSIGNED DEFAULT NULL,
  `registration_number` varchar(255) NOT NULL,
  `vin` varchar(255) DEFAULT NULL,
  `make` varchar(255) DEFAULT NULL,
  `model` varchar(255) DEFAULT NULL,
  `year` varchar(255) DEFAULT NULL,
  `color` varchar(255) DEFAULT NULL,
  `fuel_type` enum('petrol','diesel','electric','hybrid','cng','lpg') DEFAULT NULL,
  `engine_number` varchar(255) DEFAULT NULL,
  `chassis_number` varchar(255) DEFAULT NULL,
  `odometer_reading` int(11) DEFAULT NULL,
  `registration_date` date DEFAULT NULL,
  `insurance_expiry` date DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `garage_vouchers`
--

CREATE TABLE `garage_vouchers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `garage_admin_id` bigint(20) UNSIGNED DEFAULT NULL,
  `voucher_type` enum('journal','receipt','payment','contra') NOT NULL,
  `voucher_no` varchar(255) NOT NULL,
  `voucher_date` date NOT NULL,
  `reference_no` varchar(255) DEFAULT NULL,
  `narration` text DEFAULT NULL,
  `total_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `approved_by` bigint(20) UNSIGNED DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `status` enum('draft','posted','cancelled') NOT NULL DEFAULT 'draft',
  `cheque_no` varchar(255) DEFAULT NULL,
  `cheque_date` date DEFAULT NULL,
  `cheque_bank` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `garage_voucher_transactions`
--

CREATE TABLE `garage_voucher_transactions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `garage_voucher_id` bigint(20) UNSIGNED NOT NULL,
  `garage_ledger_id` bigint(20) UNSIGNED NOT NULL,
  `transaction_type` enum('debit','credit') NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `narration` text DEFAULT NULL,
  `sort_order` 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;

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

--
-- Table structure for table `garage_work_orders`
--

CREATE TABLE `garage_work_orders` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `garage_admin_id` bigint(20) UNSIGNED DEFAULT NULL,
  `customer_ledger_id` bigint(20) UNSIGNED DEFAULT NULL,
  `vehicle_id` bigint(20) UNSIGNED DEFAULT NULL,
  `estimate_id` bigint(20) UNSIGNED DEFAULT NULL,
  `work_order_number` varchar(255) NOT NULL,
  `work_order_date` date NOT NULL,
  `start_date` date DEFAULT NULL,
  `completion_date` date DEFAULT NULL,
  `reference_number` varchar(255) DEFAULT NULL,
  `customer_notes` text DEFAULT NULL,
  `internal_notes` text DEFAULT NULL,
  `work_description` text DEFAULT NULL,
  `subtotal` decimal(15,2) NOT NULL DEFAULT 0.00,
  `tax_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `discount_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `discount_type` enum('percentage','fixed') DEFAULT NULL,
  `total_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `status` enum('draft','in_progress','on_hold','completed','cancelled') NOT NULL DEFAULT 'draft',
  `priority` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `garage_work_order_items`
--

CREATE TABLE `garage_work_order_items` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `garage_work_order_id` bigint(20) UNSIGNED NOT NULL,
  `item_type` varchar(255) NOT NULL,
  `part_id` bigint(20) UNSIGNED DEFAULT NULL,
  `labor_id` bigint(20) UNSIGNED DEFAULT NULL,
  `service_group_id` bigint(20) UNSIGNED DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `quantity` int(11) NOT NULL DEFAULT 1,
  `quantity_used` int(11) NOT NULL DEFAULT 0,
  `unit_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `discount_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `discount_type` enum('percentage','fixed') DEFAULT NULL,
  `tax_rate` decimal(5,2) NOT NULL DEFAULT 0.00,
  `tax_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `total_price` decimal(15,2) NOT NULL DEFAULT 0.00,
  `status` enum('pending','in_progress','completed') NOT NULL DEFAULT 'pending',
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `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;

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

--
-- Table structure for table `garage_work_schedules`
--

CREATE TABLE `garage_work_schedules` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `garage_admin_id` bigint(20) UNSIGNED DEFAULT NULL,
  `employee_name` varchar(255) DEFAULT NULL,
  `employee_email` varchar(255) DEFAULT NULL,
  `employee_phone` varchar(255) DEFAULT NULL,
  `day_of_week` enum('monday','tuesday','wednesday','thursday','friday','saturday','sunday') NOT NULL,
  `start_time` time NOT NULL,
  `end_time` time NOT NULL,
  `specific_date` date DEFAULT NULL,
  `is_recurring` tinyint(1) NOT NULL DEFAULT 1,
  `status` enum('active','inactive','on_leave') NOT NULL DEFAULT 'active',
  `notes` text DEFAULT NULL,
  `max_appointments_per_slot` int(11) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ledgers`
--

CREATE TABLE `ledgers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `ledger_group_id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED DEFAULT NULL,
  `ledger_type` enum('supplier','customer','simple') NOT NULL DEFAULT 'simple',
  `name` varchar(255) NOT NULL,
  `code` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `opening_balance` decimal(15,2) NOT NULL DEFAULT 0.00,
  `opening_balance_type` enum('debit','credit') NOT NULL DEFAULT 'debit',
  `contact_person` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `tax_number` varchar(255) DEFAULT NULL,
  `credit_limit` decimal(15,2) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `ledgers`
--

INSERT INTO `ledgers` (`id`, `ledger_group_id`, `garage_id`, `ledger_type`, `name`, `code`, `description`, `opening_balance`, `opening_balance_type`, `contact_person`, `phone`, `email`, `address`, `tax_number`, `credit_limit`, `is_active`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 1, NULL, 'simple', 'Cash in Hand', 'CASH-001', 'Cash available in office', 0.00, 'debit', NULL, NULL, NULL, NULL, NULL, NULL, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(2, 2, NULL, 'simple', 'Main Bank Account', 'BANK-001', 'Primary business bank account', 0.00, 'debit', NULL, NULL, NULL, NULL, NULL, NULL, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(3, 5, NULL, 'simple', 'Owner\'s Capital', 'CAP-001', 'Business owner capital account', 0.00, 'credit', NULL, NULL, NULL, NULL, NULL, NULL, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(5, 1, 1, 'customer', 'Test Customer Ledger 1765089917', 'TEST-1765089917', NULL, 0.00, 'debit', NULL, NULL, NULL, NULL, NULL, 1000.00, 1, '2025-12-07 01:45:17', '2025-12-07 01:45:17', NULL);

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

--
-- Table structure for table `ledger_groups`
--

CREATE TABLE `ledger_groups` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `sub_nature_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `ledger_groups`
--

INSERT INTO `ledger_groups` (`id`, `sub_nature_id`, `name`, `code`, `description`, `is_active`, `sort_order`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 1, 'Cash', 'CASH', 'Cash in hand and petty cash', 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(2, 1, 'Bank Accounts', 'BANK', 'Bank accounts and deposits', 1, 2, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(3, 1, 'Debtors/Receivables', 'DEBT', 'Customers who owe money', 1, 3, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(4, 3, 'Creditors/Payables', 'CRED', 'Vendors to whom money is owed', 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(5, 5, 'Capital', 'CAP', 'Owner\'s capital account', 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(6, 6, 'Sales/Service Revenue', 'SALES', 'Revenue from services', 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL);

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

--
-- Table structure for table `marketplace_items`
--

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

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

--
-- Table structure for table `marketplace_mechanics`
--

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

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

--
-- Table structure for table `marketplace_services`
--

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

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

--
-- Table structure for table `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 for table `migrations`
--

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2019_12_14_000001_create_personal_access_tokens_table', 1),
(2, '2025_11_30_081219_create_activity_logs_table', 1),
(3, '2025_11_30_081219_create_areas_table', 1),
(4, '2025_11_30_081219_create_audit_logs_table', 1),
(5, '2025_11_30_081219_create_categories_table', 1),
(6, '2025_11_30_081219_create_cities_table', 1),
(7, '2025_11_30_081219_create_garages_table', 1),
(8, '2025_11_30_081219_create_ledger_groups_table', 1),
(9, '2025_11_30_081219_create_ledgers_table', 1),
(10, '2025_11_30_081219_create_marketplace_items_table', 1),
(11, '2025_11_30_081219_create_marketplace_mechanics_table', 1),
(12, '2025_11_30_081219_create_marketplace_services_table', 1),
(13, '2025_11_30_081219_create_modules_table', 1),
(14, '2025_11_30_081219_create_order_items_table', 1),
(15, '2025_11_30_081219_create_orders_table', 1),
(16, '2025_11_30_081219_create_package_modules_table', 1),
(17, '2025_11_30_081219_create_packages_table', 1),
(18, '2025_11_30_081219_create_payments_table', 1),
(19, '2025_11_30_081219_create_payouts_table', 1),
(20, '2025_11_30_081219_create_settings_table', 1),
(21, '2025_11_30_081219_create_subscriptions_table', 1),
(22, '2025_11_30_081219_create_users_table', 1),
(23, '2025_11_30_081219_create_voucher_transactions_table', 1),
(24, '2025_11_30_081219_create_vouchers_table', 1),
(25, '2025_11_30_092803_create_super_admins_table', 1),
(26, '2025_11_30_104318_add_natures_table', 1),
(27, '2025_11_30_104409_add_sub_natures_table', 1),
(28, '2025_11_30_111259_add_soft_deletes_to_vouchers_table', 1),
(29, '2025_11_30_112000_recreate_ledger_tables', 1),
(30, '2025_12_02_080100_create_car_brands_table', 1),
(31, '2025_12_02_080239_create_service_categories_table', 1),
(32, '2025_12_02_080733_create_services_table', 1),
(33, '2025_12_02_080801_create_spare_part_categories_table', 1),
(34, '2025_12_02_081307_create_car_models_table', 1),
(35, '2025_12_02_081405_create_spare_parts_table', 1),
(36, '2025_12_02_094014_add_soft_deletes_to_gomechanic_tables', 2),
(37, '2025_12_02_150000_add_soft_deletes_to_gomechanic_tables', 2),
(38, '2025_12_02_160000_add_soft_deletes_to_all_tables', 2),
(39, '2025_12_07_064144_add_ledger_type_to_ledgers_table', 3),
(40, '2025_12_07_065241_update_garages_table_schema', 4),
(41, '2025_12_10_100000_create_garages_admins_table', 5),
(42, '2025_12_11_100000_create_garage_appointments_table', 6),
(43, '2025_12_11_100001_create_garage_work_schedules_table', 6),
(44, '2025_12_11_100002_create_garage_ledgers_table', 6),
(45, '2025_12_11_100003_create_garage_natures_table', 7),
(46, '2025_12_11_100004_create_garage_sub_natures_table', 7),
(47, '2025_12_11_100005_add_garage_sub_nature_to_garage_ledgers_table', 7),
(48, '2025_12_11_100006_update_garage_appointments_table_structure', 8),
(49, '2025_12_11_100007_create_garage_appointment_reminders_table', 8),
(50, '2025_12_11_100008_create_garage_appointment_internal_notes_table', 8),
(51, '2025_12_11_100009_update_garage_appointments_for_summary', 9),
(52, '2025_12_11_100010_create_garage_appointment_labels_table', 9),
(53, '2025_12_11_100011_create_garage_appointment_label_pivot_table', 9),
(54, '2025_12_11_100012_create_garage_vehicles_table', 9),
(55, '2025_12_11_100013_create_garage_part_categories_table', 10),
(56, '2025_12_11_100014_create_garage_parts_table', 10),
(57, '2025_12_11_100015_create_garage_labor_categories_table', 10),
(58, '2025_12_11_100016_create_garage_labors_table', 10),
(59, '2025_12_11_100017_create_garage_service_groups_table', 10),
(60, '2025_12_11_100018_create_garage_service_group_items_table', 10),
(61, '2025_12_11_100019_create_garage_inventory_adjustments_table', 10),
(62, '2025_12_11_100020_create_garage_inventory_adjustment_items_table', 11),
(63, '2025_12_11_100021_create_garage_inspections_table', 11),
(64, '2025_12_11_100022_create_garage_vouchers_table', 12),
(65, '2025_12_11_100023_create_garage_voucher_transactions_table', 12),
(66, '2025_12_11_100024_create_garage_estimates_table', 13),
(67, '2025_12_11_100025_create_garage_estimate_items_table', 13),
(68, '2025_12_11_100026_create_garage_work_orders_table', 13),
(69, '2025_12_11_100027_create_garage_work_order_items_table', 13),
(70, '2025_12_11_100028_create_garage_invoices_table', 13),
(71, '2025_12_11_100029_create_garage_invoice_items_table', 13),
(72, '2025_12_11_100030_create_garage_payments_received_table', 13),
(73, '2026_02_25_010000_update_modules_table_structure', 14),
(74, '2026_02_28_000001_update_packages_table_structure', 15),
(75, '2026_02_28_000002_update_package_modules_table_structure', 16),
(76, '2026_02_28_000003_update_subscriptions_table_structure', 17);

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

--
-- Table structure for table `modules`
--

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

--
-- Dumping data for table `modules`
--

INSERT INTO `modules` (`id`, `name`, `slug`, `description`, `is_active`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'Accounting', 'acc', 'test', 1, '2026-02-28 01:38:11', '2026-02-28 01:40:05', NULL),
(2, 'Services', 'serv', 'test', 1, '2026-02-28 01:39:39', '2026-02-28 01:39:39', NULL),
(3, 'Inventory', 'Inv', 'test', 1, '2026-02-28 01:39:57', '2026-02-28 01:39:57', NULL),
(4, 'Reports', 'rep', 'test', 1, '2026-02-28 01:40:15', '2026-02-28 01:40:15', NULL),
(5, 'Bookings', 'book', 'test', 1, '2026-02-28 01:40:52', '2026-02-28 01:40:52', NULL);

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

--
-- Table structure for table `natures`
--

CREATE TABLE `natures` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) NOT NULL,
  `type` enum('debit','credit') NOT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `natures`
--

INSERT INTO `natures` (`id`, `name`, `code`, `type`, `description`, `is_active`, `sort_order`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'Assets', 'A', 'debit', 'Resources owned by the business', 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(2, 'Liabilities', 'L', 'credit', 'Obligations of the business', 1, 2, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(3, 'Capital/Equity', 'C', 'credit', 'Owner\'s equity in the business', 1, 3, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(4, 'Income', 'I', 'credit', 'Revenue and income', 1, 4, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(5, 'Expenses', 'E', 'debit', 'Costs of doing business', 1, 5, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL);

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

--
-- Table structure for table `orders`
--

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

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

--
-- Table structure for table `order_items`
--

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

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

--
-- Table structure for table `packages`
--

CREATE TABLE `packages` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `price` decimal(10,2) NOT NULL DEFAULT 0.00,
  `billing_period` varchar(255) NOT NULL DEFAULT 'monthly',
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `packages`
--

INSERT INTO `packages` (`id`, `name`, `slug`, `description`, `price`, `billing_period`, `is_active`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'Package 1', 'pck1', 'test', 15000.00, 'monthly', 1, '2026-02-28 01:59:16', '2026-02-28 01:59:16', NULL),
(2, 'Package 2', 'pck2', 'test', 12000.00, 'monthly', 1, '2026-02-28 01:59:50', '2026-02-28 01:59:50', NULL),
(3, 'Package 3', 'pck3', 'test', 8000.00, 'monthly', 1, '2026-02-28 02:00:10', '2026-02-28 02:00:10', NULL);

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

--
-- Table structure for table `package_modules`
--

CREATE TABLE `package_modules` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `package_id` bigint(20) UNSIGNED NOT NULL,
  `module_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 for table `package_modules`
--

INSERT INTO `package_modules` (`id`, `package_id`, `module_id`, `created_at`, `updated_at`) VALUES
(1, 1, 1, '2026-02-28 01:59:16', '2026-02-28 01:59:16'),
(2, 1, 5, '2026-02-28 01:59:16', '2026-02-28 01:59:16'),
(3, 2, 3, '2026-02-28 01:59:50', '2026-02-28 01:59:50'),
(4, 2, 2, '2026-02-28 01:59:50', '2026-02-28 01:59:50'),
(5, 3, 4, '2026-02-28 02:00:10', '2026-02-28 02:00:10');

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

--
-- Table structure for table `payments`
--

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

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

--
-- Table structure for table `payouts`
--

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

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

--
-- Table structure for table `services`
--

CREATE TABLE `services` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `service_category_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `includes` text DEFAULT NULL,
  `base_price` decimal(10,2) NOT NULL DEFAULT 0.00,
  `estimated_time` int(11) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `services`
--

INSERT INTO `services` (`id`, `service_category_id`, `name`, `slug`, `description`, `includes`, `base_price`, `estimated_time`, `is_active`, `sort_order`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 1, 'Basic Service', 'basic-service', NULL, NULL, 2499.00, 180, 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(2, 1, 'Standard Service', 'standard-service', NULL, NULL, 4499.00, 240, 1, 2, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(3, 1, 'Comprehensive Service', 'comprehensive-service', NULL, NULL, 6999.00, 300, 1, 3, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(4, 1, 'Oil Change', 'oil-change', NULL, NULL, 1499.00, 60, 1, 4, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(5, 1, 'Wheel Care', 'wheel-care', NULL, NULL, 599.00, 90, 1, 5, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(6, 2, 'AC Service & Repair', 'ac-service-repair', NULL, NULL, 1999.00, 120, 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(7, 2, 'AC Gas Refill/Top Up', 'ac-gas-refilltop-up', NULL, NULL, 2499.00, 90, 1, 2, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(8, 2, 'AC Condenser Replacement', 'ac-condenser-replacement', NULL, NULL, 4999.00, 180, 1, 3, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(9, 2, 'AC Compressor Replacement', 'ac-compressor-replacement', NULL, NULL, 8999.00, 240, 1, 4, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(10, 2, 'Heater Blower Replacement', 'heater-blower-replacement', NULL, NULL, 3499.00, 150, 1, 5, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(11, 3, 'Interior Dry Cleaning', 'interior-dry-cleaning', NULL, NULL, 1999.00, 120, 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(12, 3, 'Complete Detailing', 'complete-detailing', NULL, NULL, 4999.00, 300, 1, 2, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(13, 3, 'Ceramic Coating', 'ceramic-coating', NULL, NULL, 9999.00, 360, 1, 3, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(14, 3, 'PPF (Paint Protection Film)', 'ppf-paint-protection-film', NULL, NULL, 24999.00, 480, 1, 4, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(15, 3, 'Teflon Coating', 'teflon-coating', NULL, NULL, 2999.00, 180, 1, 5, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(16, 4, 'Headlight Bulb Replacement', 'headlight-bulb-replacement', NULL, NULL, 599.00, 30, 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(17, 4, 'Taillight Replacement', 'taillight-replacement', NULL, NULL, 799.00, 45, 1, 2, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(18, 4, 'Fog Light Installation', 'fog-light-installation', NULL, NULL, 1499.00, 90, 1, 3, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(19, 4, 'LED Conversion', 'led-conversion', NULL, NULL, 2999.00, 120, 1, 4, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(20, 4, 'Headlight Restoration', 'headlight-restoration', NULL, NULL, 1999.00, 90, 1, 5, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(21, 5, 'Minor Dent Repair', 'minor-dent-repair', NULL, NULL, 1999.00, 240, 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(22, 5, 'Major Dent Repair', 'major-dent-repair', NULL, NULL, 4999.00, 480, 1, 2, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(23, 5, 'Bumper Painting', 'bumper-painting', NULL, NULL, 3499.00, 360, 1, 3, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(24, 5, 'Full Body Painting', 'full-body-painting', NULL, NULL, 24999.00, 1440, 1, 4, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(25, 5, 'Scratches & Scuffs', 'scratches-scuffs', NULL, NULL, 1499.00, 180, 1, 5, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(26, 6, 'Insurance Claim Support', 'insurance-claim-support', NULL, NULL, 0.00, 120, 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(27, 6, 'Accidental Repair', 'accidental-repair', NULL, NULL, 9999.00, 720, 1, 2, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(28, 6, 'Insurance Renewal', 'insurance-renewal', NULL, NULL, 0.00, 60, 1, 3, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(29, 7, 'Engine Repair', 'engine-repair', NULL, NULL, 7999.00, 480, 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(30, 7, 'Transmission Repair', 'transmission-repair', NULL, NULL, 9999.00, 600, 1, 2, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(31, 7, 'Suspension Repair', 'suspension-repair', NULL, NULL, 4999.00, 300, 1, 3, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(32, 7, 'Clutch Replacement', 'clutch-replacement', NULL, NULL, 5999.00, 360, 1, 4, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(33, 7, 'Brake System Repair', 'brake-system-repair', NULL, NULL, 3499.00, 240, 1, 5, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(34, 8, 'Battery Replacement (Amaron)', 'battery-replacement-amaron', NULL, NULL, 4999.00, 45, 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(35, 8, 'Battery Replacement (Exide)', 'battery-replacement-exide', NULL, NULL, 4799.00, 45, 1, 2, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(36, 8, 'Battery Health Check', 'battery-health-check', NULL, NULL, 0.00, 30, 1, 3, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(37, 8, 'Jump Start Service', 'jump-start-service', NULL, NULL, 499.00, 30, 1, 4, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(38, 9, 'Tyre Replacement (Single)', 'tyre-replacement-single', NULL, NULL, 3999.00, 60, 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(39, 9, 'Wheel Alignment', 'wheel-alignment', NULL, NULL, 799.00, 60, 1, 2, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(40, 9, 'Wheel Balancing', 'wheel-balancing', NULL, NULL, 599.00, 45, 1, 3, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(41, 9, 'Tyre Rotation', 'tyre-rotation', NULL, NULL, 499.00, 45, 1, 4, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(42, 9, 'Puncture Repair', 'puncture-repair', NULL, NULL, 199.00, 30, 1, 5, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(43, 10, 'Car Spa & Polish', 'car-spa-polish', NULL, NULL, 2999.00, 240, 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(44, 10, 'Rubbing & Polishing', 'rubbing-polishing', NULL, NULL, 3999.00, 300, 1, 2, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(45, 10, 'Underbody Coating', 'underbody-coating', NULL, NULL, 2499.00, 180, 1, 3, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(46, 10, 'Engine Bay Cleaning', 'engine-bay-cleaning', NULL, NULL, 999.00, 90, 1, 4, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(47, 11, 'Windshield Replacement', 'windshield-replacement', NULL, NULL, 7999.00, 240, 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(48, 11, 'Side Glass Replacement', 'side-glass-replacement', NULL, NULL, 3999.00, 120, 1, 2, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(49, 11, 'Windshield Chip Repair', 'windshield-chip-repair', NULL, NULL, 999.00, 60, 1, 3, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(50, 11, 'Mirror Replacement', 'mirror-replacement', NULL, NULL, 1999.00, 90, 1, 4, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL);

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

--
-- Table structure for table `service_categories`
--

CREATE TABLE `service_categories` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `icon` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `service_categories`
--

INSERT INTO `service_categories` (`id`, `name`, `slug`, `icon`, `description`, `is_active`, `sort_order`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'Scheduled Services', 'scheduled-services', '🛞', 'Regular maintenance and scheduled services', 1, 1, '2025-12-02 04:26:14', '2026-02-23 06:09:29', NULL),
(2, 'AC Services', 'ac-services', '💨', 'AC repair, service, and maintenance', 1, 2, '2025-12-02 04:26:14', '2026-02-23 06:09:46', NULL),
(3, 'Cleaning & Detailing', 'cleaning-detailing', '🚗', 'Car washing, interior cleaning, and detailing', 1, 3, '2025-12-02 04:26:14', '2026-02-23 06:09:58', NULL),
(4, 'Lights & Fitments', 'lights-fitments', '????', 'Headlight, taillight, and other fitment services', 1, 4, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(5, 'Denting Painting', 'denting-painting', '????', 'Body repair, denting, and painting services', 1, 5, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(6, 'Insurance Services', 'insurance-services', '???????', 'Insurance claim and related services', 1, 6, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(7, 'Custom Repair', 'custom-repair', '????', 'Custom repairs and modifications', 1, 7, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(8, 'Batteries', 'batteries', '????', 'Battery replacement and services', 1, 8, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(9, 'Tyres', 'tyres', '????', 'Tyre replacement, alignment, and balancing', 1, 9, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(10, 'Detailing Services', 'detailing-services', '????', 'Professional car detailing and spa', 1, 10, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(11, 'Windshields & Glass', 'windshields-glass', '????', 'Windshield replacement and glass services', 1, 11, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(12, 'repairing lab', 'repairing-lab', '⚙️', 'test', 1, 10, '2026-02-23 06:09:02', '2026-02-23 06:09:02', NULL);

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

--
-- Table structure for table `settings`
--

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

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

--
-- Table structure for table `spare_parts`
--

CREATE TABLE `spare_parts` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `spare_part_category_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `part_number` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `brand` varchar(255) DEFAULT NULL,
  `base_price` decimal(10,2) NOT NULL DEFAULT 0.00,
  `warranty` varchar(255) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `spare_parts`
--

INSERT INTO `spare_parts` (`id`, `spare_part_category_id`, `name`, `slug`, `part_number`, `description`, `brand`, `base_price`, `warranty`, `is_active`, `sort_order`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 1, 'Air Filter', 'air-filter', NULL, NULL, NULL, 499.00, '6 months', 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(2, 1, 'Oil Filter', 'oil-filter', NULL, NULL, NULL, 299.00, '6 months', 1, 2, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(3, 1, 'Fuel Filter', 'fuel-filter', NULL, NULL, NULL, 599.00, '6 months', 1, 3, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(4, 1, 'Spark Plugs (Set of 4)', 'spark-plugs-set-of-4', NULL, NULL, NULL, 1299.00, '1 year', 1, 4, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(5, 1, 'Engine Oil (1L)', 'engine-oil-1l', NULL, NULL, NULL, 899.00, 'N/A', 1, 5, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(6, 1, 'Timing Belt', 'timing-belt', NULL, NULL, NULL, 2999.00, '1 year', 1, 6, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(7, 1, 'Water Pump', 'water-pump', NULL, NULL, NULL, 3499.00, '1 year', 1, 7, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(8, 1, 'Radiator', 'radiator', NULL, NULL, NULL, 5999.00, '1 year', 1, 8, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(9, 2, 'Brake Pads (Front)', 'brake-pads-front', NULL, NULL, NULL, 1999.00, '1 year', 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(10, 2, 'Brake Pads (Rear)', 'brake-pads-rear', NULL, NULL, NULL, 1799.00, '1 year', 1, 2, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(11, 2, 'Brake Disc (Front)', 'brake-disc-front', NULL, NULL, NULL, 2999.00, '1 year', 1, 3, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(12, 2, 'Brake Disc (Rear)', 'brake-disc-rear', NULL, NULL, NULL, 2799.00, '1 year', 1, 4, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(13, 2, 'Brake Fluid (500ml)', 'brake-fluid-500ml', NULL, NULL, NULL, 399.00, 'N/A', 1, 5, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(14, 2, 'Brake Shoe Set', 'brake-shoe-set', NULL, NULL, NULL, 1499.00, '1 year', 1, 6, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(15, 3, 'Shock Absorber (Front)', 'shock-absorber-front', NULL, NULL, NULL, 3999.00, '1 year', 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(16, 3, 'Shock Absorber (Rear)', 'shock-absorber-rear', NULL, NULL, NULL, 3799.00, '1 year', 1, 2, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(17, 3, 'Strut Mount', 'strut-mount', NULL, NULL, NULL, 1499.00, '1 year', 1, 3, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(18, 3, 'Control Arm', 'control-arm', NULL, NULL, NULL, 2999.00, '1 year', 1, 4, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(19, 3, 'Ball Joint', 'ball-joint', NULL, NULL, NULL, 1799.00, '1 year', 1, 5, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(20, 3, 'Tie Rod End', 'tie-rod-end', NULL, NULL, NULL, 1299.00, '1 year', 1, 6, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(21, 4, 'Battery (12V)', 'battery-12v', NULL, NULL, NULL, 4999.00, '2 years', 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(22, 4, 'Alternator', 'alternator', NULL, NULL, NULL, 7999.00, '1 year', 1, 2, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(23, 4, 'Starter Motor', 'starter-motor', NULL, NULL, NULL, 6999.00, '1 year', 1, 3, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(24, 4, 'Headlight Bulb (Halogen)', 'headlight-bulb-halogen', NULL, NULL, NULL, 299.00, '6 months', 1, 4, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(25, 4, 'Headlight Bulb (LED)', 'headlight-bulb-led', NULL, NULL, NULL, 1299.00, '1 year', 1, 5, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(26, 4, 'Wiper Blade (Set)', 'wiper-blade-set', NULL, NULL, NULL, 599.00, '6 months', 1, 6, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(27, 5, 'AC Compressor', 'ac-compressor', NULL, NULL, NULL, 8999.00, '1 year', 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(28, 5, 'AC Condenser', 'ac-condenser', NULL, NULL, NULL, 4999.00, '1 year', 1, 2, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(29, 5, 'AC Gas (R134a)', 'ac-gas-r134a', NULL, NULL, NULL, 2499.00, 'N/A', 1, 3, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(30, 5, 'Cabin Air Filter', 'cabin-air-filter', NULL, NULL, NULL, 699.00, '6 months', 1, 4, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(31, 5, 'Blower Motor', 'blower-motor', NULL, NULL, NULL, 3499.00, '1 year', 1, 5, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(32, 6, 'Tyre (165/80 R14)', 'tyre-16580-r14', NULL, NULL, NULL, 3999.00, '5 years', 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(33, 6, 'Tyre (175/70 R14)', 'tyre-17570-r14', NULL, NULL, NULL, 4299.00, '5 years', 1, 2, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(34, 6, 'Tyre (185/65 R15)', 'tyre-18565-r15', NULL, NULL, NULL, 4999.00, '5 years', 1, 3, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(35, 6, 'Tyre (195/55 R16)', 'tyre-19555-r16', NULL, NULL, NULL, 5999.00, '5 years', 1, 4, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(36, 6, 'Alloy Wheel (14 inch)', 'alloy-wheel-14-inch', NULL, NULL, NULL, 3999.00, '1 year', 1, 5, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(37, 6, 'Wheel Cap (Set of 4)', 'wheel-cap-set-of-4', NULL, NULL, NULL, 799.00, '1 year', 1, 6, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(38, 7, 'Bumper (Front)', 'bumper-front', NULL, NULL, NULL, 4999.00, '1 year', 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(39, 7, 'Bumper (Rear)', 'bumper-rear', NULL, NULL, NULL, 4499.00, '1 year', 1, 2, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(40, 7, 'Side Mirror', 'side-mirror', NULL, NULL, NULL, 1999.00, '1 year', 1, 3, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(41, 7, 'Door Handle', 'door-handle', NULL, NULL, NULL, 899.00, '1 year', 1, 4, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(42, 7, 'Tail Light', 'tail-light', NULL, NULL, NULL, 2499.00, '1 year', 1, 5, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(43, 7, 'Headlight Assembly', 'headlight-assembly', NULL, NULL, NULL, 4999.00, '1 year', 1, 6, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(44, 8, 'Floor Mat (Set)', 'floor-mat-set', NULL, NULL, NULL, 1299.00, '1 year', 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(45, 8, 'Seat Cover (Set)', 'seat-cover-set', NULL, NULL, NULL, 2999.00, '1 year', 1, 2, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(46, 8, 'Dashboard Cover', 'dashboard-cover', NULL, NULL, NULL, 1499.00, '1 year', 1, 3, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(47, 8, 'Steering Wheel Cover', 'steering-wheel-cover', NULL, NULL, NULL, 499.00, '1 year', 1, 4, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(48, 8, 'Sun Visor', 'sun-visor', NULL, NULL, NULL, 799.00, '1 year', 1, 5, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(49, 9, 'Clutch Plate', 'clutch-plate', NULL, NULL, NULL, 2999.00, '1 year', 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(50, 9, 'Pressure Plate', 'pressure-plate', NULL, NULL, NULL, 3499.00, '1 year', 1, 2, '2025-12-02 04:26:15', '2025-12-02 04:26:15', NULL),
(51, 9, 'Release Bearing', 'release-bearing', NULL, NULL, NULL, 1299.00, '1 year', 1, 3, '2025-12-02 04:26:15', '2025-12-02 04:26:15', NULL),
(52, 9, 'Clutch Cable', 'clutch-cable', NULL, NULL, NULL, 599.00, '1 year', 1, 4, '2025-12-02 04:26:15', '2025-12-02 04:26:15', NULL),
(53, 10, 'Engine Oil 5W-30 (4L)', 'engine-oil-5w-30-4l', NULL, NULL, NULL, 2999.00, 'N/A', 1, 1, '2025-12-02 04:26:15', '2025-12-02 04:26:15', NULL),
(54, 10, 'Engine Oil 10W-40 (4L)', 'engine-oil-10w-40-4l', NULL, NULL, NULL, 2799.00, 'N/A', 1, 2, '2025-12-02 04:26:15', '2025-12-02 04:26:15', NULL),
(55, 10, 'Transmission Fluid (1L)', 'transmission-fluid-1l', NULL, NULL, NULL, 899.00, 'N/A', 1, 3, '2025-12-02 04:26:15', '2025-12-02 04:26:15', NULL),
(56, 10, 'Coolant (1L)', 'coolant-1l', NULL, NULL, NULL, 499.00, 'N/A', 1, 4, '2025-12-02 04:26:15', '2025-12-02 04:26:15', NULL),
(57, 10, 'Power Steering Fluid (500ml)', 'power-steering-fluid-500ml', NULL, NULL, NULL, 399.00, 'N/A', 1, 5, '2025-12-02 04:26:15', '2025-12-02 04:26:15', NULL),
(58, 10, 'Windshield Washer Fluid (1L)', 'windshield-washer-fluid-1l', NULL, NULL, NULL, 199.00, 'N/A', 1, 6, '2025-12-02 04:26:15', '2025-12-02 04:26:15', NULL);

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

--
-- Table structure for table `spare_part_categories`
--

CREATE TABLE `spare_part_categories` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `icon` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `spare_part_categories`
--

INSERT INTO `spare_part_categories` (`id`, `name`, `slug`, `icon`, `description`, `is_active`, `sort_order`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'Engine Parts', 'engine-parts', '??????', 'Engine components and parts', 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(2, 'Brake Parts', 'brake-parts', '????', 'Brake system components', 1, 2, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(3, 'Suspension Parts', 'suspension-parts', '????', 'Suspension and steering components', 1, 3, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(4, 'Electrical Parts', 'electrical-parts', '???', 'Electrical and electronic components', 1, 4, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(5, 'AC Parts', 'ac-parts', '??????', 'Air conditioning components', 1, 5, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(6, 'Tyres & Wheels', 'tyres-wheels', '????', 'Tyres and wheel components', 1, 6, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(7, 'Body Parts', 'body-parts', '????', 'Body panels and exterior parts', 1, 7, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(8, 'Interior Parts', 'interior-parts', '????', 'Interior components and accessories', 1, 8, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(9, 'Clutch Parts', 'clutch-parts', '??????', 'Clutch system components', 1, 9, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(10, 'Oils & Fluids', 'oils-fluids', '???????', 'Lubricants and fluids', 1, 10, '2025-12-02 04:26:15', '2025-12-02 04:26:15', NULL),
(11, 'Filters', 'filters', '⚙️', 'testing', 1, 10, '2026-02-23 06:26:35', '2026-02-23 06:26:35', NULL);

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

--
-- Table structure for table `subscriptions`
--

CREATE TABLE `subscriptions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED NOT NULL,
  `package_id` bigint(20) UNSIGNED NOT NULL,
  `price` decimal(10,2) NOT NULL DEFAULT 0.00,
  `starts_at` datetime DEFAULT NULL,
  `ends_at` datetime DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'active',
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `subscriptions`
--

INSERT INTO `subscriptions` (`id`, `garage_id`, `package_id`, `price`, `starts_at`, `ends_at`, `status`, `notes`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 3, 1, 5000.00, '2026-03-01 00:00:00', '2026-03-31 00:00:00', 'active', 'test', '2026-02-28 02:06:03', '2026-02-28 02:06:03', NULL),
(2, 8, 3, 8000.00, '2026-03-02 00:00:00', '2026-03-20 00:00:00', 'active', NULL, '2026-03-02 05:53:23', '2026-03-02 05:53:23', NULL);

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

--
-- Table structure for table `sub_natures`
--

CREATE TABLE `sub_natures` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `nature_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sub_natures`
--

INSERT INTO `sub_natures` (`id`, `nature_id`, `name`, `code`, `description`, `is_active`, `sort_order`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 1, 'Current Assets', 'CA', 'Assets convertible to cash within one year', 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(2, 1, 'Fixed Assets', 'FA', 'Long-term tangible assets', 1, 2, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(3, 2, 'Current Liabilities', 'CL', 'Obligations due within one year', 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(4, 2, 'Long Term Liabilities', 'LTL', 'Obligations due after one year', 1, 2, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(5, 3, 'Owners Equity', 'OE', 'Owner\'s capital and reserves', 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(6, 4, 'Operating Income', 'OI', 'Revenue from core business operations', 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(7, 4, 'Non-Operating Income', 'NOI', 'Revenue from secondary sources', 1, 2, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(8, 5, 'Operating Expenses', 'OPEX', 'Day-to-day business expenses', 1, 1, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL),
(9, 5, 'Non-Operating Expenses', 'NOE', 'Expenses outside core operations', 1, 2, '2025-12-02 04:26:14', '2025-12-02 04:26:14', NULL);

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

--
-- Table structure for table `users`
--

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

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

--
-- Table structure for table `vouchers`
--

CREATE TABLE `vouchers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `garage_id` bigint(20) UNSIGNED DEFAULT NULL,
  `voucher_type` enum('journal','receipt','payment','contra') NOT NULL,
  `voucher_no` varchar(255) NOT NULL,
  `voucher_date` date NOT NULL,
  `reference_no` varchar(255) DEFAULT NULL,
  `narration` text DEFAULT NULL,
  `total_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `created_by` bigint(20) UNSIGNED NOT NULL,
  `approved_by` bigint(20) UNSIGNED DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `status` enum('draft','posted','cancelled') NOT NULL DEFAULT 'draft',
  `cheque_no` varchar(255) DEFAULT NULL,
  `cheque_date` date DEFAULT NULL,
  `cheque_bank` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vouchers`
--

INSERT INTO `vouchers` (`id`, `garage_id`, `voucher_type`, `voucher_no`, `voucher_date`, `reference_no`, `narration`, `total_amount`, `created_by`, `approved_by`, `approved_at`, `status`, `cheque_no`, `cheque_date`, `cheque_bank`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, NULL, 'journal', 'JO-2512-0001', '2025-12-02', NULL, NULL, 10.00, 1, NULL, NULL, 'posted', NULL, NULL, NULL, '2025-12-02 06:02:38', '2025-12-02 06:02:38', NULL);

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

--
-- Table structure for table `voucher_transactions`
--

CREATE TABLE `voucher_transactions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `voucher_id` bigint(20) UNSIGNED NOT NULL,
  `ledger_id` bigint(20) UNSIGNED NOT NULL,
  `transaction_type` enum('debit','credit') NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `narration` text DEFAULT NULL,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `voucher_transactions`
--

INSERT INTO `voucher_transactions` (`id`, `voucher_id`, `ledger_id`, `transaction_type`, `amount`, `narration`, `sort_order`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 1, 1, 'debit', 10.00, NULL, 0, '2025-12-02 06:02:38', '2025-12-02 06:02:38', NULL),
(2, 1, 2, 'credit', 10.00, NULL, 1, '2025-12-02 06:02:38', '2025-12-02 06:02:38', NULL);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `activity_logs`
--
ALTER TABLE `activity_logs`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `areas`
--
ALTER TABLE `areas`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `audit_logs`
--
ALTER TABLE `audit_logs`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `car_brands`
--
ALTER TABLE `car_brands`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `car_brands_slug_unique` (`slug`);

--
-- Indexes for table `car_models`
--
ALTER TABLE `car_models`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `car_models_car_brand_id_slug_unique` (`car_brand_id`,`slug`);

--
-- Indexes for table `categories`
--
ALTER TABLE `categories`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `cities`
--
ALTER TABLE `cities`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `garages`
--
ALTER TABLE `garages`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `garage_appointments`
--
ALTER TABLE `garage_appointments`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `garage_appointments_appointment_number_unique` (`appointment_number`),
  ADD KEY `garage_appointments_garage_admin_id_foreign` (`garage_admin_id`),
  ADD KEY `garage_appointments_garage_id_index` (`garage_id`),
  ADD KEY `garage_appointments_garage_id_appointment_date_index` (`garage_id`,`appointment_date`),
  ADD KEY `garage_appointments_garage_id_status_index` (`garage_id`,`status`),
  ADD KEY `garage_appointments_service_writer_id_foreign` (`service_writer_id`),
  ADD KEY `garage_appointments_technician_id_foreign` (`technician_id`),
  ADD KEY `garage_appointments_appointment_number_index` (`appointment_number`),
  ADD KEY `garage_appointments_garage_id_start_time_end_time_index` (`garage_id`,`start_time`,`end_time`),
  ADD KEY `garage_appointments_order_number_index` (`order_number`);

--
-- Indexes for table `garage_appointment_internal_notes`
--
ALTER TABLE `garage_appointment_internal_notes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `garage_appointment_internal_notes_created_by_foreign` (`created_by`),
  ADD KEY `garage_appointment_internal_notes_garage_id_index` (`garage_id`),
  ADD KEY `garage_appointment_internal_notes_appointment_id_index` (`appointment_id`);

--
-- Indexes for table `garage_appointment_labels`
--
ALTER TABLE `garage_appointment_labels`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `garage_appointment_labels_garage_id_name_unique` (`garage_id`,`name`),
  ADD KEY `garage_appointment_labels_garage_id_index` (`garage_id`);

--
-- Indexes for table `garage_appointment_label_pivot`
--
ALTER TABLE `garage_appointment_label_pivot`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `garage_appointment_label_pivot_appointment_id_label_id_unique` (`appointment_id`,`label_id`),
  ADD KEY `garage_appointment_label_pivot_garage_id_index` (`garage_id`),
  ADD KEY `garage_appointment_label_pivot_appointment_id_index` (`appointment_id`),
  ADD KEY `garage_appointment_label_pivot_label_id_index` (`label_id`);

--
-- Indexes for table `garage_appointment_reminders`
--
ALTER TABLE `garage_appointment_reminders`
  ADD PRIMARY KEY (`id`),
  ADD KEY `garage_appointment_reminders_garage_id_index` (`garage_id`),
  ADD KEY `garage_appointment_reminders_appointment_id_index` (`appointment_id`),
  ADD KEY `garage_appointment_reminders_reminder_date_reminder_time_index` (`reminder_date`,`reminder_time`);

--
-- Indexes for table `garage_estimates`
--
ALTER TABLE `garage_estimates`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `garage_estimates_estimate_number_unique` (`estimate_number`),
  ADD KEY `garage_estimates_garage_admin_id_foreign` (`garage_admin_id`),
  ADD KEY `garage_estimates_customer_ledger_id_foreign` (`customer_ledger_id`),
  ADD KEY `garage_estimates_vehicle_id_foreign` (`vehicle_id`),
  ADD KEY `garage_estimates_garage_id_index` (`garage_id`),
  ADD KEY `garage_estimates_estimate_number_index` (`estimate_number`),
  ADD KEY `garage_estimates_estimate_date_index` (`estimate_date`),
  ADD KEY `garage_estimates_status_index` (`status`),
  ADD KEY `garage_estimates_garage_id_estimate_number_index` (`garage_id`,`estimate_number`);

--
-- Indexes for table `garage_estimate_items`
--
ALTER TABLE `garage_estimate_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `garage_estimate_items_part_id_foreign` (`part_id`),
  ADD KEY `garage_estimate_items_labor_id_foreign` (`labor_id`),
  ADD KEY `garage_estimate_items_service_group_id_foreign` (`service_group_id`),
  ADD KEY `garage_estimate_items_garage_id_index` (`garage_id`),
  ADD KEY `garage_estimate_items_garage_estimate_id_index` (`garage_estimate_id`);

--
-- Indexes for table `garage_inspections`
--
ALTER TABLE `garage_inspections`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `garage_inspections_inspection_number_unique` (`inspection_number`),
  ADD KEY `garage_inspections_garage_admin_id_foreign` (`garage_admin_id`),
  ADD KEY `garage_inspections_customer_ledger_id_foreign` (`customer_ledger_id`),
  ADD KEY `garage_inspections_vehicle_id_foreign` (`vehicle_id`),
  ADD KEY `garage_inspections_garage_id_index` (`garage_id`),
  ADD KEY `garage_inspections_inspection_number_index` (`inspection_number`),
  ADD KEY `garage_inspections_inspection_date_index` (`inspection_date`),
  ADD KEY `garage_inspections_garage_id_status_index` (`garage_id`,`status`);

--
-- Indexes for table `garage_inventory_adjustments`
--
ALTER TABLE `garage_inventory_adjustments`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `garage_inventory_adjustments_adjustment_number_unique` (`adjustment_number`),
  ADD KEY `garage_inventory_adjustments_garage_admin_id_foreign` (`garage_admin_id`),
  ADD KEY `garage_inventory_adjustments_garage_id_index` (`garage_id`),
  ADD KEY `garage_inventory_adjustments_adjustment_number_index` (`adjustment_number`),
  ADD KEY `garage_inventory_adjustments_adjustment_date_index` (`adjustment_date`);

--
-- Indexes for table `garage_inventory_adjustment_items`
--
ALTER TABLE `garage_inventory_adjustment_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `garage_inventory_adjustment_items_garage_id_foreign` (`garage_id`);

--
-- Indexes for table `garage_invoices`
--
ALTER TABLE `garage_invoices`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `garage_invoices_invoice_number_unique` (`invoice_number`),
  ADD KEY `garage_invoices_garage_admin_id_foreign` (`garage_admin_id`),
  ADD KEY `garage_invoices_customer_ledger_id_foreign` (`customer_ledger_id`),
  ADD KEY `garage_invoices_vehicle_id_foreign` (`vehicle_id`),
  ADD KEY `garage_invoices_work_order_id_foreign` (`work_order_id`),
  ADD KEY `garage_invoices_estimate_id_foreign` (`estimate_id`),
  ADD KEY `garage_invoices_garage_id_index` (`garage_id`),
  ADD KEY `garage_invoices_invoice_number_index` (`invoice_number`),
  ADD KEY `garage_invoices_invoice_date_index` (`invoice_date`),
  ADD KEY `garage_invoices_due_date_index` (`due_date`),
  ADD KEY `garage_invoices_status_index` (`status`),
  ADD KEY `garage_invoices_garage_id_invoice_number_index` (`garage_id`,`invoice_number`);

--
-- Indexes for table `garage_invoice_items`
--
ALTER TABLE `garage_invoice_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `garage_invoice_items_part_id_foreign` (`part_id`),
  ADD KEY `garage_invoice_items_labor_id_foreign` (`labor_id`),
  ADD KEY `garage_invoice_items_service_group_id_foreign` (`service_group_id`),
  ADD KEY `garage_invoice_items_garage_id_index` (`garage_id`),
  ADD KEY `garage_invoice_items_garage_invoice_id_index` (`garage_invoice_id`);

--
-- Indexes for table `garage_labors`
--
ALTER TABLE `garage_labors`
  ADD PRIMARY KEY (`id`),
  ADD KEY `garage_labors_garage_id_index` (`garage_id`),
  ADD KEY `garage_labors_garage_labor_category_id_index` (`garage_labor_category_id`),
  ADD KEY `garage_labors_garage_id_code_index` (`garage_id`,`code`);

--
-- Indexes for table `garage_labor_categories`
--
ALTER TABLE `garage_labor_categories`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `garage_labor_categories_garage_id_code_unique` (`garage_id`,`code`),
  ADD KEY `garage_labor_categories_garage_id_index` (`garage_id`);

--
-- Indexes for table `garage_ledgers`
--
ALTER TABLE `garage_ledgers`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `garage_ledgers_garage_id_code_unique` (`garage_id`,`code`),
  ADD KEY `garage_ledgers_ledger_group_id_foreign` (`ledger_group_id`),
  ADD KEY `garage_ledgers_garage_id_index` (`garage_id`),
  ADD KEY `garage_ledgers_garage_id_ledger_type_index` (`garage_id`,`ledger_type`),
  ADD KEY `garage_ledgers_garage_id_code_index` (`garage_id`,`code`),
  ADD KEY `garage_ledgers_garage_sub_nature_id_index` (`garage_sub_nature_id`);

--
-- Indexes for table `garage_natures`
--
ALTER TABLE `garage_natures`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `garage_natures_garage_id_code_unique` (`garage_id`,`code`),
  ADD KEY `garage_natures_garage_id_index` (`garage_id`),
  ADD KEY `garage_natures_garage_id_code_index` (`garage_id`,`code`);

--
-- Indexes for table `garage_parts`
--
ALTER TABLE `garage_parts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `garage_parts_garage_id_index` (`garage_id`),
  ADD KEY `garage_parts_garage_part_category_id_index` (`garage_part_category_id`),
  ADD KEY `garage_parts_garage_id_part_number_index` (`garage_id`,`part_number`),
  ADD KEY `garage_parts_garage_id_code_index` (`garage_id`,`code`);

--
-- Indexes for table `garage_part_categories`
--
ALTER TABLE `garage_part_categories`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `garage_part_categories_garage_id_code_unique` (`garage_id`,`code`),
  ADD KEY `garage_part_categories_garage_id_index` (`garage_id`);

--
-- Indexes for table `garage_payments_received`
--
ALTER TABLE `garage_payments_received`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `garage_payments_received_payment_number_unique` (`payment_number`),
  ADD KEY `garage_payments_received_garage_admin_id_foreign` (`garage_admin_id`),
  ADD KEY `garage_payments_received_customer_ledger_id_foreign` (`customer_ledger_id`),
  ADD KEY `garage_payments_received_invoice_id_foreign` (`invoice_id`),
  ADD KEY `garage_payments_received_garage_id_index` (`garage_id`),
  ADD KEY `garage_payments_received_payment_number_index` (`payment_number`),
  ADD KEY `garage_payments_received_payment_date_index` (`payment_date`),
  ADD KEY `garage_payments_received_status_index` (`status`),
  ADD KEY `garage_payments_received_garage_id_payment_number_index` (`garage_id`,`payment_number`);

--
-- Indexes for table `garage_service_groups`
--
ALTER TABLE `garage_service_groups`
  ADD PRIMARY KEY (`id`),
  ADD KEY `garage_service_groups_garage_id_index` (`garage_id`),
  ADD KEY `garage_service_groups_garage_id_code_index` (`garage_id`,`code`);

--
-- Indexes for table `garage_service_group_items`
--
ALTER TABLE `garage_service_group_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `garage_service_group_items_part_id_foreign` (`part_id`),
  ADD KEY `garage_service_group_items_labor_id_foreign` (`labor_id`),
  ADD KEY `garage_service_group_items_garage_id_index` (`garage_id`),
  ADD KEY `garage_service_group_items_garage_service_group_id_index` (`garage_service_group_id`),
  ADD KEY `garage_service_group_items_item_type_part_id_index` (`item_type`,`part_id`),
  ADD KEY `garage_service_group_items_item_type_labor_id_index` (`item_type`,`labor_id`);

--
-- Indexes for table `garage_sub_natures`
--
ALTER TABLE `garage_sub_natures`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `garage_sub_natures_garage_id_code_unique` (`garage_id`,`code`),
  ADD KEY `garage_sub_natures_garage_id_index` (`garage_id`),
  ADD KEY `garage_sub_natures_garage_nature_id_index` (`garage_nature_id`),
  ADD KEY `garage_sub_natures_garage_id_code_index` (`garage_id`,`code`);

--
-- Indexes for table `garage_vehicles`
--
ALTER TABLE `garage_vehicles`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `garage_vehicles_garage_id_registration_number_unique` (`garage_id`,`registration_number`),
  ADD KEY `garage_vehicles_garage_id_index` (`garage_id`),
  ADD KEY `garage_vehicles_customer_ledger_id_index` (`customer_ledger_id`),
  ADD KEY `garage_vehicles_registration_number_index` (`registration_number`),
  ADD KEY `garage_vehicles_garage_id_registration_number_index` (`garage_id`,`registration_number`);

--
-- Indexes for table `garage_vouchers`
--
ALTER TABLE `garage_vouchers`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `garage_vouchers_garage_id_voucher_no_unique` (`garage_id`,`voucher_no`),
  ADD KEY `garage_vouchers_garage_admin_id_foreign` (`garage_admin_id`),
  ADD KEY `garage_vouchers_approved_by_foreign` (`approved_by`),
  ADD KEY `garage_vouchers_garage_id_index` (`garage_id`),
  ADD KEY `garage_vouchers_voucher_type_index` (`voucher_type`),
  ADD KEY `garage_vouchers_voucher_date_index` (`voucher_date`),
  ADD KEY `garage_vouchers_status_index` (`status`);

--
-- Indexes for table `garage_voucher_transactions`
--
ALTER TABLE `garage_voucher_transactions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `garage_voucher_transactions_garage_id_index` (`garage_id`),
  ADD KEY `garage_voucher_transactions_garage_voucher_id_index` (`garage_voucher_id`),
  ADD KEY `garage_voucher_transactions_garage_ledger_id_index` (`garage_ledger_id`);

--
-- Indexes for table `garage_work_orders`
--
ALTER TABLE `garage_work_orders`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `garage_work_orders_work_order_number_unique` (`work_order_number`),
  ADD KEY `garage_work_orders_garage_admin_id_foreign` (`garage_admin_id`),
  ADD KEY `garage_work_orders_customer_ledger_id_foreign` (`customer_ledger_id`),
  ADD KEY `garage_work_orders_vehicle_id_foreign` (`vehicle_id`),
  ADD KEY `garage_work_orders_estimate_id_foreign` (`estimate_id`),
  ADD KEY `garage_work_orders_garage_id_index` (`garage_id`),
  ADD KEY `garage_work_orders_work_order_number_index` (`work_order_number`),
  ADD KEY `garage_work_orders_work_order_date_index` (`work_order_date`),
  ADD KEY `garage_work_orders_status_index` (`status`),
  ADD KEY `garage_work_orders_garage_id_work_order_number_index` (`garage_id`,`work_order_number`);

--
-- Indexes for table `garage_work_order_items`
--
ALTER TABLE `garage_work_order_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `garage_work_order_items_part_id_foreign` (`part_id`),
  ADD KEY `garage_work_order_items_labor_id_foreign` (`labor_id`),
  ADD KEY `garage_work_order_items_service_group_id_foreign` (`service_group_id`),
  ADD KEY `garage_work_order_items_garage_id_index` (`garage_id`),
  ADD KEY `garage_work_order_items_garage_work_order_id_index` (`garage_work_order_id`);

--
-- Indexes for table `garage_work_schedules`
--
ALTER TABLE `garage_work_schedules`
  ADD PRIMARY KEY (`id`),
  ADD KEY `garage_work_schedules_garage_admin_id_foreign` (`garage_admin_id`),
  ADD KEY `garage_work_schedules_garage_id_day_of_week_index` (`garage_id`,`day_of_week`),
  ADD KEY `garage_work_schedules_garage_id_specific_date_index` (`garage_id`,`specific_date`);

--
-- Indexes for table `ledgers`
--
ALTER TABLE `ledgers`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `ledgers_code_unique` (`code`),
  ADD KEY `ledgers_ledger_group_id_foreign` (`ledger_group_id`),
  ADD KEY `ledgers_garage_id_foreign` (`garage_id`);

--
-- Indexes for table `ledger_groups`
--
ALTER TABLE `ledger_groups`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `ledger_groups_code_unique` (`code`),
  ADD KEY `ledger_groups_sub_nature_id_foreign` (`sub_nature_id`);

--
-- Indexes for table `marketplace_items`
--
ALTER TABLE `marketplace_items`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `marketplace_mechanics`
--
ALTER TABLE `marketplace_mechanics`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `marketplace_services`
--
ALTER TABLE `marketplace_services`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `modules`
--
ALTER TABLE `modules`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `natures`
--
ALTER TABLE `natures`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `natures_code_unique` (`code`);

--
-- Indexes for table `orders`
--
ALTER TABLE `orders`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `order_items`
--
ALTER TABLE `order_items`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `packages`
--
ALTER TABLE `packages`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `packages_slug_unique` (`slug`);

--
-- Indexes for table `package_modules`
--
ALTER TABLE `package_modules`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `package_modules_package_id_module_id_unique` (`package_id`,`module_id`),
  ADD KEY `package_modules_module_id_foreign` (`module_id`);

--
-- Indexes for table `payments`
--
ALTER TABLE `payments`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `payouts`
--
ALTER TABLE `payouts`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `services`
--
ALTER TABLE `services`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `services_slug_unique` (`slug`),
  ADD KEY `services_service_category_id_foreign` (`service_category_id`);

--
-- Indexes for table `service_categories`
--
ALTER TABLE `service_categories`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `service_categories_slug_unique` (`slug`);

--
-- Indexes for table `settings`
--
ALTER TABLE `settings`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `spare_parts`
--
ALTER TABLE `spare_parts`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `spare_parts_slug_unique` (`slug`),
  ADD KEY `spare_parts_spare_part_category_id_foreign` (`spare_part_category_id`);

--
-- Indexes for table `spare_part_categories`
--
ALTER TABLE `spare_part_categories`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `spare_part_categories_slug_unique` (`slug`);

--
-- Indexes for table `subscriptions`
--
ALTER TABLE `subscriptions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `subscriptions_garage_id_foreign` (`garage_id`),
  ADD KEY `subscriptions_package_id_foreign` (`package_id`);

--
-- Indexes for table `sub_natures`
--
ALTER TABLE `sub_natures`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `sub_natures_code_unique` (`code`),
  ADD KEY `sub_natures_nature_id_foreign` (`nature_id`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `vouchers`
--
ALTER TABLE `vouchers`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `vouchers_voucher_no_unique` (`voucher_no`),
  ADD KEY `vouchers_garage_id_foreign` (`garage_id`),
  ADD KEY `vouchers_created_by_foreign` (`created_by`),
  ADD KEY `vouchers_approved_by_foreign` (`approved_by`);

--
-- Indexes for table `voucher_transactions`
--
ALTER TABLE `voucher_transactions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `voucher_transactions_voucher_id_foreign` (`voucher_id`),
  ADD KEY `voucher_transactions_ledger_id_foreign` (`ledger_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `activity_logs`
--
ALTER TABLE `activity_logs`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `areas`
--
ALTER TABLE `areas`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `audit_logs`
--
ALTER TABLE `audit_logs`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `car_brands`
--
ALTER TABLE `car_brands`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24;

--
-- AUTO_INCREMENT for table `car_models`
--
ALTER TABLE `car_models`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `categories`
--
ALTER TABLE `categories`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `cities`
--
ALTER TABLE `cities`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `garages`
--
ALTER TABLE `garages`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `garage_appointments`
--
ALTER TABLE `garage_appointments`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `garage_appointment_internal_notes`
--
ALTER TABLE `garage_appointment_internal_notes`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `garage_appointment_labels`
--
ALTER TABLE `garage_appointment_labels`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `garage_appointment_label_pivot`
--
ALTER TABLE `garage_appointment_label_pivot`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `garage_appointment_reminders`
--
ALTER TABLE `garage_appointment_reminders`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `garage_estimates`
--
ALTER TABLE `garage_estimates`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `garage_estimate_items`
--
ALTER TABLE `garage_estimate_items`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `garage_inspections`
--
ALTER TABLE `garage_inspections`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `garage_inventory_adjustments`
--
ALTER TABLE `garage_inventory_adjustments`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `garage_inventory_adjustment_items`
--
ALTER TABLE `garage_inventory_adjustment_items`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `garage_invoices`
--
ALTER TABLE `garage_invoices`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `garage_invoice_items`
--
ALTER TABLE `garage_invoice_items`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `garage_labors`
--
ALTER TABLE `garage_labors`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `garage_labor_categories`
--
ALTER TABLE `garage_labor_categories`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `garage_ledgers`
--
ALTER TABLE `garage_ledgers`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `garage_natures`
--
ALTER TABLE `garage_natures`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `garage_parts`
--
ALTER TABLE `garage_parts`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `garage_part_categories`
--
ALTER TABLE `garage_part_categories`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `garage_payments_received`
--
ALTER TABLE `garage_payments_received`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `garage_service_groups`
--
ALTER TABLE `garage_service_groups`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `garage_service_group_items`
--
ALTER TABLE `garage_service_group_items`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `garage_sub_natures`
--
ALTER TABLE `garage_sub_natures`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=36;

--
-- AUTO_INCREMENT for table `garage_vehicles`
--
ALTER TABLE `garage_vehicles`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `garage_vouchers`
--
ALTER TABLE `garage_vouchers`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `garage_voucher_transactions`
--
ALTER TABLE `garage_voucher_transactions`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `garage_work_orders`
--
ALTER TABLE `garage_work_orders`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `garage_work_order_items`
--
ALTER TABLE `garage_work_order_items`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `garage_work_schedules`
--
ALTER TABLE `garage_work_schedules`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ledgers`
--
ALTER TABLE `ledgers`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `ledger_groups`
--
ALTER TABLE `ledger_groups`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `marketplace_items`
--
ALTER TABLE `marketplace_items`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `marketplace_mechanics`
--
ALTER TABLE `marketplace_mechanics`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `marketplace_services`
--
ALTER TABLE `marketplace_services`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=77;

--
-- AUTO_INCREMENT for table `modules`
--
ALTER TABLE `modules`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `natures`
--
ALTER TABLE `natures`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `orders`
--
ALTER TABLE `orders`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `order_items`
--
ALTER TABLE `order_items`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `packages`
--
ALTER TABLE `packages`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `package_modules`
--
ALTER TABLE `package_modules`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `payments`
--
ALTER TABLE `payments`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `payouts`
--
ALTER TABLE `payouts`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `services`
--
ALTER TABLE `services`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=51;

--
-- AUTO_INCREMENT for table `service_categories`
--
ALTER TABLE `service_categories`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT for table `settings`
--
ALTER TABLE `settings`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `spare_parts`
--
ALTER TABLE `spare_parts`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=59;

--
-- AUTO_INCREMENT for table `spare_part_categories`
--
ALTER TABLE `spare_part_categories`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT for table `subscriptions`
--
ALTER TABLE `subscriptions`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `sub_natures`
--
ALTER TABLE `sub_natures`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vouchers`
--
ALTER TABLE `vouchers`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `voucher_transactions`
--
ALTER TABLE `voucher_transactions`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `car_models`
--
ALTER TABLE `car_models`
  ADD CONSTRAINT `car_models_car_brand_id_foreign` FOREIGN KEY (`car_brand_id`) REFERENCES `car_brands` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `garage_appointments`
--
ALTER TABLE `garage_appointments`
  ADD CONSTRAINT `garage_appointments_garage_admin_id_foreign` FOREIGN KEY (`garage_admin_id`) REFERENCES `garages_admins` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `garage_appointments_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `garage_appointments_service_writer_id_foreign` FOREIGN KEY (`service_writer_id`) REFERENCES `garages_admins` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `garage_appointments_technician_id_foreign` FOREIGN KEY (`technician_id`) REFERENCES `garages_admins` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `garage_appointment_internal_notes`
--
ALTER TABLE `garage_appointment_internal_notes`
  ADD CONSTRAINT `garage_appointment_internal_notes_appointment_id_foreign` FOREIGN KEY (`appointment_id`) REFERENCES `garage_appointments` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `garage_appointment_internal_notes_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `garages_admins` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `garage_appointment_internal_notes_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `garage_appointment_labels`
--
ALTER TABLE `garage_appointment_labels`
  ADD CONSTRAINT `garage_appointment_labels_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `garage_appointment_label_pivot`
--
ALTER TABLE `garage_appointment_label_pivot`
  ADD CONSTRAINT `garage_appointment_label_pivot_appointment_id_foreign` FOREIGN KEY (`appointment_id`) REFERENCES `garage_appointments` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `garage_appointment_label_pivot_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `garage_appointment_label_pivot_label_id_foreign` FOREIGN KEY (`label_id`) REFERENCES `garage_appointment_labels` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `garage_appointment_reminders`
--
ALTER TABLE `garage_appointment_reminders`
  ADD CONSTRAINT `garage_appointment_reminders_appointment_id_foreign` FOREIGN KEY (`appointment_id`) REFERENCES `garage_appointments` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `garage_appointment_reminders_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `garage_estimates`
--
ALTER TABLE `garage_estimates`
  ADD CONSTRAINT `garage_estimates_customer_ledger_id_foreign` FOREIGN KEY (`customer_ledger_id`) REFERENCES `garage_ledgers` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `garage_estimates_garage_admin_id_foreign` FOREIGN KEY (`garage_admin_id`) REFERENCES `garages_admins` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `garage_estimates_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `garage_estimates_vehicle_id_foreign` FOREIGN KEY (`vehicle_id`) REFERENCES `garage_vehicles` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `garage_estimate_items`
--
ALTER TABLE `garage_estimate_items`
  ADD CONSTRAINT `garage_estimate_items_garage_estimate_id_foreign` FOREIGN KEY (`garage_estimate_id`) REFERENCES `garage_estimates` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `garage_estimate_items_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `garage_estimate_items_labor_id_foreign` FOREIGN KEY (`labor_id`) REFERENCES `garage_labors` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `garage_estimate_items_part_id_foreign` FOREIGN KEY (`part_id`) REFERENCES `garage_parts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `garage_estimate_items_service_group_id_foreign` FOREIGN KEY (`service_group_id`) REFERENCES `garage_service_groups` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `garage_inspections`
--
ALTER TABLE `garage_inspections`
  ADD CONSTRAINT `garage_inspections_customer_ledger_id_foreign` FOREIGN KEY (`customer_ledger_id`) REFERENCES `garage_ledgers` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `garage_inspections_garage_admin_id_foreign` FOREIGN KEY (`garage_admin_id`) REFERENCES `garages_admins` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `garage_inspections_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `garage_inspections_vehicle_id_foreign` FOREIGN KEY (`vehicle_id`) REFERENCES `garage_vehicles` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `garage_inventory_adjustments`
--
ALTER TABLE `garage_inventory_adjustments`
  ADD CONSTRAINT `garage_inventory_adjustments_garage_admin_id_foreign` FOREIGN KEY (`garage_admin_id`) REFERENCES `garages_admins` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `garage_inventory_adjustments_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `garage_inventory_adjustment_items`
--
ALTER TABLE `garage_inventory_adjustment_items`
  ADD CONSTRAINT `garage_inventory_adjustment_items_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `garage_invoices`
--
ALTER TABLE `garage_invoices`
  ADD CONSTRAINT `garage_invoices_customer_ledger_id_foreign` FOREIGN KEY (`customer_ledger_id`) REFERENCES `garage_ledgers` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `garage_invoices_estimate_id_foreign` FOREIGN KEY (`estimate_id`) REFERENCES `garage_estimates` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `garage_invoices_garage_admin_id_foreign` FOREIGN KEY (`garage_admin_id`) REFERENCES `garages_admins` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `garage_invoices_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `garage_invoices_vehicle_id_foreign` FOREIGN KEY (`vehicle_id`) REFERENCES `garage_vehicles` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `garage_invoices_work_order_id_foreign` FOREIGN KEY (`work_order_id`) REFERENCES `garage_work_orders` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `garage_invoice_items`
--
ALTER TABLE `garage_invoice_items`
  ADD CONSTRAINT `garage_invoice_items_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `garage_invoice_items_garage_invoice_id_foreign` FOREIGN KEY (`garage_invoice_id`) REFERENCES `garage_invoices` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `garage_invoice_items_labor_id_foreign` FOREIGN KEY (`labor_id`) REFERENCES `garage_labors` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `garage_invoice_items_part_id_foreign` FOREIGN KEY (`part_id`) REFERENCES `garage_parts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `garage_invoice_items_service_group_id_foreign` FOREIGN KEY (`service_group_id`) REFERENCES `garage_service_groups` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `garage_labors`
--
ALTER TABLE `garage_labors`
  ADD CONSTRAINT `garage_labors_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `garage_labors_garage_labor_category_id_foreign` FOREIGN KEY (`garage_labor_category_id`) REFERENCES `garage_labor_categories` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `garage_labor_categories`
--
ALTER TABLE `garage_labor_categories`
  ADD CONSTRAINT `garage_labor_categories_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `garage_ledgers`
--
ALTER TABLE `garage_ledgers`
  ADD CONSTRAINT `garage_ledgers_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `garage_ledgers_garage_sub_nature_id_foreign` FOREIGN KEY (`garage_sub_nature_id`) REFERENCES `garage_sub_natures` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `garage_ledgers_ledger_group_id_foreign` FOREIGN KEY (`ledger_group_id`) REFERENCES `ledger_groups` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `garage_natures`
--
ALTER TABLE `garage_natures`
  ADD CONSTRAINT `garage_natures_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `garage_parts`
--
ALTER TABLE `garage_parts`
  ADD CONSTRAINT `garage_parts_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `garage_parts_garage_part_category_id_foreign` FOREIGN KEY (`garage_part_category_id`) REFERENCES `garage_part_categories` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `garage_part_categories`
--
ALTER TABLE `garage_part_categories`
  ADD CONSTRAINT `garage_part_categories_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `garage_payments_received`
--
ALTER TABLE `garage_payments_received`
  ADD CONSTRAINT `garage_payments_received_customer_ledger_id_foreign` FOREIGN KEY (`customer_ledger_id`) REFERENCES `garage_ledgers` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `garage_payments_received_garage_admin_id_foreign` FOREIGN KEY (`garage_admin_id`) REFERENCES `garages_admins` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `garage_payments_received_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `garage_payments_received_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `garage_invoices` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `garage_service_groups`
--
ALTER TABLE `garage_service_groups`
  ADD CONSTRAINT `garage_service_groups_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `garage_service_group_items`
--
ALTER TABLE `garage_service_group_items`
  ADD CONSTRAINT `garage_service_group_items_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `garage_service_group_items_garage_service_group_id_foreign` FOREIGN KEY (`garage_service_group_id`) REFERENCES `garage_service_groups` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `garage_service_group_items_labor_id_foreign` FOREIGN KEY (`labor_id`) REFERENCES `garage_labors` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `garage_service_group_items_part_id_foreign` FOREIGN KEY (`part_id`) REFERENCES `garage_parts` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `garage_sub_natures`
--
ALTER TABLE `garage_sub_natures`
  ADD CONSTRAINT `garage_sub_natures_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `garage_sub_natures_garage_nature_id_foreign` FOREIGN KEY (`garage_nature_id`) REFERENCES `garage_natures` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `garage_vehicles`
--
ALTER TABLE `garage_vehicles`
  ADD CONSTRAINT `garage_vehicles_customer_ledger_id_foreign` FOREIGN KEY (`customer_ledger_id`) REFERENCES `garage_ledgers` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `garage_vehicles_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `garage_vouchers`
--
ALTER TABLE `garage_vouchers`
  ADD CONSTRAINT `garage_vouchers_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `garages_admins` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `garage_vouchers_garage_admin_id_foreign` FOREIGN KEY (`garage_admin_id`) REFERENCES `garages_admins` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `garage_vouchers_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `garage_voucher_transactions`
--
ALTER TABLE `garage_voucher_transactions`
  ADD CONSTRAINT `garage_voucher_transactions_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `garage_voucher_transactions_garage_ledger_id_foreign` FOREIGN KEY (`garage_ledger_id`) REFERENCES `garage_ledgers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `garage_voucher_transactions_garage_voucher_id_foreign` FOREIGN KEY (`garage_voucher_id`) REFERENCES `garage_vouchers` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `garage_work_orders`
--
ALTER TABLE `garage_work_orders`
  ADD CONSTRAINT `garage_work_orders_customer_ledger_id_foreign` FOREIGN KEY (`customer_ledger_id`) REFERENCES `garage_ledgers` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `garage_work_orders_estimate_id_foreign` FOREIGN KEY (`estimate_id`) REFERENCES `garage_estimates` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `garage_work_orders_garage_admin_id_foreign` FOREIGN KEY (`garage_admin_id`) REFERENCES `garages_admins` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `garage_work_orders_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `garage_work_orders_vehicle_id_foreign` FOREIGN KEY (`vehicle_id`) REFERENCES `garage_vehicles` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `garage_work_order_items`
--
ALTER TABLE `garage_work_order_items`
  ADD CONSTRAINT `garage_work_order_items_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `garage_work_order_items_garage_work_order_id_foreign` FOREIGN KEY (`garage_work_order_id`) REFERENCES `garage_work_orders` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `garage_work_order_items_labor_id_foreign` FOREIGN KEY (`labor_id`) REFERENCES `garage_labors` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `garage_work_order_items_part_id_foreign` FOREIGN KEY (`part_id`) REFERENCES `garage_parts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `garage_work_order_items_service_group_id_foreign` FOREIGN KEY (`service_group_id`) REFERENCES `garage_service_groups` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `garage_work_schedules`
--
ALTER TABLE `garage_work_schedules`
  ADD CONSTRAINT `garage_work_schedules_garage_admin_id_foreign` FOREIGN KEY (`garage_admin_id`) REFERENCES `garages_admins` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `garage_work_schedules_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `ledgers`
--
ALTER TABLE `ledgers`
  ADD CONSTRAINT `ledgers_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `ledgers_ledger_group_id_foreign` FOREIGN KEY (`ledger_group_id`) REFERENCES `ledger_groups` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `ledger_groups`
--
ALTER TABLE `ledger_groups`
  ADD CONSTRAINT `ledger_groups_sub_nature_id_foreign` FOREIGN KEY (`sub_nature_id`) REFERENCES `sub_natures` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `package_modules`
--
ALTER TABLE `package_modules`
  ADD CONSTRAINT `package_modules_module_id_foreign` FOREIGN KEY (`module_id`) REFERENCES `modules` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_modules_package_id_foreign` FOREIGN KEY (`package_id`) REFERENCES `packages` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `services`
--
ALTER TABLE `services`
  ADD CONSTRAINT `services_service_category_id_foreign` FOREIGN KEY (`service_category_id`) REFERENCES `service_categories` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `spare_parts`
--
ALTER TABLE `spare_parts`
  ADD CONSTRAINT `spare_parts_spare_part_category_id_foreign` FOREIGN KEY (`spare_part_category_id`) REFERENCES `spare_part_categories` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `subscriptions`
--
ALTER TABLE `subscriptions`
  ADD CONSTRAINT `subscriptions_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `subscriptions_package_id_foreign` FOREIGN KEY (`package_id`) REFERENCES `packages` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `sub_natures`
--
ALTER TABLE `sub_natures`
  ADD CONSTRAINT `sub_natures_nature_id_foreign` FOREIGN KEY (`nature_id`) REFERENCES `natures` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vouchers`
--
ALTER TABLE `vouchers`
  ADD CONSTRAINT `vouchers_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `super_admins` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `vouchers_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `super_admins` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `vouchers_garage_id_foreign` FOREIGN KEY (`garage_id`) REFERENCES `garages` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `voucher_transactions`
--
ALTER TABLE `voucher_transactions`
  ADD CONSTRAINT `voucher_transactions_ledger_id_foreign` FOREIGN KEY (`ledger_id`) REFERENCES `ledgers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `voucher_transactions_voucher_id_foreign` FOREIGN KEY (`voucher_id`) REFERENCES `vouchers` (`id`) ON DELETE CASCADE;
COMMIT;

