> For the complete documentation index, see [llms.txt](https://docs.pyck.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pyck.cloud/graphql-api/mutations/updateinventoryrepositorymovement.md).

# Update Inventory Repository Movement

Update Inventory Repository Movement Mutation

Updates an existing RepositoryMovement object in the system with new data. Repository movements represent operations that affect entire repositories, such as consolidations, reorganizations, or bulk transfers.

## Arguments

| Name    | Type                             | Description                                                |
| ------- | -------------------------------- | ---------------------------------------------------------- |
| `id`    | `ID!`                            | The unique identifier of the repository movement to update |
| `input` | `UpdateRepositoryMovementInput!` | Input data for updating the repository movement            |

## Return Type

`InventoryRepositoryMovementOutput` - Contains the updated repository movement and any related workflows.

## Input Fields

`UpdateRepositoryMovementInput`:

| Field               | Type                          | Description                                          |
| ------------------- | ----------------------------- | ---------------------------------------------------- |
| `dataTypeID`        | `UUID`                        | Optional data type ID to associate with the movement |
| `clearDataTypeID`   | `Boolean`                     | Clear the existing data type ID                      |
| `dataTypeSlug`      | `String`                      | Optional data type slug                              |
| `clearDataTypeSlug` | `Boolean`                     | Clear the existing data type slug                    |
| `data`              | `Map`                         | Custom data associated with the movement             |
| `clearData`         | `Boolean`                     | Clear the existing custom data                       |
| `handler`           | `String`                      | Handler responsible for processing the movement      |
| `blockedBy`         | `RepositoryMovementBlockedBy` | Reason why the movement is blocked (if applicable)   |
| `clearBlockedBy`    | `Boolean`                     | Clear the blocked status                             |

## RepositoryMovementBlockedBy Options

Possible reasons why a repository movement might be blocked:

* `RecalledProducts` - Products in repository are subject to recall
* `ExpiredProducts` - Repository contains expired products
* `MislabelledGoods` - Goods with incorrect labeling
* `RegulatoryHold` - Regulatory authorities have placed a hold
* `AwaitingDocumentation` - Required documentation is pending
* `InventoryDiscrepancies` - Count discrepancies need resolution
* `HazardousMaterials` - Special handling required for hazardous materials
* `CounterfeitGoods` - Suspected counterfeit products present
* `SeasonalGoods` - Seasonal restrictions apply

## Return Fields

`InventoryRepositoryMovementOutput`:

| Field                         | Type                 | Description                                    |
| ----------------------------- | -------------------- | ---------------------------------------------- |
| `inventoryRepositoryMovement` | `RepositoryMovement` | The updated repository movement                |
| `workflows`                   | `[TemporalWorkflow]` | Related workflow instances that were triggered |

## Usage Example

```graphql
mutation {
  updateInventoryRepositoryMovement(
    id: "repo_movement_456"
    input: {
      handler: "warehouse_supervisor_789",
      data: {
        "priority": "critical",
        "scheduled_time": "2024-12-15T08:00:00Z",
        "reason": "consolidation",
        "estimated_duration_hours": 4,
        "equipment_required": ["forklift", "pallet_jack", "scanner"],
        "staff_count": 3,
        "safety_requirements": ["hard_hat", "safety_vest", "steel_toed_boots"]
      },
      dataTypeSlug: "warehouse_consolidation",
      clearBlockedBy: true
    }
  ) {
    inventoryRepositoryMovement {
      id
      repositoryID
      fromID
      toID
      executed
      handler
      blockedBy
      data
      dataTypeSlug
      from {
        id
        name
        type
      }
      to {
        id
        name
        type
      }
      repository {
        id
        name
        type
      }
      updatedAt
      updatedBy
    }
    workflows {
      id
      type
      status
      runID
    }
  }
}
```

## JavaScript Example

```javascript
const UPDATE_INVENTORY_REPOSITORY_MOVEMENT = gql`
  mutation UpdateInventoryRepositoryMovement($id: ID!, $input: UpdateRepositoryMovementInput!) {
    updateInventoryRepositoryMovement(id: $id, input: $input) {
      inventoryRepositoryMovement {
        id
        repositoryID
        fromID
        toID
        executed
        handler
        blockedBy
        data
        dataTypeSlug
        from {
          id
          name
          type
        }
        to {
          id
          name
          type
        }
        repository {
          id
          name
          type
        }
        updatedAt
        updatedBy
      }
      workflows {
        id
        type
        status
        runID
      }
    }
  }
`;

const { data } = await client.mutate({
  mutation: UPDATE_INVENTORY_REPOSITORY_MOVEMENT,
  variables: {
    id: "repo_movement_456",
    input: {
      handler: "warehouse_supervisor_789",
      data: {
        priority: "critical",
        scheduled_time: "2024-12-15T08:00:00Z",
        reason: "consolidation",
        estimated_duration_hours: 4,
        equipment_required: ["forklift", "pallet_jack", "scanner"],
        staff_count: 3,
        safety_requirements: ["hard_hat", "safety_vest", "steel_toed_boots"]
      },
      dataTypeSlug: "warehouse_consolidation",
      clearBlockedBy: true
    }
  }
});
```

## Important Notes

* **Movement State**: Only non-executed repository movements can be updated
* **Handler Assignment**: Updating the handler reassigns responsibility for the repository operation
* **Blocked Status**: Use `clearBlockedBy: true` to unblock a movement when conditions are resolved
* **Workflow Impact**: Updates may trigger workflows for resource allocation, scheduling, or safety notifications
* **Data Validation**: The system validates that movement parameters are consistent with repository types and business rules
* **Audit Tracking**: All updates to repository movements are logged for audit purposes
* **Scale Impact**: Repository movements typically affect large quantities of inventory

## Common Update Scenarios

1. **Reassign Supervisor**: Change who is responsible for overseeing the repository operation
2. **Update Priority**: Mark a movement as critical for expedited processing
3. **Add Safety Requirements**: Include additional safety protocols or equipment requirements
4. **Unblock Movement**: Clear blocking conditions when regulatory or quality issues are resolved
5. **Schedule Timing**: Set or update optimal timing for large-scale repository operations
6. **Resource Planning**: Update equipment and staffing requirements based on scope changes

## Related Operations

After updating a repository movement, you may need to:

* Update related item movements within the affected repositories
* Adjust resource allocation and scheduling
* Notify affected staff and stakeholders
* Update safety protocols and equipment reservations


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.pyck.cloud/graphql-api/mutations/updateinventoryrepositorymovement.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
