Skip to content

The circulation policy reminder is sometimes not correct #3930

@PascalRepond

Description

@PascalRepond

Bug description:

If a CIPO defines a list of reminders that are not in the correct order in the data (ascending for "overdue" and descending for "due_soon"). The notifications are sent with incorrect parameters because it uses the order of the reminders in the data to know which reminder to use.

Expected behavior:

When sending a circulation reminder-notification, choosing which reminder params to use should be done by ordering the reminders by "delay" (according to the notification type). The order of these reminders in the data is sometimes not coherent.

Steps to Reproduce (very convoluted to reproduce)

  1. Create a cipo with two "overdue" reminders in this order:
{
        "communication_channel": "mail",
        "days_delay": 49,
        "template": "email/overdue",
        "type": "overdue"
      },
      {
        "communication_channel": "patron_setting",
        "days_delay": 1,
        "template": "email/overdue",
        "type": "overdue"
      }
  1. This should send a notification by "patron_setting" one day after the due date and one by "mail" 49 days after the dure date.
  2. Checkout an loan with this CIPO and wait one day after the due date.
  3. See that the notification is sent by "mail"

Metadata

Metadata

Assignees

Labels

bugBreaks something but is not blockingf: circulationConcerns the circulation interface or backend

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions