Visitor locations
The staff location screen uses Visitor Incident Management workflows and Core
resources. visitor_locations marks the resources belonging to this product;
other Core resources are not listed as visitor locations. The product row has
tenant RLS and a composite foreign key that enforces the resource tenant.
Every request rechecks the selected membership before establishing tenant context. As a provisional rule, all members can read and managers and admins can create. This is not yet the location-specific authorization model required for v1; authentication hardening and MFA also remain outstanding. Do not use real customer or visitor data until those requirements are satisfied.
This migration adds a new product mapping; it intentionally does not turn existing Core resources into locations. Any future data migration must identify the intended resources explicitly rather than guessing.
New locations require street address, postal code, city and country; address line 2 is optional. Existing locations without an address remain intact and must be completed when edited. Addresses belong to the visitor product, not Core. Only completeness and field length are checked: the system does not verify that the address exists. Geocoding, coordinates, address verification, map provider and handling changed coordinates remain future decisions.
Location position and address search
Section titled “Location position and address search”A new or edited location requires the user to confirm a position. The address search is backed by Photon; selecting a result fills available address fields, and the marker can be adjusted before confirmation. An address edit or marker move requires confirmation again. Older locations remain readable without a position until they are edited. Coordinates are product data on the Visitor location, not on the Core resource. The current development search index covers Sweden; search results may be incomplete and a street-level hit is approximate.
The Rails server calls PHOTON_URL (default for the current development server:
http://notifi-photon-test-photon-1:2322); keep Photon on an internal network
and set this URL explicitly in other environments. If search is unavailable,
the application returns a service-unavailable response. MapLibre is vendored
under public/vendor/maplibre; map tiles and style are supplied by
OpenFreeMap, with their attribution displayed on the map. The map client contacts
that service directly. The current Photon index is a separate test installation;
its updates, backup and production operation still need an operational plan.
The location list and detail pages share a read-only map. The list’s markers come only from positions belonging to the currently authorized organization; locations without a stored position remain in the list and are counted as missing. The detail page shows the map without a marker when its position is missing. Selecting a marker displays the location name; the list remains the keyboard-accessible route to each location.
Address lookup checks the current membership and role before contacting Photon. The tenant transaction is closed and the request’s database connection is returned to the pool before waiting for the provider. Photon has a two-second connection timeout and a four-second read timeout; unavailable or invalid responses return service unavailable to the UI. Authorization is checked at request start, not continuously during the external call.