-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Aug 31, 2025 at 03:29 PM
-- Server version: 10.4.28-MariaDB
-- PHP Version: 8.0.28

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


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

--
-- Database: `car_showroom`
--

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

--
-- Table structure for table `commissions`
--

CREATE TABLE `commissions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `car_sale_id` bigint(20) UNSIGNED NOT NULL,
  `date` date NOT NULL,
  `buyer_commission` decimal(10,2) NOT NULL,
  `seller_commission` decimal(10,2) NOT NULL,
  `receiver_name` varchar(255) NOT NULL,
  `registration_no` varchar(255) NOT NULL,
  `buyer_name` varchar(255) NOT NULL,
  `seller_name` varchar(255) NOT NULL,
  `owner_name` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `commissions`
--

INSERT INTO `commissions` (`id`, `car_sale_id`, `date`, `buyer_commission`, `seller_commission`, `receiver_name`, `registration_no`, `buyer_name`, `seller_name`, `owner_name`, `created_at`, `updated_at`) VALUES
(1, 18, '2025-08-30', 1000.00, 1000.00, 'usman', 'LEC-7665', 'Imtiaz Khan', 'Kashif Khan', 'Kashif', '2025-08-30 13:32:25', '2025-08-31 09:24:15'),
(2, 34, '2025-08-30', 9000.00, 8000.00, 'Junaid', 'LEC-7665', 'Kamran Khan', 'Ishfaq Khan', '', '2025-08-30 15:03:55', '2025-08-30 15:03:55');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `commissions`
--
ALTER TABLE `commissions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `commissions_car_sale_id_foreign` (`car_sale_id`);

--
-- AUTO_INCREMENT for dumped tables
--

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `commissions`
--
ALTER TABLE `commissions`
  ADD CONSTRAINT `commissions_car_sale_id_foreign` FOREIGN KEY (`car_sale_id`) REFERENCES `car_sales` (`id`) ON DELETE CASCADE;
COMMIT;

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