Address alert in patron registration

Bug #898248 reported by Bill Erickson
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Wishlist
Unassigned

Bug Description

Feature request / discussion...

The goal is to provide a way for staff to maintain a set of addresses that, when entered into the patron registration interface as a patron's address, will cause an alert to appear in the interface. Use cases for this include addresses at group homes, addresses known to be beyond some physical or political boundary, etc. any of which may affect lending policies to the patron. These would be full addresses, including street address, not just post code and/or city, etc.

The implementation seems simple enough: a table to store the addresses plus the alert message, a UI for managing the addresses, and an additional type of alert (a la duplicate patron alerts) within the patron registration UI.

Comments/suggestions appreciated. Is this type of feature one that would be generally useful to Evergreen users? Should it do more?

Tags: pullrequest
Revision history for this message
Thomas Berezansky (tsbere) wrote :

I would make the addresses able to be specified/matched by regex, at least for the street component, probably for all of the components, and perhaps by "billing address" and "mailing address" type limiters.

Maybe with an "any/all" flag for "any of the fields or all of the fields", so you can match on, say, a known set of ZIP codes for post office boxes only OR Street contains "P.?O.? Box" regardless of city/state fields to say that a "mailing address" shouldn't be a post office box.

Revision history for this message
Bill Erickson (berick) wrote :

All great ideas. I'll start putting together a topic branch.

Revision history for this message
Bill Erickson (berick) wrote :

I pushed a topic branch to user/berick/patron-reg-address-alert @ working.

I realize as I'm typing this, though, I did not take billing/mailing address into consideration. In the meantime, testing and/or eyes on the code, particularly the SQL bits, appreciated.

For billing/mailing address, would the idea be to have billing_address and mailing_address boolean columns on the address alert table. Any alert where (say) billing_address=true would only match to a test address if the test address was intended to be used as a billing address and if billing_address=false, it could match against any address?

Revision history for this message
Thomas Berezansky (tsbere) wrote :

I gave you some commentary on the SQL in IRC. But I have more!

Should there be an "active" flag on these, so you can leave it in place but turn it off for whatever reason?

As for the billing/mailing address bit, I would say that would work. Unless you think there is a reason someone might care to, say, match whenever something is *not* a billing or mailing address?

Revision history for this message
Bill Erickson (berick) wrote :

Pushed updated, rebased, and semi-squashed branch to

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/patron-reg-address-alert-rebase1

* Uses ~* for case-insensitive matching instead of lower()
* Adds additional docs to the conify UI to clarify case-sensitive matching
* Adds active column to allow for address alert
* Adds support for matching on billing/mailing address

Revision history for this message
Bill Erickson (berick) wrote :

correction to above: s/Adds active column to allow for address alert/Adds active column to address alert/

Bill Erickson (berick)
tags: added: pullrequest
Revision history for this message
Thomas Berezansky (tsbere) wrote :

In looking at this again, I have one comment on the billing/mailing address flags. You implemented the check as:

AND (NOT mailing_address OR $9)
AND (NOT billing_address OR $10)

I wonder if that should be more like

AND (
    (NOT mailing_address AND NOT billing_address)
    OR (mailing_address AND $9)
    OR (billing_address AND $10)
)

This would allow a rule that should only match active addresses (current mailing/billing address) to exist without having to have 3 versions (mailing only, billing only, and both). It removes the ability to say "I care about this rule only if the address is just a mailing address and isn't a billing address" and similar, but I don't see that as being as useful anyway.

Revision history for this message
Bill Erickson (berick) wrote :

Thanks Thomas. user/berick/patron-reg-address-alert-rebase2 now has these changes.

Revision history for this message
Bill Erickson (berick) wrote :

user/berick/patron-reg-address-alert-rebase2 force-pushed, now with menu entry in local-admin for accessing the conify UI. plus minor repair to conify UI code.

Revision history for this message
Thomas Berezansky (tsbere) wrote :

Looks good, pushed to master

Changed in evergreen:
status: New → Fix Committed
Ben Shum (bshum)
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.