move

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package move implements the wherehouse move command.

The move command relocates items to a different location with strict validation:

  • System locations (Missing, Borrowed) are forbidden as source or destination
  • Canonical name matches must be EXACT and UNIQUE (ambiguous names fail with ID list)
  • Items only (location moves deferred to v2)
  • Fail-fast batch processing (stops on first error)

Supported selector types:

  • ID: aB3xK9mPqR (exact ID)
  • LOCATION:ITEM: garage:socket (both canonical names, filters by location)
  • Canonical name: "10mm socket" (must match exactly 1 item)

Examples:

wherehouse move garage:socket --to toolbox
wherehouse move aB3xK9mPqR --to desk
wherehouse move "10mm socket" --to garage --temp
wherehouse move wrench screwdriver --to toolbox --keep-project

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDefaultMoveCmd

func NewDefaultMoveCmd() *cobra.Command

NewDefaultMoveCmd returns a move command that opens the database from context configuration at runtime. This is the production entry point registered with the root command.

func NewMoveCmd

func NewMoveCmd(db moveDB) *cobra.Command

NewMoveCmd returns a move command that uses the provided db for all database operations. The caller retains no reference to db after this call; the returned command's RunE closes it via defer before returning.

Types

type Result

type Result struct {
	ItemID       string `json:"item_id"`
	DisplayName  string `json:"display_name"`
	FromLocation string `json:"from_location"`
	ToLocation   string `json:"to_location"`
	EventID      int64  `json:"event_id"`
	MoveType     string `json:"move_type"`
}

Result represents the result of a single item move operation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL