CREATE TABLE IF NOT EXISTS products (
  id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  name TEXT NOT NULL,
  basePrice DECIMAL(15,2) NOT NULL,
  price DECIMAL(15,2) NOT NULL,
  stock DECIMAL(15,3) NOT NULL DEFAULT 0,
  unit TEXT NULL,
  type ENUM('Barang','Jasa') NOT NULL DEFAULT 'Barang',
  barcode VARCHAR(255) NULL,
  PRIMARY KEY (id),
  UNIQUE KEY uq_products_barcode (barcode)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
