ddc00523e0
refactor: убрать categoryRepo из ExportService, порядок из DefaultCategories
...
Категория лота приходит из прайслиста — запрашивать её из серверной БД
нарушало принцип local-first. Сигнатура NewExportService упрощена,
все call-sites обновлены.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-24 19:06:39 +03:00
Mikhail Chusavitin
66ff7e25a6
Fix pricelist sync upsert and refresh tests
2026-04-28 16:54:36 +03:00
Mikhail Chusavitin
d026c28ea7
Add vendor workspace import and pricing export workflow
2026-03-07 21:03:40 +03:00
f3d8e653f8
Implement persistent Line ordering for project specs and update bible
2026-02-21 07:09:38 +03:00
81203fc7a7
chore: save current changes
2026-02-18 07:02:17 +03:00
Mikhail Chusavitin
432d8c57c2
export: implement streaming CSV with Excel compatibility
...
Implement Phase 1 CSV Export Optimization:
- Replace buffering with true HTTP streaming (ToCSV writes to io.Writer)
- Add UTF-8 BOM (0xEF 0xBB 0xBF) for correct Cyrillic display in Excel
- Use semicolon (;) delimiter for Russian Excel locale
- Use comma (,) as decimal separator in numbers (100,50 instead of 100.50)
- Add graceful two-phase error handling:
* Before streaming: return JSON errors for validation failures
* During streaming: log errors only (HTTP 200 already sent)
- Add backward-compatible ToCSVBytes() helper
- Add GET /api/configs/:uuid/export route for configuration export
New tests (13 total):
- Service layer (7 tests):
* UTF-8 BOM verification
* Semicolon delimiter parsing
* Total row formatting
* Category sorting
* Empty data handling
* Backward compatibility wrapper
* Writer error handling
- Handler layer (6 tests):
* Successful CSV export with streaming
* Invalid request validation
* Empty items validation
* Config export with proper headers
* 404 for missing configs
* Empty config validation
All tests passing, build verified.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com >
2026-02-09 10:47:10 +03:00