Skip to main content
Version: v1.0.0(int)

W095: Delete location

Removes a fulfillment location that nothing references. Triggered from Settings, Fulfillment locations. The in-use check is broad: POs, WOs, SOs, and both inventory ledgers all block deletion.

Steps​

  1. Check usage across every domain. Call Locations.isInUse, which returns counts across POs, WOs, SOs, and both inventory ledgers.

  2. Refuse if any count is non-zero. Return the per-domain counts in the error payload so the UI can guide the user to the right place to clean up.

  3. Delete the location. Call Locations.delete.

Returns​

Nothing.

Business rules​

  • Any reference blocks deletion. A location used as a PO ship-to, WO work site, SO fulfillment location, or as a bin in either ledger cannot be deleted.

Errors​

  • NotFoundError. The location was not found.
  • InUseError. One or more domains reference this location; counts are returned per domain.