From e308657a85455669ab0b116d2b4111acfa8c6f15 Mon Sep 17 00:00:00 2001 From: Dirk Peter Date: Fri, 12 Jul 2024 10:54:35 +0200 Subject: [PATCH 1/2] #30: adds fragement for cleared reminders to support proper retention --- src/app/reminder-plugin/reminder.model.ts | 1 + src/app/reminder-plugin/services/reminder.service.ts | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/app/reminder-plugin/reminder.model.ts b/src/app/reminder-plugin/reminder.model.ts index ec688ef..96210b1 100644 --- a/src/app/reminder-plugin/reminder.model.ts +++ b/src/app/reminder-plugin/reminder.model.ts @@ -25,6 +25,7 @@ export interface Reminder extends IEvent { status: ReminderStatus; isGroup?: object; diff?: number; + isCleared?: object; } export interface ReminderGroup { diff --git a/src/app/reminder-plugin/services/reminder.service.ts b/src/app/reminder-plugin/services/reminder.service.ts index d7bf5be..e4053fd 100644 --- a/src/app/reminder-plugin/services/reminder.service.ts +++ b/src/app/reminder-plugin/services/reminder.service.ts @@ -125,6 +125,9 @@ export class ReminderService { status: reminder.status, }; + if (reminder.status === ReminderStatus.cleared) event.isCleared = {}; + else event.isCleared = null; + return (await this.eventService.update(event)) as IResult; } From e96fe6582f7269d617dd4562e90b13003216c1eb Mon Sep 17 00:00:00 2001 From: Dirk Peter Date: Fri, 12 Jul 2024 10:59:13 +0200 Subject: [PATCH 2/2] #30 adjust code and add info for retention --- src/app/reminder-plugin/services/reminder.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/reminder-plugin/services/reminder.service.ts b/src/app/reminder-plugin/services/reminder.service.ts index e4053fd..74676bb 100644 --- a/src/app/reminder-plugin/services/reminder.service.ts +++ b/src/app/reminder-plugin/services/reminder.service.ts @@ -125,8 +125,8 @@ export class ReminderService { status: reminder.status, }; - if (reminder.status === ReminderStatus.cleared) event.isCleared = {}; - else event.isCleared = null; + // (un)set `isCleared` fragment to supoprt using retention rules for cleared reminders + event.isCleared = (reminder.status === ReminderStatus.cleared) ? {} : null; return (await this.eventService.update(event)) as IResult; }