feat(phase-6): Bulk CSV processing and background worker implementation

- Add BulkJob model to Prisma schema with relations
- Implement BulkProcessorService for CSV parsing and job management
- Create BulkTrackingWorker for background processing with BullMQ
- Add comprehensive bulk API routes (upload, jobs, progress, export)
- Integrate multer for CSV file uploads with validation
- Add job progress tracking and estimation
- Implement CSV export functionality for results
- Add queue statistics and cleanup endpoints
- Create shared types for bulk processing
- Add comprehensive test suite for all bulk functionality
- Implement graceful worker shutdown and error handling
- Add rate limiting and authentication for all bulk endpoints

Backward compatibility: Maintained for /api/track and /api/v1/track
This commit is contained in:
Andrei
2025-08-18 14:18:13 +00:00
parent 8c8300780f
commit 9626863917
13 changed files with 2309 additions and 64 deletions

View File

@@ -19,6 +19,7 @@ import authRoutes from './routes/auth.routes';
import trackingRoutes from './routes/tracking.routes';
import analysisRoutes from './routes/analysis.routes';
import exportRoutes from './routes/export.routes';
import bulkRoutes from './routes/bulk.routes';
const app = express();
const PORT = process.env.PORT || 3333;
@@ -77,6 +78,7 @@ app.use('/api/v2/analyze', analysisRoutes);
// Export routes (v2)
app.use('/api/v2/export', exportRoutes);
app.use('/api/v2/bulk', bulkRoutes);
// Health check endpoint
app.get('/health', (req, res) => {