mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
1.4 KiB
1.4 KiB
Museums
Museums are institution lookup records that can be linked to localities. The museum record itself describes the institution; the locality tab stores which museums are connected to a locality.
Database model
The main museum lookup record is com_mlist:
museum(primary key, museum code)institutionalt_int_namecitystate_codestatecountryused_morphused_nowused_gene
Locality links are stored in now_mus:
lidreferencesnow_loc.lidmuseumreferencescom_mlist.museum- composite primary key:
lid+museum
Deleting a locality cascades its now_mus rows. Deleting or renaming a museum code needs care because the code is part of the link-table key.
API endpoints
GET /museum/all: list museumsGET /museum/:id: read museum details and linked localitiesPUT /museum: create or update a museum; requires an edit role
The detail endpoint supports tabular query options for the linked locality list.
Frontend usage
/museum/:id?routes to the museum detail page.- Locality edit views use the museum lookup list when linking museums to a locality.
- The Museum tab in locality details edits
now_musrows through the locality edit payload rather than by editing the museum record directly.
Validation notes
Museum codes are treated as stable identifiers. Backend tests cover creation, update, empty-code validation, and duplicate-code checks that differ only by case.