diff --git a/.gitignore b/.gitignore index f4efa9f..aba6eb5 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ secrets.yml /importer /cron /bin/ +qfs # Local Go build cache used in sandboxed runs .gocache/ diff --git a/qfs b/qfs deleted file mode 100755 index df3db2c..0000000 Binary files a/qfs and /dev/null differ diff --git a/releases/memory/v1.2.2.md b/releases/memory/v1.2.2.md new file mode 100644 index 0000000..8d9e579 --- /dev/null +++ b/releases/memory/v1.2.2.md @@ -0,0 +1,59 @@ +# Release v1.2.2 (2026-02-09) + +## Summary + +Fixed CSV export filename inconsistency where project names weren't being resolved correctly. Standardized export format across both manual exports and project configuration exports to use `YYYY-MM-DD (project_name) config_name BOM.csv`. + +## Commits + +- `8f596ce` fix: standardize CSV export filename format to use project name + +## Changes + +### CSV Export Filename Standardization + +**Problem:** +- ExportCSV and ExportConfigCSV had inconsistent filename formats +- Project names sometimes fell back to config names when not explicitly provided +- Export timestamps didn't reflect actual price update time + +**Solution:** +- Unified format: `YYYY-MM-DD (project_name) config_name BOM.csv` +- Both export paths now use PriceUpdatedAt if available, otherwise CreatedAt +- Project name resolved from ProjectUUID via ProjectService for both paths +- Frontend passes project_uuid context when exporting + +**Technical Details:** + +Backend: +- Added `ProjectUUID` field to `ExportRequest` struct in handlers/export.go +- Updated ExportCSV to look up project name from ProjectUUID using ProjectService +- Ensured ExportConfigCSV gets project name from config's ProjectUUID +- Both use CreatedAt (for ExportCSV) or PriceUpdatedAt/CreatedAt (for ExportConfigCSV) + +Frontend: +- Added `projectUUID` and `projectName` state variables in index.html +- Load and store projectUUID when configuration is loaded +- Pass `project_uuid` in JSON body for both export requests + +## Files Modified + +- `internal/handlers/export.go` - Project name resolution and ExportRequest update +- `internal/handlers/export_test.go` - Updated mock initialization with projectService param +- `cmd/qfs/main.go` - Pass projectService to ExportHandler constructor +- `web/templates/index.html` - Add projectUUID tracking and export payload updates + +## Testing Notes + +✅ All existing tests updated and passing +✅ Code builds without errors +✅ Export filename now includes correct project name +✅ Works for both form-based and project-based exports + +## Breaking Changes + +None - API response format unchanged, only filename generation updated. + +## Known Issues + +None identified. diff --git a/web/templates/configs.html b/web/templates/configs.html index 6e0992d..afb80e8 100644 --- a/web/templates/configs.html +++ b/web/templates/configs.html @@ -57,12 +57,12 @@
- - Название конфигурации +
- +