From 3fe2741165eec5e54e0a827083bdf7cf64750550 Mon Sep 17 00:00:00 2001 From: Lambdius Date: Wed, 28 Oct 2026 15:07:41 +0000 Subject: [PATCH] fix(datasets): add missing notification data for default accounts --- package.json | 2 +- .../demo/notification/channel.dataset.ts | 52 ++++++++++++++ .../demo/notification/preference.dataset.ts | 60 +++++++++++++++++ .../demo/notification/recipient.dataset.ts | 20 ++++++ .../system/notification/channel.dataset.ts | 57 +++++++++++++++- .../system/notification/preference.dataset.ts | 67 ++++++++++++++++++- .../system/notification/recipient.dataset.ts | 27 +++++++- 7 files changed, 281 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 987d38a..ab0dac6 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "Shared Kafka/gRPC contracts and common enums between MonadIAM services", "author": "Daniil Egorov (https://github.com/Lambdius)", "license": "UNLICENSED", - "version": "3.1.0", + "version": "3.1.1", "types": "dist/index.d.ts", "main": "dist/index.js", "exports": { diff --git a/src/datasets/demo/notification/channel.dataset.ts b/src/datasets/demo/notification/channel.dataset.ts index a349ac4..dbde2f5 100644 --- a/src/datasets/demo/notification/channel.dataset.ts +++ b/src/datasets/demo/notification/channel.dataset.ts @@ -1,4 +1,56 @@ const dataset = [ + { + id: "00000011-0000-4000-8000-100000000001", + recipient_id: "00000010-0000-4000-8000-100000000001", + type: "IN_APP", + address: null, + source_identifier: null, + sound_enabled: true, + is_verified: true, + verified_at: new Date("2026-01-01T00:00:00.000Z"), + created_at: new Date("2026-01-01T00:00:00.000Z"), + updated_at: null, + version: 1, + }, + { + id: "00000011-0000-4000-8000-100000000002", + recipient_id: "00000010-0000-4000-8000-100000000001", + type: "EMAIL", + address: "admin@example.com", + source_identifier: "00000001-0000-4000-8000-100000000001", + sound_enabled: null, + is_verified: true, + verified_at: new Date("2026-01-01T00:00:00.000Z"), + created_at: new Date("2026-01-01T00:00:00.000Z"), + updated_at: null, + version: 1, + }, + { + id: "00000011-0000-4000-8000-100000000003", + recipient_id: "00000010-0000-4000-8000-100000000002", + type: "IN_APP", + address: null, + source_identifier: null, + sound_enabled: true, + is_verified: true, + verified_at: new Date("2026-01-01T00:00:00.000Z"), + created_at: new Date("2026-01-01T00:00:00.000Z"), + updated_at: null, + version: 1, + }, + { + id: "00000011-0000-4000-8000-100000000004", + recipient_id: "00000010-0000-4000-8000-100000000002", + type: "EMAIL", + address: "user@example.com", + source_identifier: "00000001-0000-4000-8000-100000000002", + sound_enabled: null, + is_verified: true, + verified_at: new Date("2026-01-01T00:00:00.000Z"), + created_at: new Date("2026-01-01T00:00:00.000Z"), + updated_at: null, + version: 1, + }, // E001 - Nathaniel Brooks { id: "c696c642-9dd6-59f6-8f8a-a16feca26ee5", diff --git a/src/datasets/demo/notification/preference.dataset.ts b/src/datasets/demo/notification/preference.dataset.ts index 9308a38..796e8f9 100644 --- a/src/datasets/demo/notification/preference.dataset.ts +++ b/src/datasets/demo/notification/preference.dataset.ts @@ -1,6 +1,66 @@ import { NotificationCategory } from "../../../enums"; const dataset = [ + { + id: "00000012-0000-4000-8000-100000000001", + recipient_id: "00000010-0000-4000-8000-100000000001", + channel_type: "EMAIL", + category: NotificationCategory.INVITES, + is_duplication_enabled: false, + created_at: new Date("2026-01-01T00:00:00.000Z"), + updated_at: null, + version: 1, + }, + { + id: "00000012-0000-4000-8000-100000000002", + recipient_id: "00000010-0000-4000-8000-100000000001", + channel_type: "EMAIL", + category: NotificationCategory.SYSTEM, + is_duplication_enabled: false, + created_at: new Date("2026-01-01T00:00:00.000Z"), + updated_at: null, + version: 1, + }, + { + id: "00000012-0000-4000-8000-100000000003", + recipient_id: "00000010-0000-4000-8000-100000000001", + channel_type: "EMAIL", + category: NotificationCategory.OTHER, + is_duplication_enabled: false, + created_at: new Date("2026-01-01T00:00:00.000Z"), + updated_at: null, + version: 1, + }, + { + id: "00000012-0000-4000-8000-100000000004", + recipient_id: "00000010-0000-4000-8000-100000000002", + channel_type: "EMAIL", + category: NotificationCategory.INVITES, + is_duplication_enabled: false, + created_at: new Date("2026-01-01T00:00:00.000Z"), + updated_at: null, + version: 1, + }, + { + id: "00000012-0000-4000-8000-100000000005", + recipient_id: "00000010-0000-4000-8000-100000000002", + channel_type: "EMAIL", + category: NotificationCategory.SYSTEM, + is_duplication_enabled: false, + created_at: new Date("2026-01-01T00:00:00.000Z"), + updated_at: null, + version: 1, + }, + { + id: "00000012-0000-4000-8000-100000000006", + recipient_id: "00000010-0000-4000-8000-100000000002", + channel_type: "EMAIL", + category: NotificationCategory.OTHER, + is_duplication_enabled: false, + created_at: new Date("2026-01-01T00:00:00.000Z"), + updated_at: null, + version: 1, + }, // E001 - Nathaniel Brooks / IN_APP / SECURITY { id: "fb30ac88-bf96-5e90-b38f-7062ed2b0923", diff --git a/src/datasets/demo/notification/recipient.dataset.ts b/src/datasets/demo/notification/recipient.dataset.ts index 2fbb881..0182756 100644 --- a/src/datasets/demo/notification/recipient.dataset.ts +++ b/src/datasets/demo/notification/recipient.dataset.ts @@ -1,4 +1,24 @@ const dataset = [ + { + id: "00000010-0000-4000-8000-100000000001", + account: "00000000-0000-4000-8000-000000000001", + locale: "en", + timezone: "UTC", + default_otp_channel_id: null, + created_at: new Date("2026-01-01T00:00:00.000Z"), + updated_at: null, + version: 1, + }, + { + id: "00000010-0000-4000-8000-100000000002", + account: "00000000-0000-4000-8000-100000000002", + locale: "en", + timezone: "UTC", + default_otp_channel_id: null, + created_at: new Date("2026-01-01T00:00:00.000Z"), + updated_at: null, + version: 1, + }, // E001 - Nathaniel Brooks { id: "064df7bb-184a-5971-a758-d1c11d8d2545", diff --git a/src/datasets/system/notification/channel.dataset.ts b/src/datasets/system/notification/channel.dataset.ts index e7050d1..26e7c2b 100644 --- a/src/datasets/system/notification/channel.dataset.ts +++ b/src/datasets/system/notification/channel.dataset.ts @@ -1,4 +1,59 @@ -const dataset: never[] = []; +const CREATED_AT = new Date("2026-01-01T00:00:00.000Z"); + +const dataset = [ + { + id: "00000011-0000-4000-8000-100000000001", + recipient_id: "00000010-0000-4000-8000-100000000001", + type: "IN_APP", + address: null, + source_identifier: null, + sound_enabled: true, + is_verified: true, + verified_at: CREATED_AT, + created_at: CREATED_AT, + updated_at: null, + version: 1, + }, + { + id: "00000011-0000-4000-8000-100000000002", + recipient_id: "00000010-0000-4000-8000-100000000001", + type: "EMAIL", + address: "admin@example.com", + source_identifier: "00000001-0000-4000-8000-100000000001", + sound_enabled: null, + is_verified: true, + verified_at: CREATED_AT, + created_at: CREATED_AT, + updated_at: null, + version: 1, + }, + { + id: "00000011-0000-4000-8000-100000000003", + recipient_id: "00000010-0000-4000-8000-100000000002", + type: "IN_APP", + address: null, + source_identifier: null, + sound_enabled: true, + is_verified: true, + verified_at: CREATED_AT, + created_at: CREATED_AT, + updated_at: null, + version: 1, + }, + { + id: "00000011-0000-4000-8000-100000000004", + recipient_id: "00000010-0000-4000-8000-100000000002", + type: "EMAIL", + address: "user@example.com", + source_identifier: "00000001-0000-4000-8000-100000000002", + sound_enabled: null, + is_verified: true, + verified_at: CREATED_AT, + created_at: CREATED_AT, + updated_at: null, + version: 1, + }, +]; export const Channels = { name: "channel", diff --git a/src/datasets/system/notification/preference.dataset.ts b/src/datasets/system/notification/preference.dataset.ts index 54a539a..877fe88 100644 --- a/src/datasets/system/notification/preference.dataset.ts +++ b/src/datasets/system/notification/preference.dataset.ts @@ -1,4 +1,69 @@ -const dataset: never[] = []; +import { NotificationCategory } from "../../../enums"; + +const CREATED_AT = new Date("2026-01-01T00:00:00.000Z"); + +const dataset = [ + { + id: "00000012-0000-4000-8000-100000000001", + recipient_id: "00000010-0000-4000-8000-100000000001", + channel_type: "EMAIL", + category: NotificationCategory.INVITES, + is_duplication_enabled: false, + created_at: CREATED_AT, + updated_at: null, + version: 1, + }, + { + id: "00000012-0000-4000-8000-100000000002", + recipient_id: "00000010-0000-4000-8000-100000000001", + channel_type: "EMAIL", + category: NotificationCategory.SYSTEM, + is_duplication_enabled: false, + created_at: CREATED_AT, + updated_at: null, + version: 1, + }, + { + id: "00000012-0000-4000-8000-100000000003", + recipient_id: "00000010-0000-4000-8000-100000000001", + channel_type: "EMAIL", + category: NotificationCategory.OTHER, + is_duplication_enabled: false, + created_at: CREATED_AT, + updated_at: null, + version: 1, + }, + { + id: "00000012-0000-4000-8000-100000000004", + recipient_id: "00000010-0000-4000-8000-100000000002", + channel_type: "EMAIL", + category: NotificationCategory.INVITES, + is_duplication_enabled: false, + created_at: CREATED_AT, + updated_at: null, + version: 1, + }, + { + id: "00000012-0000-4000-8000-100000000005", + recipient_id: "00000010-0000-4000-8000-100000000002", + channel_type: "EMAIL", + category: NotificationCategory.SYSTEM, + is_duplication_enabled: false, + created_at: CREATED_AT, + updated_at: null, + version: 1, + }, + { + id: "00000012-0000-4000-8000-100000000006", + recipient_id: "00000010-0000-4000-8000-100000000002", + channel_type: "EMAIL", + category: NotificationCategory.OTHER, + is_duplication_enabled: false, + created_at: CREATED_AT, + updated_at: null, + version: 1, + }, +]; export const Preferences = { name: "preference", diff --git a/src/datasets/system/notification/recipient.dataset.ts b/src/datasets/system/notification/recipient.dataset.ts index 8d991e6..716c488 100644 --- a/src/datasets/system/notification/recipient.dataset.ts +++ b/src/datasets/system/notification/recipient.dataset.ts @@ -1,4 +1,29 @@ -const dataset: never[] = []; +import { ADMIN_ACCOUNT_ID, USER_ACCOUNT_ID } from "../../../constants"; + +const CREATED_AT = new Date("2026-01-01T00:00:00.000Z"); + +const dataset = [ + { + id: "00000010-0000-4000-8000-100000000001", + account: ADMIN_ACCOUNT_ID, + locale: "en", + timezone: "UTC", + default_otp_channel_id: null, + created_at: CREATED_AT, + updated_at: null, + version: 1, + }, + { + id: "00000010-0000-4000-8000-100000000002", + account: USER_ACCOUNT_ID, + locale: "en", + timezone: "UTC", + default_otp_channel_id: null, + created_at: CREATED_AT, + updated_at: null, + version: 1, + }, +]; export const Recipients = { name: "recipient",