Skip to content

Housing and location updates - #12

Open
labkey-martyp wants to merge 8 commits into
release26.7-SNAPSHOTfrom
26.7_fb_housing_location
Open

Housing and location updates#12
labkey-martyp wants to merge 8 commits into
release26.7-SNAPSHOTfrom
26.7_fb_housing_location

Conversation

@labkey-martyp

@labkey-martyp labkey-martyp commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Rationale

Remove floors from the NBRI location hierarchy so a location is identified by building, room, and cage alone. Floors are not a meaningful unit of location at NBRI, and requiring one on every room forced entry of a value that carries no information while complicating the derived location keys. This also drops the historicalOther dataset, which is no longer part of the reference study.

Keys are derived only when a record is created, so nothing recomputes them for locations that already exist. There is no location data in place yet, so there is nothing to migrate.

Related Pull Requests

None.

Changes

  • Rooms are keyed by building and name, and floor is no longer required or shown. Room entry now requires a building, since the derived key depends on it.

  • Buildings no longer fold the area into their name, so a description identifies a building on its own and a reused one is rejected rather than colliding.

  • Derived building, room, and cage keys are persisted consistently, and a key too long for its column is rejected with a message naming the parts at fault. Cages resolve to their room.

  • The cagemates report resolves animals in group pens, which have no cage and are housed against the room alone. Animals with a cage continue to match on the cage, which already identifies its room.

  • The cagemates report now counts only current occupants. It previously counted every living animal that had ever been housed in the cage, and it now also skips housing records that have not been approved.

  • Removes the floor-based combined room and floor display columns, and repoints everything that depended on them: the room and floor lookups, the housing views and history, the cage details page, and every view that previously reached the building through a floor.

  • Room lookups carry a link through to the cage details page, matching how cages already behave.

  • Location test fixtures build rooms from a building instead of a floor, and cover the room key, the building rules, and cagemates for both group pens and cages recorded without a room.

  • Removes the historicalOther dataset, its report, and its metadata.

Rooms are now keyed by building and name instead of floor, buildings drop the area suffix, and the derived cage location key is persisted via a managed column. Cagemates now matches on room as well as cage so group-pen animals, which have no cage, resolve correctly.
Removing floors deleted the fullRoom and fullFloor display columns but left the room and floor lookups, the cage details page, and roughly fifty views still pointing through them, so Room and Building rendered blank.

Room entry now requires a building, which the derived room key needs and previously went unchecked.
The fixtures housed animals in rooms and cages that nothing ever created, so every room lookup in the housing views resolved to nothing. Adds coverage for the derived room key, the building requirement, and cagemates in a group pen.
The sample housing rows used a free-text location that matches no registered room or cage, and omitted the room entirely, so the housing trigger skipped every one of them.
The fixture supplied a location outright, so the derivation the trigger performs for real entry was never exercised and the test keys looked nothing like production ones.
Cagemates match on the cage where there is one and fall back to the room only for group pens, so a record entered without a room still resolves. Derived room, building, and cage keys are persisted the same way as the cage location and rejected when they cannot be stored or would collide, and floor is kept out of the room views.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant