Bug 30484 - Interlibrary loans should have the ability to send notices based on request supplier updates
Summary: Interlibrary loans should have the ability to send notices based on request s...
Status: Needs documenting
Alias: None
Product: Koha
Classification: Unclassified
Component: ILL (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Bugs List
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on: 28909
Blocks:
  Show dependency treegraph
 
Reported: 2022-04-07 11:31 UTC by Andrew Isherwood
Modified: 2022-11-09 15:07 UTC (History)
3 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Medium patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This interlibrary loans module enhancement allows backend developers to trigger notices to patrons upon certain backend actions. **Sponsored by** *PTFS Europe*
Version(s) released in:
22.11.00


Attachments
Bug 30484: Add ILL update notice (11.18 KB, patch)
2022-04-19 10:16 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 30484: Implement support for ILL request updates (15.38 KB, patch)
2022-04-19 10:16 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 30484: Add unit tests (7.86 KB, patch)
2022-04-19 10:16 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 30484: Add ILL update notice (11.18 KB, patch)
2022-04-19 11:02 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 30484: Implement support for ILL request updates (15.55 KB, patch)
2022-04-19 11:02 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 30484: Add unit tests (7.86 KB, patch)
2022-04-19 11:02 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 30484: Add ILL update notice (11.29 KB, patch)
2022-05-03 08:46 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 30484: Implement support for ILL request updates (15.55 KB, patch)
2022-05-03 08:46 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 30484: Add unit tests (7.86 KB, patch)
2022-05-03 08:46 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 30484: Add ILL update notice (11.29 KB, patch)
2022-05-04 08:33 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 30484: Implement support for ILL request updates (15.55 KB, patch)
2022-05-04 08:33 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 30484: Add unit tests (7.86 KB, patch)
2022-05-04 08:33 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 30484: Add ILL update notice (11.38 KB, patch)
2022-05-04 09:50 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 30484: Implement support for ILL request updates (15.65 KB, patch)
2022-05-04 09:50 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 30484: Add unit tests (7.95 KB, patch)
2022-05-04 09:50 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 30484: Add ILL update notice (11.29 KB, patch)
2022-05-05 09:22 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 30484: Implement support for ILL request updates (17.81 KB, patch)
2022-05-05 09:22 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 30484: Add unit tests (7.67 KB, patch)
2022-05-05 09:22 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 30484: Add ILL update notice (11.46 KB, patch)
2022-08-08 21:01 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 30484: Implement support for ILL request updates (17.91 KB, patch)
2022-08-08 21:01 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 30484: Add unit tests (7.59 KB, patch)
2022-08-08 21:01 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 28909: (QA follow-up) Fix typo 'Kind Regards' (6.89 KB, patch)
2022-08-08 21:01 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Isherwood 2022-04-07 11:31:49 UTC
It should be possible for the Interlibrary Loans module to inform a user when a request supplier makes a pertinent change to an outstanding request.

Scenario defined by customer to be fulfilled by this bug:
- A user places an ILL request for a journal article via the RapidILL backend.
- RapidILL fulfil the request with an electronic resource.
- The user is notified of the request fulfilment via their chosen communication method, the notice contains the link and password required to access the requested resource.

The intended solution will add a mechanism to allow Koha ILL to periodically check outstanding requests with suppliers for updates and act accordingly.

As an aside, there is a known customer requirement for notices to be sent when requests are modified locally, this requirement will be catered for in the design of the solution.

Details of the intended implementation:
- An ILL backend, or core Koha ILL, can define one or more "update processors", these are functions that can perform an action when supplied with an update meeting the criteria they're interested in
- An ILL request will be given the ability to obtain its latest status with the supplier, known as an "update"
- "Updates" can then be passed to "update processors" that are interested in them, which can then perform whatever actions they wish.

Generic 
- Core Koha ILL will provide:
  - An object to encapsulate supplier updates
  - A base class from which "update processors" can be subclassed
  - Functions to gather updates from backends and orchestrate the processing
  - A notice template which will be used to send update notices
  - A shell script that can be run to initiate the process

For the customer use case defined above:
- The RapidILL backend will:
  - Provide the ability to retrieve the latest update from the RapidILL API
  - Define a SendArticleLink processor
Comment 1 Andrew Isherwood 2022-04-19 10:16:41 UTC
Created attachment 133394 [details] [review]
Bug 30484: Add ILL update notice

Adds a new ILL_REQUEST_UPDATE notice which is to be used for the
formation of notices informing users of updates to ILL requests.

Commit includes database updates and template changes for messaging
preferences
Comment 2 Andrew Isherwood 2022-04-19 10:16:45 UTC
Created attachment 133395 [details] [review]
Bug 30484: Implement support for ILL request updates

This commit adds support for the concept of ILL request update notices.

- Adds a new Koha::Illrequest::SupplierUpdate class that is used to
encapsulate an update to a request, this update may come from a
supplier via a backend or from core ILL via, perhaps, a user action
- Adds a new Koha::Illrequest::SupplierUpdateProcessor base class that
can be subclassed in order to create a processor that can be passed an
update and act accordingly.
- Updates to Illrequest.pm to support the above classes and allow core
Koha to offer update processors
- A shell script to initiate a periodic process to check for updates
meeting given criteria and run the appropriate processors
Comment 3 Andrew Isherwood 2022-04-19 10:16:49 UTC
Created attachment 133396 [details] [review]
Bug 30484: Add unit tests
Comment 4 Andrew Isherwood 2022-04-19 11:02:28 UTC
Created attachment 133399 [details] [review]
Bug 30484: Add ILL update notice

Adds a new ILL_REQUEST_UPDATE notice which is to be used for the
formation of notices informing users of updates to ILL requests.

Commit includes database updates and template changes for messaging
preferences
Comment 5 Andrew Isherwood 2022-04-19 11:02:32 UTC
Created attachment 133400 [details] [review]
Bug 30484: Implement support for ILL request updates

This commit adds support for the concept of ILL request update notices.

- Adds a new Koha::Illrequest::SupplierUpdate class that is used to
encapsulate an update to a request, this update may come from a
supplier via a backend or from core ILL via, perhaps, a user action
- Adds a new Koha::Illrequest::SupplierUpdateProcessor base class that
can be subclassed in order to create a processor that can be passed an
update and act accordingly.
- Updates to Illrequest.pm to support the above classes and allow core
Koha to offer update processors
- A shell script to initiate a periodic process to check for updates
meeting given criteria and run the appropriate processors
Comment 6 Andrew Isherwood 2022-04-19 11:02:36 UTC
Created attachment 133401 [details] [review]
Bug 30484: Add unit tests
Comment 7 Andrew Isherwood 2022-04-19 12:42:43 UTC
TEST PLAN:

This test plan tests the provided functionality by using a mocked update supplied by the FreeForm backend. The command line script is run which will look for requests that match the supplied criteria, obtain a mocked update from them, and process the update. The processor simply prints the message supplied in the update to the screen.

- Ensure you have Interlibrary Loans turned on and have the FreeForm backend installed. It is important you are using the "bug_30484_mock_request_update" branch of the FreeForm backend as this enables the backend to provide mock updates that this functionality uses.
- Create a FreeForm ILL request
- On the "Manage ILL request" page for the newly created request, click the "Confirm request" button, thereby setting the request status to "Requested"
- Run the script, in the "misc" directory, run:

  perl process_ill_updates.pl --statuses REQ --backend FreeForm

- TEST: You should see the following:
  - The message "This is a mock update from the FreeForm backend"
  - The following run report:

Run details:
Request ID: xxx
  Processing by: FreeForm
  Number of processors run: 1
  Processor details:
    Processor name: Print to STDERR
    Success messages: PRINTED
    Error messages:

- If the above messages were printed, the test plan can be considered successful.
Comment 8 Andrew Isherwood 2022-04-25 13:14:38 UTC
Revised test plan:


This test plan tests the provided functionality by using a mocked update supplied by the FreeForm backend. The command line script is run which will look for requests that match the supplied criteria, obtain a mocked update from them, and process the update. The processor simply prints the message supplied in the update to the screen.

- Ensure you have Interlibrary Loans turned on and have the FreeForm backend installed. It is important you are using the "bug_30484_mock_request_update" branch of the FreeForm backend as this enables the backend to provide mock updates that this functionality uses.
- Ensure that the patron that will be creating the request has the "Interlibrary loan updated" notice enabled for at least "Email"
- Create a FreeForm ILL request
- On the "Manage ILL request" page for the newly created request, click the "Confirm request" button, thereby setting the request status to "Requested"
- Run the script, in the "misc" directory, run:

  perl process_ill_updates.pl --statuses REQ --backend FreeForm

- TEST: You should see the following:
  - The message "This is a mock update from the FreeForm backend"
  - The following run report:

Run details:
Request ID: xxx
  Processing by: FreeForm
  Number of processors run: 1
  Processor details:
    Processor name: Print to STDERR
    Success messages: PRINTED
    Error messages:

- If the above messages were printed, the test plan can be considered successful.
Comment 9 Andrew Isherwood 2022-05-03 08:07:22 UTC
Set this back to assigned as I'd forgotten it needs forward porting onto master before it can be QA'ed, it was developed against 21.11
Comment 10 Andrew Isherwood 2022-05-03 08:46:48 UTC
Created attachment 134486 [details] [review]
Bug 30484: Add ILL update notice

Adds a new ILL_REQUEST_UPDATE notice which is to be used for the
formation of notices informing users of updates to ILL requests.

Commit includes database updates and template changes for messaging
preferences
Comment 11 Andrew Isherwood 2022-05-03 08:46:52 UTC
Created attachment 134487 [details] [review]
Bug 30484: Implement support for ILL request updates

This commit adds support for the concept of ILL request update notices.

- Adds a new Koha::Illrequest::SupplierUpdate class that is used to
encapsulate an update to a request, this update may come from a
supplier via a backend or from core ILL via, perhaps, a user action
- Adds a new Koha::Illrequest::SupplierUpdateProcessor base class that
can be subclassed in order to create a processor that can be passed an
update and act accordingly.
- Updates to Illrequest.pm to support the above classes and allow core
Koha to offer update processors
- A shell script to initiate a periodic process to check for updates
meeting given criteria and run the appropriate processors
Comment 12 Andrew Isherwood 2022-05-03 08:46:58 UTC
Created attachment 134488 [details] [review]
Bug 30484: Add unit tests
Comment 13 Andrew Isherwood 2022-05-03 08:47:39 UTC
Now setting back to Needs signoff, forward ported to master
Comment 14 Andrew Isherwood 2022-05-04 08:33:22 UTC
Created attachment 134569 [details] [review]
Bug 30484: Add ILL update notice

Adds a new ILL_REQUEST_UPDATE notice which is to be used for the
formation of notices informing users of updates to ILL requests.

Commit includes database updates and template changes for messaging
preferences
Comment 15 Andrew Isherwood 2022-05-04 08:33:26 UTC
Created attachment 134570 [details] [review]
Bug 30484: Implement support for ILL request updates

This commit adds support for the concept of ILL request update notices.

- Adds a new Koha::Illrequest::SupplierUpdate class that is used to
encapsulate an update to a request, this update may come from a
supplier via a backend or from core ILL via, perhaps, a user action
- Adds a new Koha::Illrequest::SupplierUpdateProcessor base class that
can be subclassed in order to create a processor that can be passed an
update and act accordingly.
- Updates to Illrequest.pm to support the above classes and allow core
Koha to offer update processors
- A shell script to initiate a periodic process to check for updates
meeting given criteria and run the appropriate processors
Comment 16 Andrew Isherwood 2022-05-04 08:33:30 UTC
Created attachment 134571 [details] [review]
Bug 30484: Add unit tests
Comment 17 Andrew Isherwood 2022-05-04 09:50:00 UTC
Created attachment 134572 [details] [review]
Bug 30484: Add ILL update notice

Adds a new ILL_REQUEST_UPDATE notice which is to be used for the
formation of notices informing users of updates to ILL requests.

Commit includes database updates and template changes for messaging
preferences

Signed-off-by: Stephen Graham <s.graham4@herts.ac.uk>

Sponsored-by: University of Hertfordshire
Comment 18 Andrew Isherwood 2022-05-04 09:50:06 UTC
Created attachment 134573 [details] [review]
Bug 30484: Implement support for ILL request updates

This commit adds support for the concept of ILL request update notices.

- Adds a new Koha::Illrequest::SupplierUpdate class that is used to
encapsulate an update to a request, this update may come from a
supplier via a backend or from core ILL via, perhaps, a user action
- Adds a new Koha::Illrequest::SupplierUpdateProcessor base class that
can be subclassed in order to create a processor that can be passed an
update and act accordingly.
- Updates to Illrequest.pm to support the above classes and allow core
Koha to offer update processors
- A shell script to initiate a periodic process to check for updates
meeting given criteria and run the appropriate processors

Signed-off-by: Stephen Graham <s.graham4@herts.ac.uk>

Sponsored-by: University of Hertfordshire
Comment 19 Andrew Isherwood 2022-05-04 09:50:10 UTC
Created attachment 134574 [details] [review]
Bug 30484: Add unit tests

Signed-off-by: Stephen Graham <s.graham4@herts.ac.uk>

Sponsored-by: University of Hertfordshire
Comment 20 Andrew Isherwood 2022-05-05 09:22:40 UTC
Created attachment 134626 [details] [review]
Bug 30484: Add ILL update notice

Adds a new ILL_REQUEST_UPDATE notice which is to be used for the
formation of notices informing users of updates to ILL requests.

Commit includes database updates and template changes for messaging
preferences
Comment 21 Andrew Isherwood 2022-05-05 09:22:45 UTC
Created attachment 134627 [details] [review]
Bug 30484: Implement support for ILL request updates

This commit adds support for the concept of ILL request update notices.

- Adds a new Koha::Illrequest::SupplierUpdate class that is used to
encapsulate an update to a request, this update may come from a
supplier via a backend or from core ILL via, perhaps, a user action
- Adds a new Koha::Illrequest::SupplierUpdateProcessor base class that
can be subclassed in order to create a processor that can be passed an
update and act accordingly.
- Updates to Illrequest.pm to support the above classes and allow core
Koha to offer update processors
- A shell script to initiate a periodic process to check for updates
meeting given criteria and run the appropriate processors
Comment 22 Andrew Isherwood 2022-05-05 09:22:49 UTC
Created attachment 134628 [details] [review]
Bug 30484: Add unit tests
Comment 23 Katrin Fischer 2022-08-08 20:58:43 UTC
(In reply to Andrew Isherwood from comment #8)
> Revised test plan:
> 
> This test plan tests the provided functionality by using a mocked update
> supplied by the FreeForm backend. The command line script is run which will
> look for requests that match the supplied criteria, obtain a mocked update
> from them, and process the update. The processor simply prints the message
> supplied in the update to the screen.
> 
> - Ensure you have Interlibrary Loans turned on and have the FreeForm backend
> installed. It is important you are using the "bug_30484_mock_request_update"
> branch of the FreeForm backend as this enables the backend to provide mock
> updates that this functionality uses.
> - Ensure that the patron that will be creating the request has the
> "Interlibrary loan updated" notice enabled for at least "Email"
> - Create a FreeForm ILL request
> - On the "Manage ILL request" page for the newly created request, click the
> "Confirm request" button, thereby setting the request status to "Requested"
> - Run the script, in the "misc" directory, run:
> 
>   perl process_ill_updates.pl --statuses REQ --backend FreeForm
> 
> - TEST: You should see the following:
>   - The message "This is a mock update from the FreeForm backend"
>   - The following run report:
> 
> Run details:
> Request ID: xxx
>   Processing by: FreeForm
>   Number of processors run: 1
>   Processor details:
>     Processor name: Print to STDERR
>     Success messages: PRINTED
>     Error messages:
> 
> - If the above messages were printed, the test plan can be considered
> successful.

1) Typo in updatedatabase: Kind Regards > Kind regards
I've added a follow-up patch fixing this globally.

2) +=head3 append_to_note.
I see it only appears in Illrequest.pm and has a test, but not sure how it relates to the functionality of this patch set?

