🛠️ Fix build compilation errors
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import { Processor, Process } from '@nestjs/bull';
|
||||
import { Job } from 'bull';
|
||||
import { Processor, Process, InjectQueue } from '@nestjs/bull';
|
||||
import { Job, Queue } from 'bull';
|
||||
import { Logger } from '@nestjs/common';
|
||||
import { InjectRedis } from '@liaoliaots/nestjs-redis';
|
||||
import Redis from 'ioredis';
|
||||
import { InvoicesService } from './invoice.service';
|
||||
|
||||
@Processor('invoice-bulk-queue')
|
||||
@@ -11,7 +9,7 @@ export class BulkUploadProcessor {
|
||||
|
||||
constructor(
|
||||
private readonly invoicesService: InvoicesService,
|
||||
@InjectRedis() private readonly redis: Redis,
|
||||
@InjectQueue('invoice-bulk-queue') private readonly bulkQueue: Queue,
|
||||
) {}
|
||||
|
||||
@Process('process-zip')
|
||||
@@ -24,11 +22,11 @@ export class BulkUploadProcessor {
|
||||
// 1. Calculate Hash (MD5/SHA256)
|
||||
// 2. Check Redis SMEMBERS to prevent duplicate processing
|
||||
// const hash = 'calculated_file_hash';
|
||||
// const exists = await this.redis.sismember(`company:${companyId}:invoice-hashes`, hash);
|
||||
// const exists = await this.bulkQueue.client.sismember(`company:${companyId}:invoice-hashes`, hash);
|
||||
// if (exists) return;
|
||||
|
||||
// 3. Save hash and trigger individual processing
|
||||
// await this.redis.sadd(`company:${companyId}:invoice-hashes`, hash);
|
||||
// await this.bulkQueue.client.sadd(`company:${companyId}:invoice-hashes`, hash);
|
||||
// await this.invoicesService.processSingleFile(fileInZip, tenantId, companyId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ export class GeminiExtractorService {
|
||||
const data = JSON.parse(cleanedJson);
|
||||
return data.invoices || [];
|
||||
} catch (error: any) {
|
||||
this.logger.error(\`AI Extraction failed: \${error.message}\`);
|
||||
this.logger.error(`AI Extraction failed: ${error.message}`);
|
||||
throw new InternalServerErrorException('AI Extraction failed');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ export class InvoiceProcessor {
|
||||
if (result.isValid) {
|
||||
await this.invoiceRepository.update(invoiceId, {
|
||||
status: InvoiceStatus.VALIDATED,
|
||||
validation_errors: null,
|
||||
validation_errors: [],
|
||||
});
|
||||
} else {
|
||||
await this.invoiceRepository.update(invoiceId, {
|
||||
|
||||
@@ -83,7 +83,7 @@ export class UBLGeneratorService {
|
||||
.up();
|
||||
|
||||
// ── InvoiceLines ─────────────────────────────────────
|
||||
invoice.lines.forEach((line) => {
|
||||
invoice.lines.forEach((line: any) => {
|
||||
doc.ele('cac:InvoiceLine')
|
||||
.ele('cbc:ID').txt(line.line_number.toString()).up()
|
||||
.ele('cbc:InvoicedQuantity', { unitCode: 'PCE' }).txt(line.quantity.toString()).up()
|
||||
|
||||
Reference in New Issue
Block a user