From 73bafe46317b4d1ae5aebcdee97392c3579e5613 Mon Sep 17 00:00:00 2001 From: alexeh Date: Tue, 26 Sep 2023 02:47:48 +0300 Subject: [PATCH] Persist failed submission event --- .../adapters/project/project-cost-surface-api-events.ts | 3 ++- .../application/project/create-project-cost-surface.handler.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/api/apps/api/src/modules/cost-surface/adapters/project/project-cost-surface-api-events.ts b/api/apps/api/src/modules/cost-surface/adapters/project/project-cost-surface-api-events.ts index bf4a524a8f..4f86d70eb3 100644 --- a/api/apps/api/src/modules/cost-surface/adapters/project/project-cost-surface-api-events.ts +++ b/api/apps/api/src/modules/cost-surface/adapters/project/project-cost-surface-api-events.ts @@ -30,9 +30,10 @@ export class ProjectCostSurfaceApiEvents async event( projectId: string, state: ProjectCostSurfaceState, + context?: Record, ): Promise { await this.create({ - data: {}, + data: context ?? {}, topic: projectId, kind: this.eventsMap[state], }); diff --git a/api/apps/api/src/modules/cost-surface/application/project/create-project-cost-surface.handler.ts b/api/apps/api/src/modules/cost-surface/application/project/create-project-cost-surface.handler.ts index fbd6516c91..2b925b79f0 100644 --- a/api/apps/api/src/modules/cost-surface/application/project/create-project-cost-surface.handler.ts +++ b/api/apps/api/src/modules/cost-surface/application/project/create-project-cost-surface.handler.ts @@ -55,7 +55,7 @@ export class CreateProjectCostSurfaceHandler error: unknown, ) => { this.logger.error( - `Failed submitting update-cost-surface-for-${projectId} job`, + `Failed submitting cost-surface-for-${projectId} job`, String(error), ); await this.events.event(