9 Commits

Author SHA1 Message Date
Malin
afd63b4aa4 fix: read type from col I (index 8) not col G
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 12:31:02 +01:00
Malin
2dcdb00a21 feat: skip starred products; add type field
- Skip products where description contains '*' after the (NNNNN) code
  (e.g. "France*") — MTZ's exclusion marker
- Add 'type' field (col G, numeric prefix stripped) to API response

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 12:30:17 +01:00
Malin
0b4aa0181b feat: strip MTZ internal suffix from descriptions
Removes trailing " (NNNNN) - Country - Npcs ByBox" pattern from
product descriptions before serving to BC.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 10:25:44 +01:00
Malin
5efb2c25ea feat: add rows_processed/rows_skipped diagnostics to health + refresh endpoints
Helps diagnose whether the product cap is from EAN filtering or a downstream limit.
health and refresh now return: product_count, rows_processed, rows_skipped.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 21:01:03 +01:00
Malin
3b167cd396 fix: drop read_only=True to avoid openpyxl dimension truncation
openpyxl in read_only mode stops iterating at the sheet's cached <dimension ref>
attribute in the XML. If MTZ extended the Excel beyond the original row range,
those rows were silently ignored (hence always ~4000 products regardless of the
real count). Removing read_only=True forces openpyxl to read all actual data rows.
The file is already in BytesIO so there is no I/O penalty.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 20:51:08 +01:00
Malin
8d75fcd060 fix: skip products with blank or non-numeric EAN codes 2026-03-20 11:35:46 +01:00
Malin
162e77c1c3 fix: safe int/float helpers for dirty Excel data (min_box_qty, stock, etc.) 2026-03-20 11:04:52 +01:00
Malin
95cbf8d25d fix: handle string EAN codes in Excel (not just integers) 2026-03-20 11:02:40 +01:00
Malin
db7c31260b feat: initial MTZ Excel-to-JSON API wrapper 2026-03-20 10:31:19 +01:00