Sites
Physical facilities/buildings. A Site is the root of the location hierarchy and the first segment of every LocationCode inside it; no Zone, Aisle or LocationSlot can exist without one.
Register a physical facility
Adds a Site to the warehouse map. The site code becomes the first segment of every LocationCode inside the facility, so it must be uppercase alphanumeric and unique across the service. Site code uniqueness is enforced here in the application layer rather than in the aggregate: a single aggregate cannot see its siblings. A newly registered Site is Active, and publishes SiteRegistered.
List every registered site
Returns every Site on the warehouse map, ordered by site code, including sites that have been decommissioned (their status says so). This is a read model over the Site repository; it performs no writes and publishes no events. Keyset-paginated: `limit` and `cursor`; follow `nextCursor` until it is absent.
Get one site
Returns a single Site by its code. This is the URL the Location header of a successful registerSite points at.
Set a site's role in the fulfilment network
Sets the site's role (ADR-0037). When the role differs from the current one, SiteRoleChanged (new and previous role) is published through the transactional outbox. Repeating the current role is an idempotent no-op: 200, no event, so no Idempotency-Key is needed. `UNSPECIFIED` cannot be assigned, and an unknown or missing role is 422 `invalid-site-role`.
The default transfer capability of every site role
Read-only table (ADR-0037): for every assignable site role, whether a site of that role should be an inter-site transfer origin and/or destination. It is the ONE source of truth the warehouse-infra seed and operators read instead of hard-coding it. It is a default only: nothing applies it automatically, a role change never flips capability, and capability is set with `PUT /sites/{siteCode}/transfer-capability` (ADR-0035). `UNSPECIFIED` has no row: an unclassified site's capability is left as it is. Rows are in a stable display order. Keyset-paginated: `limit` and `cursor`; follow `nextCursor` until it is absent.
Get a site's transfer capability
Returns whether the site may act as the origin (donates stock) and/or the destination (receives stock) of an inter-warehouse transfer, and the revision of its last published SiteCapabilityChanged (ADR-0035). A site whose capability was never set is capable of nothing at revision 0 — exactly how network-inventory-planning treats a site it has never heard about.
Set a site's transfer capability
Replaces the site's transfer capability with the full snapshot in the body (ADR-0035). When the snapshot differs from the current one — or no snapshot was ever published — the site's capabilityRevision advances by exactly one and SiteCapabilityChanged is published through the transactional outbox with that revision. Repeating the current snapshot is an idempotent no-op: 200, same revision, no event, so no Idempotency-Key is needed.