Backend: Validation for elements in location hierarchy (institution)
Description
Purpose: Prevent users from creating names and codes in the location hierarchy that will not be processed correctly by circulation rules. (For example, prevent creation of "Science Reserves" when "Science-Reserves" already exists, since "Science Reserves" and "Science-Reserves" will both be normalized to science-reserves in circulation rules.
Scenario
Given an Institution A with code <code>
When a user attempts to save Institution B, with a code that does not differ from that of Institution A, or differs only by non-alphanumeric characters
Then do not allow the user to save
Error message: An institution with this code already exists
Scenario
Given an institution with a code only consisting of non-alphanumeric characters
When a user attempts to save the institution
Then do not allow the user to save
Institution names must have at least one alphanumeric character
Notes
Non-alphanumeric characters should still be allowed (e.g., they may be part of a library's official name)
Prevent creation of "Science-Reserves" when "Science Reserves" already exists
Purpose: Prevent users from creating names and codes in the location hierarchy that will not be processed correctly by circulation rules. (For example, prevent creation of "Science Reserves" when "Science-Reserves" already exists, since "Science Reserves" and "Science-Reserves" will both be normalized to
science-reserves
in circulation rules.Scenario
Given an Institution A with code <code>
When a user attempts to save Institution B, with a code that does not differ from that of Institution A, or differs only by non-alphanumeric characters
Then do not allow the user to save
Error message: An institution with this code already exists
Scenario
Given an institution with a code only consisting of non-alphanumeric characters
When a user attempts to save the institution
Then do not allow the user to save
Institution names must have at least one alphanumeric character
Notes
Non-alphanumeric characters should still be allowed (e.g., they may be part of a library's official name)
Prevent creation of "Science-Reserves" when "Science Reserves" already exists