Locations
Fulfillment locations — warehouses, fulfillment centers, work sites. Same entity reused as PO ship-to, WO work site, SO fulfillment location, and inventory bin.
Tables owned
| Table | Purpose |
|---|---|
org.locations | Location records (name, address, city, state, country, zip_code, notes, sort_order). Emails / phones live in the contacts domain via entity_contacts, not on this table. |
Operations
Writes
create(conn, input)→Location.input:{ name, country?, address?, city?, state?, zipCode?, notes?, sortOrder? }.update(conn, locationId, patch)→Location. Partial update includingsortOrder.delete(conn, locationId)→void. Hard-delete. L3 enforces "not referenced by any PO/WO/SO/ledger" before calling.
Reads
list(conn)→Location[]. Ordered bysort_order.getById(conn, locationId)→Location | null.getByIds(conn, locationIds)→Location[]. Batch hydration.isInUse(conn, locationId)→{ inUse: boolean, references: { poCount, woCount, soCount, ledgerCount } }. Gates deletion in L3.