Locations
Audience Programmer
Since pyck v0.27.0
Overview
Section titled “Overview”pyck provides a location and device management system within the Management Service. It maps the physical warehouse layout, tracks devices, lets users check in and out, and associates inventory repositories with specific locations.
Core entities
Section titled “Core entities”Location
Section titled “Location”Represents a physical area within the warehouse (e.g., workstation, zone, dock).
| Field | Type | Description |
|---|---|---|
id |
UUID | Unique identifier |
name |
String | Location name (unique per tenant) |
tenantID |
UUID | Owning tenant |
dataTypeID |
UUID | Optional custom DataType |
data |
Map | Custom fields defined by DataType |
Device
Section titled “Device”Represents a physical device (scanner, tablet, workstation terminal).
| Field | Type | Description |
|---|---|---|
id |
UUID | Unique identifier |
name |
String | Device name (unique per tenant) |
tenantID |
UUID | Owning tenant |
dataTypeID |
UUID | Optional custom DataType |
data |
Map | Custom fields defined by DataType |
DeviceLocation
Section titled “DeviceLocation”Associates a device with a location. A device can only be assigned to one location at a time.
| Field | Type | Description |
|---|---|---|
id |
UUID | Unique identifier |
deviceID |
UUID | Associated device |
locationID |
UUID | Associated location |
DeviceUser
Section titled “DeviceUser”Tracks which user is currently checked-in to a device. Only one user can be checked-in to a device at a time.
| Field | Type | Description |
|---|---|---|
id |
UUID | Unique identifier |
deviceID |
UUID | Associated device |
userID |
UUID | Checked-in user |
Entity relationships
Section titled “Entity relationships”Location ──────────────────────────────────────────┐ │ │ ▼ │DeviceLocation ◄─── Device ◄─── DeviceUser ───► User │ │ ▼ InventoryRepository (location_id)Key relationships:
- Location → DeviceLocation: One-to-many (a location can have multiple devices)
- Device → DeviceLocation: One-to-one (a device is at one location)
- Device → DeviceUser: One-to-one (only one user per device)
- User → DeviceUser: One-to-many (a user can have check-in history)
- Location → Repository: One-to-many (repositories can reference a location)
GraphQL operations
Section titled “GraphQL operations”Creating a location
Section titled “Creating a location”mutation CreateLocation($input: CreateLocationInput!) { createLocation(input: $input) { location { id name data } }}Variables:
{ "input": { "name": "Workstation-A1" }}Creating a device
Section titled “Creating a device”mutation CreateDevice($input: CreateDeviceInput!) { createDevice(input: $input) { device { id name data } }}Variables:
{ "input": { "name": "Scanner-001" }}Assigning a device to a location
Section titled “Assigning a device to a location”mutation SetDeviceLocation($input: CreateDeviceLocationInput!) { setDeviceLocation(input: $input) { DeviceLocation { id deviceID locationID } }}Variables:
{ "input": { "deviceID": "device-uuid-here", "locationID": "location-uuid-here" }}To remove a device from its location:
mutation UnsetDeviceLocation($id: ID!) { unsetDeviceLocation(id: $id) { deletedID }}User check-in
Section titled “User check-in”When a user starts working at a device:
mutation CheckInUserDevice($input: CheckInUserDeviceInput!) { checkInUserDevice(input: $input) { deviceUser { id deviceID userID } }}Variables:
{ "input": { "deviceID": "device-uuid-here" }}The userID is automatically derived from the authenticated user’s token.
User check-out
Section titled “User check-out”When a user finishes working at a device:
mutation CheckOutUserDevice($input: CheckOutUserDeviceInput!) { checkOutUserDevice(input: $input) { deviceUser { id deviceID userID } }}Variables:
{ "input": { "deviceID": "device-uuid-here" }}Assigning a location to a repository
Section titled “Assigning a location to a repository”When creating or updating an inventory repository, you can associate it with a management location:
mutation CreateInventoryRepository($input: CreateRepositoryInput!) { createInventoryRepository(input: $input) { inventoryRepository { id name locationID } }}Variables:
{ "input": { "name": "Shelf-A1-001", "type": "static", "locationID": "location-uuid-here" }}