# Types

{% hint style="warning" %}
**Navixy Repository API is a work in progress.** This documentation is published for preview purposes only and doesn't reflect a stable release. Structure, field names, and behaviors are subject to change.
{% endhint %}

## Objects

### AssetType

A classification type for assets.

**Implements:** [CatalogItem](https://www.navixy.com/docs/navixy-repository-api/catalogs/catalog-items#type-catalogitem), [Node](https://www.navixy.com/docs/navixy-repository-api/common#type-node), [Versioned](https://www.navixy.com/docs/navixy-repository-api/common#type-versioned), [Titled](https://www.navixy.com/docs/navixy-repository-api/common#type-titled)

| Field                    | Type                                                                                                                     | Description                                                                     |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------- |
| `id`                     | `ID!`                                                                                                                    | A globally unique identifier.                                                   |
| `version`                | `Int!`                                                                                                                   | The version number for optimistic locking.                                      |
| `title`                  | `String!`                                                                                                                | The human-readable display name. Can be localized.                              |
| `code`                   | `Code!`                                                                                                                  | A machine-readable code, unique within the catalog scope.                       |
| `order`                  | `Int!`                                                                                                                   | The display order within the same level or category.                            |
| `catalog`                | [Catalog](https://www.navixy.com/docs/navixy-repository-api/catalogs/catalog-items#type-catalog)!                        | The catalog this item belongs to.                                               |
| `organization`           | [Organization](https://www.navixy.com/docs/navixy-repository-api/organizations#type-organization)                        | The organization that owns this item. Null for system items.                    |
| `meta`                   | [CatalogItemMeta](https://www.navixy.com/docs/navixy-repository-api/catalogs/catalog-items#type-catalogitemmeta)!        | Metadata about this item including description, origin, and display properties. |
| `customFieldDefinitions` | \[[CustomFieldDefinition](https://www.navixy.com/docs/navixy-repository-api/custom-fields#type-customfielddefinition)!]! | Custom field definitions specific to this asset type, ordered by display order. |

***

### Asset

A physical or logical asset being tracked.

**Implements:** [Node](https://www.navixy.com/docs/navixy-repository-api/common#type-node), [Titled](https://www.navixy.com/docs/navixy-repository-api/common#type-titled), [Customizable](https://www.navixy.com/docs/navixy-repository-api/common#type-customizable), [Versioned](https://www.navixy.com/docs/navixy-repository-api/common#type-versioned)

| Field           | Type                                                                                                                                 | Description                                                                                                                                                                                                                          |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `id`            | `ID!`                                                                                                                                | A globally unique identifier. This ID is opaque and should not be parsed by clients.                                                                                                                                                 |
| `version`       | `Int!`                                                                                                                               | The version number for optimistic locking. Incremented on each update. Can be provided in update/delete mutations to prevent lost updates. If omitted, the update proceeds without stale-read protection.                            |
| `title`         | `String!`                                                                                                                            | The human-readable display name.                                                                                                                                                                                                     |
| `organization`  | [Organization](https://www.navixy.com/docs/navixy-repository-api/organizations#type-organization)!                                   | The organization that owns this asset.                                                                                                                                                                                               |
| `type`          | [AssetType](#type-assettype)!                                                                                                        | The asset type classification.                                                                                                                                                                                                       |
| `customFields`  | `JSON!`                                                                                                                              | Custom field values as a key-value map. Keys are `CustomFieldDefinition` codes. System-reserved codes (`geojson_data`, `schedule_data`) are excluded from this map and exposed through dedicated typed fields on the entity instead. |
| `primaryDevice` | [Device](https://www.navixy.com/docs/navixy-repository-api/devices/types#type-device)                                                | The primary device (isPrimary=true among DEVICE-type custom fields).                                                                                                                                                                 |
| `devices`       | \[[Device](https://www.navixy.com/docs/navixy-repository-api/devices/types#type-device)!]!                                           | All devices linked via DEVICE-type custom fields.                                                                                                                                                                                    |
| `groups`        | [AssetGroupConnection](https://www.navixy.com/docs/navixy-repository-api/core-api-reference/groups/types#type-assetgroupconnection)! | The groups this asset belongs to.                                                                                                                                                                                                    |

***

### AssetPayload

The result of an asset mutation.

| Field   | Type                  | Description                   |
| ------- | --------------------- | ----------------------------- |
| `asset` | [Asset](#type-asset)! | The created or updated asset. |

***

### AssetTypePayload

The result of an asset type mutation.

| Field       | Type                          | Description                        |
| ----------- | ----------------------------- | ---------------------------------- |
| `assetType` | [AssetType](#type-assettype)! | The created or updated asset type. |

***

## Inputs

### AssetFilter

Filtering options for assets.

| Field           | Type                                                                                                            | Description                                         |
| --------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
| `typeIds`       | `[ID!]`                                                                                                         | Filter by asset types (OR within field).            |
| `deviceIds`     | `[ID!]`                                                                                                         | Filter by linked devices (OR within field).         |
| `titleContains` | `String`                                                                                                        | Partial match on title (case-insensitive contains). |
| `customFields`  | \[[CustomFieldFilter](https://www.navixy.com/docs/navixy-repository-api/custom-fields#type-customfieldfilter)!] | Filter by custom field values.                      |

***

### AssetOrder

Ordering options for assets.

| Field             | Type                                                                                            | Description                                                                |
| ----------------- | ----------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| `field`           | [AssetOrderField](#type-assetorderfield)                                                        | The standard field to order by. Mutually exclusive with `customFieldCode`. |
| `customFieldCode` | `Code`                                                                                          | The custom field code to order by. Mutually exclusive with `field`.        |
| `direction`       | [OrderDirection](https://www.navixy.com/docs/navixy-repository-api/common#type-orderdirection)! | The direction to order.                                                    |

***

### AssetCreateInput

Input for creating a new asset.

| Field            | Type                                                                                                                  | Description                               |
| ---------------- | --------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- |
| `organizationId` | `ID!`                                                                                                                 | The organization that will own the asset. |
| `typeId`         | `ID!`                                                                                                                 | The asset type ID.                        |
| `title`          | `String!`                                                                                                             | The asset display name.                   |
| `customFields`   | [CustomFieldsPatchInput](https://www.navixy.com/docs/navixy-repository-api/custom-fields#type-customfieldspatchinput) | The custom field values.                  |

***

### AssetUpdateInput

Input for updating an existing asset.

| Field          | Type                                                                                                                  | Description                                                                                     |
| -------------- | --------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| `id`           | `ID!`                                                                                                                 | The asset ID to update.                                                                         |
| `version`      | `Int`                                                                                                                 | The current version for optimistic locking. If omitted, auto-increments without conflict check. |
| `title`        | `String`                                                                                                              | The new display name.                                                                           |
| `customFields` | [CustomFieldsPatchInput](https://www.navixy.com/docs/navixy-repository-api/custom-fields#type-customfieldspatchinput) | The custom field changes.                                                                       |

***

### AssetDeleteInput

Input for deleting an asset.

| Field     | Type  | Description                                                                                     |
| --------- | ----- | ----------------------------------------------------------------------------------------------- |
| `id`      | `ID!` | The asset ID to delete.                                                                         |
| `version` | `Int` | The current version for optimistic locking. If omitted, auto-increments without conflict check. |

***

### AssetTypeCreateInput

Input for creating an asset type.

| Field                    | Type                                                                                                                              | Description                                                                                                            |
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| `organizationId`         | `ID!`                                                                                                                             | The organization that will own the item.                                                                               |
| `code`                   | `Code`                                                                                                                            | The machine-readable code. Auto-generated from title if omitted.                                                       |
| `title`                  | `String!`                                                                                                                         | The display name.                                                                                                      |
| `order`                  | `Int`                                                                                                                             | The display order. Auto-calculated as last position if omitted.                                                        |
| `meta`                   | [CatalogItemMetaInput](https://www.navixy.com/docs/navixy-repository-api/catalogs/catalog-items#type-catalogitemmetainput)        | The display properties.                                                                                                |
| `customFieldDefinitions` | \[[CustomFieldDefinitionInput](https://www.navixy.com/docs/navixy-repository-api/custom-fields#type-customfielddefinitioninput)!] | Operations on custom field definitions for this asset type. Only `create` is allowed when creating a new catalog item. |

***

### AssetTypeUpdateInput

Input for updating an asset type.

| Field                    | Type                                                                                                                              | Description                                                                                     |
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| `id`                     | `ID!`                                                                                                                             | The item ID to update.                                                                          |
| `version`                | `Int`                                                                                                                             | The current version for optimistic locking. If omitted, auto-increments without conflict check. |
| `title`                  | `String`                                                                                                                          | The new display name.                                                                           |
| `order`                  | `Int`                                                                                                                             | The new display order.                                                                          |
| `meta`                   | [CatalogItemMetaInput](https://www.navixy.com/docs/navixy-repository-api/catalogs/catalog-items#type-catalogitemmetainput)        | The display properties.                                                                         |
| `customFieldDefinitions` | \[[CustomFieldDefinitionInput](https://www.navixy.com/docs/navixy-repository-api/custom-fields#type-customfielddefinitioninput)!] | Operations on custom field definitions belonging to this asset type.                            |

***

## Enums

### AssetOrderField

Fields available for ordering assets.

| Value   | Description     |
| ------- | --------------- |
| `TITLE` | Order by title. |

***

## Pagination types

### AssetConnection

A paginated list of Asset items.

**Implements:** [Connection](https://www.navixy.com/docs/navixy-repository-api/common#type-connection)

| Field      | Type                                                                                 | Description                                                |
| ---------- | ------------------------------------------------------------------------------------ | ---------------------------------------------------------- |
| `edges`    | \[[AssetEdge](#type-assetedge)!]!                                                    | A list of edges.                                           |
| `nodes`    | \[[Asset](#type-asset)!]!                                                            | A list of nodes in the connection (without edge metadata). |
| `pageInfo` | [PageInfo](https://www.navixy.com/docs/navixy-repository-api/common#type-pageinfo)!  | Information about the current page.                        |
| `total`    | [CountInfo](https://www.navixy.com/docs/navixy-repository-api/common#type-countinfo) | The total count of items matching the filter.              |

***

### AssetEdge

An edge in the Asset connection.

**Implements:** [Edge](https://www.navixy.com/docs/navixy-repository-api/common#type-edge)

| Field    | Type                  | Description                       |
| -------- | --------------------- | --------------------------------- |
| `cursor` | `String!`             | An opaque cursor for this edge.   |
| `node`   | [Asset](#type-asset)! | The asset at the end of the edge. |

***

### AssetTypeConnection

A paginated list of AssetType items.

**Implements:** [Connection](https://www.navixy.com/docs/navixy-repository-api/common#type-connection)

| Field      | Type                                                                                 | Description                                                |
| ---------- | ------------------------------------------------------------------------------------ | ---------------------------------------------------------- |
| `edges`    | \[[AssetTypeEdge](#type-assettypeedge)!]!                                            | A list of edges.                                           |
| `nodes`    | \[[AssetType](#type-assettype)!]!                                                    | A list of nodes in the connection (without edge metadata). |
| `pageInfo` | [PageInfo](https://www.navixy.com/docs/navixy-repository-api/common#type-pageinfo)!  | Information about the current page.                        |
| `total`    | [CountInfo](https://www.navixy.com/docs/navixy-repository-api/common#type-countinfo) | The total count of items matching the filter.              |

***

### AssetTypeEdge

An edge in the AssetType connection.

**Implements:** [Edge](https://www.navixy.com/docs/navixy-repository-api/common#type-edge)

| Field    | Type                          | Description                            |
| -------- | ----------------------------- | -------------------------------------- |
| `cursor` | `String!`                     | An opaque cursor for this edge.        |
| `node`   | [AssetType](#type-assettype)! | The asset type at the end of the edge. |

***
