From fb0bb36bdd6a7e820949825e59287673ff6175d9 Mon Sep 17 00:00:00 2001 From: "Kyryll O." Date: Thu, 18 Jun 2026 16:45:12 +0300 Subject: [PATCH] fix: publish system.notification.send in {pattern, data} format for NestJS RMQ --- package.json | 2 +- src/backend/services/core.service.ts | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index d40959f..759b4a0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@erp/plugin-sdk", - "version": "1.11.1", + "version": "1.11.2", "main": "dist/index.js", "types": "dist/index.d.ts", "bin": { diff --git a/src/backend/services/core.service.ts b/src/backend/services/core.service.ts index 69346ee..d02c305 100644 --- a/src/backend/services/core.service.ts +++ b/src/backend/services/core.service.ts @@ -410,10 +410,9 @@ export class CoreService { const conn = await amqp.connect(this.getRMQUrl()); const ch = await conn.createChannel(); await ch.assertExchange('system_events', 'topic', { durable: true }); - const eventData = { - eventId: uuidv4(), + ch.publish('system_events', 'system.notification.send', Buffer.from(JSON.stringify({ pattern: 'system.notification.send', - payload: { + data: { userId: payload.userId, title: payload.title, message: payload.message, @@ -421,10 +420,7 @@ export class CoreService { image: payload.image, details: payload.details, }, - source: this.serviceName, - timestamp: Date.now(), - }; - ch.publish('system_events', 'system.notification.send', Buffer.from(JSON.stringify(eventData))); + }))); await ch.close(); await conn.close(); } catch (err: any) {