14 Commits

Author SHA1 Message Date
Kabiru Mwenja eaee546c81 fix(reminders): align visible scope with instance-level authorization check (#22615)
The class-level visible scope now verifies the user retains access to
the associated remindable, consistent with the existing instance method.
Updated specs to reflect the corrected authorization behavior.
2026-03-31 16:43:55 +03:00
Kabiru Mwenja 7efa737e9e Support remindable visible? check 2025-06-03 21:08:49 +03:00
Jan Sandbrink 0b87e7543f Freeze string literals in specs
Rolling out frozen string literals further by freezing all
string literals in core specs.
2025-05-05 09:29:55 +02:00
Jonas Jabari 267dd6f485 addressed feedback from @akabiru 2024-12-11 12:21:09 +01:00
Kabiru Mwenja 36e23d9d55 Add reminder completion via delete service 2024-11-29 16:30:08 +03:00
Kabiru Mwenja 724f899033 Define set reminders update service 2024-11-27 18:17:25 +03:00
Kabiru Mwenja b6367992bc Revert "fix[Op#59433]: simplify reminder model to directly linked to notification"
This reverts commit ae3f77da80.

Maintain a persistent record of reminder notifications as notifications are always retrievable by the user, e.g. via
email, viewing "all" notifications.

A reminder notification is only created IF there are no active unread notifications, hence when rescheduling, snoozing or editing a reminder then
ensure all previous notifications are marked as read- as we should not have duplicate notifications for a given reminder.
2024-11-27 12:39:46 +03:00
Kabiru Mwenja b9a5fd0cd5 Revert back to reminder state inference model
(1) Notified - a `notification_id` exists
(2) Scheduled - a `job_id` exists

Reverts fdf09b9aa8
2024-11-25 17:35:03 +03:00
Kabiru Mwenja 89bd340e93 Ensure notifications are unique to reminders
Add uniqueness index on NOT null

```
-- add_index(:reminders, :notification_id, {:unique=>true, :where=>"notification_id IS NOT NULL", :name=>"index_reminders_on_notification_id_unique"})
   (1.0ms)  CREATE UNIQUE INDEX "index_reminders_on_notification_id_unique" ON "reminders" ("notification_id") WHERE notification_id IS NOT NULL
```

On notification delete, nullify the reminder record- at present reminders are a persistent record (so are notifications, but that could change).
2024-11-25 11:18:08 +03:00
Kabiru Mwenja ae3f77da80 fix[Op#59433]: simplify reminder model to directly linked to notification
Introduce simple status enums to track various reminder states
2024-11-22 23:14:30 +03:00
Kabiru Mwenja fdf09b9aa8 Separate schedule status from notification status on reminders
As reminders are generally scheduled in the future, we need to keet track of
 (1) scheduled status - make it easy to track down the (good) job for edit/reschedule actions
 (2) notified at timestamp - prevents duplicate notifications, skip schedule when already notified
2024-11-22 12:32:51 +03:00
Kabiru Mwenja 09622465b9 Keep track of reminder notifications
Arises from: 73aa20c5aa

Once a reminder is created we need to keep track of:
 (1) The scheduled job: this is done via Reminder#job_id which corresponds to a GoodJob::Job#id
 (2) Any Notification(s) resulting from the reminder

This is important in order to easily handle any modifications to the reminder such as snoozing, editing
& deleting reminders
2024-11-21 15:53:11 +03:00
Kabiru Mwenja 40d0756211 fix[Op#59433]: track reminder job id for job scheduling control 2024-11-20 18:56:21 +03:00
Kabiru Mwenja b466fba10c [#59433] Define database model for reminders
https://community.openproject.org/work_packages/59433
2024-11-19 16:31:00 +03:00