# Changelog - Barcode Label System

## [Unreleased]

## [1.2.0] - 2026-08-04

### Added - Custom Code Text Feature
- ✨ **Custom Code Text untuk Brand**: Field baru untuk meng-customize text yang ditampilkan di bawah barcode
- 📝 Field `custom_code_text` di database (VARCHAR 200, nullable)
- 🎨 Form field "Custom Text di Bawah Barcode" dengan live preview
- 🔄 Logika prioritas: Custom text → Config no_space → Auto format
- 📖 Dokumentasi lengkap: `FITUR_CUSTOM_CODE_TEXT.md` dan `QUICK_GUIDE_CUSTOM_TEXT.md`

### Changed
- 🔧 Model `Label`: Update accessor `getCodeTextAttribute()` untuk support custom text
- 🔧 Controller `LabelController`: Update method `preview()` untuk accept custom_code_text
- 🔧 Request `LabelRequest`: Tambah validasi untuk custom_code_text
- 🔧 View `form.blade.php`: Tambah field dan JavaScript untuk custom text

### Files Modified
- `database/migrations/2026_08_04_040237_add_custom_code_text_to_labels_table.php` (NEW)
- `app/Models/Label.php`
- `app/Http/Controllers/LabelController.php`
- `app/Http/Requests/LabelRequest.php`
- `resources/views/labels/form.blade.php`

---

## [1.1.0] - 2026-08-04

### Added - Live Preview Feature
- ✨ **Live Preview**: Preview barcode label real-time saat mengetik di form
- 🚀 Preview endpoint: `GET /labels/preview`
- 🔄 Auto-update dengan 500ms debounce
- 📊 Support single dan bulk input mode
- 🐛 Comprehensive error handling dan logging
- 📖 Dokumentasi: `LIVE_PREVIEW_IMPLEMENTATION.md`, `TROUBLESHOOTING_LIVE_PREVIEW.md`, `QUICK_TEST.md`

### Changed
- 🔧 View `form.blade.php`: Tambah JavaScript untuk live preview
- 🔧 Controller `LabelController`: Tambah method `preview()`
- 🔧 Routes: Tambah route `/labels/preview`

### Test Files Added
- `public/test-preview-direct.php` - Test PHP backend
- `public/test-js.html` - Test JavaScript
- `DEBUG_PREVIEW.md` - Debug guide

---

## [1.0.9] - 2026-07-30

### Added - Bulk Input Feature
- ✨ **Bulk Code Serial Input**: Input multiple kode seri sekaligus
- 📝 Textarea untuk bulk input dengan auto-detect delimiter
- 🔢 Support space, comma, newline sebagai separator
- 📊 Max 100 codes per bulk input
- 🔄 Auto-deduplicate codes
- 🏷️ Batch grouping dengan import_batch

### Changed
- 🔧 View `form.blade.php`: Tambah checkbox "Bulk Input" dan textarea
- 🔧 Controller `LabelController`: Tambah method `storeBulk()`
- 🔧 Request `LabelRequest`: Update validasi untuk bulk mode

---

## [1.0.8] - 2026-07-30

### Added - Paste Data Feature
- ✨ **Paste Data from Excel**: Import manual dengan paste text
- 📋 Support TAB-separated dan comma-separated values
- 🔄 Auto-detect delimiter
- 📊 Format: TOTAL | PECAHAN | KET | KODE SERI

### Changed
- 🔧 View `import.blade.php`: Tambah radio toggle dan textarea
- 🔧 Controller `LabelImportController`: Tambah logic paste data
- 🔧 Importer `LabelImporter`: Tambah method `importFromText()`

---

## [1.0.7] - 2026-07-30

### Added - Configuration
- ⚙️ **Config Display Format**: `BARCODE_CODE_TEXT_NO_SPACE` di .env
- 📝 Config `barcode.code_text_no_space` untuk toggle spasi
- 🎨 Format tanpa spasi: `DEXADBS5G063TH26`
- 🎨 Format dengan spasi: `DEXA DBS 5G063TH26`

