From bbc1075836de1f9a6047bc1d3ca14a5d19ebba97 Mon Sep 17 00:00:00 2001 From: vineet-suri <49708329+vineet-suri@users.noreply.github.com> Date: Mon, 7 Dec 2020 18:33:28 +0530 Subject: [PATCH] feat(notification-service): adds actionMeta property to NotificationUser model (#99) * feat(notification-service): adds actionMeta property to NotificationUser model RFIT-1121 * feat(notification-service): adds dynamic properties to notification user model RFIT-1121 * fix(notification-service): code review fix RFIT-1121 Co-authored-by: samarpan-b <39519829+samarpan-b@users.noreply.github.com> --- .../src/models/notification-user.model.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/services/notification-service/src/models/notification-user.model.ts b/services/notification-service/src/models/notification-user.model.ts index 165be54d85..90348fc7d4 100644 --- a/services/notification-service/src/models/notification-user.model.ts +++ b/services/notification-service/src/models/notification-user.model.ts @@ -1,9 +1,12 @@ -import {model, property, belongsTo} from '@loopback/repository'; +import {model, property, belongsTo, AnyObject} from '@loopback/repository'; import {BaseEntity} from '@sourceloop/core'; import {Notification} from './notification.model'; @model({ name: 'notification_users', + settings: { + strict: false, + } }) export class NotificationUser extends BaseEntity { @property({ @@ -36,6 +39,20 @@ export class NotificationUser extends BaseEntity { }) isRead?: boolean; + @property({ + type: 'object', + required: false, + name: 'action_meta', + }) + actionMeta?: AnyObject; + + // Define well-known properties here + + // Indexer property to allow additional data + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [prop: string]: any; + + constructor(data?: Partial) { super(data); }