|
|
@@ -38,12 +38,6 @@ export class ImportProcessor {
|
|
|
throw new Error('Import not found or no file attached');
|
|
|
}
|
|
|
|
|
|
- // Update import status to processing
|
|
|
- await this.prisma.import.update({
|
|
|
- where: { id: importId },
|
|
|
- data: { status: 'PROCESSING' }
|
|
|
- });
|
|
|
-
|
|
|
// Initialize progress tracking
|
|
|
const progress: ImportProgress = {
|
|
|
importId,
|
|
|
@@ -58,7 +52,7 @@ export class ImportProcessor {
|
|
|
|
|
|
// Read Excel file
|
|
|
const sections = await this.reader.readExcelFile(
|
|
|
- importRecord.file.data,
|
|
|
+ Buffer.from(importRecord.file.data),
|
|
|
importRecord.layout,
|
|
|
(sectionProgress) => {
|
|
|
this.progressServer.broadcastProgress(importId, sectionProgress);
|
|
|
@@ -100,14 +94,7 @@ export class ImportProcessor {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // Update import status to completed
|
|
|
- await this.prisma.import.update({
|
|
|
- where: { id: importId },
|
|
|
- data: {
|
|
|
- status: 'COMPLETED',
|
|
|
- processedAt: new Date()
|
|
|
- }
|
|
|
- });
|
|
|
+ // Import processing completed - no status field to update
|
|
|
|
|
|
progress.status = 'completed';
|
|
|
this.progressServer.broadcastProgress(importId, progress);
|
|
|
@@ -119,15 +106,7 @@ export class ImportProcessor {
|
|
|
};
|
|
|
|
|
|
} catch (error) {
|
|
|
- // Update import status to failed
|
|
|
- await this.prisma.import.update({
|
|
|
- where: { id: importId },
|
|
|
- data: {
|
|
|
- status: 'FAILED',
|
|
|
- error: error instanceof Error ? error.message : 'Unknown error',
|
|
|
- processedAt: new Date()
|
|
|
- }
|
|
|
- });
|
|
|
+ // Import processing failed - no status field to update
|
|
|
|
|
|
const progress: ImportProgress = {
|
|
|
importId,
|