Execute Inventory Repository Movement

Execute Inventory Repository Movement Mutation

Executes a pending repository movement, updating the repository's location in the system.

Arguments

Name
Type
Description

id

ID!

ID of the repository movement to execute

Return Type

InventoryRepositoryMovementOutput - Contains the executed repository movement and any triggered workflows.

Field
Type
Description

inventoryRepositoryMovement

RepositoryMovement

The executed repository movement

workflows

[TemporalWorkflow]

Any workflows triggered by this operation

Usage Example

mutation {
  executeInventoryRepositoryMovement(
    id: "movement-123"
  ) {
    inventoryRepositoryMovement {
      id
      executed
      executedAt
      repository {
        id
        name
        parentID
      }
      from {
        name
      }
      to {
        name
      }
    }
    workflows {
      id
      type
      status
      runID
    }
  }
}

What Happens During Execution

  1. Validation: Checks if movement can be executed

    • Movement must be pending (not already executed)

    • Not blocked by business rules

    • Repository must exist and be valid

  2. Location Update:

    • Updates the repository's parentID to the destination

    • Updates any child repositories if applicable

    • Maintains location hierarchy

  3. Movement Update:

    • Sets executed to true

    • Sets executedAt timestamp

    • Records the executing user

  4. Workflow Triggers:

    • May trigger configured workflows

    • Can initiate automated processes

Error Cases

  • Movement already executed

  • Movement is blocked

  • Repository not found

  • Invalid destination repository

  • Circular reference (moving to self or child)

Notes

  • Execution is atomic - either fully completes or rolls back

  • Changes the physical location tracking in the system

  • Cannot be undone - create reverse movement to undo

  • All items within the moved repository move with it

Last updated

Was this helpful?