LP#1752334 - BadContact, use additional note if provided. user/stompro/lp1752334_badcontact_use_additional_note
authorJosh Stompro <stompro@stompro.org>
Thu, 28 Feb 2019 16:41:01 +0000 (10:41 -0600)
committerJosh Stompro <stompro@stompro.org>
Thu, 28 Feb 2019 16:41:01 +0000 (10:41 -0600)
commit766e09d70082477d824519d7daa198d816683602
tree67bfcf2e74046b3b2817be0fe6030dfcde1a244a
parentbb6495dd8e2e7a8c8cee4577799b14b061261f21
LP#1752334 - BadContact, use additional note if provided.

If an additional note is provided when marking a contact invalid,
then that note should be appended to the penalty note field.

This change adds that functionality.  This doesn't change the results
for staff that are using the invalidate buttons in the client, since
there isn't a chance to add an additional note from that interface.

But if someone is calling open-ils.actor.invalidate.email via some other
method, then you can specify the additional note.

I would like to be able to add extra notes when automatically processing
bounced emails, to give staff a clue as to why the email failed.  Such as
"<email> Account over quota for past 3 weeks, ask patron to check their account."

Testing plan:

Before fix.
1. Choose a patron with an email address and note their patron id number.
2. Run an srfsh shell.
3. Login to get an auth token 'login username password'
4. Run the invalidate email command to mark the users email invalid, including
   an addition note value.
  srfsh# request open-ils.actor open-ils.actor.invalidate.email "<authtoken>" "<patronid>" "Testing Additional Note"
5. Take a look at the patron account and see that the penalty message only
   includes a copy of the email address that was marked invalid.

After fix.
1. Restart the opensrf actor service if needed to re-read the changed perl module.
  osrf_control -l --service open-ils.actor --restart
2. Remove the penalty and re-add email address to test patron's account.
3. Run an srfsh shell.
4. Login to get an auth token 'login username password'
5. Run the invalidate email command to mark the users email invalid,
   including an addition note value.
  srfsh# request open-ils.actor open-ils.actor.invalidate.email "<authtoken>" "<patronid>" "Testing Additional Note"
6. Take a look at the patron account and see that the penalty message note
   now includes the additional note.

Signed-off-by: Josh Stompro <stompro@stompro.org>
Open-ILS/src/perlmods/lib/OpenILS/Utils/BadContact.pm