3) Worked through the test plan and it works as described. The changes for messaging preferences appear to be complete, but we should start thinking about a way to make the list of message options configurable as not all libraries will offer all notices (totally a separate bug of course).

Now we need another QA for the dependent bug 28909 to unlock!
Comment 24 Katrin Fischer 2022-08-08 21:01:21 UTC
Created attachment 138859 [details] [review]
Bug 30484: Add ILL update notice

Adds a new ILL_REQUEST_UPDATE notice which is to be used for the
formation of notices informing users of updates to ILL requests.

Commit includes database updates and template changes for messaging
preferences

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

https://bugs.koha-community.org/show_bug.cgi?id=28909
Comment 25 Katrin Fischer 2022-08-08 21:01:26 UTC
Created attachment 138860 [details] [review]
Bug 30484: Implement support for ILL request updates

This commit adds support for the concept of ILL request update notices.

- Adds a new Koha::Illrequest::SupplierUpdate class that is used to
encapsulate an update to a request, this update may come from a
supplier via a backend or from core ILL via, perhaps, a user action
- Adds a new Koha::Illrequest::SupplierUpdateProcessor base class that
can be subclassed in order to create a processor that can be passed an
update and act accordingly.
- Updates to Illrequest.pm to support the above classes and allow core
Koha to offer update processors
- A shell script to initiate a periodic process to check for updates
meeting given criteria and run the appropriate processors

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

https://bugs.koha-community.org/show_bug.cgi?id=28909
Comment 26 Katrin Fischer 2022-08-08 21:01:30 UTC
Created attachment 138861 [details] [review]
Bug 30484: Add unit tests

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

https://bugs.koha-community.org/show_bug.cgi?id=28909
Comment 27 Katrin Fischer 2022-08-08 21:01:35 UTC
Created attachment 138862 [details] [review]
Bug 28909: (QA follow-up) Fix typo 'Kind Regards'

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 28 Tomás Cohen Arazi 2022-09-23 12:32:23 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 29 Lucas Gass 2022-11-01 22:08:48 UTC
Enhancement will not be backported to 22.05.x series