# Changelog

## [Unreleased]

## [v1.0.6] - 2026-05-15
### Changed
- `ProcessFilesService::parseXml()`: added auto-detection of XML format (GS1 ECOM v3 vs EAN.UCC v2) based on namespace inspection.
- `ProcessFilesService`: GS1 ECOM v3 (`order:orderMessage`) parsing extracted to `parseGs1V3()` — reads quantity from element text + `measurementUnitCode` attribute, supplier code from attribute-typed `additionalTradeItemIdentification`, description from `tradeItemDescription`, and delivery customer code from `shipTo` seller-assigned identifier.
- `ProcessFilesService`: EAN.UCC v2 parsing preserved in `parseEanUcc()` as fallback for legacy format files.

## [v1.0.0] - 2026-05-15
### Added
- Initial `ngauge-indicator` module scaffold (based on `ngauge-zupa`).

## [v1.0.5] - 2026-05-15
### Changed
- `ProcessFilesService`: switched to `NgaugeCart::fromApi()` for order import, replacing manual `Cartsbe`/`Cartlines`/`Paymentresponsesbe` manipulation.
- `ProcessFilesService`: import wrapped in a DB transaction; deduplication now deletes existing basket and lines before re-importing.
- `ProcessFilesService`: XML payload keys changed to camelCase to match `Cart::fromApi()` format.
- `ProcessFilesService`: `parseXml()` changed to `public` visibility.
- `FtpDownloadService`: XML file filtering pre-computed before the download loop (both FTP and SFTP).

### Added
- `FtpDownloadService`: `$limit` property to cap the number of files downloaded per run (0 = unlimited).
- `ProcessFilesService`: `specialDeliveryNote` XML field mapped to order `message`.

## [v1.0.4] - 2026-05-12
### Fixed
- URL rules now appended (run last) to avoid overriding application rules.

## [v1.0.3] - 2026-05-12
### Fixed
- XML parsing switched to `DOMDocument` for improved reliability.
- FTP/SFTP post-process file lifecycle (move/delete) corrected.
- `porderref` field mapping fixed for deduplication checks.

### Added
- File browser UI for inspecting inbox/processed/failed directories.

## [v1.0.2] - 2026-05-12
### Added
- Configurable Cart class dropdown in the config UI for selecting the order processing model.

## [v1.0.1] - 2026-05-12
### Added
- `moveAfterDownload` / `moveToPath` option for FTP/SFTP post-download file handling.

## [v1.0.0] - 2026-05-09
### Added
- Initial `ngauge-indicator` module scaffold.
- FTP/SFTP downloader service for XML file pickup.
- XML-to-JSON order normalization pipeline.
- Two recurring jobs for download and processing.
- Cart import logic using module `Cart` model extending `\\backend\\models\\Cartsbe`.
- Summary email reporting for import runs.
- Config UI for FTP details, pickup interval, and summary email recipient.
