Prevent user from adding multiple organizational hierarchy elements with the same code

Description

Purpose: Because codes are used in loan rules, they must be unique at their level of the organization hierarchy.

Scenarios

  1. Scenario

    • Given a saved institution with code <ANYCODE>

    • When the user attempts to save a new institution with code <ANYCODE>

    • Then do not save the new institution

      • Display error text, "Institution code must be unique" below code field

  2. Scenario

    • Given an institution, and a campus for that institution with code <ANYCODE>

    • When the user attempts to save a new campus with code <ANYCODE> for the same institution

    • Then do not save the new campus

      • Display error text, "Campus code must be unique" below code field

  3. Scenario

    • Given an institution and campus, and a library for that institution and campus with code <ANYCODE>

    • When the user attempts to save a new library with code <ANYCODE> for the same institution and campus

    • Then do not save the new library

      • Display error text, "Library codes must be unique" below code field

  4. Scenario

    • Given an institution and campus and library, and a location for that institution and campus and library with code <ANYCODE>

    • When the user attempts to save a new location with code <ANYCODE> for the same institution and campus and library

    • Then do not save the new location

      • Display error text, "Location code must be unique" below code field

Notes:

  • for first three scenarios, using error text similar to that of institution name not being unique (example attached)

  • for last scenario, using similar error text to that used when a location name is not unique

  • Story only requires unique codes for the same place in hierarchy

    • Two locations may have identical codes, if they are assigned to different libraries (and two libraries may have identical codes, if they are assigned to different campuses, etc.)

Environment

None

Potential Workaround

None

Attachments

6

Checklist

hide

TestRail: Results

Activity

Show:

Cate Boerema March 31, 2020 at 11:07 AM

Upgrading these issues to P2, as the lack of validation and uniqueness in locations can cause problems for circ rules.

Cate Boerema March 30, 2020 at 9:06 AM

On second thought, this is about codes, not location names and we don't (currently) rely on location codes for distinguishing locations throughout FOLIO. Given that, requiring codes to be unique only in their own hierarchy would be less of a problem. Let's think about it.

Pros:

  1. Saves on data entry when creating locations

  2. Would save on real-estate in Circ rules here:

  3. Enforces consistency in Circ rules display so you don't end up with a situation like the one showing below (which would occur if a mistake was made in data entry during location creation):

Cons:

  1. FOLIO currently constrains locations codes so they are unique across the entire tenant (I just tested this in snapshot). This would need to be changed.

  2. FOLIO also constrains location names so they are unique across the entire tenant. This is necessary for the reasons stated above at least until we have the ability to configure which elements of the hierarchy display in FOLIO (see ). I think it might be confusing to have these behave differently.

  3. If we change location codes so they need only be unique within the hierarchy, we'll need to rethink the location menu values in Inventory. It currently displays the location codes. This would be pretty meaningless if many of the location had the same code (e.g. if, for both Main Library Reference and Law Library Reference, the code was "REF"). We would have to change the way that menu works so it assembles code elements from higher up in the hierarchy.

Overall, we definitely need a uniqueness check on Institution, Campus and Library codes. There is no check at all currently (not within the hierarchy nor across the entire tenant). Forcing these to be unique across the entire tenant would worsen the user experience for location CRUD and take up even more real estate in circ rules. So I think for these levels we definitely need to make the codes unique just within their hierarchies, as you specified. And, if Institution, Campus and Library codes are going to behave this way, Location codes should too.

So, let's go ahead and do this story as defined. We will need another story for addressing the codes displaying in the Inventory location selection menu. I think there is a similar location selection menu used in Orders. Not sure if we need a separate story for that or not. I'll investigate.

Cate Boerema March 30, 2020 at 8:08 AM

Hi . I just re-read this and I think the last scenario might be problematic. In FOLIO, when we want to display location, we only display the FOLIO name from the lowest level ("Location"). If we only require that locations be unique within their own Institution, Campus and Library, we could have different locations that are indistinguishable from one another in the UI (e.g. Reference in the Law library and Reference in the Main library would be undistinguishable). This is why we currently require uniqueness across all locations (as opposed to just within a given hierarchy).

Emma Boettcher August 16, 2019 at 8:35 PM

Corrected error text. Other validation stories (low priority, still in draft) are linked to .

Emma Boettcher August 6, 2019 at 8:23 PM

Your questions about validation might also apply to those other areas I'm talking about. I'll start a conversation with the PO's for this area and let you know.

Details

Assignee

Reporter

Priority

Development Team

Vega

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs
Created August 5, 2019 at 8:40 PM
Updated April 19, 2022 at 7:18 AM
TestRail: Cases
TestRail: Runs