690528:1524 ADR-030-230 context aware #02
CI / CD Pipeline / build (push) Failing after 4m14s
CI / CD Pipeline / deploy (push) Has been skipped

This commit is contained in:
2026-05-28 15:24:41 +07:00
parent 960cd78b8a
commit 4391bbe61d
29 changed files with 4001 additions and 44 deletions
+11 -6
View File
@@ -290,12 +290,15 @@ export class AiService {
if (activeJob) {
return { success: true, jobId: String(activeJob.id) };
}
const defaultProject = await this.importTransactionRepo.manager.findOne(
Project,
{ where: {} }
);
const projectPublicId =
defaultProject?.publicId ?? '00000000-0000-0000-0000-000000000000';
let projectPublicId = dto.payload.contextOverride?.projectPublicId;
if (!projectPublicId) {
const defaultProject = await this.importTransactionRepo.manager.findOne(
Project,
{ where: {} }
);
projectPublicId =
defaultProject?.publicId ?? '00000000-0000-0000-0000-000000000000';
}
try {
const job = await this.aiBatchQueue.add(
'migrate-document',
@@ -309,7 +312,9 @@ export class AiService {
batchId: dto.payload.batchId,
existingTags: dto.payload.existingTags,
systemCategories: dto.payload.systemCategories,
contextOverride: dto.payload.contextOverride,
},
batchId: dto.payload.batchId,
idempotencyKey,
},
{ jobId: idempotencyKey }