xpeditis2.0/apps/backend/src/application
David f5eabf4861
Some checks failed
CI/CD Pipeline / Backend - Build, Test & Push (push) Failing after 1m32s
CI/CD Pipeline / Frontend - Build, Test & Push (push) Successful in 11m35s
CI/CD Pipeline / Integration Tests (push) Has been skipped
CI/CD Pipeline / Deployment Summary (push) Has been skipped
CI/CD Pipeline / Discord Notification (Failure) (push) Has been skipped
CI/CD Pipeline / Discord Notification (Success) (push) Has been skipped
fix: generate CSV filename from company name instead of using multer callback
Fixed CSV file upload to properly generate filename based on company name. The previous implementation tried to read `req.body.companyName` in multer's filename callback, but the body is not yet parsed at that point, causing files to be named "unknown.csv".

## Solution
1. Use temporary filename during upload (timestamp + random)
2. After validation and parsing, rename file to proper company name format
3. Delete old file if it exists before renaming
4. Store final filename in database configuration

## Changes
- Multer filename callback now generates temporary filename
- Added file renaming logic after successful validation
- Updated database records to use final filename instead of temp name
- Added logging for file operations

## Impact
- New CSV uploads will have correct filenames (e.g., "ssc-consolidation.csv")
- No more "unknown.csv" files
- Existing "unknown.csv" needs to be manually deleted via dashboard

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 19:57:10 +01:00
..
audit fix: replace relative domain imports with TypeScript path aliases 2025-11-16 19:20:58 +01:00
auth fix: replace relative domain imports with TypeScript path aliases 2025-11-16 19:20:58 +01:00
bookings fix: replace relative domain imports with TypeScript path aliases 2025-11-16 19:20:58 +01:00
controllers fix: generate CSV filename from company name instead of using multer callback 2025-11-17 19:57:10 +01:00
dashboard fix path controller 2025-10-27 20:49:06 +01:00
decorators format prettier 2025-10-27 20:54:01 +01:00
dto fix: replace relative domain imports with TypeScript path aliases 2025-11-16 19:20:58 +01:00
gateways fix: replace relative domain imports with TypeScript path aliases 2025-11-16 19:20:58 +01:00
gdpr feat: GDPR Compliance - Data privacy, consent & user rights (Phase 4) 2025-10-14 19:13:19 +02:00
guards format prettier 2025-10-27 20:54:01 +01:00
interceptors feature 2025-11-04 07:30:15 +01:00
mappers fix: replace relative domain imports with TypeScript path aliases 2025-11-16 19:20:58 +01:00
notifications fix: replace relative domain imports with TypeScript path aliases 2025-11-16 19:20:58 +01:00
organizations fix: replace relative domain imports with TypeScript path aliases 2025-11-16 19:20:58 +01:00
rates fix: replace relative domain imports with TypeScript path aliases 2025-11-16 19:20:58 +01:00
services fix 2025-11-16 19:44:32 +01:00
users fix: replace relative domain imports with TypeScript path aliases 2025-11-16 19:20:58 +01:00
webhooks fix: replace relative domain imports with TypeScript path aliases 2025-11-16 19:20:58 +01:00
csv-bookings.module.ts fix 2025-11-12 18:33:29 +01:00