### Changed
- 🔧 Model `Label`: Update accessor `getCodeTextAttribute()`
- 🔧 Config `barcode.php`: Tambah option `code_text_no_space`
- 🔧 `.env.example`: Tambah example config

---

## [1.0.6] - 2026-07-30

### Changed - Barcode Generation Logic
- 🔧 **Fix Barcode Value**: Update `buildBarcodeValue()` untuk concatenate tanpa spasi
- 🔧 Handle multi-word company names
- 🔧 Detect duplicate product prefix in item_code
- 🔧 Example: DEXA + DBS + 5G063TH26 = `DEXADBS5G063TH26`

---

## [1.0.5] - 2026-07-30

### Added - Excel Template & Import
- 📊 **Excel Template**: Download template dengan header yang benar
- 📝 Header: TOTAL | PECAHAN | KET | KODE SERI (uppercase)
- 🔄 Replace mode: Delete old data sebelum import
- 🔍 Duplicate detection dalam import file
- 📊 Sample data di template

### Changed
- 🔧 Exporter `LabelExporter`: Update template headers
- 🔧 View `import.blade.php`: Tambah replace mode
- 🔧 Importer `LabelImporter`: Tambah duplicate detection

---

## [1.0.4] - 2026-07-30

### Added - Delete All Feature
- 🗑️ **Delete All Barcode**: Button untuk hapus semua label sekaligus
- ⚠️ Confirmation dialog dengan label count
- 🔒 Button hanya muncul jika ada labels

### Changed
- 🔧 View `index.blade.php`: Tambah delete all button
- 🔧 Controller `LabelController`: Tambah method `destroyAll()`
- 🔧 Routes: Tambah route `labels/destroy-all`

---

## [1.0.3] - 2026-07-30

### Changed - Display Format
- 🎨 **Remove DEXA Prefix**: Text di bawah barcode hanya tampilkan kode seri
- 📝 Example: `5G063TH26` bukan `DEXA 5G063TH26`
- 🔧 Model `Label`: Tambah method `stripCompanyPrefix()`

---

## [1.0.2] - 2026-07-30

### Added - Database Columns
- 📊 **TOTAL & PECAHAN**: Kolom untuk data dari Excel
- 📊 **IMPORT_BATCH**: Tracking import batch
- 🔄 **TITLE Sync**: Sync title dengan kolom KET dari Excel

### Migrations
- `2026_07_30_100000_add_total_and_pecahan_to_labels_table.php`
- `2026_07_30_110000_add_import_batch_to_labels_table.php`
- `2026_07_30_120000_sync_label_title_with_ket.php`

---

## [1.0.1] - 2026-07-30

### Added
- 📊 Seeder `LabelSeeder`: Sample data untuk testing

---

## [1.0.0] - 2026-07-30

### Initial Release
- ✨ Basic CRUD untuk barcode labels
- 📊 Import dari Excel
- 📤 Export ke Excel
- 🖨️ Print barcode labels
- 🎨 Custom label sizes
- 🔍 Search dan filter
- 📝 Validation
- 🎯 CODE128 barcode generation

### Core Features
- Model: `Label`
- Controllers: `LabelController`, `LabelImportController`, `LabelPrintController`
- Views: index, form, import, print
- Support: `BarcodeRenderer`, `LabelImporter`, `LabelExporter`

---

## Legend

- ✨ New feature
- 🔧 Changed/Updated
- 🐛 Bug fix
- 🗑️ Deprecated
- 🔒 Security
- 📖 Documentation
- 🚀 Performance
- 🎨 UI/UX
- 📊 Data/Database
- 🔄 Refactor
- ⚙️ Configuration
- 📝 Content
- 🔍 Search
- 📤 Export
- 📥 Import
- 🖨️ Print
- ⚠️ Warning

---

**Current Version**: 1.2.0  
**Last Updated**: August 4, 2026
