16 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
Alexander Brandon Coles d17da65477 Freeze string literals in app/models
rubocop -A --only Style/FrozenStringLiteralComment,Layout/EmptyLineAfterMagicComment,Style/RedundantFreeze app/models
2025-07-22 18:26:13 +01:00
Kabiru Mwenja 7efa737e9e Support remindable visible? check 2025-06-03 21:08:49 +03:00
Jan Sandbrink 112ae02926 Update Ruby copyright headers using rake task
This effectively removes the year from a bunch of copyright headers.
We stopped indicating a specific year at some point, but
didn't propagate this change to every file yet.
2025-03-18 14:23:54 +01:00
Jonas Jabari 267dd6f485 addressed feedback from @akabiru 2024-12-11 12:21:09 +01:00
Jonas Jabari 8c08239169 implemented reminder creation/update modal on workpackag page and basic spec coverage 2024-12-03 16:59:34 +01:00
Kabiru Mwenja 36e23d9d55 Add reminder completion via delete service 2024-11-29 16:30:08 +03:00
Kabiru Mwenja 64cecd3241 Unify Reminder#unread_notifactions query
exists? can be chained to where without having adverse effects

See: https://docs.rubocop.org/rubocop-rails/cops_rails.html#railswhereexists
2024-11-28 20:20:42 +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 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