-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 20, 2026 at 11:40 PM
-- Server version: 10.4.32-MariaDB
-- PHP Version: 8.2.12

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


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

--
-- Database: `fuelpos`
--

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

--
-- Table structure for table `empleados`
--

CREATE TABLE `empleados` (
  `id` int(11) NOT NULL,
  `codigo_empresa` varchar(50) NOT NULL,
  `codigo_empleado` varchar(50) NOT NULL,
  `nombre` varchar(255) NOT NULL,
  `telefono` varchar(50) DEFAULT NULL,
  `direccion` text DEFAULT NULL,
  `cargo` varchar(100) DEFAULT NULL,
  `codigo_tarjeta` varchar(100) DEFAULT NULL,
  `limite_credito` decimal(10,2) DEFAULT 0.00,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `empleados`
--

INSERT INTO `empleados` (`id`, `codigo_empresa`, `codigo_empleado`, `nombre`, `telefono`, `direccion`, `cargo`, `codigo_tarjeta`, `limite_credito`, `created_at`, `updated_at`) VALUES
(1, 'EMP001', 'EMP001-001', 'Carlos Méndez', '809-555-1001', 'Calle 1 #10', 'Gerente de Operaciones', 'CARD-0001', 8000.00, '2026-02-20 21:06:20', '2026-02-20 21:21:31'),
(2, 'EMP001', 'EMP001-002', 'Ana Rodríguez', '809-555-1002', 'Calle 2 #20', 'Contador', 'CARD-0002', 8000.00, '2026-02-20 21:06:20', '2026-02-20 21:21:25'),
(3, 'EMP002', 'EMP002-001', 'Luis Fernández', '809-555-2001', 'Calle 3 #30', 'Conductor', 'CARD-0003', 8000.00, '2026-02-20 21:06:20', '2026-02-20 21:21:36');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `empleados`
--
ALTER TABLE `empleados`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `codigo_empleado` (`codigo_empleado`),
  ADD UNIQUE KEY `codigo_tarjeta` (`codigo_tarjeta`),
  ADD KEY `idx_codigo_empresa` (`codigo_empresa`),
  ADD KEY `idx_nombre` (`nombre`),
  ADD KEY `idx_cargo` (`cargo`),
  ADD KEY `idx_limite_credito` (`limite_credito`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `empleados`
--
ALTER TABLE `empleados`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `empleados`
--
ALTER TABLE `empleados`
  ADD CONSTRAINT `fk_empleado_empresa` FOREIGN KEY (`codigo_empresa`) REFERENCES `empresa` (`codigo`) ON DELETE CASCADE ON UPDATE 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 */;
