🛠️ Fix build compilation errors

This commit is contained in:
Hamza-Ayed
2026-04-22 01:17:49 +03:00
parent 444097814d
commit fd00e9c57d
4 changed files with 8 additions and 10 deletions

View File

@@ -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);
}
}

View File

@@ -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');
}
}

View File

@@ -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, {

View File

@@ -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()