Housing
Herply models two kinds of housing: racks with tubs and standalone cages. An animal lives in exactly one of them — never both, never neither (unless it's sold or dead, in which case its location is cleared).
Racks and tubs
A rack is a fixed-slot container — a stack of tubs in a hot rack, an SCS V-series, a CB70-style breeder rack. When you create a rack, you tell the app how many slots it has, and the app auto-creates the tubs. You don't add tubs one by one.
This is the rack-tubs invariant: a rack always has exactly slots tubs. Anywhere this could drift, the app re-syncs. If you bump a 21-slot rack to 28, seven new empty tubs appear at the bottom. Drop it back to 21 and the seven empty tubs at the bottom are removed — the app refuses to drop a slot that's currently occupied.
Two helpers make small adjustments easier:
- Add slot — adds one tub at the next position.
- Remove slot — removes the last tub if it's empty.
Why no manual tub management? Three reasons:
- Dimensional consistency. A rack and its tubs are the same physical object. Letting them drift apart in the app produces "tubs without a rack" or "racks with missing positions" — both meaningless.
- Drag-and-drop is unambiguous. When you pick up an animal and drop it on rack #3, slot 7, there's exactly one valid destination.
- Bulk edits are cheap. Resizing a rack is one number, not a multi-tub workflow.
If you want to label a tub differently from its position number — e.g. "Female Mojave" instead of "Slot 7" — there's a tub-name field. The position is structural, the name is descriptive.
Cages
A cage is a single unit — a Vision V-15, a 4×2×2 PVC, a tortoise table. Unlike racks, cages don't subdivide. One animal per cage by default. (If you co-house — a colony of skinks, a young trio of tegus — you'll probably want to keep them all in the same cage and accept that the "one animal per location" model under-represents the social structure. The trade-off is intentional: a colony is rare enough that bending it for one animal is cheaper than building first-class colony support.)
Why no "shelves" or "free-form locations"
Some collection-management tools let you create arbitrary locations ("Bedroom shelf, top row"). Herply doesn't, because:
- The QR-code workflow needs a stable, scan-able address. A rack/tub or a cage is one.
- Searching "where is this animal" gets noisy fast with arbitrary strings.
- The constraint is one-tub-per-animal, which is meaningful only if tubs are a real thing the app understands.
If your setup doesn't fit racks-with-tubs or standalone cages — say, an outdoor pen — the closest model is "cage" with a descriptive name. We will probably never add a third location primitive.